1 | import type { local } from 'webdriver';
|
2 | import type { Cookie } from '@wdio/protocols';
|
3 | export type MockFilterOptions = {
|
4 | method?: string | ((method: string) => boolean);
|
5 | requestHeaders?: Record<string, string> | ((headers: Record<string, string>) => boolean);
|
6 | responseHeaders?: Record<string, string> | ((headers: Record<string, string>) => boolean);
|
7 | statusCode?: number | ((statusCode: number) => boolean);
|
8 | };
|
9 | type Overwrite<T, Request> = T | ((request: Request) => T);
|
10 | type Methods = 'POST' | 'GET' | 'DELETE' | 'PUT' | 'PATCH' | 'OPTIONS' | 'HEAD';
|
11 | export interface RequestWithOptions {
|
12 | body?: Overwrite<any, local.NetworkBeforeRequestSentParameters>;
|
13 | cookies?: Overwrite<Cookie[], local.NetworkBeforeRequestSentParameters>;
|
14 | headers?: Overwrite<Record<string, string>, local.NetworkBeforeRequestSentParameters>;
|
15 | method?: Overwrite<Methods, local.NetworkBeforeRequestSentParameters>;
|
16 | url?: Overwrite<string, local.NetworkBeforeRequestSentParameters>;
|
17 | }
|
18 | export interface RespondWithOptions extends Omit<RequestWithOptions, 'url' | 'method'> {
|
19 | statusCode?: Overwrite<number, local.NetworkResponseCompletedParameters>;
|
20 | }
|
21 | export interface MockRequestOptions {
|
22 | requestWith?: RequestWithOptions;
|
23 | }
|
24 | export {};
|
25 | //# sourceMappingURL=types.d.ts.map |
\ | No newline at end of file |