mphttpx 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +705 -24
- package/dist/index.cjs.js +1962 -1569
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.d.ts +558 -289
- package/dist/index.esm.js +1961 -1570
- package/dist/index.esm.min.js +1 -1
- package/package.json +2 -1
- package/README.md.bak +0 -107
package/dist/index.d.ts
CHANGED
|
@@ -1,132 +1,33 @@
|
|
|
1
|
+
/** @type {typeof globalThis.TextEncoder} */
|
|
1
2
|
declare class TextEncoderP implements TextEncoder {
|
|
2
3
|
get encoding(): string;
|
|
3
4
|
encode(input?: string): Uint8Array<ArrayBuffer>;
|
|
4
|
-
encodeInto(
|
|
5
|
-
toString(): string;
|
|
6
|
-
get isPolyfill(): {
|
|
7
|
-
symbol: symbol;
|
|
8
|
-
hierarchy: string[];
|
|
9
|
-
};
|
|
5
|
+
encodeInto(...args: Parameters<TextEncoder["encodeInto"]>): TextEncoderEncodeIntoResult;
|
|
10
6
|
}
|
|
11
7
|
declare const TextEncoderE: {
|
|
12
8
|
new (): TextEncoder;
|
|
13
9
|
prototype: TextEncoder;
|
|
14
10
|
};
|
|
15
11
|
|
|
12
|
+
/** @type {typeof globalThis.TextDecoder} */
|
|
16
13
|
declare class TextDecoderP implements TextDecoder {
|
|
17
|
-
constructor(
|
|
14
|
+
constructor(label?: string, { fatal, ignoreBOM }?: {
|
|
18
15
|
fatal?: boolean | undefined;
|
|
19
16
|
ignoreBOM?: boolean | undefined;
|
|
20
17
|
});
|
|
21
18
|
get encoding(): string;
|
|
22
19
|
get fatal(): boolean;
|
|
23
20
|
get ignoreBOM(): boolean;
|
|
24
|
-
decode(
|
|
21
|
+
decode(input?: Parameters<TextDecoder["decode"]>[0], { stream }?: {
|
|
25
22
|
stream?: boolean | undefined;
|
|
26
23
|
}): string;
|
|
27
|
-
toString(): string;
|
|
28
|
-
get isPolyfill(): {
|
|
29
|
-
symbol: symbol;
|
|
30
|
-
hierarchy: string[];
|
|
31
|
-
};
|
|
32
24
|
}
|
|
33
25
|
declare const TextDecoderE: {
|
|
34
26
|
new (label?: string, options?: TextDecoderOptions): TextDecoder;
|
|
35
27
|
prototype: TextDecoder;
|
|
36
28
|
};
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
static readonly NONE: 0;
|
|
40
|
-
static readonly CAPTURING_PHASE: 1;
|
|
41
|
-
static readonly AT_TARGET: 2;
|
|
42
|
-
static readonly BUBBLING_PHASE: 3;
|
|
43
|
-
constructor(type: string, eventInitDict?: EventInit);
|
|
44
|
-
get type(): string;
|
|
45
|
-
get bubbles(): boolean;
|
|
46
|
-
get cancelable(): boolean;
|
|
47
|
-
get composed(): boolean;
|
|
48
|
-
get target(): EventTarget | null;
|
|
49
|
-
get currentTarget(): EventTarget | null;
|
|
50
|
-
get eventPhase(): number;
|
|
51
|
-
readonly NONE: 0;
|
|
52
|
-
readonly CAPTURING_PHASE: 1;
|
|
53
|
-
readonly AT_TARGET: 2;
|
|
54
|
-
readonly BUBBLING_PHASE: 3;
|
|
55
|
-
get srcElement(): EventTarget | null;
|
|
56
|
-
get cancelBubble(): boolean;
|
|
57
|
-
set cancelBubble(value: boolean);
|
|
58
|
-
get defaultPrevented(): boolean;
|
|
59
|
-
get returnValue(): boolean;
|
|
60
|
-
set returnValue(value: boolean);
|
|
61
|
-
readonly isTrusted: boolean;
|
|
62
|
-
get timeStamp(): number;
|
|
63
|
-
composedPath(): EventTarget[];
|
|
64
|
-
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
|
|
65
|
-
preventDefault(): void;
|
|
66
|
-
stopImmediatePropagation(): void;
|
|
67
|
-
stopPropagation(): void;
|
|
68
|
-
toString(): string;
|
|
69
|
-
get isPolyfill(): {
|
|
70
|
-
symbol: symbol;
|
|
71
|
-
hierarchy: string[];
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
declare const EventE: {
|
|
75
|
-
new (type: string, eventInitDict?: EventInit): Event;
|
|
76
|
-
prototype: Event;
|
|
77
|
-
readonly NONE: 0;
|
|
78
|
-
readonly CAPTURING_PHASE: 1;
|
|
79
|
-
readonly AT_TARGET: 2;
|
|
80
|
-
readonly BUBBLING_PHASE: 3;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
declare class EventTargetP implements EventTarget {
|
|
84
|
-
constructor();
|
|
85
|
-
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
|
|
86
|
-
dispatchEvent(event: Event): boolean;
|
|
87
|
-
removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
|
|
88
|
-
toString(): string;
|
|
89
|
-
get isPolyfill(): {
|
|
90
|
-
symbol: symbol;
|
|
91
|
-
hierarchy: string[];
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
declare const EventTargetE: {
|
|
95
|
-
new (): EventTarget;
|
|
96
|
-
prototype: EventTarget;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
declare class CustomEventP<T> extends EventP implements CustomEvent {
|
|
100
|
-
constructor(type: string, eventInitDict?: CustomEventInit<T>);
|
|
101
|
-
get detail(): T;
|
|
102
|
-
initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void;
|
|
103
|
-
toString(): string;
|
|
104
|
-
get isPolyfill(): {
|
|
105
|
-
symbol: symbol;
|
|
106
|
-
hierarchy: string[];
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
declare const CustomEventE: {
|
|
110
|
-
new <T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
|
|
111
|
-
prototype: CustomEvent;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
declare class ProgressEventP extends EventP implements ProgressEvent {
|
|
115
|
-
constructor(type: string, eventInitDict?: ProgressEventInit);
|
|
116
|
-
get lengthComputable(): boolean;
|
|
117
|
-
get loaded(): number;
|
|
118
|
-
get total(): number;
|
|
119
|
-
toString(): string;
|
|
120
|
-
get isPolyfill(): {
|
|
121
|
-
symbol: symbol;
|
|
122
|
-
hierarchy: string[];
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
declare const ProgressEventE: {
|
|
126
|
-
new (type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
|
|
127
|
-
prototype: ProgressEvent;
|
|
128
|
-
};
|
|
129
|
-
|
|
30
|
+
/** @type {typeof globalThis.Blob} */
|
|
130
31
|
declare class BlobP implements Blob {
|
|
131
32
|
constructor(blobParts?: BlobPart[], options?: BlobPropertyBag);
|
|
132
33
|
get size(): number;
|
|
@@ -136,33 +37,37 @@ declare class BlobP implements Blob {
|
|
|
136
37
|
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
137
38
|
stream(): ReturnType<Blob["stream"]>;
|
|
138
39
|
text(): Promise<string>;
|
|
139
|
-
toString(): string;
|
|
140
|
-
get isPolyfill(): {
|
|
141
|
-
symbol: symbol;
|
|
142
|
-
hierarchy: string[];
|
|
143
|
-
};
|
|
144
40
|
}
|
|
145
41
|
declare const BlobE: {
|
|
146
42
|
new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
|
|
147
43
|
prototype: Blob;
|
|
148
44
|
};
|
|
149
45
|
|
|
46
|
+
/** @type {typeof globalThis.File} */
|
|
150
47
|
declare class FileP extends BlobP implements File {
|
|
151
|
-
constructor(
|
|
48
|
+
constructor(...args: [BlobPart[], string, FilePropertyBag?]);
|
|
152
49
|
get lastModified(): number;
|
|
153
50
|
get name(): string;
|
|
154
51
|
get webkitRelativePath(): string;
|
|
155
|
-
toString(): string;
|
|
156
|
-
get isPolyfill(): {
|
|
157
|
-
symbol: symbol;
|
|
158
|
-
hierarchy: string[];
|
|
159
|
-
};
|
|
160
52
|
}
|
|
161
53
|
declare const FileE: {
|
|
162
54
|
new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
|
|
163
55
|
prototype: File;
|
|
164
56
|
};
|
|
165
57
|
|
|
58
|
+
/** @type {typeof globalThis.EventTarget} */
|
|
59
|
+
declare class EventTargetP implements EventTarget {
|
|
60
|
+
constructor();
|
|
61
|
+
addEventListener(...args: [string, EventListenerOrEventListenerObject | null, (AddEventListenerOptions | boolean)?]): void;
|
|
62
|
+
dispatchEvent(...args: [Event]): boolean;
|
|
63
|
+
removeEventListener(...args: [string, EventListenerOrEventListenerObject | null, (EventListenerOptions | boolean)?]): void;
|
|
64
|
+
}
|
|
65
|
+
declare const EventTargetE: {
|
|
66
|
+
new (): EventTarget;
|
|
67
|
+
prototype: EventTarget;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @type {typeof globalThis.FileReader} */
|
|
166
71
|
declare class FileReaderP extends EventTargetP implements FileReader {
|
|
167
72
|
static readonly EMPTY: 0;
|
|
168
73
|
static readonly LOADING: 1;
|
|
@@ -173,12 +78,12 @@ declare class FileReaderP extends EventTargetP implements FileReader {
|
|
|
173
78
|
readonly EMPTY: 0;
|
|
174
79
|
readonly LOADING: 1;
|
|
175
80
|
readonly DONE: 2;
|
|
176
|
-
get error(): DOMException | null;
|
|
81
|
+
get error(): (DOMException | null);
|
|
177
82
|
abort(): void;
|
|
178
|
-
readAsArrayBuffer(
|
|
179
|
-
readAsBinaryString(
|
|
180
|
-
readAsDataURL(
|
|
181
|
-
readAsText(
|
|
83
|
+
readAsArrayBuffer(...args: [Blob]): void;
|
|
84
|
+
readAsBinaryString(...args: [Blob]): void;
|
|
85
|
+
readAsDataURL(...args: [Blob]): void;
|
|
86
|
+
readAsText(...args: [Blob, string?]): void;
|
|
182
87
|
get onabort(): ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
|
|
183
88
|
set onabort(value: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null);
|
|
184
89
|
get onerror(): ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
|
|
@@ -191,11 +96,6 @@ declare class FileReaderP extends EventTargetP implements FileReader {
|
|
|
191
96
|
set onloadstart(value: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null);
|
|
192
97
|
get onprogress(): ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
|
|
193
98
|
set onprogress(value: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null);
|
|
194
|
-
toString(): string;
|
|
195
|
-
get isPolyfill(): {
|
|
196
|
-
symbol: symbol;
|
|
197
|
-
hierarchy: string[];
|
|
198
|
-
};
|
|
199
99
|
}
|
|
200
100
|
declare const FileReaderE: {
|
|
201
101
|
new (): FileReader;
|
|
@@ -205,71 +105,152 @@ declare const FileReaderE: {
|
|
|
205
105
|
readonly DONE: 2;
|
|
206
106
|
};
|
|
207
107
|
|
|
108
|
+
/** @type {typeof globalThis.URLSearchParams} */
|
|
109
|
+
declare class URLSearchParamsP implements URLSearchParams {
|
|
110
|
+
constructor(init?: string[][] | Record<string, string> | string | URLSearchParams);
|
|
111
|
+
get size(): number;
|
|
112
|
+
append(...args: [string, string]): void;
|
|
113
|
+
delete(...args: [string, string?]): void;
|
|
114
|
+
get(...args: [string]): string | null;
|
|
115
|
+
getAll(...args: [string]): string[];
|
|
116
|
+
has(...args: [string, string?]): boolean;
|
|
117
|
+
set(...args: [string, string]): void;
|
|
118
|
+
sort(): void;
|
|
119
|
+
forEach(...args: [(value: string, key: string, parent: URLSearchParams) => void, any?]): void;
|
|
120
|
+
entries(): ArrayIterator<[string, string]>;
|
|
121
|
+
keys(): ArrayIterator<string>;
|
|
122
|
+
values(): ArrayIterator<string>;
|
|
123
|
+
[Symbol.iterator](): ArrayIterator<[string, string]>;
|
|
124
|
+
toString(): string;
|
|
125
|
+
}
|
|
126
|
+
declare const URLSearchParamsE: {
|
|
127
|
+
new (init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
|
|
128
|
+
prototype: URLSearchParams;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/** @type {typeof globalThis.FormData} */
|
|
208
132
|
declare class FormDataP implements FormData {
|
|
209
133
|
constructor(form?: HTMLFormElement, submitter?: HTMLElement | null);
|
|
210
|
-
append(
|
|
211
|
-
delete(
|
|
212
|
-
get(
|
|
213
|
-
getAll(
|
|
214
|
-
has(
|
|
215
|
-
set(
|
|
216
|
-
forEach(
|
|
134
|
+
append(...args: [string, string | Blob, string?]): void;
|
|
135
|
+
delete(...args: [string]): void;
|
|
136
|
+
get(...args: [string]): FormDataEntryValue | null;
|
|
137
|
+
getAll(...args: [string]): FormDataEntryValue[];
|
|
138
|
+
has(...args: [string]): boolean;
|
|
139
|
+
set(...args: [string, string | Blob, string?]): void;
|
|
140
|
+
forEach(...args: [(value: FormDataEntryValue, key: string, parent: FormData) => void, any?]): void;
|
|
217
141
|
entries(): ArrayIterator<[string, FormDataEntryValue]>;
|
|
218
142
|
keys(): ArrayIterator<string>;
|
|
219
143
|
values(): ArrayIterator<FormDataEntryValue>;
|
|
220
144
|
[Symbol.iterator](): ArrayIterator<[string, FormDataEntryValue]>;
|
|
221
|
-
toString(): string;
|
|
222
|
-
get isPolyfill(): {
|
|
223
|
-
symbol: symbol;
|
|
224
|
-
hierarchy: string[];
|
|
225
|
-
};
|
|
226
145
|
}
|
|
227
146
|
declare const FormDataE: {
|
|
228
147
|
new (form?: HTMLFormElement, submitter?: HTMLElement | null): FormData;
|
|
229
148
|
prototype: FormData;
|
|
230
149
|
};
|
|
231
150
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
append(
|
|
236
|
-
delete(
|
|
237
|
-
get(
|
|
238
|
-
|
|
239
|
-
has(
|
|
240
|
-
set(
|
|
241
|
-
|
|
242
|
-
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
|
|
151
|
+
/** @type {typeof globalThis.Headers} */
|
|
152
|
+
declare class HeadersP implements Headers {
|
|
153
|
+
constructor(init?: HeadersInit);
|
|
154
|
+
append(...args: [string, string]): void;
|
|
155
|
+
delete(...args: [string]): void;
|
|
156
|
+
get(...args: [string]): string | null;
|
|
157
|
+
getSetCookie(): string[];
|
|
158
|
+
has(...args: [string]): boolean;
|
|
159
|
+
set(...args: [string, string]): void;
|
|
160
|
+
forEach(...args: [(value: string, key: string, parent: Headers) => void, any?]): void;
|
|
243
161
|
entries(): ArrayIterator<[string, string]>;
|
|
244
162
|
keys(): ArrayIterator<string>;
|
|
245
163
|
values(): ArrayIterator<string>;
|
|
246
164
|
[Symbol.iterator](): ArrayIterator<[string, string]>;
|
|
247
|
-
toString(): string;
|
|
248
|
-
get isPolyfill(): {
|
|
249
|
-
symbol: symbol;
|
|
250
|
-
hierarchy: string[];
|
|
251
|
-
};
|
|
252
165
|
}
|
|
253
|
-
declare const
|
|
254
|
-
new (init?:
|
|
255
|
-
prototype:
|
|
166
|
+
declare const HeadersE: {
|
|
167
|
+
new (init?: HeadersInit): Headers;
|
|
168
|
+
prototype: Headers;
|
|
256
169
|
};
|
|
257
170
|
|
|
171
|
+
declare const setXMLHttpRequest: (XHR: (typeof globalThis)["XMLHttpRequest"]) => void;
|
|
172
|
+
/** @type {typeof globalThis["fetch"]} */
|
|
173
|
+
declare function fetchP(...args: [RequestInfo | URL, RequestInit?]): Promise<Response>;
|
|
174
|
+
declare const fetchE: typeof fetch;
|
|
175
|
+
|
|
176
|
+
declare abstract class BodyImpl implements Body {
|
|
177
|
+
get body(): Body["body"];
|
|
178
|
+
get bodyUsed(): boolean;
|
|
179
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
180
|
+
blob(): Promise<Blob>;
|
|
181
|
+
bytes(): Promise<Uint8Array<ArrayBuffer>>;
|
|
182
|
+
formData(): Promise<FormData>;
|
|
183
|
+
json(): Promise<any>;
|
|
184
|
+
text(): Promise<string>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** @type {typeof globalThis.Request} */
|
|
188
|
+
declare class RequestP extends BodyImpl implements Request {
|
|
189
|
+
constructor(...args: [RequestInfo | URL, RequestInit?]);
|
|
190
|
+
get cache(): RequestCache;
|
|
191
|
+
get credentials(): RequestCredentials;
|
|
192
|
+
get destination(): RequestDestination;
|
|
193
|
+
get headers(): Headers;
|
|
194
|
+
get integrity(): string;
|
|
195
|
+
get keepalive(): boolean;
|
|
196
|
+
get method(): string;
|
|
197
|
+
get mode(): RequestMode;
|
|
198
|
+
get redirect(): RequestRedirect;
|
|
199
|
+
get referrer(): string;
|
|
200
|
+
get referrerPolicy(): ReferrerPolicy;
|
|
201
|
+
get signal(): AbortSignal;
|
|
202
|
+
get url(): string;
|
|
203
|
+
clone(): Request;
|
|
204
|
+
}
|
|
205
|
+
declare const RequestE: {
|
|
206
|
+
new (input: RequestInfo | URL, init?: RequestInit): Request;
|
|
207
|
+
prototype: Request;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/** @type {typeof globalThis.Response} */
|
|
211
|
+
declare class ResponseP extends BodyImpl implements Response {
|
|
212
|
+
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
213
|
+
get headers(): Headers;
|
|
214
|
+
get ok(): boolean;
|
|
215
|
+
get redirected(): boolean;
|
|
216
|
+
get status(): number;
|
|
217
|
+
get statusText(): string;
|
|
218
|
+
get type(): ResponseType;
|
|
219
|
+
get url(): string;
|
|
220
|
+
clone(): Response;
|
|
221
|
+
static json(...args: [any, ResponseInit?]): Response;
|
|
222
|
+
static error(): Response;
|
|
223
|
+
static redirect(...args: [string | URL, number?]): Response;
|
|
224
|
+
}
|
|
225
|
+
declare const ResponseE: {
|
|
226
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
227
|
+
prototype: Response;
|
|
228
|
+
error(): Response;
|
|
229
|
+
json(data: any, init?: ResponseInit): Response;
|
|
230
|
+
redirect(url: string | URL, status?: number): Response;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/** @type {typeof globalThis.AbortController} */
|
|
234
|
+
declare class AbortControllerP implements AbortController {
|
|
235
|
+
constructor();
|
|
236
|
+
get signal(): AbortSignal;
|
|
237
|
+
abort(reason?: any): void;
|
|
238
|
+
}
|
|
239
|
+
declare const AbortControllerE: {
|
|
240
|
+
new (): AbortController;
|
|
241
|
+
prototype: AbortController;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/** @type {typeof globalThis.AbortSignal} */
|
|
258
245
|
declare class AbortSignalP extends EventTargetP implements AbortSignal {
|
|
259
246
|
static abort(reason?: any): AbortSignal;
|
|
260
|
-
static any(
|
|
261
|
-
static timeout(
|
|
262
|
-
constructor();
|
|
247
|
+
static any(...args: [AbortSignal[]]): AbortSignal;
|
|
248
|
+
static timeout(...args: [number]): AbortSignal;
|
|
263
249
|
get aborted(): boolean;
|
|
264
250
|
get reason(): any;
|
|
265
251
|
throwIfAborted(): void;
|
|
266
252
|
get onabort(): ((this: AbortSignal, ev: Event) => any) | null;
|
|
267
253
|
set onabort(value: ((this: AbortSignal, ev: Event) => any) | null);
|
|
268
|
-
toString(): string;
|
|
269
|
-
get isPolyfill(): {
|
|
270
|
-
symbol: symbol;
|
|
271
|
-
hierarchy: string[];
|
|
272
|
-
};
|
|
273
254
|
}
|
|
274
255
|
declare const AbortSignalE: {
|
|
275
256
|
new (): AbortSignal;
|
|
@@ -279,23 +260,72 @@ declare const AbortSignalE: {
|
|
|
279
260
|
timeout(milliseconds: number): AbortSignal;
|
|
280
261
|
};
|
|
281
262
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
263
|
+
/** @type {typeof globalThis.Event} */
|
|
264
|
+
declare class EventP implements Event {
|
|
265
|
+
static readonly NONE: 0;
|
|
266
|
+
static readonly CAPTURING_PHASE: 1;
|
|
267
|
+
static readonly AT_TARGET: 2;
|
|
268
|
+
static readonly BUBBLING_PHASE: 3;
|
|
269
|
+
constructor(...args: [string, EventInit?]);
|
|
270
|
+
get type(): string;
|
|
271
|
+
get bubbles(): boolean;
|
|
272
|
+
get cancelable(): boolean;
|
|
273
|
+
get composed(): boolean;
|
|
274
|
+
get target(): EventTarget | null;
|
|
275
|
+
get currentTarget(): EventTarget | null;
|
|
276
|
+
get eventPhase(): number;
|
|
277
|
+
readonly NONE: 0;
|
|
278
|
+
readonly CAPTURING_PHASE: 1;
|
|
279
|
+
readonly AT_TARGET: 2;
|
|
280
|
+
readonly BUBBLING_PHASE: 3;
|
|
281
|
+
get srcElement(): EventTarget | null;
|
|
282
|
+
get cancelBubble(): boolean;
|
|
283
|
+
set cancelBubble(value: boolean);
|
|
284
|
+
get defaultPrevented(): boolean;
|
|
285
|
+
get returnValue(): boolean;
|
|
286
|
+
set returnValue(value: boolean);
|
|
287
|
+
readonly isTrusted: boolean;
|
|
288
|
+
get timeStamp(): number;
|
|
289
|
+
composedPath(): EventTarget[];
|
|
290
|
+
initEvent(...args: [string, boolean?, boolean?]): void;
|
|
291
|
+
preventDefault(): void;
|
|
292
|
+
stopImmediatePropagation(): void;
|
|
293
|
+
stopPropagation(): void;
|
|
291
294
|
}
|
|
292
|
-
declare const
|
|
293
|
-
new ():
|
|
294
|
-
prototype:
|
|
295
|
+
declare const EventE: {
|
|
296
|
+
new (type: string, eventInitDict?: EventInit): Event;
|
|
297
|
+
prototype: Event;
|
|
298
|
+
readonly NONE: 0;
|
|
299
|
+
readonly CAPTURING_PHASE: 1;
|
|
300
|
+
readonly AT_TARGET: 2;
|
|
301
|
+
readonly BUBBLING_PHASE: 3;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/** @type {typeof globalThis.CustomEvent} */
|
|
305
|
+
declare class CustomEventP<T> extends EventP implements CustomEvent {
|
|
306
|
+
constructor(type: string, eventInitDict?: CustomEventInit<T>);
|
|
307
|
+
get detail(): T;
|
|
308
|
+
initCustomEvent(...args: [string, boolean?, boolean?, T?]): void;
|
|
309
|
+
}
|
|
310
|
+
declare const CustomEventE: {
|
|
311
|
+
new <T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
|
|
312
|
+
prototype: CustomEvent;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
/** @type {typeof globalThis.ProgressEvent} */
|
|
316
|
+
declare class ProgressEventP extends EventP implements ProgressEvent {
|
|
317
|
+
constructor(type: string, eventInitDict?: ProgressEventInit);
|
|
318
|
+
get lengthComputable(): boolean;
|
|
319
|
+
get loaded(): number;
|
|
320
|
+
get total(): number;
|
|
321
|
+
}
|
|
322
|
+
declare const ProgressEventE: {
|
|
323
|
+
new (type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
|
|
324
|
+
prototype: ProgressEvent;
|
|
295
325
|
};
|
|
296
326
|
|
|
327
|
+
/** @type {typeof globalThis.XMLHttpRequestEventTarget} */
|
|
297
328
|
declare class XMLHttpRequestEventTargetP extends EventTargetP implements XMLHttpRequestEventTarget {
|
|
298
|
-
constructor();
|
|
299
329
|
get onabort(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
300
330
|
set onabort(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
|
|
301
331
|
get onerror(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
@@ -310,13 +340,355 @@ declare class XMLHttpRequestEventTargetP extends EventTargetP implements XMLHttp
|
|
|
310
340
|
set onprogress(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
|
|
311
341
|
get ontimeout(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
312
342
|
set ontimeout(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* 发起 HTTPS 网络请求。
|
|
347
|
+
*/
|
|
348
|
+
type TRequestFunc = (options: IRequestOptions) => IRequestTask;
|
|
349
|
+
interface IRequestOptions {
|
|
350
|
+
/**
|
|
351
|
+
* 开发者服务器接口地址
|
|
352
|
+
*/
|
|
353
|
+
url: string;
|
|
354
|
+
/**
|
|
355
|
+
* 请求的参数
|
|
356
|
+
*/
|
|
357
|
+
data?: string | object | ArrayBuffer;
|
|
358
|
+
/**
|
|
359
|
+
* 设置请求的 header,header 中不能设置 Referer。content-type 默认为 application/json
|
|
360
|
+
*/
|
|
361
|
+
header?: object;
|
|
362
|
+
/**
|
|
363
|
+
* 超时时间,单位为毫秒。默认值为 60000
|
|
364
|
+
*/
|
|
365
|
+
timeout?: number;
|
|
366
|
+
/**
|
|
367
|
+
* HTTP 请求方法
|
|
368
|
+
* 默认值:GET
|
|
369
|
+
*/
|
|
370
|
+
method?: "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE" | "CONNECT";
|
|
371
|
+
/**
|
|
372
|
+
* 返回的数据格式
|
|
373
|
+
* 合法值:
|
|
374
|
+
* - json(默认值): 返回的数据为 JSON,返回后会对返回的数据进行一次 JSON.parse
|
|
375
|
+
* - 其他: 不对返回的内容进行 JSON.parse
|
|
376
|
+
* - 支付宝(额外类型):"json_or_text" | "base64" | "arraybuffer"
|
|
377
|
+
*/
|
|
378
|
+
dataType?: "json" | "text" | "json_or_text" | "base64" | "arraybuffer";
|
|
379
|
+
/**
|
|
380
|
+
* 响应的数据类型
|
|
381
|
+
* 合法值:
|
|
382
|
+
* - text(默认值): 响应的数据为文本
|
|
383
|
+
* - arraybuffer: 响应的数据为 ArrayBuffer
|
|
384
|
+
*/
|
|
385
|
+
responseType?: "text" | "arraybuffer";
|
|
386
|
+
/**
|
|
387
|
+
* 使用高性能模式。从基础库 v3.5.0 开始在 Android 端默认开启,其他端暂不生效。该模式下有更优的网络性能表现,更多信息请查看下方说明。
|
|
388
|
+
* 默认值:true
|
|
389
|
+
*/
|
|
390
|
+
useHighPerformanceMode?: boolean;
|
|
391
|
+
withCredentials?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* 支付宝
|
|
394
|
+
* 是否手工设置 cookie。如果为 true,请求将使用 headers 中设置的 cookie;如果为 false,则 headers 中的 cookie 字段将被忽略,请求头中将包含服务端上一次返回的 cookie(如果有且未过期)
|
|
395
|
+
* 默认值:false
|
|
396
|
+
*/
|
|
397
|
+
enableCookie?: boolean;
|
|
398
|
+
/**
|
|
399
|
+
* 开启 http2
|
|
400
|
+
* 默认值:false
|
|
401
|
+
*/
|
|
402
|
+
enableHttp2?: boolean;
|
|
403
|
+
/**
|
|
404
|
+
* 是否开启 profile。iOS 和 Android 端默认开启,其他端暂不支持。开启后可在接口回调的 res.profile 中查看性能调试信息。
|
|
405
|
+
* 默认值:true
|
|
406
|
+
*/
|
|
407
|
+
enableProfile?: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* 是否开启 Quic/h3 协议(iOS 微信目前使用 gQUIC-Q43;Android 微信在 v8.0.54 前使用 gQUIC-Q43,v8.0.54 开始使用 IETF QUIC,即 h3 协议;PC微信使用 IETF QUIC,即 h3 协议)
|
|
410
|
+
* 默认值:false
|
|
411
|
+
*/
|
|
412
|
+
enableQuic?: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* 开启 Http 缓存
|
|
415
|
+
* 默认值:false
|
|
416
|
+
*/
|
|
417
|
+
enableCache?: boolean;
|
|
418
|
+
/**
|
|
419
|
+
* 是否开启 HttpDNS 服务。如开启,需要同时填入 httpDNSServiceId 。
|
|
420
|
+
* 默认值:false
|
|
421
|
+
*/
|
|
422
|
+
enableHttpDNS?: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* HttpDNS 服务商 Id。
|
|
425
|
+
*/
|
|
426
|
+
httpDNSServiceId?: string;
|
|
427
|
+
/**
|
|
428
|
+
* HttpDNS 超时时间。HttpDNS解析时间超过该值时不再走HttpDNS,本次请求将回退到localDNS。默认为 60000 毫秒。
|
|
429
|
+
* 默认值:60000
|
|
430
|
+
*/
|
|
431
|
+
httpDNSTimeout?: number;
|
|
432
|
+
/**
|
|
433
|
+
* 开启 transfer-encoding chunked。
|
|
434
|
+
* 默认值:false
|
|
435
|
+
*/
|
|
436
|
+
enableChunked?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
* 强制使用蜂窝网络发送请求
|
|
439
|
+
* 默认值:false
|
|
440
|
+
*/
|
|
441
|
+
forceCellularNetwork?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* 重定向拦截策略。(目前安卓、iOS、开发者工具已支持,PC端将在后续支持)
|
|
444
|
+
* 合法值:
|
|
445
|
+
* - follow(默认值): 不拦截重定向,即客户端自动处理重定向
|
|
446
|
+
* - manual: 拦截重定向。开启后,当 http 状态码为 3xx 时客户端不再自动重定向,而是触发 onHeadersReceived 回调,并结束本次 request 请求。可通过 onHeadersReceived 回调中的 header.Location 获取重定向的 url
|
|
447
|
+
*/
|
|
448
|
+
redirect?: "follow" | "manual";
|
|
449
|
+
/**
|
|
450
|
+
* 接口调用成功的回调函数
|
|
451
|
+
*/
|
|
452
|
+
success?: (res: IRequestSuccessCallbackResult) => void;
|
|
453
|
+
/**
|
|
454
|
+
* 接口调用失败的回调函数
|
|
455
|
+
*/
|
|
456
|
+
fail?: (err: IRequestFailCallbackResult) => void;
|
|
457
|
+
/**
|
|
458
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
459
|
+
*/
|
|
460
|
+
complete?: Function;
|
|
461
|
+
}
|
|
462
|
+
interface IGeneralCallbackResult {
|
|
463
|
+
/**
|
|
464
|
+
* 网络请求过程中的一些异常信息,例如httpdns超时等
|
|
465
|
+
*/
|
|
466
|
+
exception: {
|
|
467
|
+
/**
|
|
468
|
+
* 本次请求底层重试次数
|
|
469
|
+
*/
|
|
470
|
+
retryCount: number;
|
|
471
|
+
/**
|
|
472
|
+
* 本次请求底层失败信息,所有失败信息均符合Errno错误码
|
|
473
|
+
*/
|
|
474
|
+
reasons: Array<{
|
|
475
|
+
/**
|
|
476
|
+
* 错误原因
|
|
477
|
+
*/
|
|
478
|
+
errMsg: string;
|
|
479
|
+
/**
|
|
480
|
+
* 错误码
|
|
481
|
+
*/
|
|
482
|
+
errno: number;
|
|
483
|
+
}>;
|
|
317
484
|
};
|
|
485
|
+
/**
|
|
486
|
+
* 最终请求是否使用了HttpDNS解析的IP。仅当enableHttpDNS传true时返回此字段。如果开启enableHttpDNS但最终请求未使用HttpDNS解析的IP,可在exception查看原因。
|
|
487
|
+
*/
|
|
488
|
+
useHttpDNS: boolean;
|
|
489
|
+
}
|
|
490
|
+
interface IRequestSuccessCallbackBaseResult {
|
|
491
|
+
/**
|
|
492
|
+
* 开发者服务器返回的数据
|
|
493
|
+
*/
|
|
494
|
+
data: string | object | ArrayBuffer;
|
|
495
|
+
/**
|
|
496
|
+
* 开发者服务器返回的 HTTP 状态码
|
|
497
|
+
*/
|
|
498
|
+
statusCode: number;
|
|
499
|
+
/**
|
|
500
|
+
* 开发者服务器返回的 HTTP Response Header
|
|
501
|
+
*/
|
|
502
|
+
header: object;
|
|
503
|
+
}
|
|
504
|
+
interface IRequestSuccessCallbackResult extends IGeneralCallbackResult, IRequestSuccessCallbackBaseResult {
|
|
505
|
+
/**
|
|
506
|
+
* 开发者服务器返回的 cookies,格式为字符串数组
|
|
507
|
+
*/
|
|
508
|
+
cookies: string[];
|
|
509
|
+
/**
|
|
510
|
+
* 网络请求过程中一些调试信息。目前仅 iOS 和 Android 端支持,其他端暂不支持。
|
|
511
|
+
*/
|
|
512
|
+
profile: {
|
|
513
|
+
/**
|
|
514
|
+
* 调用接口的时间。
|
|
515
|
+
*/
|
|
516
|
+
invokeStart: number;
|
|
517
|
+
/**
|
|
518
|
+
* httpDNS 开始查询的时间。仅当开启 httpDNS 功能时返回该字段。目前仅wx.request接口支持
|
|
519
|
+
*/
|
|
520
|
+
httpDNSDomainLookUpStart: number;
|
|
521
|
+
/**
|
|
522
|
+
* httpDNS 完成查询的时间。仅当开启 httpDNS 功能时返回该字段。目前仅wx.request接口支持
|
|
523
|
+
*/
|
|
524
|
+
httpDNSDomainLookUpEnd: number;
|
|
525
|
+
/**
|
|
526
|
+
* 开始排队的时间。达到并行上限时才需要排队。
|
|
527
|
+
*/
|
|
528
|
+
queueStart: number;
|
|
529
|
+
/**
|
|
530
|
+
* 结束排队的时间。达到并行上限时才需要排队。如果未发生排队,则该字段和 queueStart 字段值相同
|
|
531
|
+
*/
|
|
532
|
+
queueEnd: number;
|
|
533
|
+
/**
|
|
534
|
+
* 第一个 HTTP 重定向发生时的时间。有跳转且是同域名内的重定向才算,否则值为 0
|
|
535
|
+
*/
|
|
536
|
+
redirectStart: number;
|
|
537
|
+
/**
|
|
538
|
+
* 最后一个 HTTP 重定向完成时的时间。有跳转且是同域名内部的重定向才算,否则值为 0
|
|
539
|
+
*/
|
|
540
|
+
redirectEnd: number;
|
|
541
|
+
/**
|
|
542
|
+
* 组件准备好使用 HTTP 请求抓取资源的时间,这发生在检查本地缓存之前
|
|
543
|
+
*/
|
|
544
|
+
fetchStart: number;
|
|
545
|
+
/**
|
|
546
|
+
* Local DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等
|
|
547
|
+
*/
|
|
548
|
+
domainLookUpStart: number;
|
|
549
|
+
/**
|
|
550
|
+
* Local DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等
|
|
551
|
+
*/
|
|
552
|
+
domainLookUpEnd: number;
|
|
553
|
+
/**
|
|
554
|
+
* HTTP(TCP) 开始建立连接的时间,如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接开始的时间
|
|
555
|
+
*/
|
|
556
|
+
connectStart: number;
|
|
557
|
+
/**
|
|
558
|
+
* HTTP(TCP) 完成建立连接的时间(完成握手),如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接完成的时间。注意这里握手结束,包括安全连接建立完成、SOCKS 授权通过
|
|
559
|
+
*/
|
|
560
|
+
connectEnd: number;
|
|
561
|
+
/**
|
|
562
|
+
* SSL建立连接的时间,如果不是安全连接,则值为 0
|
|
563
|
+
*/
|
|
564
|
+
SSLconnectionStart: number;
|
|
565
|
+
/**
|
|
566
|
+
* SSL建立完成的时间,如果不是安全连接,则值为 0
|
|
567
|
+
*/
|
|
568
|
+
SSLconnectionEnd: number;
|
|
569
|
+
/**
|
|
570
|
+
* HTTP请求读取真实文档开始的时间(完成建立连接),包括从本地读取缓存。连接错误重连时,这里显示的也是新建立连接的时间
|
|
571
|
+
*/
|
|
572
|
+
requestStart: number;
|
|
573
|
+
/**
|
|
574
|
+
* HTTP请求读取真实文档结束的时间
|
|
575
|
+
*/
|
|
576
|
+
requestEnd: number;
|
|
577
|
+
/**
|
|
578
|
+
* HTTP 开始接收响应的时间(获取到第一个字节),包括从本地读取缓存
|
|
579
|
+
*/
|
|
580
|
+
responseStart: number;
|
|
581
|
+
/**
|
|
582
|
+
* HTTP 响应全部接收完成的时间(获取到最后一个字节),包括从本地读取缓存
|
|
583
|
+
*/
|
|
584
|
+
responseEnd: number;
|
|
585
|
+
/**
|
|
586
|
+
* 当次请求连接过程中实时 rtt
|
|
587
|
+
*/
|
|
588
|
+
rtt: number;
|
|
589
|
+
/**
|
|
590
|
+
* 评估的网络状态 unknown, offline, slow 2g, 2g, 3g, 4g, last/0, 1, 2, 3, 4, 5, 6
|
|
591
|
+
*/
|
|
592
|
+
estimate_nettype: number;
|
|
593
|
+
/**
|
|
594
|
+
* 协议层根据多个请求评估当前网络的 rtt(仅供参考)
|
|
595
|
+
*/
|
|
596
|
+
httpRttEstimate: number;
|
|
597
|
+
/**
|
|
598
|
+
* 传输层根据多个请求评估的当前网络的 rtt(仅供参考)
|
|
599
|
+
*/
|
|
600
|
+
transportRttEstimate: number;
|
|
601
|
+
/**
|
|
602
|
+
* 评估当前网络下载的kbps
|
|
603
|
+
*/
|
|
604
|
+
downstreamThroughputKbpsEstimate: number;
|
|
605
|
+
/**
|
|
606
|
+
* 当前网络的实际下载kbps
|
|
607
|
+
*/
|
|
608
|
+
throughputKbps: number;
|
|
609
|
+
/**
|
|
610
|
+
* 当前请求的IP
|
|
611
|
+
*/
|
|
612
|
+
peerIP: string;
|
|
613
|
+
/**
|
|
614
|
+
* 当前请求的端口
|
|
615
|
+
*/
|
|
616
|
+
port: number;
|
|
617
|
+
/**
|
|
618
|
+
* 是否复用连接
|
|
619
|
+
*/
|
|
620
|
+
socketReused: boolean;
|
|
621
|
+
/**
|
|
622
|
+
* 发送的字节数
|
|
623
|
+
*/
|
|
624
|
+
sendBytesCount: number;
|
|
625
|
+
/**
|
|
626
|
+
* 收到字节数
|
|
627
|
+
*/
|
|
628
|
+
receivedBytedCount: number;
|
|
629
|
+
/**
|
|
630
|
+
* 使用协议类型,有效值:http1.1, h2, quic, unknown
|
|
631
|
+
*/
|
|
632
|
+
protocol: string;
|
|
633
|
+
/**
|
|
634
|
+
* 是否走到了高性能模式。基础库 v3.3.4 起支持。
|
|
635
|
+
*/
|
|
636
|
+
usingHighPerformanceMode: boolean;
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
interface IRequestFailCallbackResult extends IGeneralCallbackResult {
|
|
640
|
+
/**
|
|
641
|
+
* 错误信息
|
|
642
|
+
*/
|
|
643
|
+
errMsg: string;
|
|
644
|
+
/**
|
|
645
|
+
* errno 错误码
|
|
646
|
+
*/
|
|
647
|
+
errno: number;
|
|
648
|
+
}
|
|
649
|
+
interface IRequestTask {
|
|
650
|
+
/**
|
|
651
|
+
* 中断请求任务
|
|
652
|
+
*/
|
|
653
|
+
abort: () => void;
|
|
654
|
+
/**
|
|
655
|
+
* 监听 HTTP Response Header 事件。会比请求完成事件更早
|
|
656
|
+
*/
|
|
657
|
+
onHeadersReceived: (listener: (res: {
|
|
658
|
+
/**
|
|
659
|
+
* 开发者服务器返回的 HTTP Response Header
|
|
660
|
+
*/
|
|
661
|
+
header: object;
|
|
662
|
+
/**
|
|
663
|
+
* 开发者服务器返回的 HTTP 状态码 (目前开发者工具上不会返回 statusCode 字段,可用真机查看该字段,后续将会支持)
|
|
664
|
+
*/
|
|
665
|
+
statusCode: number;
|
|
666
|
+
/**
|
|
667
|
+
* 开发者服务器返回的 cookies,格式为字符串数组
|
|
668
|
+
*/
|
|
669
|
+
cookies: string[];
|
|
670
|
+
}) => void) => void;
|
|
671
|
+
/**
|
|
672
|
+
* 移除 HTTP Response Header 事件的监听函数
|
|
673
|
+
*/
|
|
674
|
+
offHeadersReceived: (listener: Function) => void;
|
|
675
|
+
/**
|
|
676
|
+
* 监听 Transfer-Encoding Chunk Received 事件。当接收到新的chunk时触发。
|
|
677
|
+
*/
|
|
678
|
+
onChunkReceived: (listener: (res: {
|
|
679
|
+
/**
|
|
680
|
+
* 返回的chunk buffer
|
|
681
|
+
*/
|
|
682
|
+
data: ArrayBuffer;
|
|
683
|
+
}) => void) => void;
|
|
684
|
+
/**
|
|
685
|
+
* 移除 Transfer-Encoding Chunk Received 事件的监听函数
|
|
686
|
+
*/
|
|
687
|
+
offChunkReceived: (listener: Function) => void;
|
|
318
688
|
}
|
|
319
689
|
|
|
690
|
+
declare const setRequest: (request: TRequestFunc) => void;
|
|
691
|
+
/** @type {typeof globalThis.XMLHttpRequest} */
|
|
320
692
|
declare class XMLHttpRequestP extends XMLHttpRequestEventTargetP implements XMLHttpRequest {
|
|
321
693
|
static readonly UNSENT: 0;
|
|
322
694
|
static readonly OPENED: 1;
|
|
@@ -345,18 +717,13 @@ declare class XMLHttpRequestP extends XMLHttpRequestEventTargetP implements XMLH
|
|
|
345
717
|
set withCredentials(value: boolean);
|
|
346
718
|
abort(): void;
|
|
347
719
|
getAllResponseHeaders(): string;
|
|
348
|
-
getResponseHeader(
|
|
720
|
+
getResponseHeader(...args: [string]): string | null;
|
|
349
721
|
open(...args: [method: string, url: string | URL, async?: boolean, username?: string | null, password?: string | null]): void;
|
|
350
|
-
overrideMimeType(
|
|
722
|
+
overrideMimeType(...args: [string]): void;
|
|
351
723
|
send(body?: Document | XMLHttpRequestBodyInit | null): void;
|
|
352
|
-
setRequestHeader(
|
|
724
|
+
setRequestHeader(...args: [string, string]): void;
|
|
353
725
|
get onreadystatechange(): ((this: XMLHttpRequest, ev: Event) => any) | null;
|
|
354
726
|
set onreadystatechange(value: ((this: XMLHttpRequest, ev: Event) => any) | null);
|
|
355
|
-
toString(): string;
|
|
356
|
-
get isPolyfill(): {
|
|
357
|
-
symbol: symbol;
|
|
358
|
-
hierarchy: string[];
|
|
359
|
-
};
|
|
360
727
|
}
|
|
361
728
|
declare const XMLHttpRequestE: {
|
|
362
729
|
new (): XMLHttpRequest;
|
|
@@ -368,102 +735,4 @@ declare const XMLHttpRequestE: {
|
|
|
368
735
|
readonly DONE: 4;
|
|
369
736
|
} | typeof XMLHttpRequestP;
|
|
370
737
|
|
|
371
|
-
|
|
372
|
-
declare const fetchE: typeof fetch;
|
|
373
|
-
|
|
374
|
-
declare class HeadersP implements Headers {
|
|
375
|
-
constructor(init?: HeadersInit);
|
|
376
|
-
append(name: string, value: string): void;
|
|
377
|
-
delete(name: string): void;
|
|
378
|
-
get(name: string): string | null;
|
|
379
|
-
getSetCookie(): string[];
|
|
380
|
-
has(name: string): boolean;
|
|
381
|
-
set(name: string, value: string): void;
|
|
382
|
-
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
|
383
|
-
entries(): MapIterator<[string, string]>;
|
|
384
|
-
keys(): ArrayIterator<string>;
|
|
385
|
-
values(): ArrayIterator<string>;
|
|
386
|
-
[Symbol.iterator](): MapIterator<[string, string]>;
|
|
387
|
-
toString(): string;
|
|
388
|
-
get isPolyfill(): {
|
|
389
|
-
symbol: symbol;
|
|
390
|
-
hierarchy: string[];
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
declare const HeadersE: {
|
|
394
|
-
new (init?: HeadersInit): Headers;
|
|
395
|
-
prototype: Headers;
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
declare class BodyP implements Body {
|
|
399
|
-
constructor();
|
|
400
|
-
get body(): Body["body"];
|
|
401
|
-
get bodyUsed(): boolean;
|
|
402
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
403
|
-
blob(): Promise<Blob>;
|
|
404
|
-
bytes(): Promise<Uint8Array<ArrayBuffer>>;
|
|
405
|
-
formData(): Promise<FormData>;
|
|
406
|
-
json(): Promise<any>;
|
|
407
|
-
text(): Promise<string>;
|
|
408
|
-
toString(): string;
|
|
409
|
-
get isPolyfill(): {
|
|
410
|
-
symbol: symbol;
|
|
411
|
-
hierarchy: string[];
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
declare class RequestP extends BodyP implements Request {
|
|
416
|
-
constructor(input: RequestInfo | URL, init?: RequestInit);
|
|
417
|
-
get cache(): RequestCache;
|
|
418
|
-
get credentials(): RequestCredentials;
|
|
419
|
-
get destination(): RequestDestination;
|
|
420
|
-
get headers(): Headers;
|
|
421
|
-
get integrity(): string;
|
|
422
|
-
get keepalive(): boolean;
|
|
423
|
-
get method(): string;
|
|
424
|
-
get mode(): RequestMode;
|
|
425
|
-
get redirect(): RequestRedirect;
|
|
426
|
-
get referrer(): string;
|
|
427
|
-
get referrerPolicy(): ReferrerPolicy;
|
|
428
|
-
get signal(): AbortSignal;
|
|
429
|
-
get url(): string;
|
|
430
|
-
clone(): Request;
|
|
431
|
-
toString(): string;
|
|
432
|
-
get isPolyfill(): {
|
|
433
|
-
symbol: symbol;
|
|
434
|
-
hierarchy: string[];
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
declare const RequestE: {
|
|
438
|
-
new (input: RequestInfo | URL, init?: RequestInit): Request;
|
|
439
|
-
prototype: Request;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
declare class ResponseP extends BodyP implements Response {
|
|
443
|
-
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
444
|
-
get headers(): Headers;
|
|
445
|
-
get ok(): boolean;
|
|
446
|
-
get redirected(): boolean;
|
|
447
|
-
get status(): number;
|
|
448
|
-
get statusText(): string;
|
|
449
|
-
get type(): ResponseType;
|
|
450
|
-
get url(): string;
|
|
451
|
-
clone(): Response;
|
|
452
|
-
static json(data: any, init?: ResponseInit): Response;
|
|
453
|
-
static error(): ResponseP;
|
|
454
|
-
static redirect(url: string | URL, status?: number): Response;
|
|
455
|
-
toString(): string;
|
|
456
|
-
get isPolyfill(): {
|
|
457
|
-
symbol: symbol;
|
|
458
|
-
hierarchy: string[];
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
declare const ResponseE: {
|
|
462
|
-
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
463
|
-
prototype: Response;
|
|
464
|
-
error(): Response;
|
|
465
|
-
json(data: any, init?: ResponseInit): Response;
|
|
466
|
-
redirect(url: string | URL, status?: number): Response;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
export { AbortControllerE as AbortController, AbortControllerP, AbortSignalE as AbortSignal, AbortSignalP, BlobE as Blob, BlobP, CustomEventE as CustomEvent, CustomEventP, EventE as Event, EventP, EventTargetE as EventTarget, EventTargetP, FileE as File, FileP, FileReaderE as FileReader, FileReaderP, FormDataE as FormData, FormDataP, HeadersE as Headers, HeadersP, ProgressEventE as ProgressEvent, ProgressEventP, RequestE as Request, RequestP, ResponseE as Response, ResponseP, TextDecoderE as TextDecoder, TextDecoderP, TextEncoderE as TextEncoder, TextEncoderP, URLSearchParamsE as URLSearchParams, URLSearchParamsP, XMLHttpRequestE as XMLHttpRequest, XMLHttpRequestP, fetchE as fetch, fetchP };
|
|
738
|
+
export { AbortControllerE as AbortController, AbortControllerP, AbortSignalE as AbortSignal, AbortSignalP, BlobE as Blob, BlobP, CustomEventE as CustomEvent, CustomEventP, EventE as Event, EventP, EventTargetE as EventTarget, EventTargetP, FileE as File, FileP, FileReaderE as FileReader, FileReaderP, FormDataE as FormData, FormDataP, HeadersE as Headers, HeadersP, ProgressEventE as ProgressEvent, ProgressEventP, RequestE as Request, RequestP, ResponseE as Response, ResponseP, TextDecoderE as TextDecoder, TextDecoderP, TextEncoderE as TextEncoder, TextEncoderP, URLSearchParamsE as URLSearchParams, URLSearchParamsP, XMLHttpRequestE as XMLHttpRequest, XMLHttpRequestP, fetchE as fetch, fetchP, setRequest, setXMLHttpRequest };
|