File size: 1,224 Bytes
9ada4bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { DeferredPromise } from '@open-draft/deferred-promise';

declare class RequestController {
    protected request: Request;
    responsePromise: DeferredPromise<Response | undefined>;
    constructor(request: Request);
    respondWith(response?: Response): void;
}

type InteractiveRequest = globalThis.Request & {
    respondWith: RequestController['respondWith'];
};

declare const IS_PATCHED_MODULE: unique symbol;
type RequestCredentials = 'omit' | 'include' | 'same-origin';
type HttpRequestEventMap = {
    request: [
        args: {
            request: InteractiveRequest;
            requestId: string;
        }
    ];
    response: [
        args: {
            response: Response;
            isMockedResponse: boolean;
            request: Request;
            requestId: string;
        }
    ];
    unhandledException: [
        args: {
            error: unknown;
            request: Request;
            requestId: string;
            controller: {
                respondWith(response: Response): void;
                errorWith(error?: Error): void;
            };
        }
    ];
};

export { HttpRequestEventMap as H, IS_PATCHED_MODULE as I, RequestCredentials as R, InteractiveRequest as a };