@cloudflare/workers-types 0.20240405.1 → 0.20240712.0
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/2021-11-03/index.d.ts +1229 -600
- package/2021-11-03/index.ts +1016 -366
- package/2022-01-31/index.d.ts +1239 -610
- package/2022-01-31/index.ts +1026 -376
- package/2022-03-21/index.d.ts +1243 -616
- package/2022-03-21/index.ts +1030 -382
- package/2022-08-04/index.d.ts +1243 -616
- package/2022-08-04/index.ts +1030 -382
- package/2022-10-31/index.d.ts +1244 -617
- package/2022-10-31/index.ts +1031 -383
- package/2022-11-30/index.d.ts +1246 -610
- package/2022-11-30/index.ts +1038 -381
- package/2023-03-01/index.d.ts +1247 -610
- package/2023-03-01/index.ts +1039 -381
- package/2023-07-01/index.d.ts +1247 -610
- package/2023-07-01/index.ts +1039 -381
- package/experimental/index.d.ts +1260 -617
- package/experimental/index.ts +1046 -382
- package/index.d.ts +1229 -600
- package/index.ts +1016 -366
- package/oldest/index.d.ts +1229 -600
- package/oldest/index.ts +1016 -366
- package/package.json +1 -1
package/2023-07-01/index.ts
CHANGED
|
@@ -14,11 +14,16 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
|
+
/**
|
|
18
|
+
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
|
19
|
+
*
|
|
20
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
|
21
|
+
*/
|
|
17
22
|
export declare class DOMException extends Error {
|
|
18
23
|
constructor(message?: string, name?: string);
|
|
19
|
-
|
|
24
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
|
|
20
25
|
readonly message: string;
|
|
21
|
-
|
|
26
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
|
|
22
27
|
readonly name: string;
|
|
23
28
|
/**
|
|
24
29
|
* @deprecated
|
|
@@ -26,7 +31,6 @@ export declare class DOMException extends Error {
|
|
|
26
31
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
|
27
32
|
*/
|
|
28
33
|
readonly code: number;
|
|
29
|
-
readonly stack: any;
|
|
30
34
|
static readonly INDEX_SIZE_ERR: number;
|
|
31
35
|
static readonly DOMSTRING_SIZE_ERR: number;
|
|
32
36
|
static readonly HIERARCHY_REQUEST_ERR: number;
|
|
@@ -52,6 +56,8 @@ export declare class DOMException extends Error {
|
|
|
52
56
|
static readonly TIMEOUT_ERR: number;
|
|
53
57
|
static readonly INVALID_NODE_TYPE_ERR: number;
|
|
54
58
|
static readonly DATA_CLONE_ERR: number;
|
|
59
|
+
get stack(): any;
|
|
60
|
+
set stack(value: any);
|
|
55
61
|
}
|
|
56
62
|
export type WorkerGlobalScopeEventMap = {
|
|
57
63
|
fetch: FetchEvent;
|
|
@@ -63,45 +69,45 @@ export type WorkerGlobalScopeEventMap = {
|
|
|
63
69
|
export declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
|
|
64
70
|
EventTarget: typeof EventTarget;
|
|
65
71
|
}
|
|
66
|
-
|
|
72
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
|
|
67
73
|
export interface Console {
|
|
68
74
|
"assert"(condition?: boolean, ...data: any[]): void;
|
|
69
|
-
|
|
75
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
|
|
70
76
|
clear(): void;
|
|
71
|
-
|
|
77
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
|
|
72
78
|
count(label?: string): void;
|
|
73
|
-
|
|
79
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
|
|
74
80
|
countReset(label?: string): void;
|
|
75
|
-
|
|
81
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
|
|
76
82
|
debug(...data: any[]): void;
|
|
77
|
-
|
|
83
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
|
|
78
84
|
dir(item?: any, options?: any): void;
|
|
79
|
-
|
|
85
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
|
|
80
86
|
dirxml(...data: any[]): void;
|
|
81
|
-
|
|
87
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
|
|
82
88
|
error(...data: any[]): void;
|
|
83
|
-
|
|
89
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
|
|
84
90
|
group(...data: any[]): void;
|
|
85
|
-
|
|
91
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
|
|
86
92
|
groupCollapsed(...data: any[]): void;
|
|
87
|
-
|
|
93
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
|
|
88
94
|
groupEnd(): void;
|
|
89
|
-
|
|
95
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
|
|
90
96
|
info(...data: any[]): void;
|
|
91
|
-
|
|
97
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
|
|
92
98
|
log(...data: any[]): void;
|
|
93
|
-
|
|
99
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
|
|
94
100
|
table(tabularData?: any, properties?: string[]): void;
|
|
95
|
-
|
|
101
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
|
|
96
102
|
time(label?: string): void;
|
|
97
|
-
|
|
103
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
|
|
98
104
|
timeEnd(label?: string): void;
|
|
99
|
-
|
|
105
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
|
|
100
106
|
timeLog(label?: string, ...data: any[]): void;
|
|
101
107
|
timeStamp(label?: string): void;
|
|
102
|
-
|
|
108
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
|
|
103
109
|
trace(...data: any[]): void;
|
|
104
|
-
|
|
110
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
|
|
105
111
|
warn(...data: any[]): void;
|
|
106
112
|
}
|
|
107
113
|
export declare const console: Console;
|
|
@@ -194,6 +200,7 @@ export declare namespace WebAssembly {
|
|
|
194
200
|
}
|
|
195
201
|
/**
|
|
196
202
|
* This ServiceWorker API interface represents the global execution context of a service worker.
|
|
203
|
+
* Available only in secure contexts.
|
|
197
204
|
*
|
|
198
205
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
|
|
199
206
|
*/
|
|
@@ -218,6 +225,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
218
225
|
clearInterval(timeoutId: number | null): void;
|
|
219
226
|
queueMicrotask(task: Function): void;
|
|
220
227
|
structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
|
|
228
|
+
reportError(error: any): void;
|
|
221
229
|
fetch(
|
|
222
230
|
input: RequestInfo,
|
|
223
231
|
init?: RequestInit<RequestInitCfProperties>,
|
|
@@ -246,10 +254,13 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
246
254
|
TransformStream: typeof TransformStream;
|
|
247
255
|
ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
|
|
248
256
|
CountQueuingStrategy: typeof CountQueuingStrategy;
|
|
257
|
+
ErrorEvent: typeof ErrorEvent;
|
|
258
|
+
EventSource: typeof EventSource;
|
|
249
259
|
ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
|
|
250
260
|
ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
|
|
251
261
|
ReadableByteStreamController: typeof ReadableByteStreamController;
|
|
252
262
|
WritableStreamDefaultController: typeof WritableStreamDefaultController;
|
|
263
|
+
TransformStreamDefaultController: typeof TransformStreamDefaultController;
|
|
253
264
|
CompressionStream: typeof CompressionStream;
|
|
254
265
|
DecompressionStream: typeof DecompressionStream;
|
|
255
266
|
TextEncoderStream: typeof TextEncoderStream;
|
|
@@ -281,16 +292,16 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
281
292
|
FixedLengthStream: typeof FixedLengthStream;
|
|
282
293
|
IdentityTransformStream: typeof IdentityTransformStream;
|
|
283
294
|
HTMLRewriter: typeof HTMLRewriter;
|
|
284
|
-
GPUAdapter: typeof
|
|
285
|
-
GPUOutOfMemoryError: typeof
|
|
286
|
-
GPUValidationError: typeof
|
|
287
|
-
GPUInternalError: typeof
|
|
288
|
-
GPUDeviceLostInfo: typeof
|
|
289
|
-
GPUBufferUsage: typeof
|
|
290
|
-
GPUShaderStage: typeof
|
|
291
|
-
GPUMapMode: typeof
|
|
292
|
-
GPUTextureUsage: typeof
|
|
293
|
-
GPUColorWrite: typeof
|
|
295
|
+
GPUAdapter: typeof GPUAdapter;
|
|
296
|
+
GPUOutOfMemoryError: typeof GPUOutOfMemoryError;
|
|
297
|
+
GPUValidationError: typeof GPUValidationError;
|
|
298
|
+
GPUInternalError: typeof GPUInternalError;
|
|
299
|
+
GPUDeviceLostInfo: typeof GPUDeviceLostInfo;
|
|
300
|
+
GPUBufferUsage: typeof GPUBufferUsage;
|
|
301
|
+
GPUShaderStage: typeof GPUShaderStage;
|
|
302
|
+
GPUMapMode: typeof GPUMapMode;
|
|
303
|
+
GPUTextureUsage: typeof GPUTextureUsage;
|
|
304
|
+
GPUColorWrite: typeof GPUColorWrite;
|
|
294
305
|
}
|
|
295
306
|
export declare function addEventListener<
|
|
296
307
|
Type extends keyof WorkerGlobalScopeEventMap,
|
|
@@ -314,52 +325,73 @@ export declare function removeEventListener<
|
|
|
314
325
|
export declare function dispatchEvent(
|
|
315
326
|
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
|
|
316
327
|
): boolean;
|
|
317
|
-
|
|
328
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
|
318
329
|
export declare function btoa(data: string): string;
|
|
319
|
-
|
|
330
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
|
320
331
|
export declare function atob(data: string): string;
|
|
321
|
-
|
|
332
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
322
333
|
export declare function setTimeout(
|
|
323
334
|
callback: (...args: any[]) => void,
|
|
324
335
|
msDelay?: number,
|
|
325
336
|
): number;
|
|
326
|
-
|
|
337
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
327
338
|
export declare function setTimeout<Args extends any[]>(
|
|
328
339
|
callback: (...args: Args) => void,
|
|
329
340
|
msDelay?: number,
|
|
330
341
|
...args: Args
|
|
331
342
|
): number;
|
|
332
|
-
|
|
343
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
|
|
333
344
|
export declare function clearTimeout(timeoutId: number | null): void;
|
|
334
|
-
|
|
345
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
335
346
|
export declare function setInterval(
|
|
336
347
|
callback: (...args: any[]) => void,
|
|
337
348
|
msDelay?: number,
|
|
338
349
|
): number;
|
|
339
|
-
|
|
350
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
340
351
|
export declare function setInterval<Args extends any[]>(
|
|
341
352
|
callback: (...args: Args) => void,
|
|
342
353
|
msDelay?: number,
|
|
343
354
|
...args: Args
|
|
344
355
|
): number;
|
|
345
|
-
|
|
356
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
|
346
357
|
export declare function clearInterval(timeoutId: number | null): void;
|
|
347
|
-
|
|
358
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
|
|
348
359
|
export declare function queueMicrotask(task: Function): void;
|
|
349
|
-
|
|
360
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
|
|
350
361
|
export declare function structuredClone<T>(
|
|
351
362
|
value: T,
|
|
352
363
|
options?: StructuredSerializeOptions,
|
|
353
364
|
): T;
|
|
354
|
-
|
|
365
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/reportError) */
|
|
366
|
+
export declare function reportError(error: any): void;
|
|
367
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
|
|
355
368
|
export declare function fetch(
|
|
356
369
|
input: RequestInfo,
|
|
357
370
|
init?: RequestInit<RequestInitCfProperties>,
|
|
358
371
|
): Promise<Response>;
|
|
359
372
|
export declare const self: ServiceWorkerGlobalScope;
|
|
373
|
+
/**
|
|
374
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
375
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
376
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
377
|
+
* compared to those implemented in most browsers.
|
|
378
|
+
*
|
|
379
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
380
|
+
*/
|
|
360
381
|
export declare const crypto: Crypto;
|
|
382
|
+
/**
|
|
383
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
384
|
+
*
|
|
385
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
386
|
+
*/
|
|
361
387
|
export declare const caches: CacheStorage;
|
|
362
388
|
export declare const scheduler: Scheduler;
|
|
389
|
+
/**
|
|
390
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
391
|
+
* as well as timing of subrequests and other operations.
|
|
392
|
+
*
|
|
393
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
394
|
+
*/
|
|
363
395
|
export declare const performance: Performance;
|
|
364
396
|
export declare const origin: string;
|
|
365
397
|
export declare const navigator: Navigator;
|
|
@@ -417,10 +449,11 @@ export interface ExportedHandler<
|
|
|
417
449
|
export interface StructuredSerializeOptions {
|
|
418
450
|
transfer?: any[];
|
|
419
451
|
}
|
|
452
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
|
|
420
453
|
export declare abstract class PromiseRejectionEvent extends Event {
|
|
421
|
-
|
|
454
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
|
|
422
455
|
readonly promise: Promise<any>;
|
|
423
|
-
|
|
456
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
|
|
424
457
|
readonly reason: any;
|
|
425
458
|
}
|
|
426
459
|
export declare abstract class Navigator {
|
|
@@ -435,17 +468,18 @@ export declare abstract class Navigator {
|
|
|
435
468
|
| FormData,
|
|
436
469
|
): boolean;
|
|
437
470
|
readonly userAgent: string;
|
|
438
|
-
readonly gpu:
|
|
471
|
+
readonly gpu: GPU;
|
|
439
472
|
}
|
|
440
473
|
/**
|
|
441
|
-
*
|
|
474
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
475
|
+
* as well as timing of subrequests and other operations.
|
|
442
476
|
*
|
|
443
|
-
* [
|
|
477
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
444
478
|
*/
|
|
445
479
|
export interface Performance {
|
|
446
|
-
|
|
480
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
|
|
447
481
|
readonly timeOrigin: number;
|
|
448
|
-
|
|
482
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
449
483
|
now(): number;
|
|
450
484
|
}
|
|
451
485
|
export interface AlarmInvocationInfo {
|
|
@@ -634,6 +668,11 @@ export interface AnalyticsEngineDataPoint {
|
|
|
634
668
|
doubles?: number[];
|
|
635
669
|
blobs?: ((ArrayBuffer | string) | null)[];
|
|
636
670
|
}
|
|
671
|
+
/**
|
|
672
|
+
* An event which takes place in the DOM.
|
|
673
|
+
*
|
|
674
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
|
675
|
+
*/
|
|
637
676
|
export declare class Event {
|
|
638
677
|
constructor(type: string, init?: EventInit);
|
|
639
678
|
/**
|
|
@@ -757,6 +796,11 @@ export interface EventListenerObject<EventType extends Event = Event> {
|
|
|
757
796
|
export type EventListenerOrEventListenerObject<
|
|
758
797
|
EventType extends Event = Event,
|
|
759
798
|
> = EventListener<EventType> | EventListenerObject<EventType>;
|
|
799
|
+
/**
|
|
800
|
+
* EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
|
|
801
|
+
*
|
|
802
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
|
803
|
+
*/
|
|
760
804
|
export declare class EventTarget<
|
|
761
805
|
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
762
806
|
> {
|
|
@@ -812,6 +856,11 @@ export interface EventTargetAddEventListenerOptions {
|
|
|
812
856
|
export interface EventTargetHandlerObject {
|
|
813
857
|
handleEvent: (event: Event) => any | undefined;
|
|
814
858
|
}
|
|
859
|
+
/**
|
|
860
|
+
* A controller object that allows you to abort one or more DOM requests as and when desired.
|
|
861
|
+
*
|
|
862
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
|
|
863
|
+
*/
|
|
815
864
|
export declare class AbortController {
|
|
816
865
|
constructor();
|
|
817
866
|
/**
|
|
@@ -827,11 +876,17 @@ export declare class AbortController {
|
|
|
827
876
|
*/
|
|
828
877
|
abort(reason?: any): void;
|
|
829
878
|
}
|
|
879
|
+
/**
|
|
880
|
+
* A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
|
|
881
|
+
*
|
|
882
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
|
|
883
|
+
*/
|
|
830
884
|
export declare abstract class AbortSignal extends EventTarget {
|
|
831
|
-
|
|
885
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
832
886
|
static abort(reason?: any): AbortSignal;
|
|
833
|
-
|
|
887
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
834
888
|
static timeout(delay: number): AbortSignal;
|
|
889
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
|
|
835
890
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
836
891
|
/**
|
|
837
892
|
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
@@ -839,13 +894,13 @@ export declare abstract class AbortSignal extends EventTarget {
|
|
|
839
894
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
840
895
|
*/
|
|
841
896
|
get aborted(): boolean;
|
|
842
|
-
|
|
897
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
843
898
|
get reason(): any;
|
|
844
|
-
|
|
899
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
845
900
|
get onabort(): any | null;
|
|
846
|
-
|
|
901
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
847
902
|
set onabort(value: any | null);
|
|
848
|
-
|
|
903
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
849
904
|
throwIfAborted(): void;
|
|
850
905
|
}
|
|
851
906
|
export interface Scheduler {
|
|
@@ -854,10 +909,16 @@ export interface Scheduler {
|
|
|
854
909
|
export interface SchedulerWaitOptions {
|
|
855
910
|
signal?: AbortSignal;
|
|
856
911
|
}
|
|
912
|
+
/**
|
|
913
|
+
* Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
|
|
914
|
+
*
|
|
915
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
|
916
|
+
*/
|
|
857
917
|
export declare abstract class ExtendableEvent extends Event {
|
|
858
|
-
|
|
918
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
859
919
|
waitUntil(promise: Promise<any>): void;
|
|
860
920
|
}
|
|
921
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
|
|
861
922
|
export declare class CustomEvent<T = any> extends Event {
|
|
862
923
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
863
924
|
/**
|
|
@@ -873,58 +934,90 @@ export interface CustomEventCustomEventInit {
|
|
|
873
934
|
composed?: boolean;
|
|
874
935
|
detail?: any;
|
|
875
936
|
}
|
|
937
|
+
/**
|
|
938
|
+
* A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.
|
|
939
|
+
*
|
|
940
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
|
|
941
|
+
*/
|
|
876
942
|
export declare class Blob {
|
|
877
943
|
constructor(
|
|
878
|
-
|
|
944
|
+
type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
879
945
|
options?: BlobOptions,
|
|
880
946
|
);
|
|
881
|
-
|
|
947
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
882
948
|
get size(): number;
|
|
883
|
-
|
|
949
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
884
950
|
get type(): string;
|
|
885
|
-
|
|
951
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
886
952
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
887
|
-
|
|
953
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
888
954
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
889
|
-
|
|
955
|
+
bytes(): Promise<Uint8Array>;
|
|
956
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
890
957
|
text(): Promise<string>;
|
|
891
|
-
|
|
958
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
892
959
|
stream(): ReadableStream;
|
|
893
960
|
}
|
|
894
961
|
export interface BlobOptions {
|
|
895
962
|
type?: string;
|
|
896
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Provides information about files and allows JavaScript in a web page to access their content.
|
|
966
|
+
*
|
|
967
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
|
|
968
|
+
*/
|
|
897
969
|
export declare class File extends Blob {
|
|
898
970
|
constructor(
|
|
899
971
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
900
972
|
name: string,
|
|
901
973
|
options?: FileOptions,
|
|
902
974
|
);
|
|
903
|
-
|
|
975
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
904
976
|
get name(): string;
|
|
905
|
-
|
|
977
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
906
978
|
get lastModified(): number;
|
|
907
979
|
}
|
|
908
980
|
export interface FileOptions {
|
|
909
981
|
type?: string;
|
|
910
982
|
lastModified?: number;
|
|
911
983
|
}
|
|
984
|
+
/**
|
|
985
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
986
|
+
*
|
|
987
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
988
|
+
*/
|
|
912
989
|
export declare abstract class CacheStorage {
|
|
913
|
-
|
|
990
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
914
991
|
open(cacheName: string): Promise<Cache>;
|
|
915
992
|
readonly default: Cache;
|
|
916
993
|
}
|
|
994
|
+
/**
|
|
995
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
996
|
+
*
|
|
997
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
998
|
+
*/
|
|
917
999
|
export declare abstract class Cache {
|
|
1000
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
|
|
918
1001
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
1002
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
|
|
919
1003
|
match(
|
|
920
1004
|
request: RequestInfo,
|
|
921
1005
|
options?: CacheQueryOptions,
|
|
922
1006
|
): Promise<Response | undefined>;
|
|
1007
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
|
|
923
1008
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
924
1009
|
}
|
|
925
1010
|
export interface CacheQueryOptions {
|
|
926
1011
|
ignoreMethod?: boolean;
|
|
927
1012
|
}
|
|
1013
|
+
/**
|
|
1014
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
1015
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
1016
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
1017
|
+
* compared to those implemented in most browsers.
|
|
1018
|
+
*
|
|
1019
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
1020
|
+
*/
|
|
928
1021
|
export declare abstract class Crypto {
|
|
929
1022
|
/**
|
|
930
1023
|
* Available only in secure contexts.
|
|
@@ -932,7 +1025,7 @@ export declare abstract class Crypto {
|
|
|
932
1025
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
933
1026
|
*/
|
|
934
1027
|
get subtle(): SubtleCrypto;
|
|
935
|
-
|
|
1028
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
936
1029
|
getRandomValues<
|
|
937
1030
|
T extends
|
|
938
1031
|
| Int8Array
|
|
@@ -952,39 +1045,50 @@ export declare abstract class Crypto {
|
|
|
952
1045
|
randomUUID(): string;
|
|
953
1046
|
DigestStream: typeof DigestStream;
|
|
954
1047
|
}
|
|
1048
|
+
/**
|
|
1049
|
+
* This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
|
|
1050
|
+
* Available only in secure contexts.
|
|
1051
|
+
*
|
|
1052
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
|
|
1053
|
+
*/
|
|
955
1054
|
export declare abstract class SubtleCrypto {
|
|
1055
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
|
|
956
1056
|
encrypt(
|
|
957
1057
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
958
1058
|
key: CryptoKey,
|
|
959
1059
|
plainText: ArrayBuffer | ArrayBufferView,
|
|
960
1060
|
): Promise<ArrayBuffer>;
|
|
1061
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
|
|
961
1062
|
decrypt(
|
|
962
1063
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
963
1064
|
key: CryptoKey,
|
|
964
1065
|
cipherText: ArrayBuffer | ArrayBufferView,
|
|
965
1066
|
): Promise<ArrayBuffer>;
|
|
1067
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
|
|
966
1068
|
sign(
|
|
967
1069
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
968
1070
|
key: CryptoKey,
|
|
969
1071
|
data: ArrayBuffer | ArrayBufferView,
|
|
970
1072
|
): Promise<ArrayBuffer>;
|
|
1073
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
|
|
971
1074
|
verify(
|
|
972
1075
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
973
1076
|
key: CryptoKey,
|
|
974
1077
|
signature: ArrayBuffer | ArrayBufferView,
|
|
975
1078
|
data: ArrayBuffer | ArrayBufferView,
|
|
976
1079
|
): Promise<boolean>;
|
|
1080
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
|
|
977
1081
|
digest(
|
|
978
1082
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
979
1083
|
data: ArrayBuffer | ArrayBufferView,
|
|
980
1084
|
): Promise<ArrayBuffer>;
|
|
981
|
-
|
|
1085
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
982
1086
|
generateKey(
|
|
983
1087
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
984
1088
|
extractable: boolean,
|
|
985
1089
|
keyUsages: string[],
|
|
986
1090
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
987
|
-
|
|
1091
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
988
1092
|
deriveKey(
|
|
989
1093
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
990
1094
|
baseKey: CryptoKey,
|
|
@@ -992,12 +1096,13 @@ export declare abstract class SubtleCrypto {
|
|
|
992
1096
|
extractable: boolean,
|
|
993
1097
|
keyUsages: string[],
|
|
994
1098
|
): Promise<CryptoKey>;
|
|
1099
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
|
|
995
1100
|
deriveBits(
|
|
996
1101
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
997
1102
|
baseKey: CryptoKey,
|
|
998
|
-
length
|
|
1103
|
+
length?: number | null,
|
|
999
1104
|
): Promise<ArrayBuffer>;
|
|
1000
|
-
|
|
1105
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
1001
1106
|
importKey(
|
|
1002
1107
|
format: string,
|
|
1003
1108
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
@@ -1005,14 +1110,16 @@ export declare abstract class SubtleCrypto {
|
|
|
1005
1110
|
extractable: boolean,
|
|
1006
1111
|
keyUsages: string[],
|
|
1007
1112
|
): Promise<CryptoKey>;
|
|
1113
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
|
|
1008
1114
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
1115
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
|
|
1009
1116
|
wrapKey(
|
|
1010
1117
|
format: string,
|
|
1011
1118
|
key: CryptoKey,
|
|
1012
1119
|
wrappingKey: CryptoKey,
|
|
1013
1120
|
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
1014
1121
|
): Promise<ArrayBuffer>;
|
|
1015
|
-
|
|
1122
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
1016
1123
|
unwrapKey(
|
|
1017
1124
|
format: string,
|
|
1018
1125
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -1027,12 +1134,18 @@ export declare abstract class SubtleCrypto {
|
|
|
1027
1134
|
b: ArrayBuffer | ArrayBufferView,
|
|
1028
1135
|
): boolean;
|
|
1029
1136
|
}
|
|
1137
|
+
/**
|
|
1138
|
+
* The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
|
|
1139
|
+
* Available only in secure contexts.
|
|
1140
|
+
*
|
|
1141
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
|
1142
|
+
*/
|
|
1030
1143
|
export declare abstract class CryptoKey {
|
|
1031
|
-
|
|
1144
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
1032
1145
|
readonly type: string;
|
|
1033
|
-
|
|
1146
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
1034
1147
|
readonly extractable: boolean;
|
|
1035
|
-
|
|
1148
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
1036
1149
|
readonly algorithm:
|
|
1037
1150
|
| CryptoKeyKeyAlgorithm
|
|
1038
1151
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -1040,7 +1153,7 @@ export declare abstract class CryptoKey {
|
|
|
1040
1153
|
| CryptoKeyRsaKeyAlgorithm
|
|
1041
1154
|
| CryptoKeyEllipticKeyAlgorithm
|
|
1042
1155
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1043
|
-
|
|
1156
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
1044
1157
|
readonly usages: string[];
|
|
1045
1158
|
}
|
|
1046
1159
|
export interface CryptoKeyPair {
|
|
@@ -1146,7 +1259,13 @@ export declare class DigestStream extends WritableStream<
|
|
|
1146
1259
|
> {
|
|
1147
1260
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
|
1148
1261
|
get digest(): Promise<ArrayBuffer>;
|
|
1262
|
+
get bytesWritten(): number | bigint;
|
|
1149
1263
|
}
|
|
1264
|
+
/**
|
|
1265
|
+
* A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
|
|
1266
|
+
*
|
|
1267
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
|
1268
|
+
*/
|
|
1150
1269
|
export declare class TextDecoder {
|
|
1151
1270
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1152
1271
|
/**
|
|
@@ -1172,6 +1291,11 @@ export declare class TextDecoder {
|
|
|
1172
1291
|
get fatal(): boolean;
|
|
1173
1292
|
get ignoreBOM(): boolean;
|
|
1174
1293
|
}
|
|
1294
|
+
/**
|
|
1295
|
+
* TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
|
|
1296
|
+
*
|
|
1297
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
|
1298
|
+
*/
|
|
1175
1299
|
export declare class TextEncoder {
|
|
1176
1300
|
constructor();
|
|
1177
1301
|
/**
|
|
@@ -1202,21 +1326,59 @@ export interface TextEncoderEncodeIntoResult {
|
|
|
1202
1326
|
read: number;
|
|
1203
1327
|
written: number;
|
|
1204
1328
|
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Events providing information related to errors in scripts or in files.
|
|
1331
|
+
*
|
|
1332
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
1333
|
+
*/
|
|
1334
|
+
export declare class ErrorEvent extends Event {
|
|
1335
|
+
constructor(type: string, init?: ErrorEventErrorEventInit);
|
|
1336
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1337
|
+
get filename(): string;
|
|
1338
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1339
|
+
get message(): string;
|
|
1340
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1341
|
+
get lineno(): number;
|
|
1342
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1343
|
+
get colno(): number;
|
|
1344
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1345
|
+
get error(): any;
|
|
1346
|
+
}
|
|
1347
|
+
export interface ErrorEventErrorEventInit {
|
|
1348
|
+
message?: string;
|
|
1349
|
+
filename?: string;
|
|
1350
|
+
lineno?: number;
|
|
1351
|
+
colno?: number;
|
|
1352
|
+
error?: any;
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
|
|
1356
|
+
*
|
|
1357
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
|
1358
|
+
*/
|
|
1205
1359
|
export declare class FormData {
|
|
1206
1360
|
constructor();
|
|
1361
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1207
1362
|
append(name: string, value: string): void;
|
|
1363
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1208
1364
|
append(name: string, value: Blob, filename?: string): void;
|
|
1365
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
|
|
1209
1366
|
delete(name: string): void;
|
|
1367
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
|
|
1210
1368
|
get(name: string): (File | string) | null;
|
|
1369
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
|
|
1211
1370
|
getAll(name: string): (File | string)[];
|
|
1371
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
|
|
1212
1372
|
has(name: string): boolean;
|
|
1373
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1213
1374
|
set(name: string, value: string): void;
|
|
1375
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1214
1376
|
set(name: string, value: Blob, filename?: string): void;
|
|
1215
|
-
|
|
1377
|
+
/* Returns an array of key, value pairs for every entry in the list. */
|
|
1216
1378
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1217
|
-
|
|
1379
|
+
/* Returns a list of keys in the list. */
|
|
1218
1380
|
keys(): IterableIterator<string>;
|
|
1219
|
-
|
|
1381
|
+
/* Returns a list of values in the list. */
|
|
1220
1382
|
values(): IterableIterator<File | string>;
|
|
1221
1383
|
forEach<This = unknown>(
|
|
1222
1384
|
callback: (
|
|
@@ -1302,10 +1464,15 @@ export interface Text {
|
|
|
1302
1464
|
export interface DocumentEnd {
|
|
1303
1465
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
1304
1466
|
}
|
|
1467
|
+
/**
|
|
1468
|
+
* This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.
|
|
1469
|
+
*
|
|
1470
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
|
1471
|
+
*/
|
|
1305
1472
|
export declare abstract class FetchEvent extends ExtendableEvent {
|
|
1306
|
-
|
|
1473
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
1307
1474
|
readonly request: Request;
|
|
1308
|
-
|
|
1475
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
1309
1476
|
respondWith(promise: Response | Promise<Response>): void;
|
|
1310
1477
|
passThroughOnException(): void;
|
|
1311
1478
|
}
|
|
@@ -1313,24 +1480,35 @@ export type HeadersInit =
|
|
|
1313
1480
|
| Headers
|
|
1314
1481
|
| Iterable<Iterable<string>>
|
|
1315
1482
|
| Record<string, string>;
|
|
1483
|
+
/**
|
|
1484
|
+
* This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.
|
|
1485
|
+
*
|
|
1486
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
1487
|
+
*/
|
|
1316
1488
|
export declare class Headers {
|
|
1317
1489
|
constructor(init?: HeadersInit);
|
|
1490
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
|
|
1318
1491
|
get(name: string): string | null;
|
|
1319
1492
|
getAll(name: string): string[];
|
|
1493
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
|
|
1320
1494
|
getSetCookie(): string[];
|
|
1495
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
|
|
1321
1496
|
has(name: string): boolean;
|
|
1497
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
|
|
1322
1498
|
set(name: string, value: string): void;
|
|
1499
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
|
|
1323
1500
|
append(name: string, value: string): void;
|
|
1501
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
|
|
1324
1502
|
delete(name: string): void;
|
|
1325
1503
|
forEach<This = unknown>(
|
|
1326
1504
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
1327
1505
|
thisArg?: This,
|
|
1328
1506
|
): void;
|
|
1329
|
-
|
|
1507
|
+
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
1330
1508
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1331
|
-
|
|
1509
|
+
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
1332
1510
|
keys(): IterableIterator<string>;
|
|
1333
|
-
|
|
1511
|
+
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
1334
1512
|
values(): IterableIterator<string>;
|
|
1335
1513
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1336
1514
|
}
|
|
@@ -1343,33 +1521,46 @@ export type BodyInit =
|
|
|
1343
1521
|
| URLSearchParams
|
|
1344
1522
|
| FormData;
|
|
1345
1523
|
export declare abstract class Body {
|
|
1524
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
|
1346
1525
|
get body(): ReadableStream | null;
|
|
1526
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
1347
1527
|
get bodyUsed(): boolean;
|
|
1528
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
1348
1529
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1530
|
+
bytes(): Promise<Uint8Array>;
|
|
1531
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
|
|
1349
1532
|
text(): Promise<string>;
|
|
1533
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
|
|
1350
1534
|
json<T>(): Promise<T>;
|
|
1535
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
|
|
1351
1536
|
formData(): Promise<FormData>;
|
|
1537
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
1352
1538
|
blob(): Promise<Blob>;
|
|
1353
1539
|
}
|
|
1540
|
+
/**
|
|
1541
|
+
* This Fetch API interface represents the response to a request.
|
|
1542
|
+
*
|
|
1543
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1544
|
+
*/
|
|
1354
1545
|
export declare class Response extends Body {
|
|
1355
1546
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1356
|
-
|
|
1547
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1357
1548
|
static redirect(url: string, status?: number): Response;
|
|
1358
|
-
|
|
1549
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1359
1550
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1360
|
-
|
|
1551
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1361
1552
|
clone(): Response;
|
|
1362
|
-
|
|
1553
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1363
1554
|
get status(): number;
|
|
1364
|
-
|
|
1555
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1365
1556
|
get statusText(): string;
|
|
1366
|
-
|
|
1557
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1367
1558
|
get headers(): Headers;
|
|
1368
|
-
|
|
1559
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1369
1560
|
get ok(): boolean;
|
|
1370
|
-
|
|
1561
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1371
1562
|
get redirected(): boolean;
|
|
1372
|
-
|
|
1563
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1373
1564
|
get url(): string;
|
|
1374
1565
|
get webSocket(): WebSocket | null;
|
|
1375
1566
|
get cf(): any | undefined;
|
|
@@ -1386,12 +1577,17 @@ export type RequestInfo<
|
|
|
1386
1577
|
CfHostMetadata = unknown,
|
|
1387
1578
|
Cf = CfProperties<CfHostMetadata>,
|
|
1388
1579
|
> = Request<CfHostMetadata, Cf> | string | URL;
|
|
1580
|
+
/**
|
|
1581
|
+
* This Fetch API interface represents a resource request.
|
|
1582
|
+
*
|
|
1583
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1584
|
+
*/
|
|
1389
1585
|
export declare class Request<
|
|
1390
1586
|
CfHostMetadata = unknown,
|
|
1391
1587
|
Cf = CfProperties<CfHostMetadata>,
|
|
1392
1588
|
> extends Body {
|
|
1393
1589
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1394
|
-
|
|
1590
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1395
1591
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1396
1592
|
/**
|
|
1397
1593
|
* Returns request's HTTP method, which is "GET" by default.
|
|
@@ -1439,19 +1635,19 @@ export declare class Request<
|
|
|
1439
1635
|
get keepalive(): boolean;
|
|
1440
1636
|
}
|
|
1441
1637
|
export interface RequestInit<Cf = CfProperties> {
|
|
1442
|
-
|
|
1638
|
+
/* A string to set request's method. */
|
|
1443
1639
|
method?: string;
|
|
1444
|
-
|
|
1640
|
+
/* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
|
|
1445
1641
|
headers?: HeadersInit;
|
|
1446
|
-
|
|
1642
|
+
/* A BodyInit object or null to set request's body. */
|
|
1447
1643
|
body?: BodyInit | null;
|
|
1448
|
-
|
|
1644
|
+
/* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */
|
|
1449
1645
|
redirect?: string;
|
|
1450
1646
|
fetcher?: Fetcher | null;
|
|
1451
1647
|
cf?: Cf;
|
|
1452
|
-
|
|
1648
|
+
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1453
1649
|
integrity?: string;
|
|
1454
|
-
|
|
1650
|
+
/* An AbortSignal to set request's signal. */
|
|
1455
1651
|
signal?: AbortSignal | null;
|
|
1456
1652
|
}
|
|
1457
1653
|
export type Service<
|
|
@@ -1885,31 +2081,36 @@ export type ReadableStreamReadResult<R = any> =
|
|
|
1885
2081
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1886
2082
|
*/
|
|
1887
2083
|
export interface ReadableStream<R = any> {
|
|
1888
|
-
|
|
2084
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1889
2085
|
get locked(): boolean;
|
|
1890
|
-
|
|
2086
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1891
2087
|
cancel(reason?: any): Promise<void>;
|
|
1892
|
-
|
|
2088
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1893
2089
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1894
|
-
|
|
2090
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1895
2091
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1896
|
-
|
|
2092
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1897
2093
|
pipeThrough<T>(
|
|
1898
2094
|
transform: ReadableWritablePair<T, R>,
|
|
1899
2095
|
options?: StreamPipeOptions,
|
|
1900
2096
|
): ReadableStream<T>;
|
|
1901
|
-
|
|
2097
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1902
2098
|
pipeTo(
|
|
1903
2099
|
destination: WritableStream<R>,
|
|
1904
2100
|
options?: StreamPipeOptions,
|
|
1905
2101
|
): Promise<void>;
|
|
1906
|
-
|
|
2102
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1907
2103
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1908
2104
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1909
2105
|
[Symbol.asyncIterator](
|
|
1910
2106
|
options?: ReadableStreamValuesOptions,
|
|
1911
2107
|
): AsyncIterableIterator<R>;
|
|
1912
2108
|
}
|
|
2109
|
+
/**
|
|
2110
|
+
* This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
|
|
2111
|
+
*
|
|
2112
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
2113
|
+
*/
|
|
1913
2114
|
export declare const ReadableStream: {
|
|
1914
2115
|
prototype: ReadableStream;
|
|
1915
2116
|
new (
|
|
@@ -1921,24 +2122,26 @@ export declare const ReadableStream: {
|
|
|
1921
2122
|
strategy?: QueuingStrategy<R>,
|
|
1922
2123
|
): ReadableStream<R>;
|
|
1923
2124
|
};
|
|
2125
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
|
|
1924
2126
|
export declare class ReadableStreamDefaultReader<R = any> {
|
|
1925
2127
|
constructor(stream: ReadableStream);
|
|
1926
2128
|
get closed(): Promise<void>;
|
|
1927
2129
|
cancel(reason?: any): Promise<void>;
|
|
1928
|
-
|
|
2130
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1929
2131
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1930
|
-
|
|
2132
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1931
2133
|
releaseLock(): void;
|
|
1932
2134
|
}
|
|
2135
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
|
1933
2136
|
export declare class ReadableStreamBYOBReader {
|
|
1934
2137
|
constructor(stream: ReadableStream);
|
|
1935
2138
|
get closed(): Promise<void>;
|
|
1936
2139
|
cancel(reason?: any): Promise<void>;
|
|
1937
|
-
|
|
2140
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1938
2141
|
read<T extends ArrayBufferView>(
|
|
1939
2142
|
view: T,
|
|
1940
2143
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1941
|
-
|
|
2144
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1942
2145
|
releaseLock(): void;
|
|
1943
2146
|
readAtLeast<T extends ArrayBufferView>(
|
|
1944
2147
|
minElements: number,
|
|
@@ -1956,52 +2159,60 @@ export interface ReadableStreamGetReaderOptions {
|
|
|
1956
2159
|
*/
|
|
1957
2160
|
mode: "byob";
|
|
1958
2161
|
}
|
|
2162
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
1959
2163
|
export declare abstract class ReadableStreamBYOBRequest {
|
|
1960
|
-
|
|
2164
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1961
2165
|
get view(): Uint8Array | null;
|
|
1962
|
-
|
|
2166
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1963
2167
|
respond(bytesWritten: number): void;
|
|
1964
|
-
|
|
2168
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1965
2169
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1966
2170
|
get atLeast(): number | null;
|
|
1967
2171
|
}
|
|
2172
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
1968
2173
|
export declare abstract class ReadableStreamDefaultController<R = any> {
|
|
1969
|
-
|
|
2174
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1970
2175
|
get desiredSize(): number | null;
|
|
1971
|
-
|
|
2176
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1972
2177
|
close(): void;
|
|
1973
|
-
|
|
2178
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1974
2179
|
enqueue(chunk?: R): void;
|
|
1975
|
-
|
|
2180
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1976
2181
|
error(reason: any): void;
|
|
1977
2182
|
}
|
|
2183
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
1978
2184
|
export declare abstract class ReadableByteStreamController {
|
|
1979
|
-
|
|
2185
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1980
2186
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
|
1981
|
-
|
|
2187
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1982
2188
|
get desiredSize(): number | null;
|
|
1983
|
-
|
|
2189
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1984
2190
|
close(): void;
|
|
1985
|
-
|
|
2191
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1986
2192
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1987
|
-
|
|
2193
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1988
2194
|
error(reason: any): void;
|
|
1989
2195
|
}
|
|
2196
|
+
/**
|
|
2197
|
+
* This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
|
|
2198
|
+
*
|
|
2199
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
2200
|
+
*/
|
|
1990
2201
|
export declare abstract class WritableStreamDefaultController {
|
|
1991
|
-
|
|
2202
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1992
2203
|
get signal(): AbortSignal;
|
|
1993
|
-
|
|
2204
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1994
2205
|
error(reason?: any): void;
|
|
1995
2206
|
}
|
|
1996
|
-
|
|
1997
|
-
export
|
|
1998
|
-
|
|
2207
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
2208
|
+
export declare abstract class TransformStreamDefaultController<O = any> {
|
|
2209
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1999
2210
|
get desiredSize(): number | null;
|
|
2000
|
-
|
|
2211
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
2001
2212
|
enqueue(chunk?: O): void;
|
|
2002
|
-
|
|
2213
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
2003
2214
|
error(reason: any): void;
|
|
2004
|
-
|
|
2215
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
2005
2216
|
terminate(): void;
|
|
2006
2217
|
}
|
|
2007
2218
|
export interface ReadableWritablePair<R = any, W = any> {
|
|
@@ -2013,46 +2224,57 @@ export interface ReadableWritablePair<R = any, W = any> {
|
|
|
2013
2224
|
writable: WritableStream<W>;
|
|
2014
2225
|
readable: ReadableStream<R>;
|
|
2015
2226
|
}
|
|
2227
|
+
/**
|
|
2228
|
+
* This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
|
|
2229
|
+
*
|
|
2230
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
|
2231
|
+
*/
|
|
2016
2232
|
export declare class WritableStream<W = any> {
|
|
2017
2233
|
constructor(
|
|
2018
2234
|
underlyingSink?: UnderlyingSink,
|
|
2019
2235
|
queuingStrategy?: QueuingStrategy,
|
|
2020
2236
|
);
|
|
2021
|
-
|
|
2237
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
2022
2238
|
get locked(): boolean;
|
|
2023
|
-
|
|
2239
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
2024
2240
|
abort(reason?: any): Promise<void>;
|
|
2025
|
-
|
|
2241
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
2026
2242
|
close(): Promise<void>;
|
|
2027
|
-
|
|
2243
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
2028
2244
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
2029
2245
|
}
|
|
2246
|
+
/**
|
|
2247
|
+
* This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.
|
|
2248
|
+
*
|
|
2249
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
|
2250
|
+
*/
|
|
2030
2251
|
export declare class WritableStreamDefaultWriter<W = any> {
|
|
2031
2252
|
constructor(stream: WritableStream);
|
|
2032
|
-
|
|
2253
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
2033
2254
|
get closed(): Promise<void>;
|
|
2034
|
-
|
|
2255
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
2035
2256
|
get ready(): Promise<void>;
|
|
2036
|
-
|
|
2257
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
2037
2258
|
get desiredSize(): number | null;
|
|
2038
|
-
|
|
2259
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
2039
2260
|
abort(reason?: any): Promise<void>;
|
|
2040
|
-
|
|
2261
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
2041
2262
|
close(): Promise<void>;
|
|
2042
|
-
|
|
2263
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
2043
2264
|
write(chunk?: W): Promise<void>;
|
|
2044
|
-
|
|
2265
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
2045
2266
|
releaseLock(): void;
|
|
2046
2267
|
}
|
|
2268
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
|
|
2047
2269
|
export declare class TransformStream<I = any, O = any> {
|
|
2048
2270
|
constructor(
|
|
2049
2271
|
transformer?: Transformer<I, O>,
|
|
2050
2272
|
writableStrategy?: QueuingStrategy<I>,
|
|
2051
2273
|
readableStrategy?: QueuingStrategy<O>,
|
|
2052
2274
|
);
|
|
2053
|
-
|
|
2275
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
2054
2276
|
get readable(): ReadableStream<O>;
|
|
2055
|
-
|
|
2277
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
2056
2278
|
get writable(): WritableStream<I>;
|
|
2057
2279
|
}
|
|
2058
2280
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
@@ -2073,18 +2295,21 @@ export interface IdentityTransformStreamQueuingStrategy {
|
|
|
2073
2295
|
export interface ReadableStreamValuesOptions {
|
|
2074
2296
|
preventCancel?: boolean;
|
|
2075
2297
|
}
|
|
2298
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
|
|
2076
2299
|
export declare class CompressionStream extends TransformStream<
|
|
2077
2300
|
ArrayBuffer | ArrayBufferView,
|
|
2078
2301
|
Uint8Array
|
|
2079
2302
|
> {
|
|
2080
2303
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2081
2304
|
}
|
|
2305
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
|
|
2082
2306
|
export declare class DecompressionStream extends TransformStream<
|
|
2083
2307
|
ArrayBuffer | ArrayBufferView,
|
|
2084
2308
|
Uint8Array
|
|
2085
2309
|
> {
|
|
2086
2310
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2087
2311
|
}
|
|
2312
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
|
|
2088
2313
|
export declare class TextEncoderStream extends TransformStream<
|
|
2089
2314
|
string,
|
|
2090
2315
|
Uint8Array
|
|
@@ -2092,6 +2317,7 @@ export declare class TextEncoderStream extends TransformStream<
|
|
|
2092
2317
|
constructor();
|
|
2093
2318
|
get encoding(): string;
|
|
2094
2319
|
}
|
|
2320
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
|
|
2095
2321
|
export declare class TextDecoderStream extends TransformStream<
|
|
2096
2322
|
ArrayBuffer | ArrayBufferView,
|
|
2097
2323
|
string
|
|
@@ -2105,20 +2331,30 @@ export interface TextDecoderStreamTextDecoderStreamInit {
|
|
|
2105
2331
|
fatal?: boolean;
|
|
2106
2332
|
ignoreBOM?: boolean;
|
|
2107
2333
|
}
|
|
2334
|
+
/**
|
|
2335
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2336
|
+
*
|
|
2337
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
|
|
2338
|
+
*/
|
|
2108
2339
|
export declare class ByteLengthQueuingStrategy
|
|
2109
2340
|
implements QueuingStrategy<ArrayBufferView>
|
|
2110
2341
|
{
|
|
2111
2342
|
constructor(init: QueuingStrategyInit);
|
|
2112
|
-
|
|
2343
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
2113
2344
|
get highWaterMark(): number;
|
|
2114
|
-
|
|
2345
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
2115
2346
|
get size(): (chunk?: any) => number;
|
|
2116
2347
|
}
|
|
2348
|
+
/**
|
|
2349
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2350
|
+
*
|
|
2351
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
|
|
2352
|
+
*/
|
|
2117
2353
|
export declare class CountQueuingStrategy implements QueuingStrategy {
|
|
2118
2354
|
constructor(init: QueuingStrategyInit);
|
|
2119
|
-
|
|
2355
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
2120
2356
|
get highWaterMark(): number;
|
|
2121
|
-
|
|
2357
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
2122
2358
|
get size(): (chunk?: any) => number;
|
|
2123
2359
|
}
|
|
2124
2360
|
export interface QueuingStrategyInit {
|
|
@@ -2243,76 +2479,115 @@ export interface TraceMetrics {
|
|
|
2243
2479
|
export interface UnsafeTraceMetrics {
|
|
2244
2480
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
2245
2481
|
}
|
|
2482
|
+
/**
|
|
2483
|
+
* The URL interface represents an object providing static methods used for creating object URLs.
|
|
2484
|
+
*
|
|
2485
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
|
2486
|
+
*/
|
|
2246
2487
|
export declare class URL {
|
|
2247
2488
|
constructor(url: string | URL, base?: string | URL);
|
|
2248
|
-
|
|
2489
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
2249
2490
|
get origin(): string;
|
|
2250
|
-
|
|
2491
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2251
2492
|
get href(): string;
|
|
2252
|
-
|
|
2493
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2253
2494
|
set href(value: string);
|
|
2254
|
-
|
|
2495
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2255
2496
|
get protocol(): string;
|
|
2256
|
-
|
|
2497
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2257
2498
|
set protocol(value: string);
|
|
2258
|
-
|
|
2499
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2259
2500
|
get username(): string;
|
|
2260
|
-
|
|
2501
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2261
2502
|
set username(value: string);
|
|
2262
|
-
|
|
2503
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2263
2504
|
get password(): string;
|
|
2264
|
-
|
|
2505
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2265
2506
|
set password(value: string);
|
|
2266
|
-
|
|
2507
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2267
2508
|
get host(): string;
|
|
2268
|
-
|
|
2509
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2269
2510
|
set host(value: string);
|
|
2270
|
-
|
|
2511
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2271
2512
|
get hostname(): string;
|
|
2272
|
-
|
|
2513
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2273
2514
|
set hostname(value: string);
|
|
2274
|
-
|
|
2515
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2275
2516
|
get port(): string;
|
|
2276
|
-
|
|
2517
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2277
2518
|
set port(value: string);
|
|
2278
|
-
|
|
2519
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2279
2520
|
get pathname(): string;
|
|
2280
|
-
|
|
2521
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2281
2522
|
set pathname(value: string);
|
|
2282
|
-
|
|
2523
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2283
2524
|
get search(): string;
|
|
2284
|
-
|
|
2525
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2285
2526
|
set search(value: string);
|
|
2286
|
-
|
|
2527
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2287
2528
|
get hash(): string;
|
|
2288
|
-
|
|
2529
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2289
2530
|
set hash(value: string);
|
|
2290
|
-
|
|
2531
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
2291
2532
|
get searchParams(): URLSearchParams;
|
|
2292
|
-
|
|
2533
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
2293
2534
|
toJSON(): string;
|
|
2535
|
+
/*function toString() { [native code] }*/
|
|
2294
2536
|
toString(): string;
|
|
2295
|
-
|
|
2537
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2296
2538
|
static canParse(url: string, base?: string): boolean;
|
|
2297
2539
|
static parse(url: string, base?: string): URL | null;
|
|
2298
2540
|
}
|
|
2541
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2299
2542
|
export declare class URLSearchParams {
|
|
2300
2543
|
constructor(
|
|
2301
2544
|
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2302
2545
|
);
|
|
2546
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2303
2547
|
get size(): number;
|
|
2548
|
+
/**
|
|
2549
|
+
* Appends a specified key/value pair as a new search parameter.
|
|
2550
|
+
*
|
|
2551
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2552
|
+
*/
|
|
2304
2553
|
append(name: string, value: string): void;
|
|
2554
|
+
/**
|
|
2555
|
+
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2556
|
+
*
|
|
2557
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
2558
|
+
*/
|
|
2305
2559
|
delete(name: string, value?: string): void;
|
|
2560
|
+
/**
|
|
2561
|
+
* Returns the first value associated to the given search parameter.
|
|
2562
|
+
*
|
|
2563
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2564
|
+
*/
|
|
2306
2565
|
get(name: string): string | null;
|
|
2566
|
+
/**
|
|
2567
|
+
* Returns all the values association with a given search parameter.
|
|
2568
|
+
*
|
|
2569
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2570
|
+
*/
|
|
2307
2571
|
getAll(name: string): string[];
|
|
2572
|
+
/**
|
|
2573
|
+
* Returns a Boolean indicating if such a search parameter exists.
|
|
2574
|
+
*
|
|
2575
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
2576
|
+
*/
|
|
2308
2577
|
has(name: string, value?: string): boolean;
|
|
2578
|
+
/**
|
|
2579
|
+
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
2580
|
+
*
|
|
2581
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2582
|
+
*/
|
|
2309
2583
|
set(name: string, value: string): void;
|
|
2584
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2310
2585
|
sort(): void;
|
|
2311
|
-
|
|
2586
|
+
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
2312
2587
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2313
|
-
|
|
2588
|
+
/* Returns a list of keys in the search params. */
|
|
2314
2589
|
keys(): IterableIterator<string>;
|
|
2315
|
-
|
|
2590
|
+
/* Returns a list of values in the search params. */
|
|
2316
2591
|
values(): IterableIterator<string>;
|
|
2317
2592
|
forEach<This = unknown>(
|
|
2318
2593
|
callback: (
|
|
@@ -2323,6 +2598,7 @@ export declare class URLSearchParams {
|
|
|
2323
2598
|
) => void,
|
|
2324
2599
|
thisArg?: This,
|
|
2325
2600
|
): void;
|
|
2601
|
+
/*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
|
|
2326
2602
|
toString(): string;
|
|
2327
2603
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
2328
2604
|
}
|
|
@@ -2375,6 +2651,11 @@ export interface URLPatternURLPatternResult {
|
|
|
2375
2651
|
export interface URLPatternURLPatternOptions {
|
|
2376
2652
|
ignoreCase?: boolean;
|
|
2377
2653
|
}
|
|
2654
|
+
/**
|
|
2655
|
+
* A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
|
|
2656
|
+
*
|
|
2657
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
|
2658
|
+
*/
|
|
2378
2659
|
export declare class CloseEvent extends Event {
|
|
2379
2660
|
constructor(type: string, initializer?: CloseEventInit);
|
|
2380
2661
|
/**
|
|
@@ -2401,36 +2682,34 @@ export interface CloseEventInit {
|
|
|
2401
2682
|
reason?: string;
|
|
2402
2683
|
wasClean?: boolean;
|
|
2403
2684
|
}
|
|
2685
|
+
/**
|
|
2686
|
+
* A message received by a target object.
|
|
2687
|
+
*
|
|
2688
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
|
2689
|
+
*/
|
|
2404
2690
|
export declare class MessageEvent extends Event {
|
|
2405
2691
|
constructor(type: string, initializer: MessageEventInit);
|
|
2692
|
+
/**
|
|
2693
|
+
* Returns the data of the message.
|
|
2694
|
+
*
|
|
2695
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
|
2696
|
+
*/
|
|
2406
2697
|
readonly data: ArrayBuffer | string;
|
|
2407
2698
|
}
|
|
2408
2699
|
export interface MessageEventInit {
|
|
2409
2700
|
data: ArrayBuffer | string;
|
|
2410
2701
|
}
|
|
2411
|
-
/**
|
|
2412
|
-
* Events providing information related to errors in scripts or in files.
|
|
2413
|
-
*
|
|
2414
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2415
|
-
*/
|
|
2416
|
-
export interface ErrorEvent extends Event {
|
|
2417
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
2418
|
-
readonly filename: string;
|
|
2419
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
2420
|
-
readonly message: string;
|
|
2421
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
2422
|
-
readonly lineno: number;
|
|
2423
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
2424
|
-
readonly colno: number;
|
|
2425
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
2426
|
-
readonly error: any;
|
|
2427
|
-
}
|
|
2428
2702
|
export type WebSocketEventMap = {
|
|
2429
2703
|
close: CloseEvent;
|
|
2430
2704
|
message: MessageEvent;
|
|
2431
2705
|
open: Event;
|
|
2432
2706
|
error: ErrorEvent;
|
|
2433
2707
|
};
|
|
2708
|
+
/**
|
|
2709
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2710
|
+
*
|
|
2711
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2712
|
+
*/
|
|
2434
2713
|
export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2435
2714
|
constructor(url: string, protocols?: string[] | string);
|
|
2436
2715
|
accept(): void;
|
|
@@ -2498,6 +2777,7 @@ export interface Socket {
|
|
|
2498
2777
|
export interface SocketOptions {
|
|
2499
2778
|
secureTransport?: string;
|
|
2500
2779
|
allowHalfOpen: boolean;
|
|
2780
|
+
highWaterMark?: number | bigint;
|
|
2501
2781
|
}
|
|
2502
2782
|
export interface SocketAddress {
|
|
2503
2783
|
hostname: string;
|
|
@@ -2510,65 +2790,61 @@ export interface SocketInfo {
|
|
|
2510
2790
|
remoteAddress?: string;
|
|
2511
2791
|
localAddress?: string;
|
|
2512
2792
|
}
|
|
2513
|
-
export interface
|
|
2514
|
-
requestAdapter(
|
|
2515
|
-
param1?: gpuGPURequestAdapterOptions,
|
|
2516
|
-
): Promise<gpuGPUAdapter | null>;
|
|
2793
|
+
export interface GPU {
|
|
2794
|
+
requestAdapter(param1?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
2517
2795
|
}
|
|
2518
|
-
export declare abstract class
|
|
2519
|
-
requestDevice(param1?:
|
|
2520
|
-
requestAdapterInfo(unmaskHints?: string[]): Promise<
|
|
2521
|
-
get features():
|
|
2522
|
-
get limits():
|
|
2796
|
+
export declare abstract class GPUAdapter {
|
|
2797
|
+
requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
2798
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
|
|
2799
|
+
get features(): GPUSupportedFeatures;
|
|
2800
|
+
get limits(): GPUSupportedLimits;
|
|
2523
2801
|
}
|
|
2524
|
-
export interface
|
|
2525
|
-
createBuffer(param1:
|
|
2802
|
+
export interface GPUDevice extends EventTarget {
|
|
2803
|
+
createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
|
|
2526
2804
|
createBindGroupLayout(
|
|
2527
|
-
descriptor:
|
|
2528
|
-
):
|
|
2529
|
-
createBindGroup(descriptor:
|
|
2530
|
-
createSampler(descriptor:
|
|
2531
|
-
createShaderModule(
|
|
2532
|
-
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2533
|
-
): gpuGPUShaderModule;
|
|
2805
|
+
descriptor: GPUBindGroupLayoutDescriptor,
|
|
2806
|
+
): GPUBindGroupLayout;
|
|
2807
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
2808
|
+
createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
|
|
2809
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
2534
2810
|
createPipelineLayout(
|
|
2535
|
-
descriptor:
|
|
2536
|
-
):
|
|
2811
|
+
descriptor: GPUPipelineLayoutDescriptor,
|
|
2812
|
+
): GPUPipelineLayout;
|
|
2537
2813
|
createComputePipeline(
|
|
2538
|
-
descriptor:
|
|
2539
|
-
):
|
|
2814
|
+
descriptor: GPUComputePipelineDescriptor,
|
|
2815
|
+
): GPUComputePipeline;
|
|
2540
2816
|
createRenderPipeline(
|
|
2541
|
-
descriptor:
|
|
2542
|
-
):
|
|
2817
|
+
descriptor: GPURenderPipelineDescriptor,
|
|
2818
|
+
): GPURenderPipeline;
|
|
2543
2819
|
createCommandEncoder(
|
|
2544
|
-
descriptor?:
|
|
2545
|
-
):
|
|
2546
|
-
createTexture(param1:
|
|
2820
|
+
descriptor?: GPUCommandEncoderDescriptor,
|
|
2821
|
+
): GPUCommandEncoder;
|
|
2822
|
+
createTexture(param1: GPUTextureDescriptor): GPUTexture;
|
|
2547
2823
|
destroy(): void;
|
|
2548
|
-
createQuerySet(descriptor:
|
|
2824
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
2549
2825
|
pushErrorScope(filter: string): void;
|
|
2550
|
-
popErrorScope(): Promise<
|
|
2551
|
-
get queue():
|
|
2552
|
-
get lost(): Promise<
|
|
2553
|
-
get features():
|
|
2554
|
-
get limits():
|
|
2826
|
+
popErrorScope(): Promise<GPUError | null>;
|
|
2827
|
+
get queue(): GPUQueue;
|
|
2828
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
2829
|
+
get features(): GPUSupportedFeatures;
|
|
2830
|
+
get limits(): GPUSupportedLimits;
|
|
2555
2831
|
}
|
|
2556
|
-
export interface
|
|
2832
|
+
export interface GPUDeviceDescriptor {
|
|
2557
2833
|
label?: string;
|
|
2558
2834
|
requiredFeatures?: string[];
|
|
2559
2835
|
requiredLimits?: Record<string, number | bigint>;
|
|
2560
|
-
defaultQueue?:
|
|
2836
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
2561
2837
|
}
|
|
2562
|
-
export interface
|
|
2838
|
+
export interface GPUBufferDescriptor {
|
|
2563
2839
|
label: string;
|
|
2564
2840
|
size: number | bigint;
|
|
2565
2841
|
usage: number;
|
|
2566
2842
|
mappedAtCreation: boolean;
|
|
2567
2843
|
}
|
|
2568
|
-
export interface
|
|
2844
|
+
export interface GPUQueueDescriptor {
|
|
2569
2845
|
label?: string;
|
|
2570
2846
|
}
|
|
2571
|
-
export declare abstract class
|
|
2847
|
+
export declare abstract class GPUBufferUsage {
|
|
2572
2848
|
static readonly MAP_READ: number;
|
|
2573
2849
|
static readonly MAP_WRITE: number;
|
|
2574
2850
|
static readonly COPY_SRC: number;
|
|
@@ -2580,7 +2856,7 @@ export declare abstract class gpuGPUBufferUsage {
|
|
|
2580
2856
|
static readonly INDIRECT: number;
|
|
2581
2857
|
static readonly QUERY_RESOLVE: number;
|
|
2582
2858
|
}
|
|
2583
|
-
export interface
|
|
2859
|
+
export interface GPUBuffer {
|
|
2584
2860
|
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2585
2861
|
unmap(): void;
|
|
2586
2862
|
destroy(): void;
|
|
@@ -2593,59 +2869,59 @@ export interface gpuGPUBuffer {
|
|
|
2593
2869
|
get usage(): number;
|
|
2594
2870
|
get mapState(): string;
|
|
2595
2871
|
}
|
|
2596
|
-
export declare abstract class
|
|
2872
|
+
export declare abstract class GPUShaderStage {
|
|
2597
2873
|
static readonly VERTEX: number;
|
|
2598
2874
|
static readonly FRAGMENT: number;
|
|
2599
2875
|
static readonly COMPUTE: number;
|
|
2600
2876
|
}
|
|
2601
|
-
export interface
|
|
2877
|
+
export interface GPUBindGroupLayoutDescriptor {
|
|
2602
2878
|
label?: string;
|
|
2603
|
-
entries:
|
|
2879
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
2604
2880
|
}
|
|
2605
|
-
export interface
|
|
2881
|
+
export interface GPUBindGroupLayoutEntry {
|
|
2606
2882
|
binding: number;
|
|
2607
2883
|
visibility: number;
|
|
2608
|
-
buffer?:
|
|
2609
|
-
sampler?:
|
|
2610
|
-
texture?:
|
|
2611
|
-
storageTexture?:
|
|
2884
|
+
buffer?: GPUBufferBindingLayout;
|
|
2885
|
+
sampler?: GPUSamplerBindingLayout;
|
|
2886
|
+
texture?: GPUTextureBindingLayout;
|
|
2887
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
2612
2888
|
}
|
|
2613
|
-
export interface
|
|
2889
|
+
export interface GPUStorageTextureBindingLayout {
|
|
2614
2890
|
access?: string;
|
|
2615
2891
|
format: string;
|
|
2616
2892
|
viewDimension?: string;
|
|
2617
2893
|
}
|
|
2618
|
-
export interface
|
|
2894
|
+
export interface GPUTextureBindingLayout {
|
|
2619
2895
|
sampleType?: string;
|
|
2620
2896
|
viewDimension?: string;
|
|
2621
2897
|
multisampled?: boolean;
|
|
2622
2898
|
}
|
|
2623
|
-
export interface
|
|
2899
|
+
export interface GPUSamplerBindingLayout {
|
|
2624
2900
|
type?: string;
|
|
2625
2901
|
}
|
|
2626
|
-
export interface
|
|
2902
|
+
export interface GPUBufferBindingLayout {
|
|
2627
2903
|
type?: string;
|
|
2628
2904
|
hasDynamicOffset?: boolean;
|
|
2629
2905
|
minBindingSize?: number | bigint;
|
|
2630
2906
|
}
|
|
2631
|
-
export interface
|
|
2632
|
-
export interface
|
|
2633
|
-
export interface
|
|
2907
|
+
export interface GPUBindGroupLayout {}
|
|
2908
|
+
export interface GPUBindGroup {}
|
|
2909
|
+
export interface GPUBindGroupDescriptor {
|
|
2634
2910
|
label?: string;
|
|
2635
|
-
layout:
|
|
2636
|
-
entries:
|
|
2911
|
+
layout: GPUBindGroupLayout;
|
|
2912
|
+
entries: GPUBindGroupEntry[];
|
|
2637
2913
|
}
|
|
2638
|
-
export interface
|
|
2914
|
+
export interface GPUBindGroupEntry {
|
|
2639
2915
|
binding: number;
|
|
2640
|
-
resource:
|
|
2916
|
+
resource: GPUBufferBinding | GPUSampler;
|
|
2641
2917
|
}
|
|
2642
|
-
export interface
|
|
2643
|
-
buffer:
|
|
2918
|
+
export interface GPUBufferBinding {
|
|
2919
|
+
buffer: GPUBuffer;
|
|
2644
2920
|
offset?: number | bigint;
|
|
2645
2921
|
size?: number | bigint;
|
|
2646
2922
|
}
|
|
2647
|
-
export interface
|
|
2648
|
-
export interface
|
|
2923
|
+
export interface GPUSampler {}
|
|
2924
|
+
export interface GPUSamplerDescriptor {
|
|
2649
2925
|
label?: string;
|
|
2650
2926
|
addressModeU?: string;
|
|
2651
2927
|
addressModeV?: string;
|
|
@@ -2658,76 +2934,74 @@ export interface gpuGPUSamplerDescriptor {
|
|
|
2658
2934
|
compare: string;
|
|
2659
2935
|
maxAnisotropy?: number;
|
|
2660
2936
|
}
|
|
2661
|
-
export interface
|
|
2662
|
-
getCompilationInfo(): Promise<
|
|
2937
|
+
export interface GPUShaderModule {
|
|
2938
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
2663
2939
|
}
|
|
2664
|
-
export interface
|
|
2940
|
+
export interface GPUShaderModuleDescriptor {
|
|
2665
2941
|
label?: string;
|
|
2666
2942
|
code: string;
|
|
2667
2943
|
}
|
|
2668
|
-
export interface
|
|
2669
|
-
export interface
|
|
2944
|
+
export interface GPUPipelineLayout {}
|
|
2945
|
+
export interface GPUPipelineLayoutDescriptor {
|
|
2670
2946
|
label?: string;
|
|
2671
|
-
bindGroupLayouts:
|
|
2947
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
2672
2948
|
}
|
|
2673
|
-
export interface
|
|
2674
|
-
getBindGroupLayout(index: number):
|
|
2949
|
+
export interface GPUComputePipeline {
|
|
2950
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2675
2951
|
}
|
|
2676
|
-
export interface
|
|
2952
|
+
export interface GPUComputePipelineDescriptor {
|
|
2677
2953
|
label?: string;
|
|
2678
|
-
compute:
|
|
2679
|
-
layout: string |
|
|
2954
|
+
compute: GPUProgrammableStage;
|
|
2955
|
+
layout: string | GPUPipelineLayout;
|
|
2680
2956
|
}
|
|
2681
|
-
export interface
|
|
2682
|
-
module:
|
|
2957
|
+
export interface GPUProgrammableStage {
|
|
2958
|
+
module: GPUShaderModule;
|
|
2683
2959
|
entryPoint: string;
|
|
2684
2960
|
constants?: Record<string, number>;
|
|
2685
2961
|
}
|
|
2686
|
-
export interface
|
|
2962
|
+
export interface GPUCommandEncoder {
|
|
2687
2963
|
get label(): string;
|
|
2688
2964
|
beginComputePass(
|
|
2689
|
-
descriptor?:
|
|
2690
|
-
):
|
|
2691
|
-
beginRenderPass(
|
|
2692
|
-
descriptor: gpuGPURenderPassDescriptor,
|
|
2693
|
-
): gpuGPURenderPassEncoder;
|
|
2965
|
+
descriptor?: GPUComputePassDescriptor,
|
|
2966
|
+
): GPUComputePassEncoder;
|
|
2967
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
2694
2968
|
copyBufferToBuffer(
|
|
2695
|
-
source:
|
|
2969
|
+
source: GPUBuffer,
|
|
2696
2970
|
sourceOffset: number | bigint,
|
|
2697
|
-
destination:
|
|
2971
|
+
destination: GPUBuffer,
|
|
2698
2972
|
destinationOffset: number | bigint,
|
|
2699
2973
|
size: number | bigint,
|
|
2700
2974
|
): void;
|
|
2701
|
-
finish(param0?:
|
|
2975
|
+
finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
2702
2976
|
copyTextureToBuffer(
|
|
2703
|
-
source:
|
|
2704
|
-
destination:
|
|
2705
|
-
copySize: Iterable<number> |
|
|
2977
|
+
source: GPUImageCopyTexture,
|
|
2978
|
+
destination: GPUImageCopyBuffer,
|
|
2979
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2706
2980
|
): void;
|
|
2707
2981
|
copyBufferToTexture(
|
|
2708
|
-
source:
|
|
2709
|
-
destination:
|
|
2710
|
-
copySize: Iterable<number> |
|
|
2982
|
+
source: GPUImageCopyBuffer,
|
|
2983
|
+
destination: GPUImageCopyTexture,
|
|
2984
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2711
2985
|
): void;
|
|
2712
2986
|
copyTextureToTexture(
|
|
2713
|
-
source:
|
|
2714
|
-
destination:
|
|
2715
|
-
copySize: Iterable<number> |
|
|
2987
|
+
source: GPUImageCopyTexture,
|
|
2988
|
+
destination: GPUImageCopyTexture,
|
|
2989
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2716
2990
|
): void;
|
|
2717
2991
|
clearBuffer(
|
|
2718
|
-
buffer:
|
|
2992
|
+
buffer: GPUBuffer,
|
|
2719
2993
|
offset?: number | bigint,
|
|
2720
2994
|
size?: number | bigint,
|
|
2721
2995
|
): void;
|
|
2722
2996
|
}
|
|
2723
|
-
export interface
|
|
2997
|
+
export interface GPUCommandEncoderDescriptor {
|
|
2724
2998
|
label?: string;
|
|
2725
2999
|
}
|
|
2726
|
-
export interface
|
|
2727
|
-
setPipeline(pipeline:
|
|
3000
|
+
export interface GPUComputePassEncoder {
|
|
3001
|
+
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2728
3002
|
setBindGroup(
|
|
2729
3003
|
index: number,
|
|
2730
|
-
bindGroup:
|
|
3004
|
+
bindGroup: GPUBindGroup | null,
|
|
2731
3005
|
dynamicOffsets?: Iterable<number>,
|
|
2732
3006
|
): void;
|
|
2733
3007
|
dispatchWorkgroups(
|
|
@@ -2737,52 +3011,52 @@ export interface gpuGPUComputePassEncoder {
|
|
|
2737
3011
|
): void;
|
|
2738
3012
|
end(): void;
|
|
2739
3013
|
}
|
|
2740
|
-
export interface
|
|
3014
|
+
export interface GPUComputePassDescriptor {
|
|
2741
3015
|
label?: string;
|
|
2742
|
-
timestampWrites?:
|
|
3016
|
+
timestampWrites?: GPUComputePassTimestampWrites;
|
|
2743
3017
|
}
|
|
2744
|
-
export interface
|
|
2745
|
-
export interface
|
|
3018
|
+
export interface GPUQuerySet {}
|
|
3019
|
+
export interface GPUQuerySetDescriptor {
|
|
2746
3020
|
label?: string;
|
|
2747
3021
|
}
|
|
2748
|
-
export interface
|
|
2749
|
-
querySet:
|
|
3022
|
+
export interface GPUComputePassTimestampWrites {
|
|
3023
|
+
querySet: GPUQuerySet;
|
|
2750
3024
|
beginningOfPassWriteIndex?: number;
|
|
2751
3025
|
endOfPassWriteIndex?: number;
|
|
2752
3026
|
}
|
|
2753
|
-
export interface
|
|
3027
|
+
export interface GPUCommandBufferDescriptor {
|
|
2754
3028
|
label?: string;
|
|
2755
3029
|
}
|
|
2756
|
-
export interface
|
|
2757
|
-
export interface
|
|
2758
|
-
submit(commandBuffers:
|
|
3030
|
+
export interface GPUCommandBuffer {}
|
|
3031
|
+
export interface GPUQueue {
|
|
3032
|
+
submit(commandBuffers: GPUCommandBuffer[]): void;
|
|
2759
3033
|
writeBuffer(
|
|
2760
|
-
buffer:
|
|
3034
|
+
buffer: GPUBuffer,
|
|
2761
3035
|
bufferOffset: number | bigint,
|
|
2762
3036
|
data: ArrayBuffer | ArrayBufferView,
|
|
2763
3037
|
dataOffset?: number | bigint,
|
|
2764
3038
|
size?: number | bigint,
|
|
2765
3039
|
): void;
|
|
2766
3040
|
}
|
|
2767
|
-
export declare abstract class
|
|
3041
|
+
export declare abstract class GPUMapMode {
|
|
2768
3042
|
static readonly READ: number;
|
|
2769
3043
|
static readonly WRITE: number;
|
|
2770
3044
|
}
|
|
2771
|
-
export interface
|
|
3045
|
+
export interface GPURequestAdapterOptions {
|
|
2772
3046
|
powerPreference: string;
|
|
2773
3047
|
forceFallbackAdapter?: boolean;
|
|
2774
3048
|
}
|
|
2775
|
-
export interface
|
|
3049
|
+
export interface GPUAdapterInfo {
|
|
2776
3050
|
get vendor(): string;
|
|
2777
3051
|
get architecture(): string;
|
|
2778
3052
|
get device(): string;
|
|
2779
3053
|
get description(): string;
|
|
2780
3054
|
}
|
|
2781
|
-
export interface
|
|
3055
|
+
export interface GPUSupportedFeatures {
|
|
2782
3056
|
has(name: string): boolean;
|
|
2783
3057
|
keys(): string[];
|
|
2784
3058
|
}
|
|
2785
|
-
export interface
|
|
3059
|
+
export interface GPUSupportedLimits {
|
|
2786
3060
|
get maxTextureDimension1D(): number;
|
|
2787
3061
|
get maxTextureDimension2D(): number;
|
|
2788
3062
|
get maxTextureDimension3D(): number;
|
|
@@ -2815,17 +3089,17 @@ export interface gpuGPUSupportedLimits {
|
|
|
2815
3089
|
get maxComputeWorkgroupSizeZ(): number;
|
|
2816
3090
|
get maxComputeWorkgroupsPerDimension(): number;
|
|
2817
3091
|
}
|
|
2818
|
-
export declare abstract class
|
|
3092
|
+
export declare abstract class GPUError {
|
|
2819
3093
|
get message(): string;
|
|
2820
3094
|
}
|
|
2821
|
-
export declare abstract class
|
|
2822
|
-
export declare abstract class
|
|
2823
|
-
export declare abstract class
|
|
2824
|
-
export declare abstract class
|
|
3095
|
+
export declare abstract class GPUOutOfMemoryError extends GPUError {}
|
|
3096
|
+
export declare abstract class GPUInternalError extends GPUError {}
|
|
3097
|
+
export declare abstract class GPUValidationError extends GPUError {}
|
|
3098
|
+
export declare abstract class GPUDeviceLostInfo {
|
|
2825
3099
|
get message(): string;
|
|
2826
3100
|
get reason(): string;
|
|
2827
3101
|
}
|
|
2828
|
-
export interface
|
|
3102
|
+
export interface GPUCompilationMessage {
|
|
2829
3103
|
get message(): string;
|
|
2830
3104
|
get type(): string;
|
|
2831
3105
|
get lineNum(): number;
|
|
@@ -2833,19 +3107,19 @@ export interface gpuGPUCompilationMessage {
|
|
|
2833
3107
|
get offset(): number;
|
|
2834
3108
|
get length(): number;
|
|
2835
3109
|
}
|
|
2836
|
-
export interface
|
|
2837
|
-
get messages():
|
|
3110
|
+
export interface GPUCompilationInfo {
|
|
3111
|
+
get messages(): GPUCompilationMessage[];
|
|
2838
3112
|
}
|
|
2839
|
-
export declare abstract class
|
|
3113
|
+
export declare abstract class GPUTextureUsage {
|
|
2840
3114
|
static readonly COPY_SRC: number;
|
|
2841
3115
|
static readonly COPY_DST: number;
|
|
2842
3116
|
static readonly TEXTURE_BINDING: number;
|
|
2843
3117
|
static readonly STORAGE_BINDING: number;
|
|
2844
3118
|
static readonly RENDER_ATTACHMENT: number;
|
|
2845
3119
|
}
|
|
2846
|
-
export interface
|
|
3120
|
+
export interface GPUTextureDescriptor {
|
|
2847
3121
|
label: string;
|
|
2848
|
-
size: number[] |
|
|
3122
|
+
size: number[] | GPUExtent3DDict;
|
|
2849
3123
|
mipLevelCount?: number;
|
|
2850
3124
|
sampleCount?: number;
|
|
2851
3125
|
dimension?: string;
|
|
@@ -2853,13 +3127,13 @@ export interface gpuGPUTextureDescriptor {
|
|
|
2853
3127
|
usage: number;
|
|
2854
3128
|
viewFormats?: string[];
|
|
2855
3129
|
}
|
|
2856
|
-
export interface
|
|
3130
|
+
export interface GPUExtent3DDict {
|
|
2857
3131
|
width: number;
|
|
2858
3132
|
height?: number;
|
|
2859
3133
|
depthOrArrayLayers?: number;
|
|
2860
3134
|
}
|
|
2861
|
-
export interface
|
|
2862
|
-
createView(descriptor?:
|
|
3135
|
+
export interface GPUTexture {
|
|
3136
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
2863
3137
|
destroy(): void;
|
|
2864
3138
|
get width(): number;
|
|
2865
3139
|
get height(): number;
|
|
@@ -2869,8 +3143,8 @@ export interface gpuGPUTexture {
|
|
|
2869
3143
|
get format(): string;
|
|
2870
3144
|
get usage(): number;
|
|
2871
3145
|
}
|
|
2872
|
-
export interface
|
|
2873
|
-
export interface
|
|
3146
|
+
export interface GPUTextureView {}
|
|
3147
|
+
export interface GPUTextureViewDescriptor {
|
|
2874
3148
|
label: string;
|
|
2875
3149
|
format: string;
|
|
2876
3150
|
dimension: string;
|
|
@@ -2880,91 +3154,91 @@ export interface gpuGPUTextureViewDescriptor {
|
|
|
2880
3154
|
baseArrayLayer?: number;
|
|
2881
3155
|
arrayLayerCount: number;
|
|
2882
3156
|
}
|
|
2883
|
-
export declare abstract class
|
|
3157
|
+
export declare abstract class GPUColorWrite {
|
|
2884
3158
|
static readonly RED: number;
|
|
2885
3159
|
static readonly GREEN: number;
|
|
2886
3160
|
static readonly BLUE: number;
|
|
2887
3161
|
static readonly ALPHA: number;
|
|
2888
3162
|
static readonly ALL: number;
|
|
2889
3163
|
}
|
|
2890
|
-
export interface
|
|
2891
|
-
export interface
|
|
3164
|
+
export interface GPURenderPipeline {}
|
|
3165
|
+
export interface GPURenderPipelineDescriptor {
|
|
2892
3166
|
label?: string;
|
|
2893
|
-
layout: string |
|
|
2894
|
-
vertex:
|
|
2895
|
-
primitive?:
|
|
2896
|
-
depthStencil?:
|
|
2897
|
-
multisample?:
|
|
2898
|
-
fragment?:
|
|
2899
|
-
}
|
|
2900
|
-
export interface
|
|
2901
|
-
module:
|
|
3167
|
+
layout: string | GPUPipelineLayout;
|
|
3168
|
+
vertex: GPUVertexState;
|
|
3169
|
+
primitive?: GPUPrimitiveState;
|
|
3170
|
+
depthStencil?: GPUDepthStencilState;
|
|
3171
|
+
multisample?: GPUMultisampleState;
|
|
3172
|
+
fragment?: GPUFragmentState;
|
|
3173
|
+
}
|
|
3174
|
+
export interface GPUVertexState {
|
|
3175
|
+
module: GPUShaderModule;
|
|
2902
3176
|
entryPoint: string;
|
|
2903
3177
|
constants?: Record<string, number>;
|
|
2904
|
-
buffers?:
|
|
3178
|
+
buffers?: GPUVertexBufferLayout[];
|
|
2905
3179
|
}
|
|
2906
|
-
export interface
|
|
3180
|
+
export interface GPUVertexBufferLayout {
|
|
2907
3181
|
arrayStride: number | bigint;
|
|
2908
3182
|
stepMode?: string;
|
|
2909
|
-
attributes:
|
|
3183
|
+
attributes: GPUVertexAttribute[];
|
|
2910
3184
|
}
|
|
2911
|
-
export interface
|
|
3185
|
+
export interface GPUVertexAttribute {
|
|
2912
3186
|
format: string;
|
|
2913
3187
|
offset: number | bigint;
|
|
2914
3188
|
shaderLocation: number;
|
|
2915
3189
|
}
|
|
2916
|
-
export interface
|
|
3190
|
+
export interface GPUPrimitiveState {
|
|
2917
3191
|
topology?: string;
|
|
2918
3192
|
stripIndexFormat?: string;
|
|
2919
3193
|
frontFace?: string;
|
|
2920
3194
|
cullMode?: string;
|
|
2921
3195
|
unclippedDepth?: boolean;
|
|
2922
3196
|
}
|
|
2923
|
-
export interface
|
|
3197
|
+
export interface GPUStencilFaceState {
|
|
2924
3198
|
compare?: string;
|
|
2925
3199
|
failOp?: string;
|
|
2926
3200
|
depthFailOp?: string;
|
|
2927
3201
|
passOp?: string;
|
|
2928
3202
|
}
|
|
2929
|
-
export interface
|
|
3203
|
+
export interface GPUDepthStencilState {
|
|
2930
3204
|
format: string;
|
|
2931
3205
|
depthWriteEnabled: boolean;
|
|
2932
3206
|
depthCompare: string;
|
|
2933
|
-
stencilFront?:
|
|
2934
|
-
stencilBack?:
|
|
3207
|
+
stencilFront?: GPUStencilFaceState;
|
|
3208
|
+
stencilBack?: GPUStencilFaceState;
|
|
2935
3209
|
stencilReadMask?: number;
|
|
2936
3210
|
stencilWriteMask?: number;
|
|
2937
3211
|
depthBias?: number;
|
|
2938
3212
|
depthBiasSlopeScale?: number;
|
|
2939
3213
|
depthBiasClamp?: number;
|
|
2940
3214
|
}
|
|
2941
|
-
export interface
|
|
3215
|
+
export interface GPUMultisampleState {
|
|
2942
3216
|
count?: number;
|
|
2943
3217
|
mask?: number;
|
|
2944
3218
|
alphaToCoverageEnabled?: boolean;
|
|
2945
3219
|
}
|
|
2946
|
-
export interface
|
|
2947
|
-
module:
|
|
3220
|
+
export interface GPUFragmentState {
|
|
3221
|
+
module: GPUShaderModule;
|
|
2948
3222
|
entryPoint: string;
|
|
2949
3223
|
constants?: Record<string, number>;
|
|
2950
|
-
targets:
|
|
3224
|
+
targets: GPUColorTargetState[];
|
|
2951
3225
|
}
|
|
2952
|
-
export interface
|
|
3226
|
+
export interface GPUColorTargetState {
|
|
2953
3227
|
format: string;
|
|
2954
|
-
blend:
|
|
3228
|
+
blend: GPUBlendState;
|
|
2955
3229
|
writeMask?: number;
|
|
2956
3230
|
}
|
|
2957
|
-
export interface
|
|
2958
|
-
color:
|
|
2959
|
-
alpha:
|
|
3231
|
+
export interface GPUBlendState {
|
|
3232
|
+
color: GPUBlendComponent;
|
|
3233
|
+
alpha: GPUBlendComponent;
|
|
2960
3234
|
}
|
|
2961
|
-
export interface
|
|
3235
|
+
export interface GPUBlendComponent {
|
|
2962
3236
|
operation?: string;
|
|
2963
3237
|
srcFactor?: string;
|
|
2964
3238
|
dstFactor?: string;
|
|
2965
3239
|
}
|
|
2966
|
-
export interface
|
|
2967
|
-
setPipeline(pipeline:
|
|
3240
|
+
export interface GPURenderPassEncoder {
|
|
3241
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2968
3242
|
draw(
|
|
2969
3243
|
vertexCount: number,
|
|
2970
3244
|
instanceCount?: number,
|
|
@@ -2973,30 +3247,30 @@ export interface gpuGPURenderPassEncoder {
|
|
|
2973
3247
|
): void;
|
|
2974
3248
|
end(): void;
|
|
2975
3249
|
}
|
|
2976
|
-
export interface
|
|
3250
|
+
export interface GPURenderPassDescriptor {
|
|
2977
3251
|
label?: string;
|
|
2978
|
-
colorAttachments:
|
|
2979
|
-
depthStencilAttachment?:
|
|
2980
|
-
occlusionQuerySet?:
|
|
2981
|
-
timestampWrites?:
|
|
3252
|
+
colorAttachments: GPURenderPassColorAttachment[];
|
|
3253
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
3254
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
3255
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
2982
3256
|
maxDrawCount?: number | bigint;
|
|
2983
3257
|
}
|
|
2984
|
-
export interface
|
|
2985
|
-
view:
|
|
3258
|
+
export interface GPURenderPassColorAttachment {
|
|
3259
|
+
view: GPUTextureView;
|
|
2986
3260
|
depthSlice?: number;
|
|
2987
|
-
resolveTarget?:
|
|
2988
|
-
clearValue?: number[] |
|
|
3261
|
+
resolveTarget?: GPUTextureView;
|
|
3262
|
+
clearValue?: number[] | GPUColorDict;
|
|
2989
3263
|
loadOp: string;
|
|
2990
3264
|
storeOp: string;
|
|
2991
3265
|
}
|
|
2992
|
-
export interface
|
|
3266
|
+
export interface GPUColorDict {
|
|
2993
3267
|
r: number;
|
|
2994
3268
|
g: number;
|
|
2995
3269
|
b: number;
|
|
2996
3270
|
a: number;
|
|
2997
3271
|
}
|
|
2998
|
-
export interface
|
|
2999
|
-
view:
|
|
3272
|
+
export interface GPURenderPassDepthStencilAttachment {
|
|
3273
|
+
view: GPUTextureView;
|
|
3000
3274
|
depthClearValue?: number;
|
|
3001
3275
|
depthLoadOp?: string;
|
|
3002
3276
|
depthStoreOp?: string;
|
|
@@ -3006,28 +3280,373 @@ export interface gpuGPURenderPassDepthStencilAttachment {
|
|
|
3006
3280
|
stencilStoreOp?: string;
|
|
3007
3281
|
stencilReadOnly?: boolean;
|
|
3008
3282
|
}
|
|
3009
|
-
export interface
|
|
3010
|
-
querySet:
|
|
3283
|
+
export interface GPURenderPassTimestampWrites {
|
|
3284
|
+
querySet: GPUQuerySet;
|
|
3011
3285
|
beginningOfPassWriteIndex?: number;
|
|
3012
3286
|
endOfPassWriteIndex?: number;
|
|
3013
3287
|
}
|
|
3014
|
-
export interface
|
|
3015
|
-
texture:
|
|
3288
|
+
export interface GPUImageCopyTexture {
|
|
3289
|
+
texture: GPUTexture;
|
|
3016
3290
|
mipLevel?: number;
|
|
3017
|
-
origin?: number[] |
|
|
3291
|
+
origin?: number[] | GPUOrigin3DDict;
|
|
3018
3292
|
aspect?: string;
|
|
3019
3293
|
}
|
|
3020
|
-
export interface
|
|
3021
|
-
buffer:
|
|
3294
|
+
export interface GPUImageCopyBuffer {
|
|
3295
|
+
buffer: GPUBuffer;
|
|
3022
3296
|
offset?: number | bigint;
|
|
3023
3297
|
bytesPerRow?: number;
|
|
3024
3298
|
rowsPerImage?: number;
|
|
3025
3299
|
}
|
|
3026
|
-
export interface
|
|
3300
|
+
export interface GPUOrigin3DDict {
|
|
3027
3301
|
x?: number;
|
|
3028
3302
|
y?: number;
|
|
3029
3303
|
z?: number;
|
|
3030
3304
|
}
|
|
3305
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3306
|
+
export declare class EventSource {
|
|
3307
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3308
|
+
/**
|
|
3309
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
3310
|
+
*
|
|
3311
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3312
|
+
*/
|
|
3313
|
+
close(): void;
|
|
3314
|
+
/**
|
|
3315
|
+
* Returns the URL providing the event stream.
|
|
3316
|
+
*
|
|
3317
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3318
|
+
*/
|
|
3319
|
+
get url(): string;
|
|
3320
|
+
/**
|
|
3321
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3322
|
+
*
|
|
3323
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3324
|
+
*/
|
|
3325
|
+
get withCredentials(): boolean;
|
|
3326
|
+
/**
|
|
3327
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3328
|
+
*
|
|
3329
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3330
|
+
*/
|
|
3331
|
+
get readyState(): number;
|
|
3332
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3333
|
+
get onopen(): any | null;
|
|
3334
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3335
|
+
set onopen(value: any | null);
|
|
3336
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3337
|
+
get onmessage(): any | null;
|
|
3338
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3339
|
+
set onmessage(value: any | null);
|
|
3340
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3341
|
+
get onerror(): any | null;
|
|
3342
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3343
|
+
set onerror(value: any | null);
|
|
3344
|
+
static readonly CONNECTING: number;
|
|
3345
|
+
static readonly OPEN: number;
|
|
3346
|
+
static readonly CLOSED: number;
|
|
3347
|
+
static from(stream: ReadableStream): EventSource;
|
|
3348
|
+
}
|
|
3349
|
+
export interface EventSourceEventSourceInit {
|
|
3350
|
+
withCredentials?: boolean;
|
|
3351
|
+
fetcher?: Fetcher;
|
|
3352
|
+
}
|
|
3353
|
+
export type AiImageClassificationInput = {
|
|
3354
|
+
image: number[];
|
|
3355
|
+
};
|
|
3356
|
+
export type AiImageClassificationOutput = {
|
|
3357
|
+
score?: number;
|
|
3358
|
+
label?: string;
|
|
3359
|
+
}[];
|
|
3360
|
+
export declare abstract class BaseAiImageClassification {
|
|
3361
|
+
inputs: AiImageClassificationInput;
|
|
3362
|
+
postProcessedOutputs: AiImageClassificationOutput;
|
|
3363
|
+
}
|
|
3364
|
+
export type AiImageToTextInput = {
|
|
3365
|
+
image: number[];
|
|
3366
|
+
prompt?: string;
|
|
3367
|
+
max_tokens?: number;
|
|
3368
|
+
temperature?: number;
|
|
3369
|
+
top_p?: number;
|
|
3370
|
+
top_k?: number;
|
|
3371
|
+
seed?: number;
|
|
3372
|
+
repetition_penalty?: number;
|
|
3373
|
+
frequency_penalty?: number;
|
|
3374
|
+
presence_penalty?: number;
|
|
3375
|
+
raw?: boolean;
|
|
3376
|
+
messages?: RoleScopedChatInput[];
|
|
3377
|
+
};
|
|
3378
|
+
export type AiImageToTextOutput = {
|
|
3379
|
+
description: string;
|
|
3380
|
+
};
|
|
3381
|
+
export declare abstract class BaseAiImageToText {
|
|
3382
|
+
inputs: AiImageToTextInput;
|
|
3383
|
+
postProcessedOutputs: AiImageToTextOutput;
|
|
3384
|
+
}
|
|
3385
|
+
export type AiObjectDetectionInput = {
|
|
3386
|
+
image: number[];
|
|
3387
|
+
};
|
|
3388
|
+
export type AiObjectDetectionOutput = {
|
|
3389
|
+
score?: number;
|
|
3390
|
+
label?: string;
|
|
3391
|
+
}[];
|
|
3392
|
+
export declare abstract class BaseAiObjectDetection {
|
|
3393
|
+
inputs: AiObjectDetectionInput;
|
|
3394
|
+
postProcessedOutputs: AiObjectDetectionOutput;
|
|
3395
|
+
}
|
|
3396
|
+
export type AiSentenceSimilarityInput = {
|
|
3397
|
+
source: string;
|
|
3398
|
+
sentences: string[];
|
|
3399
|
+
};
|
|
3400
|
+
export type AiSentenceSimilarityOutput = number[];
|
|
3401
|
+
export declare abstract class BaseAiSentenceSimilarity {
|
|
3402
|
+
inputs: AiSentenceSimilarityInput;
|
|
3403
|
+
postProcessedOutputs: AiSentenceSimilarityOutput;
|
|
3404
|
+
}
|
|
3405
|
+
export type AiSpeechRecognitionInput = {
|
|
3406
|
+
audio: number[];
|
|
3407
|
+
};
|
|
3408
|
+
export type AiSpeechRecognitionOutput = {
|
|
3409
|
+
text?: string;
|
|
3410
|
+
words?: {
|
|
3411
|
+
word: string;
|
|
3412
|
+
start: number;
|
|
3413
|
+
end: number;
|
|
3414
|
+
}[];
|
|
3415
|
+
vtt?: string;
|
|
3416
|
+
};
|
|
3417
|
+
export declare abstract class BaseAiSpeechRecognition {
|
|
3418
|
+
inputs: AiSpeechRecognitionInput;
|
|
3419
|
+
postProcessedOutputs: AiSpeechRecognitionOutput;
|
|
3420
|
+
}
|
|
3421
|
+
export type AiSummarizationInput = {
|
|
3422
|
+
input_text: string;
|
|
3423
|
+
max_length?: number;
|
|
3424
|
+
};
|
|
3425
|
+
export type AiSummarizationOutput = {
|
|
3426
|
+
summary: string;
|
|
3427
|
+
};
|
|
3428
|
+
export declare abstract class BaseAiSummarization {
|
|
3429
|
+
inputs: AiSummarizationInput;
|
|
3430
|
+
postProcessedOutputs: AiSummarizationOutput;
|
|
3431
|
+
}
|
|
3432
|
+
export type AiTextClassificationInput = {
|
|
3433
|
+
text: string;
|
|
3434
|
+
};
|
|
3435
|
+
export type AiTextClassificationOutput = {
|
|
3436
|
+
score?: number;
|
|
3437
|
+
label?: string;
|
|
3438
|
+
}[];
|
|
3439
|
+
export declare abstract class BaseAiTextClassification {
|
|
3440
|
+
inputs: AiTextClassificationInput;
|
|
3441
|
+
postProcessedOutputs: AiTextClassificationOutput;
|
|
3442
|
+
}
|
|
3443
|
+
export type AiTextEmbeddingsInput = {
|
|
3444
|
+
text: string | string[];
|
|
3445
|
+
};
|
|
3446
|
+
export type AiTextEmbeddingsOutput = {
|
|
3447
|
+
shape: number[];
|
|
3448
|
+
data: number[][];
|
|
3449
|
+
};
|
|
3450
|
+
export declare abstract class BaseAiTextEmbeddings {
|
|
3451
|
+
inputs: AiTextEmbeddingsInput;
|
|
3452
|
+
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3453
|
+
}
|
|
3454
|
+
export type RoleScopedChatInput = {
|
|
3455
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3456
|
+
content: string;
|
|
3457
|
+
};
|
|
3458
|
+
export type AiTextGenerationToolInput = {
|
|
3459
|
+
type: "function";
|
|
3460
|
+
function: {
|
|
3461
|
+
name: string;
|
|
3462
|
+
description: string;
|
|
3463
|
+
parameters?: {
|
|
3464
|
+
type: "object";
|
|
3465
|
+
properties: {
|
|
3466
|
+
[key: string]: {
|
|
3467
|
+
type: string;
|
|
3468
|
+
description?: string;
|
|
3469
|
+
};
|
|
3470
|
+
};
|
|
3471
|
+
required: string[];
|
|
3472
|
+
};
|
|
3473
|
+
};
|
|
3474
|
+
};
|
|
3475
|
+
export type AiTextGenerationInput = {
|
|
3476
|
+
prompt?: string;
|
|
3477
|
+
raw?: boolean;
|
|
3478
|
+
stream?: boolean;
|
|
3479
|
+
max_tokens?: number;
|
|
3480
|
+
temperature?: number;
|
|
3481
|
+
top_p?: number;
|
|
3482
|
+
top_k?: number;
|
|
3483
|
+
seed?: number;
|
|
3484
|
+
repetition_penalty?: number;
|
|
3485
|
+
frequency_penalty?: number;
|
|
3486
|
+
presence_penalty?: number;
|
|
3487
|
+
messages?: RoleScopedChatInput[];
|
|
3488
|
+
tools?: AiTextGenerationToolInput[];
|
|
3489
|
+
};
|
|
3490
|
+
export type AiTextGenerationOutput =
|
|
3491
|
+
| {
|
|
3492
|
+
response?: string;
|
|
3493
|
+
tool_calls?: {
|
|
3494
|
+
name: string;
|
|
3495
|
+
arguments: unknown;
|
|
3496
|
+
}[];
|
|
3497
|
+
}
|
|
3498
|
+
| ReadableStream;
|
|
3499
|
+
export declare abstract class BaseAiTextGeneration {
|
|
3500
|
+
inputs: AiTextGenerationInput;
|
|
3501
|
+
postProcessedOutputs: AiTextGenerationOutput;
|
|
3502
|
+
}
|
|
3503
|
+
export type AiTextToImageInput = {
|
|
3504
|
+
prompt: string;
|
|
3505
|
+
image?: number[];
|
|
3506
|
+
mask?: number[];
|
|
3507
|
+
num_steps?: number;
|
|
3508
|
+
strength?: number;
|
|
3509
|
+
guidance?: number;
|
|
3510
|
+
};
|
|
3511
|
+
export type AiTextToImageOutput = Uint8Array;
|
|
3512
|
+
export declare abstract class BaseAiTextToImage {
|
|
3513
|
+
inputs: AiTextToImageInput;
|
|
3514
|
+
postProcessedOutputs: AiTextToImageOutput;
|
|
3515
|
+
}
|
|
3516
|
+
export type AiTranslationInput = {
|
|
3517
|
+
text: string;
|
|
3518
|
+
target_lang: string;
|
|
3519
|
+
source_lang?: string;
|
|
3520
|
+
};
|
|
3521
|
+
export type AiTranslationOutput = {
|
|
3522
|
+
translated_text?: string;
|
|
3523
|
+
};
|
|
3524
|
+
export declare abstract class BaseAiTranslation {
|
|
3525
|
+
inputs: AiTranslationInput;
|
|
3526
|
+
postProcessedOutputs: AiTranslationOutput;
|
|
3527
|
+
}
|
|
3528
|
+
export type GatewayOptions = {
|
|
3529
|
+
id: string;
|
|
3530
|
+
cacheTtl?: number;
|
|
3531
|
+
skipCache?: boolean;
|
|
3532
|
+
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
3533
|
+
};
|
|
3534
|
+
export type AiOptions = {
|
|
3535
|
+
gateway?: GatewayOptions;
|
|
3536
|
+
prefix?: string;
|
|
3537
|
+
extraHeaders?: object;
|
|
3538
|
+
};
|
|
3539
|
+
export type BaseAiTextClassificationModels =
|
|
3540
|
+
"@cf/huggingface/distilbert-sst-2-int8";
|
|
3541
|
+
export type BaseAiTextToImageModels =
|
|
3542
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3543
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3544
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3545
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3546
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3547
|
+
export type BaseAiTextEmbeddingsModels =
|
|
3548
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3549
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3550
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3551
|
+
export type BaseAiSpeechRecognitionModels =
|
|
3552
|
+
| "@cf/openai/whisper"
|
|
3553
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3554
|
+
| "@cf/openai/whisper-sherpa";
|
|
3555
|
+
export type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3556
|
+
export type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3557
|
+
export type BaseAiTextGenerationModels =
|
|
3558
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3559
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3560
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3561
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3562
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3563
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3564
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3565
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3566
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3567
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3568
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3569
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3570
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3571
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3572
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3573
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3574
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3575
|
+
| "@hf/google/gemma-7b-it"
|
|
3576
|
+
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3577
|
+
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3578
|
+
| "@cf/defog/sqlcoder-7b-2"
|
|
3579
|
+
| "@cf/openchat/openchat-3.5-0106"
|
|
3580
|
+
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3581
|
+
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3582
|
+
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3583
|
+
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3584
|
+
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3585
|
+
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3586
|
+
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3587
|
+
| "@cf/microsoft/phi-2"
|
|
3588
|
+
| "@cf/google/gemma-2b-it-lora"
|
|
3589
|
+
| "@cf/google/gemma-7b-it-lora"
|
|
3590
|
+
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3591
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3592
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3593
|
+
export type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3594
|
+
export type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3595
|
+
export type BaseAiImageToTextModels =
|
|
3596
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3597
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3598
|
+
export declare abstract class Ai {
|
|
3599
|
+
run(
|
|
3600
|
+
model: BaseAiTextClassificationModels,
|
|
3601
|
+
inputs: BaseAiTextClassification["inputs"],
|
|
3602
|
+
options?: AiOptions,
|
|
3603
|
+
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3604
|
+
run(
|
|
3605
|
+
model: BaseAiTextToImageModels,
|
|
3606
|
+
inputs: BaseAiTextToImage["inputs"],
|
|
3607
|
+
options?: AiOptions,
|
|
3608
|
+
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3609
|
+
run(
|
|
3610
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3611
|
+
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3612
|
+
options?: AiOptions,
|
|
3613
|
+
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3614
|
+
run(
|
|
3615
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3616
|
+
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3617
|
+
options?: AiOptions,
|
|
3618
|
+
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3619
|
+
run(
|
|
3620
|
+
model: BaseAiImageClassificationModels,
|
|
3621
|
+
inputs: BaseAiImageClassification["inputs"],
|
|
3622
|
+
options?: AiOptions,
|
|
3623
|
+
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3624
|
+
run(
|
|
3625
|
+
model: BaseAiObjectDetectionModels,
|
|
3626
|
+
inputs: BaseAiObjectDetection["inputs"],
|
|
3627
|
+
options?: AiOptions,
|
|
3628
|
+
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3629
|
+
run(
|
|
3630
|
+
model: BaseAiTextGenerationModels,
|
|
3631
|
+
inputs: BaseAiTextGeneration["inputs"],
|
|
3632
|
+
options?: AiOptions,
|
|
3633
|
+
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3634
|
+
run(
|
|
3635
|
+
model: BaseAiTranslationModels,
|
|
3636
|
+
inputs: BaseAiTranslation["inputs"],
|
|
3637
|
+
options?: AiOptions,
|
|
3638
|
+
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3639
|
+
run(
|
|
3640
|
+
model: BaseAiSummarizationModels,
|
|
3641
|
+
inputs: BaseAiSummarization["inputs"],
|
|
3642
|
+
options?: AiOptions,
|
|
3643
|
+
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3644
|
+
run(
|
|
3645
|
+
model: BaseAiImageToTextModels,
|
|
3646
|
+
inputs: BaseAiImageToText["inputs"],
|
|
3647
|
+
options?: AiOptions,
|
|
3648
|
+
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
3649
|
+
}
|
|
3031
3650
|
export interface BasicImageTransformations {
|
|
3032
3651
|
/**
|
|
3033
3652
|
* Maximum width in image pixels. The value must be an integer.
|
|
@@ -3142,6 +3761,7 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3142
3761
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
3143
3762
|
mirage?: boolean;
|
|
3144
3763
|
polish?: "lossy" | "lossless" | "off";
|
|
3764
|
+
r2?: RequestInitCfPropertiesR2;
|
|
3145
3765
|
/**
|
|
3146
3766
|
* Redirects the request to an alternate origin server. You can use this,
|
|
3147
3767
|
* for example, to implement load balancing across several origins.
|
|
@@ -3326,6 +3946,12 @@ export interface RequestInitCfPropertiesImageMinify {
|
|
|
3326
3946
|
css?: boolean;
|
|
3327
3947
|
html?: boolean;
|
|
3328
3948
|
}
|
|
3949
|
+
export interface RequestInitCfPropertiesR2 {
|
|
3950
|
+
/**
|
|
3951
|
+
* Colo id of bucket that an object is stored in
|
|
3952
|
+
*/
|
|
3953
|
+
bucketColoId?: number;
|
|
3954
|
+
}
|
|
3329
3955
|
/**
|
|
3330
3956
|
* Request metadata provided by Cloudflare's edge.
|
|
3331
3957
|
*/
|
|
@@ -3718,7 +4344,7 @@ export interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
|
|
|
3718
4344
|
certNotAfter: "";
|
|
3719
4345
|
}
|
|
3720
4346
|
/** Possible outcomes of TLS verification */
|
|
3721
|
-
export type CertVerificationStatus =
|
|
4347
|
+
export declare type CertVerificationStatus =
|
|
3722
4348
|
/** Authentication succeeded */
|
|
3723
4349
|
| "SUCCESS"
|
|
3724
4350
|
/** No certificate was presented */
|
|
@@ -3736,7 +4362,7 @@ export type CertVerificationStatus =
|
|
|
3736
4362
|
/**
|
|
3737
4363
|
* An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.
|
|
3738
4364
|
*/
|
|
3739
|
-
export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
4365
|
+
export declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
3740
4366
|
| 0 /** Unknown */
|
|
3741
4367
|
| 1 /** no keepalives (not found) */
|
|
3742
4368
|
| 2 /** no connection re-use, opening keepalive connection failed */
|
|
@@ -3744,7 +4370,7 @@ export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
|
3744
4370
|
| 4 /** connection re-use, refused by the origin server (`TCP FIN`) */
|
|
3745
4371
|
| 5; /** connection re-use, accepted by the origin server */
|
|
3746
4372
|
/** ISO 3166-1 Alpha-2 codes */
|
|
3747
|
-
export type Iso3166Alpha2Code =
|
|
4373
|
+
export declare type Iso3166Alpha2Code =
|
|
3748
4374
|
| "AD"
|
|
3749
4375
|
| "AE"
|
|
3750
4376
|
| "AF"
|
|
@@ -3995,7 +4621,14 @@ export type Iso3166Alpha2Code =
|
|
|
3995
4621
|
| "ZM"
|
|
3996
4622
|
| "ZW";
|
|
3997
4623
|
/** The 2-letter continent codes Cloudflare uses */
|
|
3998
|
-
export type ContinentCode =
|
|
4624
|
+
export declare type ContinentCode =
|
|
4625
|
+
| "AF"
|
|
4626
|
+
| "AN"
|
|
4627
|
+
| "AS"
|
|
4628
|
+
| "EU"
|
|
4629
|
+
| "NA"
|
|
4630
|
+
| "OC"
|
|
4631
|
+
| "SA";
|
|
3999
4632
|
export type CfProperties<HostMetadata = unknown> =
|
|
4000
4633
|
| IncomingRequestCfProperties<HostMetadata>
|
|
4001
4634
|
| RequestInitCfProperties;
|
|
@@ -4096,7 +4729,7 @@ export interface SendEmail {
|
|
|
4096
4729
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
4097
4730
|
readonly message: ForwardableEmailMessage;
|
|
4098
4731
|
}
|
|
4099
|
-
export type EmailExportedHandler<Env = unknown> = (
|
|
4732
|
+
export declare type EmailExportedHandler<Env = unknown> = (
|
|
4100
4733
|
message: ForwardableEmailMessage,
|
|
4101
4734
|
env: Env,
|
|
4102
4735
|
ctx: ExecutionContext,
|
|
@@ -4225,6 +4858,20 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
|
|
|
4225
4858
|
// Key Identifier of the JWK
|
|
4226
4859
|
readonly kid: string;
|
|
4227
4860
|
}
|
|
4861
|
+
export interface RateLimitOptions {
|
|
4862
|
+
key: string;
|
|
4863
|
+
}
|
|
4864
|
+
export interface RateLimitOutcome {
|
|
4865
|
+
success: boolean;
|
|
4866
|
+
}
|
|
4867
|
+
export interface RateLimit {
|
|
4868
|
+
/**
|
|
4869
|
+
* Rate limit a request based on the provided options.
|
|
4870
|
+
* @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
|
|
4871
|
+
* @returns A promise that resolves with the outcome of the rate limit.
|
|
4872
|
+
*/
|
|
4873
|
+
limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
|
|
4874
|
+
}
|
|
4228
4875
|
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4229
4876
|
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4230
4877
|
// strips all `module` blocks.
|
|
@@ -4488,6 +5135,15 @@ export interface VectorizeVectorMutation {
|
|
|
4488
5135
|
/* Total count of the number of processed vectors. */
|
|
4489
5136
|
count: number;
|
|
4490
5137
|
}
|
|
5138
|
+
/**
|
|
5139
|
+
* Results of an operation that performed a mutation on a set of vectors
|
|
5140
|
+
* with the v2 version of Vectorize.
|
|
5141
|
+
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
5142
|
+
*/
|
|
5143
|
+
export interface VectorizeVectorMutationV2 {
|
|
5144
|
+
/* The identifier for the last mutation processed by Vectorize. */
|
|
5145
|
+
mutationId: string;
|
|
5146
|
+
}
|
|
4491
5147
|
export declare abstract class VectorizeIndex {
|
|
4492
5148
|
/**
|
|
4493
5149
|
* Get information about the currently bound index.
|
|
@@ -4538,6 +5194,8 @@ export type WorkerVersionMetadata = {
|
|
|
4538
5194
|
id: string;
|
|
4539
5195
|
/** The tag of the Worker Version using this binding */
|
|
4540
5196
|
tag: string;
|
|
5197
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
5198
|
+
timestamp: string;
|
|
4541
5199
|
};
|
|
4542
5200
|
export interface DynamicDispatchLimits {
|
|
4543
5201
|
/**
|