@n1k1t/mock-server
Version:
Powerful util to setup mocks over HTTP APIs
32 lines • 1.57 kB
TypeScript
import type { IRequestContextMessage, RequestContextSnapshot } from '../../models';
import type { THistoryStatus } from './types';
import type { Expectation } from '../../../expectations';
export declare class History {
protected configuration: Pick<History, 'group' | 'snapshot'> & Partial<Pick<History, 'timestamp' | 'id' | 'status' | 'expectation' | 'duration'>>;
TPlain: Pick<History, 'id' | 'status' | 'group' | 'timestamp' | 'duration'> & {
snapshot: RequestContextSnapshot['TPlain'];
expectation?: Expectation<any>['TPlain'];
};
id: string;
messagesCounter: (value?: number) => number;
group: string;
snapshot: RequestContextSnapshot;
status: THistoryStatus;
expectation?: Expectation<any>;
timestamp: number;
duration: number;
private cached;
constructor(configuration: Pick<History, 'group' | 'snapshot'> & Partial<Pick<History, 'timestamp' | 'id' | 'status' | 'expectation' | 'duration'>>);
get plain(): History['TPlain'];
pushMessage(location: IRequestContextMessage['location'], data: unknown): this;
actualizeSnapshot(snapshot: RequestContextSnapshot): this;
switchStatus(status: History['status']): this;
hasStatus(status: History['status']): boolean;
complete(): this;
assign<T extends Partial<Pick<History, 'expectation'>>>(payload: T): this & T;
/** Updates duration property base on timestamp */
mark(): this;
toPlain(): History['TPlain'];
static build(configuration: History['configuration']): History;
}
//# sourceMappingURL=model.d.ts.map