aboutsummaryrefslogtreecommitdiff
path: root/types/globals.d.ts
blob: 4fb4601289879dc9583141f570d686240c9b2bc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// bun.js v

declare global {
  function addEventListener(
    name: "fetch",
    callback: (event: FetchEvent) => void
  ): void;
}

declare global {
  export interface FetchEvent {
    /**  HTTP client metadata. This is not implemented yet, do not use.  */
    readonly client: undefined;

    /**  HTTP request  */
    readonly request: InstanceType<Request>;

    /**  Render the response in the active HTTP request  */
    respondWith(response: Response): void;
  }
}

export {};