@n1k1t/mock-server
Version:
The ultimate toolkit to intercept, transform, and simulate HTTP/WS traffic with type-safe expectations
30 lines • 1.87 kB
TypeScript
import { PartialDeep, TFunction } from '../../../types';
import { ExpectationOperator } from '../models/operator';
import { CompileExpectationOperatorValue, CompileExpectationOperatorValueWithPredicate, IExpectationSchemaContext, IExpectationExecUtils, TExpectationOperatorLocation, IExpectationMeta } 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?: TFunction<Promise<unknown>, [import("../types").IExpectationExecMode, TContext, ...unknown[]]> | undefined;
regExpAnyOf?: RegExp[] | undefined;
regExp?: RegExp | undefined;
};
get tags(): IExpectationMeta['tags'];
match(context: TContext): Promise<boolean>;
manipulate<T extends TContext>(context: T): Promise<T>;
}
//# sourceMappingURL=has.operator.d.ts.map