UNPKG

@n1k1t/mock-server

Version:

The ultimate toolkit to intercept, transform, and simulate HTTP/WS traffic with type-safe expectations

22 lines 1.39 kB
import { Constructable, TFunction } from '../../../types'; import { IExpectationSchemaContext, IExpectationExecMode, IExpectationOperatorsSchema, TExpectationOperators, IExpectationMeta } from '../types'; export type TExpectationOperatorConstructor<TContext extends IExpectationSchemaContext> = Constructable<ExpectationOperator<TContext, any>, ConstructorParameters<typeof ExpectationOperator>>; export declare abstract class ExpectationOperator<TContext extends IExpectationSchemaContext<any>, TSchema = unknown> { operators: TExpectationOperators; command: TSchema; TContext: TContext; TSchema: TSchema; abstract match(context: TContext): Promise<boolean>; abstract manipulate<T extends TContext>(context: T): Promise<T>; abstract get tags(): IExpectationMeta['tags']; constructor(operators: TExpectationOperators, command: TSchema); protected compileExecHandler(raw: TFunction<any, any[]> | string, provide: ('payload' | 'utils')[]): TFunction<Promise<unknown>, [IExpectationExecMode, TContext, ...unknown[]]>; protected extractNestedSchema(schema: IExpectationOperatorsSchema<any, any>): { [K in keyof IExpectationOperatorsSchema]: null | { key: K; nested: IExpectationOperatorsSchema[K]; }; }[keyof IExpectationOperatorsSchema]; private compileExecUtils; } //# sourceMappingURL=operator.d.ts.map