forked from cloudflare/workers-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp.d.ts
70 lines (58 loc) · 1.83 KB
/
http.d.ts
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
declare abstract class Body {
json<T>(): Promise<T>;
}
declare class FormData {
append(name: string, value: string): void;
append(name: string, value: Blob, filename?: string): void;
set(name: string, value: string): void;
set(name: string, value: Blob, filename?: string): void;
entries(): IterableIterator<[key: string, value: File | string]>;
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
forEach<This = unknown>(
callback: (
this: This,
key: string,
value: File | string,
parent: FormData
) => void,
thisArg?: This
): void;
}
declare class Headers {
entries(): IterableIterator<[key: string, value: string]>;
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
forEach<This = unknown>(
callback: (this: This, key: string, value: string, parent: Headers) => void,
thisArg?: This
): void;
}
// This override provides the typing over the tuples as a nicety.
// The inner array is required to have exactly two elements.
declare type HeadersInit =
| Headers
| Record<string, string>
| [key: string, value: string][];
declare class URLSearchParams {
entries(): IterableIterator<[key: string, value: string]>;
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
forEach<This = unknown>(
callback: (
this: This,
key: string,
value: string,
parent: URLSearchParams
) => void,
thisArg?: This
): void;
}
// This override provides the typing over the tuples as a nicety.
// The inner array is required to have exactly two elements.
declare type URLSearchParamsInit =
| URLSearchParams
| string
| Record<string, string>
| [key: string, value: string][];
declare class FetchEvent extends ExtendableEvent {
respondWith(promise: Response | Promise<Response>): void;
}
export {};