@n1k1t/mock-server
Version:
Powerful util to setup mocks over HTTP APIs
27 lines • 1.63 kB
TypeScript
import type { Expectation, IExpectationSchemaInput } from '../../expectations';
import type { IServerContext } from '../../server';
import type { TMethodsSchema } from '../types';
import type { TFunction } from '../../../types';
import { IExpectationHandlerContext, IExpectationSimplifiedConfiguration, IExpectationSimplifiedInput } from './types';
export declare class Client<TContext extends IServerContext = IServerContext> {
protected methods: TMethodsSchema;
constructor(methods: TMethodsSchema);
get ping(): TFunction<Promise<"pong">, [void]>;
get deleteExpectations(): TFunction<Promise<null>, [void | {
ids?: string[];
} | undefined]>;
createExpectation<TInput extends IExpectationSchemaInput>(handler: TFunction<IExpectationSimplifiedConfiguration<TContext>, [IExpectationHandlerContext<TContext, TInput>]>): ReturnType<TMethodsSchema['createExpectation']>;
createExpectation(configuration: Expectation<IExpectationSimplifiedInput<TContext>>['configuration']): ReturnType<TMethodsSchema['createExpectation']>;
updateExpectation(configuration: {
id: string;
set: Partial<Expectation<IExpectationSimplifiedInput<TContext>>['configuration']>;
}): ReturnType<TMethodsSchema['updateExpectation']>;
updateExpectation<TInput extends IExpectationSchemaInput>(handler: TFunction<{
id: string;
set: Partial<IExpectationSimplifiedConfiguration<TContext>>;
}, [
IExpectationHandlerContext<TContext, TInput>
]>): ReturnType<TMethodsSchema['updateExpectation']>;
private compileHandlerUtils;
}
//# sourceMappingURL=client.d.ts.map