@n1k1t/mock-server
Version:
The ultimate toolkit to intercept, transform, and simulate HTTP/WS traffic with type-safe expectations
29 lines • 1.79 kB
TypeScript
import type { Expectation, IExpectationSchemaContext, IExpectationSchemaInput } from '../../expectations';
import type { IExpectationHandlerContext } from './types';
import type { IServerContext } from '../../server';
import type { TMethodsSchema } from '../types';
import type { TFunction } from '../../../types';
export declare class Client<TContext extends IServerContext = any> {
protected methods: TMethodsSchema;
constructor(methods: TMethodsSchema);
get ping(): TFunction<Promise<"pong">, [void]>;
get deleteExpectations(): TFunction<Promise<null>, [void | {
ids?: string[];
} | undefined]>;
createExpectation<TInput extends Partial<IExpectationSchemaInput>, TConfiguration extends Expectation['configuration'] = Expectation<IExpectationSchemaContext<TInput & TContext>>['configuration']>(handler: TFunction<TConfiguration, [
IExpectationHandlerContext<IExpectationSchemaContext<TInput & TContext>>
]>): ReturnType<TMethodsSchema['expectationsCreate']>;
createExpectation(configuration: Expectation['configuration']): ReturnType<TMethodsSchema['expectationsCreate']>;
updateExpectation(configuration: {
id: string;
set: Partial<Expectation['configuration']>;
}): ReturnType<TMethodsSchema['expectationsUpdate']>;
updateExpectation<TInput extends Partial<IExpectationSchemaInput>, TConfiguration extends Expectation['configuration'] = Expectation<IExpectationSchemaContext<TInput & TContext>>['configuration']>(handler: TFunction<{
id: string;
set: Partial<TConfiguration>;
}, [
IExpectationHandlerContext<IExpectationSchemaContext<TInput & TContext>>
]>): ReturnType<TMethodsSchema['expectationsUpdate']>;
private compileHandlerContext;
}
//# sourceMappingURL=client.d.ts.map