@n1k1t/mock-server
Version:
Powerful util to setup mocks over HTTP APIs
30 lines • 1.5 kB
TypeScript
import type { IRequestContextMessage, RequestContextSnapshot } from '../../models';
import type { SetRequiredKeys } from '../../../../types';
import type { Expectation } from '../../../expectations';
export declare class History {
protected configuration: Pick<History, 'group' | 'snapshot'> & Partial<Pick<History, 'timestamp'>>;
TPlain: Pick<History, 'id' | 'status' | 'group' | 'timestamp' | 'duration'> & {
snapshot: RequestContextSnapshot['TPlain'];
expectation?: Expectation<any>['TPlain'];
};
id: string;
messagesCounter: (value?: number) => number;
group: string;
snapshot: SetRequiredKeys<RequestContextSnapshot, 'messages'>;
status: "registered" | "completed" | "unregistered" | "pending";
expectation?: Expectation<any>;
timestamp: number;
duration: number;
constructor(configuration: Pick<History, 'group' | 'snapshot'> & Partial<Pick<History, 'timestamp'>>);
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