summaryrefslogtreecommitdiffhomepage
path: root/packages/trace-replay/src/types.ts
blob: 0bcea1f148dfda67bd34ec65ddf7531296c37aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export interface HttpExchangeFixture {
  readonly request: {
    readonly method: string;
    readonly url: string;
    readonly headers: Record<string, string>;
    readonly body: string | null;
  };
  readonly response: {
    readonly status: number;
    readonly statusText?: string;
    readonly headers: Record<string, string>;
    readonly body: string;
  };
  readonly meta?: Record<string, string | number | boolean | null>;
}

export interface CapturedRequest {
  method: string;
  url: string;
  headers: Record<string, string>;
  body: string | null;
}

export type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;