@n1k1t/mock-server
Version:
Powerful util to setup mocks over HTTP APIs
30 lines • 1.85 kB
TypeScript
import { PartialDeep, TFunction } from '../../../types';
import { ExpectationOperator } from '../models/operator';
import { CompileExpectationOperatorValue, CompileExpectationOperatorValueWithPredicate, IExpectationSchemaContext, IExpectationExecUtils, TExpectationMetaTag, TExpectationOperatorLocation } from '../types';
export default class HasExpectationOperator<TContext extends IExpectationSchemaContext, TLocation extends TExpectationOperatorLocation = TExpectationOperatorLocation, TValue = void> extends ExpectationOperator<TContext, {
[K in TLocation]: {
$location: K;
$path?: string;
$jsonPath?: string;
$regExp?: RegExp;
$regExpAnyOf?: RegExp[];
$match?: NonNullable<CompileExpectationOperatorValue<TContext, K, TValue>> extends object ? PartialDeep<NonNullable<CompileExpectationOperatorValue<TContext, K, TValue>>> : string;
$matchAnyOf?: (NonNullable<CompileExpectationOperatorValue<TContext, K, TValue>> extends object ? PartialDeep<NonNullable<CompileExpectationOperatorValue<TContext, K, TValue>>> : string)[];
$value?: CompileExpectationOperatorValueWithPredicate<TContext, K, TValue>;
$valueAnyOf?: CompileExpectationOperatorValueWithPredicate<TContext, K, TValue>[];
$exec?: string | TFunction<boolean, [
CompileExpectationOperatorValue<TContext, K, TValue>,
IExpectationExecUtils<TContext>
]>;
};
}[TLocation]> {
compiled: {
exec?: ((mode: import("../types").IExpectationExecMode, context: TContext, ...args: unknown[]) => any) | undefined;
regExpAnyOf?: RegExp[] | undefined;
regExp?: RegExp | undefined;
};
get tags(): TExpectationMetaTag[];
match(context: TContext): boolean;
manipulate<T extends TContext>(context: T): T;
}
//# sourceMappingURL=has.operator.d.ts.map