UNPKG

@n1k1t/mock-server

Version:

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

19 lines 821 B
import { ValueError } from '@n1k1t/typebox/errors'; import { IExpectationSchemaContext } from '../types'; import { Expectation } from './expectation'; export type TExpectationsStorageRegisterationResult = { status: 'REGISTERED'; expectation: Expectation; } | { status: 'ERROR'; reasons: ValueError[]; }; export declare class ExpectationsStorage extends Map<string, Expectation> { protected configuration: Pick<Expectation, 'group'>; constructor(configuration: Pick<Expectation, 'group'>); /** Extends this storage with another */ extend(storage: ExpectationsStorage): this; register(configuration: Expectation['configuration']): TExpectationsStorageRegisterationResult; match(context: IExpectationSchemaContext): Promise<Expectation | null>; } //# sourceMappingURL=storage.d.ts.map