1 | import { NormalizedRequestOptions } from './RequestUtils.js';
|
2 | import { RouteMatcher } from './Matchers.js';
|
3 | import Route, { RouteConfig, RouteName } from './Route.js';
|
4 | import Router from './Router.js';
|
5 | import type { FetchMockConfig } from './FetchMock.js';
|
6 | export type Matched = 'matched';
|
7 | export type Unmatched = 'unmatched';
|
8 | export type CallHistoryFilter = RouteName | Matched | Unmatched | boolean | RouteMatcher;
|
9 | export type CallLog = {
|
10 | args: unknown[];
|
11 | url: string;
|
12 | options: NormalizedRequestOptions;
|
13 | request?: Request;
|
14 | signal?: AbortSignal;
|
15 | route?: Route;
|
16 | response?: Response;
|
17 | expressParams?: {
|
18 | [x: string]: string;
|
19 | };
|
20 | queryParams?: URLSearchParams;
|
21 | pendingPromises: Promise<unknown>[];
|
22 | };
|
23 | declare class CallHistory {
|
24 | callLogs: CallLog[];
|
25 | config: FetchMockConfig;
|
26 | router: Router;
|
27 | constructor(config: FetchMockConfig, router: Router);
|
28 | recordCall(callLog: CallLog): void;
|
29 | clear(): void;
|
30 | flush(waitForResponseMethods?: boolean): Promise<void>;
|
31 | calls(filter?: CallHistoryFilter, options?: RouteConfig): CallLog[];
|
32 | called(filter?: CallHistoryFilter, options?: RouteConfig): boolean;
|
33 | lastCall(filter?: CallHistoryFilter, options?: RouteConfig): CallLog | undefined;
|
34 | done(routeNames?: RouteName | RouteName[]): boolean;
|
35 | }
|
36 | export default CallHistory;
|