This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
/
http.d.ts
79 lines (64 loc) · 2.06 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
71
72
73
74
75
76
77
78
79
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]>;
keys(): IterableIterator<string>;
values(): IterableIterator<string | File>;
forEach<This = unknown>(
callback: (
this: This,
value: File | string,
key: string,
parent: FormData
) => void,
thisArg?: This
): void;
}
declare class Headers {
entries(): IterableIterator<[key: string, value: string]>;
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
forEach<This = unknown>(
callback: (this: This, value: string, key: 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]>;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
forEach<This = unknown>(
callback: (
this: This,
value: string,
key: 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 {};