UNPKG

@n1k1t/mock-server

Version:

Powerful util to setup mocks over HTTP APIs

22 lines 1.37 kB
import { Constructable, TFunction } from '../../../types'; import { IExpectationSchemaContext, IExpectationExecMode, IExpectationOperatorsSchema, TExpectationMetaTag, TExpectationOperators } 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): boolean; abstract manipulate<T extends TContext>(context: T): T; abstract get tags(): TExpectationMetaTag[]; constructor(operators: TExpectationOperators, command: TSchema); protected compileExecHandler(raw: TFunction<any, any[]> | string, provide: ('payload' | 'utils')[]): (mode: IExpectationExecMode, context: TContext, ...args: unknown[]) => any; 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