UNPKG

@n1k1t/mock-server

Version:

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

36 lines 1.65 kB
import type { IHistoryMeta, THistoryStatus } from './types'; import type { RequestContextSnapshot } from '../../models'; import type { Expectation } from '../../../expectations'; export declare class History { protected configuration: Pick<History, 'group' | 'snapshot'> & Partial<Pick<History, 'timestamp' | 'id' | 'status' | 'expectation' | 'meta'>>; TPlain: Pick<History, 'id' | 'status' | 'group' | 'timestamp' | 'meta'> & { format: 'plain'; snapshot: RequestContextSnapshot['TPlain']; expectation?: Expectation['TPlain']; }; TCompact: Omit<History['TPlain'], 'snapshot' | 'expectation' | 'format'> & { format: 'compact'; expectation?: Expectation['TCompact']; }; id: string; timestamp: number; group: string; snapshot: RequestContextSnapshot; status: THistoryStatus; meta: IHistoryMeta; expectation?: Expectation; constructor(configuration: Pick<History, 'group' | 'snapshot'> & Partial<Pick<History, 'timestamp' | 'id' | 'status' | 'expectation' | 'meta'>>); /** Actualizes internal snapshot with provided */ actualize(snapshot: RequestContextSnapshot): this; /** Switched status and updates duration */ switch(status: History['status']): this; is(status: History['status']): boolean; complete(): this; assign<T extends Partial<Pick<History, 'expectation'>>>(payload: T): this & T; /** Updates duration based on timestamp */ mark(): this; toPlain(): History['TPlain']; toCompact(): History['TCompact']; static build(configuration: History['configuration']): History; } //# sourceMappingURL=model.d.ts.map