@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/2022-11-30/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,23 +1480,33 @@ 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/has) */
|
|
1320
1494
|
has(name: string): boolean;
|
|
1495
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
|
|
1321
1496
|
set(name: string, value: string): void;
|
|
1497
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
|
|
1322
1498
|
append(name: string, value: string): void;
|
|
1499
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
|
|
1323
1500
|
delete(name: string): void;
|
|
1324
1501
|
forEach<This = unknown>(
|
|
1325
1502
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
1326
1503
|
thisArg?: This,
|
|
1327
1504
|
): void;
|
|
1328
|
-
|
|
1505
|
+
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
1329
1506
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1330
|
-
|
|
1507
|
+
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
1331
1508
|
keys(): IterableIterator<string>;
|
|
1332
|
-
|
|
1509
|
+
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
1333
1510
|
values(): IterableIterator<string>;
|
|
1334
1511
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1335
1512
|
}
|
|
@@ -1342,33 +1519,46 @@ export type BodyInit =
|
|
|
1342
1519
|
| URLSearchParams
|
|
1343
1520
|
| FormData;
|
|
1344
1521
|
export declare abstract class Body {
|
|
1522
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
|
1345
1523
|
get body(): ReadableStream | null;
|
|
1524
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
1346
1525
|
get bodyUsed(): boolean;
|
|
1526
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
1347
1527
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1528
|
+
bytes(): Promise<Uint8Array>;
|
|
1529
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
|
|
1348
1530
|
text(): Promise<string>;
|
|
1531
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
|
|
1349
1532
|
json<T>(): Promise<T>;
|
|
1533
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
|
|
1350
1534
|
formData(): Promise<FormData>;
|
|
1535
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
1351
1536
|
blob(): Promise<Blob>;
|
|
1352
1537
|
}
|
|
1538
|
+
/**
|
|
1539
|
+
* This Fetch API interface represents the response to a request.
|
|
1540
|
+
*
|
|
1541
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1542
|
+
*/
|
|
1353
1543
|
export declare class Response extends Body {
|
|
1354
1544
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1355
|
-
|
|
1545
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1356
1546
|
static redirect(url: string, status?: number): Response;
|
|
1357
|
-
|
|
1547
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1358
1548
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1359
|
-
|
|
1549
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1360
1550
|
clone(): Response;
|
|
1361
|
-
|
|
1551
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1362
1552
|
get status(): number;
|
|
1363
|
-
|
|
1553
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1364
1554
|
get statusText(): string;
|
|
1365
|
-
|
|
1555
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1366
1556
|
get headers(): Headers;
|
|
1367
|
-
|
|
1557
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1368
1558
|
get ok(): boolean;
|
|
1369
|
-
|
|
1559
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1370
1560
|
get redirected(): boolean;
|
|
1371
|
-
|
|
1561
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1372
1562
|
get url(): string;
|
|
1373
1563
|
get webSocket(): WebSocket | null;
|
|
1374
1564
|
get cf(): any | undefined;
|
|
@@ -1385,12 +1575,17 @@ export type RequestInfo<
|
|
|
1385
1575
|
CfHostMetadata = unknown,
|
|
1386
1576
|
Cf = CfProperties<CfHostMetadata>,
|
|
1387
1577
|
> = Request<CfHostMetadata, Cf> | string | URL;
|
|
1578
|
+
/**
|
|
1579
|
+
* This Fetch API interface represents a resource request.
|
|
1580
|
+
*
|
|
1581
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1582
|
+
*/
|
|
1388
1583
|
export declare class Request<
|
|
1389
1584
|
CfHostMetadata = unknown,
|
|
1390
1585
|
Cf = CfProperties<CfHostMetadata>,
|
|
1391
1586
|
> extends Body {
|
|
1392
1587
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1393
|
-
|
|
1588
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1394
1589
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1395
1590
|
/**
|
|
1396
1591
|
* Returns request's HTTP method, which is "GET" by default.
|
|
@@ -1438,19 +1633,19 @@ export declare class Request<
|
|
|
1438
1633
|
get keepalive(): boolean;
|
|
1439
1634
|
}
|
|
1440
1635
|
export interface RequestInit<Cf = CfProperties> {
|
|
1441
|
-
|
|
1636
|
+
/* A string to set request's method. */
|
|
1442
1637
|
method?: string;
|
|
1443
|
-
|
|
1638
|
+
/* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
|
|
1444
1639
|
headers?: HeadersInit;
|
|
1445
|
-
|
|
1640
|
+
/* A BodyInit object or null to set request's body. */
|
|
1446
1641
|
body?: BodyInit | null;
|
|
1447
|
-
|
|
1642
|
+
/* 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. */
|
|
1448
1643
|
redirect?: string;
|
|
1449
1644
|
fetcher?: Fetcher | null;
|
|
1450
1645
|
cf?: Cf;
|
|
1451
|
-
|
|
1646
|
+
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1452
1647
|
integrity?: string;
|
|
1453
|
-
|
|
1648
|
+
/* An AbortSignal to set request's signal. */
|
|
1454
1649
|
signal?: AbortSignal | null;
|
|
1455
1650
|
}
|
|
1456
1651
|
export type Service<
|
|
@@ -1884,31 +2079,36 @@ export type ReadableStreamReadResult<R = any> =
|
|
|
1884
2079
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1885
2080
|
*/
|
|
1886
2081
|
export interface ReadableStream<R = any> {
|
|
1887
|
-
|
|
2082
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1888
2083
|
get locked(): boolean;
|
|
1889
|
-
|
|
2084
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1890
2085
|
cancel(reason?: any): Promise<void>;
|
|
1891
|
-
|
|
2086
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1892
2087
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1893
|
-
|
|
2088
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1894
2089
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1895
|
-
|
|
2090
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1896
2091
|
pipeThrough<T>(
|
|
1897
2092
|
transform: ReadableWritablePair<T, R>,
|
|
1898
2093
|
options?: StreamPipeOptions,
|
|
1899
2094
|
): ReadableStream<T>;
|
|
1900
|
-
|
|
2095
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1901
2096
|
pipeTo(
|
|
1902
2097
|
destination: WritableStream<R>,
|
|
1903
2098
|
options?: StreamPipeOptions,
|
|
1904
2099
|
): Promise<void>;
|
|
1905
|
-
|
|
2100
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1906
2101
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1907
2102
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1908
2103
|
[Symbol.asyncIterator](
|
|
1909
2104
|
options?: ReadableStreamValuesOptions,
|
|
1910
2105
|
): AsyncIterableIterator<R>;
|
|
1911
2106
|
}
|
|
2107
|
+
/**
|
|
2108
|
+
* 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.
|
|
2109
|
+
*
|
|
2110
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
2111
|
+
*/
|
|
1912
2112
|
export declare const ReadableStream: {
|
|
1913
2113
|
prototype: ReadableStream;
|
|
1914
2114
|
new (
|
|
@@ -1920,24 +2120,26 @@ export declare const ReadableStream: {
|
|
|
1920
2120
|
strategy?: QueuingStrategy<R>,
|
|
1921
2121
|
): ReadableStream<R>;
|
|
1922
2122
|
};
|
|
2123
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
|
|
1923
2124
|
export declare class ReadableStreamDefaultReader<R = any> {
|
|
1924
2125
|
constructor(stream: ReadableStream);
|
|
1925
2126
|
get closed(): Promise<void>;
|
|
1926
2127
|
cancel(reason?: any): Promise<void>;
|
|
1927
|
-
|
|
2128
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1928
2129
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1929
|
-
|
|
2130
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1930
2131
|
releaseLock(): void;
|
|
1931
2132
|
}
|
|
2133
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
|
1932
2134
|
export declare class ReadableStreamBYOBReader {
|
|
1933
2135
|
constructor(stream: ReadableStream);
|
|
1934
2136
|
get closed(): Promise<void>;
|
|
1935
2137
|
cancel(reason?: any): Promise<void>;
|
|
1936
|
-
|
|
2138
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1937
2139
|
read<T extends ArrayBufferView>(
|
|
1938
2140
|
view: T,
|
|
1939
2141
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1940
|
-
|
|
2142
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1941
2143
|
releaseLock(): void;
|
|
1942
2144
|
readAtLeast<T extends ArrayBufferView>(
|
|
1943
2145
|
minElements: number,
|
|
@@ -1955,52 +2157,60 @@ export interface ReadableStreamGetReaderOptions {
|
|
|
1955
2157
|
*/
|
|
1956
2158
|
mode: "byob";
|
|
1957
2159
|
}
|
|
2160
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
1958
2161
|
export declare abstract class ReadableStreamBYOBRequest {
|
|
1959
|
-
|
|
2162
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1960
2163
|
get view(): Uint8Array | null;
|
|
1961
|
-
|
|
2164
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1962
2165
|
respond(bytesWritten: number): void;
|
|
1963
|
-
|
|
2166
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1964
2167
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1965
2168
|
get atLeast(): number | null;
|
|
1966
2169
|
}
|
|
2170
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
1967
2171
|
export declare abstract class ReadableStreamDefaultController<R = any> {
|
|
1968
|
-
|
|
2172
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1969
2173
|
get desiredSize(): number | null;
|
|
1970
|
-
|
|
2174
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1971
2175
|
close(): void;
|
|
1972
|
-
|
|
2176
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1973
2177
|
enqueue(chunk?: R): void;
|
|
1974
|
-
|
|
2178
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1975
2179
|
error(reason: any): void;
|
|
1976
2180
|
}
|
|
2181
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
1977
2182
|
export declare abstract class ReadableByteStreamController {
|
|
1978
|
-
|
|
2183
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1979
2184
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
|
1980
|
-
|
|
2185
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1981
2186
|
get desiredSize(): number | null;
|
|
1982
|
-
|
|
2187
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1983
2188
|
close(): void;
|
|
1984
|
-
|
|
2189
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1985
2190
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1986
|
-
|
|
2191
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1987
2192
|
error(reason: any): void;
|
|
1988
2193
|
}
|
|
2194
|
+
/**
|
|
2195
|
+
* 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.
|
|
2196
|
+
*
|
|
2197
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
2198
|
+
*/
|
|
1989
2199
|
export declare abstract class WritableStreamDefaultController {
|
|
1990
|
-
|
|
2200
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1991
2201
|
get signal(): AbortSignal;
|
|
1992
|
-
|
|
2202
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1993
2203
|
error(reason?: any): void;
|
|
1994
2204
|
}
|
|
1995
|
-
|
|
1996
|
-
export
|
|
1997
|
-
|
|
2205
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
2206
|
+
export declare abstract class TransformStreamDefaultController<O = any> {
|
|
2207
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1998
2208
|
get desiredSize(): number | null;
|
|
1999
|
-
|
|
2209
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
2000
2210
|
enqueue(chunk?: O): void;
|
|
2001
|
-
|
|
2211
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
2002
2212
|
error(reason: any): void;
|
|
2003
|
-
|
|
2213
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
2004
2214
|
terminate(): void;
|
|
2005
2215
|
}
|
|
2006
2216
|
export interface ReadableWritablePair<R = any, W = any> {
|
|
@@ -2012,46 +2222,57 @@ export interface ReadableWritablePair<R = any, W = any> {
|
|
|
2012
2222
|
writable: WritableStream<W>;
|
|
2013
2223
|
readable: ReadableStream<R>;
|
|
2014
2224
|
}
|
|
2225
|
+
/**
|
|
2226
|
+
* 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.
|
|
2227
|
+
*
|
|
2228
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
|
2229
|
+
*/
|
|
2015
2230
|
export declare class WritableStream<W = any> {
|
|
2016
2231
|
constructor(
|
|
2017
2232
|
underlyingSink?: UnderlyingSink,
|
|
2018
2233
|
queuingStrategy?: QueuingStrategy,
|
|
2019
2234
|
);
|
|
2020
|
-
|
|
2235
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
2021
2236
|
get locked(): boolean;
|
|
2022
|
-
|
|
2237
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
2023
2238
|
abort(reason?: any): Promise<void>;
|
|
2024
|
-
|
|
2239
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
2025
2240
|
close(): Promise<void>;
|
|
2026
|
-
|
|
2241
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
2027
2242
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
2028
2243
|
}
|
|
2244
|
+
/**
|
|
2245
|
+
* 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.
|
|
2246
|
+
*
|
|
2247
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
|
2248
|
+
*/
|
|
2029
2249
|
export declare class WritableStreamDefaultWriter<W = any> {
|
|
2030
2250
|
constructor(stream: WritableStream);
|
|
2031
|
-
|
|
2251
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
2032
2252
|
get closed(): Promise<void>;
|
|
2033
|
-
|
|
2253
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
2034
2254
|
get ready(): Promise<void>;
|
|
2035
|
-
|
|
2255
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
2036
2256
|
get desiredSize(): number | null;
|
|
2037
|
-
|
|
2257
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
2038
2258
|
abort(reason?: any): Promise<void>;
|
|
2039
|
-
|
|
2259
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
2040
2260
|
close(): Promise<void>;
|
|
2041
|
-
|
|
2261
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
2042
2262
|
write(chunk?: W): Promise<void>;
|
|
2043
|
-
|
|
2263
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
2044
2264
|
releaseLock(): void;
|
|
2045
2265
|
}
|
|
2266
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
|
|
2046
2267
|
export declare class TransformStream<I = any, O = any> {
|
|
2047
2268
|
constructor(
|
|
2048
2269
|
transformer?: Transformer<I, O>,
|
|
2049
2270
|
writableStrategy?: QueuingStrategy<I>,
|
|
2050
2271
|
readableStrategy?: QueuingStrategy<O>,
|
|
2051
2272
|
);
|
|
2052
|
-
|
|
2273
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
2053
2274
|
get readable(): ReadableStream<O>;
|
|
2054
|
-
|
|
2275
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
2055
2276
|
get writable(): WritableStream<I>;
|
|
2056
2277
|
}
|
|
2057
2278
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
@@ -2072,18 +2293,21 @@ export interface IdentityTransformStreamQueuingStrategy {
|
|
|
2072
2293
|
export interface ReadableStreamValuesOptions {
|
|
2073
2294
|
preventCancel?: boolean;
|
|
2074
2295
|
}
|
|
2296
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
|
|
2075
2297
|
export declare class CompressionStream extends TransformStream<
|
|
2076
2298
|
ArrayBuffer | ArrayBufferView,
|
|
2077
2299
|
Uint8Array
|
|
2078
2300
|
> {
|
|
2079
2301
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2080
2302
|
}
|
|
2303
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
|
|
2081
2304
|
export declare class DecompressionStream extends TransformStream<
|
|
2082
2305
|
ArrayBuffer | ArrayBufferView,
|
|
2083
2306
|
Uint8Array
|
|
2084
2307
|
> {
|
|
2085
2308
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2086
2309
|
}
|
|
2310
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
|
|
2087
2311
|
export declare class TextEncoderStream extends TransformStream<
|
|
2088
2312
|
string,
|
|
2089
2313
|
Uint8Array
|
|
@@ -2091,6 +2315,7 @@ export declare class TextEncoderStream extends TransformStream<
|
|
|
2091
2315
|
constructor();
|
|
2092
2316
|
get encoding(): string;
|
|
2093
2317
|
}
|
|
2318
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
|
|
2094
2319
|
export declare class TextDecoderStream extends TransformStream<
|
|
2095
2320
|
ArrayBuffer | ArrayBufferView,
|
|
2096
2321
|
string
|
|
@@ -2104,20 +2329,30 @@ export interface TextDecoderStreamTextDecoderStreamInit {
|
|
|
2104
2329
|
fatal?: boolean;
|
|
2105
2330
|
ignoreBOM?: boolean;
|
|
2106
2331
|
}
|
|
2332
|
+
/**
|
|
2333
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2334
|
+
*
|
|
2335
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
|
|
2336
|
+
*/
|
|
2107
2337
|
export declare class ByteLengthQueuingStrategy
|
|
2108
2338
|
implements QueuingStrategy<ArrayBufferView>
|
|
2109
2339
|
{
|
|
2110
2340
|
constructor(init: QueuingStrategyInit);
|
|
2111
|
-
|
|
2341
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
2112
2342
|
get highWaterMark(): number;
|
|
2113
|
-
|
|
2343
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
2114
2344
|
get size(): (chunk?: any) => number;
|
|
2115
2345
|
}
|
|
2346
|
+
/**
|
|
2347
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2348
|
+
*
|
|
2349
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
|
|
2350
|
+
*/
|
|
2116
2351
|
export declare class CountQueuingStrategy implements QueuingStrategy {
|
|
2117
2352
|
constructor(init: QueuingStrategyInit);
|
|
2118
|
-
|
|
2353
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
2119
2354
|
get highWaterMark(): number;
|
|
2120
|
-
|
|
2355
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
2121
2356
|
get size(): (chunk?: any) => number;
|
|
2122
2357
|
}
|
|
2123
2358
|
export interface QueuingStrategyInit {
|
|
@@ -2242,76 +2477,115 @@ export interface TraceMetrics {
|
|
|
2242
2477
|
export interface UnsafeTraceMetrics {
|
|
2243
2478
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
2244
2479
|
}
|
|
2480
|
+
/**
|
|
2481
|
+
* The URL interface represents an object providing static methods used for creating object URLs.
|
|
2482
|
+
*
|
|
2483
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
|
2484
|
+
*/
|
|
2245
2485
|
export declare class URL {
|
|
2246
2486
|
constructor(url: string | URL, base?: string | URL);
|
|
2247
|
-
|
|
2487
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
2248
2488
|
get origin(): string;
|
|
2249
|
-
|
|
2489
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2250
2490
|
get href(): string;
|
|
2251
|
-
|
|
2491
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2252
2492
|
set href(value: string);
|
|
2253
|
-
|
|
2493
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2254
2494
|
get protocol(): string;
|
|
2255
|
-
|
|
2495
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2256
2496
|
set protocol(value: string);
|
|
2257
|
-
|
|
2497
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2258
2498
|
get username(): string;
|
|
2259
|
-
|
|
2499
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2260
2500
|
set username(value: string);
|
|
2261
|
-
|
|
2501
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2262
2502
|
get password(): string;
|
|
2263
|
-
|
|
2503
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2264
2504
|
set password(value: string);
|
|
2265
|
-
|
|
2505
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2266
2506
|
get host(): string;
|
|
2267
|
-
|
|
2507
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2268
2508
|
set host(value: string);
|
|
2269
|
-
|
|
2509
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2270
2510
|
get hostname(): string;
|
|
2271
|
-
|
|
2511
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2272
2512
|
set hostname(value: string);
|
|
2273
|
-
|
|
2513
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2274
2514
|
get port(): string;
|
|
2275
|
-
|
|
2515
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2276
2516
|
set port(value: string);
|
|
2277
|
-
|
|
2517
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2278
2518
|
get pathname(): string;
|
|
2279
|
-
|
|
2519
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2280
2520
|
set pathname(value: string);
|
|
2281
|
-
|
|
2521
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2282
2522
|
get search(): string;
|
|
2283
|
-
|
|
2523
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2284
2524
|
set search(value: string);
|
|
2285
|
-
|
|
2525
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2286
2526
|
get hash(): string;
|
|
2287
|
-
|
|
2527
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2288
2528
|
set hash(value: string);
|
|
2289
|
-
|
|
2529
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
2290
2530
|
get searchParams(): URLSearchParams;
|
|
2291
|
-
|
|
2531
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
2292
2532
|
toJSON(): string;
|
|
2533
|
+
/*function toString() { [native code] }*/
|
|
2293
2534
|
toString(): string;
|
|
2294
|
-
|
|
2535
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2295
2536
|
static canParse(url: string, base?: string): boolean;
|
|
2296
2537
|
static parse(url: string, base?: string): URL | null;
|
|
2297
2538
|
}
|
|
2539
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2298
2540
|
export declare class URLSearchParams {
|
|
2299
2541
|
constructor(
|
|
2300
2542
|
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2301
2543
|
);
|
|
2544
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2302
2545
|
get size(): number;
|
|
2546
|
+
/**
|
|
2547
|
+
* Appends a specified key/value pair as a new search parameter.
|
|
2548
|
+
*
|
|
2549
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2550
|
+
*/
|
|
2303
2551
|
append(name: string, value: string): void;
|
|
2552
|
+
/**
|
|
2553
|
+
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2554
|
+
*
|
|
2555
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
2556
|
+
*/
|
|
2304
2557
|
delete(name: string): void;
|
|
2558
|
+
/**
|
|
2559
|
+
* Returns the first value associated to the given search parameter.
|
|
2560
|
+
*
|
|
2561
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2562
|
+
*/
|
|
2305
2563
|
get(name: string): string | null;
|
|
2564
|
+
/**
|
|
2565
|
+
* Returns all the values association with a given search parameter.
|
|
2566
|
+
*
|
|
2567
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2568
|
+
*/
|
|
2306
2569
|
getAll(name: string): string[];
|
|
2570
|
+
/**
|
|
2571
|
+
* Returns a Boolean indicating if such a search parameter exists.
|
|
2572
|
+
*
|
|
2573
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
2574
|
+
*/
|
|
2307
2575
|
has(name: string): boolean;
|
|
2576
|
+
/**
|
|
2577
|
+
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
2578
|
+
*
|
|
2579
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2580
|
+
*/
|
|
2308
2581
|
set(name: string, value: string): void;
|
|
2582
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2309
2583
|
sort(): void;
|
|
2310
|
-
|
|
2584
|
+
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
2311
2585
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2312
|
-
|
|
2586
|
+
/* Returns a list of keys in the search params. */
|
|
2313
2587
|
keys(): IterableIterator<string>;
|
|
2314
|
-
|
|
2588
|
+
/* Returns a list of values in the search params. */
|
|
2315
2589
|
values(): IterableIterator<string>;
|
|
2316
2590
|
forEach<This = unknown>(
|
|
2317
2591
|
callback: (
|
|
@@ -2322,6 +2596,7 @@ export declare class URLSearchParams {
|
|
|
2322
2596
|
) => void,
|
|
2323
2597
|
thisArg?: This,
|
|
2324
2598
|
): void;
|
|
2599
|
+
/*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
|
|
2325
2600
|
toString(): string;
|
|
2326
2601
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
2327
2602
|
}
|
|
@@ -2374,6 +2649,11 @@ export interface URLPatternURLPatternResult {
|
|
|
2374
2649
|
export interface URLPatternURLPatternOptions {
|
|
2375
2650
|
ignoreCase?: boolean;
|
|
2376
2651
|
}
|
|
2652
|
+
/**
|
|
2653
|
+
* 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.
|
|
2654
|
+
*
|
|
2655
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
|
2656
|
+
*/
|
|
2377
2657
|
export declare class CloseEvent extends Event {
|
|
2378
2658
|
constructor(type: string, initializer?: CloseEventInit);
|
|
2379
2659
|
/**
|
|
@@ -2400,36 +2680,34 @@ export interface CloseEventInit {
|
|
|
2400
2680
|
reason?: string;
|
|
2401
2681
|
wasClean?: boolean;
|
|
2402
2682
|
}
|
|
2683
|
+
/**
|
|
2684
|
+
* A message received by a target object.
|
|
2685
|
+
*
|
|
2686
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
|
2687
|
+
*/
|
|
2403
2688
|
export declare class MessageEvent extends Event {
|
|
2404
2689
|
constructor(type: string, initializer: MessageEventInit);
|
|
2690
|
+
/**
|
|
2691
|
+
* Returns the data of the message.
|
|
2692
|
+
*
|
|
2693
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
|
2694
|
+
*/
|
|
2405
2695
|
readonly data: ArrayBuffer | string;
|
|
2406
2696
|
}
|
|
2407
2697
|
export interface MessageEventInit {
|
|
2408
2698
|
data: ArrayBuffer | string;
|
|
2409
2699
|
}
|
|
2410
|
-
/**
|
|
2411
|
-
* Events providing information related to errors in scripts or in files.
|
|
2412
|
-
*
|
|
2413
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2414
|
-
*/
|
|
2415
|
-
export interface ErrorEvent extends Event {
|
|
2416
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
2417
|
-
readonly filename: string;
|
|
2418
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
2419
|
-
readonly message: string;
|
|
2420
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
2421
|
-
readonly lineno: number;
|
|
2422
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
2423
|
-
readonly colno: number;
|
|
2424
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
2425
|
-
readonly error: any;
|
|
2426
|
-
}
|
|
2427
2700
|
export type WebSocketEventMap = {
|
|
2428
2701
|
close: CloseEvent;
|
|
2429
2702
|
message: MessageEvent;
|
|
2430
2703
|
open: Event;
|
|
2431
2704
|
error: ErrorEvent;
|
|
2432
2705
|
};
|
|
2706
|
+
/**
|
|
2707
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2708
|
+
*
|
|
2709
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2710
|
+
*/
|
|
2433
2711
|
export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2434
2712
|
constructor(url: string, protocols?: string[] | string);
|
|
2435
2713
|
accept(): void;
|
|
@@ -2497,6 +2775,7 @@ export interface Socket {
|
|
|
2497
2775
|
export interface SocketOptions {
|
|
2498
2776
|
secureTransport?: string;
|
|
2499
2777
|
allowHalfOpen: boolean;
|
|
2778
|
+
highWaterMark?: number | bigint;
|
|
2500
2779
|
}
|
|
2501
2780
|
export interface SocketAddress {
|
|
2502
2781
|
hostname: string;
|
|
@@ -2509,65 +2788,61 @@ export interface SocketInfo {
|
|
|
2509
2788
|
remoteAddress?: string;
|
|
2510
2789
|
localAddress?: string;
|
|
2511
2790
|
}
|
|
2512
|
-
export interface
|
|
2513
|
-
requestAdapter(
|
|
2514
|
-
param1?: gpuGPURequestAdapterOptions,
|
|
2515
|
-
): Promise<gpuGPUAdapter | null>;
|
|
2791
|
+
export interface GPU {
|
|
2792
|
+
requestAdapter(param1?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
2516
2793
|
}
|
|
2517
|
-
export declare abstract class
|
|
2518
|
-
requestDevice(param1?:
|
|
2519
|
-
requestAdapterInfo(unmaskHints?: string[]): Promise<
|
|
2520
|
-
get features():
|
|
2521
|
-
get limits():
|
|
2794
|
+
export declare abstract class GPUAdapter {
|
|
2795
|
+
requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
2796
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
|
|
2797
|
+
get features(): GPUSupportedFeatures;
|
|
2798
|
+
get limits(): GPUSupportedLimits;
|
|
2522
2799
|
}
|
|
2523
|
-
export interface
|
|
2524
|
-
createBuffer(param1:
|
|
2800
|
+
export interface GPUDevice extends EventTarget {
|
|
2801
|
+
createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
|
|
2525
2802
|
createBindGroupLayout(
|
|
2526
|
-
descriptor:
|
|
2527
|
-
):
|
|
2528
|
-
createBindGroup(descriptor:
|
|
2529
|
-
createSampler(descriptor:
|
|
2530
|
-
createShaderModule(
|
|
2531
|
-
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2532
|
-
): gpuGPUShaderModule;
|
|
2803
|
+
descriptor: GPUBindGroupLayoutDescriptor,
|
|
2804
|
+
): GPUBindGroupLayout;
|
|
2805
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
2806
|
+
createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
|
|
2807
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
2533
2808
|
createPipelineLayout(
|
|
2534
|
-
descriptor:
|
|
2535
|
-
):
|
|
2809
|
+
descriptor: GPUPipelineLayoutDescriptor,
|
|
2810
|
+
): GPUPipelineLayout;
|
|
2536
2811
|
createComputePipeline(
|
|
2537
|
-
descriptor:
|
|
2538
|
-
):
|
|
2812
|
+
descriptor: GPUComputePipelineDescriptor,
|
|
2813
|
+
): GPUComputePipeline;
|
|
2539
2814
|
createRenderPipeline(
|
|
2540
|
-
descriptor:
|
|
2541
|
-
):
|
|
2815
|
+
descriptor: GPURenderPipelineDescriptor,
|
|
2816
|
+
): GPURenderPipeline;
|
|
2542
2817
|
createCommandEncoder(
|
|
2543
|
-
descriptor?:
|
|
2544
|
-
):
|
|
2545
|
-
createTexture(param1:
|
|
2818
|
+
descriptor?: GPUCommandEncoderDescriptor,
|
|
2819
|
+
): GPUCommandEncoder;
|
|
2820
|
+
createTexture(param1: GPUTextureDescriptor): GPUTexture;
|
|
2546
2821
|
destroy(): void;
|
|
2547
|
-
createQuerySet(descriptor:
|
|
2822
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
2548
2823
|
pushErrorScope(filter: string): void;
|
|
2549
|
-
popErrorScope(): Promise<
|
|
2550
|
-
get queue():
|
|
2551
|
-
get lost(): Promise<
|
|
2552
|
-
get features():
|
|
2553
|
-
get limits():
|
|
2824
|
+
popErrorScope(): Promise<GPUError | null>;
|
|
2825
|
+
get queue(): GPUQueue;
|
|
2826
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
2827
|
+
get features(): GPUSupportedFeatures;
|
|
2828
|
+
get limits(): GPUSupportedLimits;
|
|
2554
2829
|
}
|
|
2555
|
-
export interface
|
|
2830
|
+
export interface GPUDeviceDescriptor {
|
|
2556
2831
|
label?: string;
|
|
2557
2832
|
requiredFeatures?: string[];
|
|
2558
2833
|
requiredLimits?: Record<string, number | bigint>;
|
|
2559
|
-
defaultQueue?:
|
|
2834
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
2560
2835
|
}
|
|
2561
|
-
export interface
|
|
2836
|
+
export interface GPUBufferDescriptor {
|
|
2562
2837
|
label: string;
|
|
2563
2838
|
size: number | bigint;
|
|
2564
2839
|
usage: number;
|
|
2565
2840
|
mappedAtCreation: boolean;
|
|
2566
2841
|
}
|
|
2567
|
-
export interface
|
|
2842
|
+
export interface GPUQueueDescriptor {
|
|
2568
2843
|
label?: string;
|
|
2569
2844
|
}
|
|
2570
|
-
export declare abstract class
|
|
2845
|
+
export declare abstract class GPUBufferUsage {
|
|
2571
2846
|
static readonly MAP_READ: number;
|
|
2572
2847
|
static readonly MAP_WRITE: number;
|
|
2573
2848
|
static readonly COPY_SRC: number;
|
|
@@ -2579,7 +2854,7 @@ export declare abstract class gpuGPUBufferUsage {
|
|
|
2579
2854
|
static readonly INDIRECT: number;
|
|
2580
2855
|
static readonly QUERY_RESOLVE: number;
|
|
2581
2856
|
}
|
|
2582
|
-
export interface
|
|
2857
|
+
export interface GPUBuffer {
|
|
2583
2858
|
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2584
2859
|
unmap(): void;
|
|
2585
2860
|
destroy(): void;
|
|
@@ -2592,59 +2867,59 @@ export interface gpuGPUBuffer {
|
|
|
2592
2867
|
get usage(): number;
|
|
2593
2868
|
get mapState(): string;
|
|
2594
2869
|
}
|
|
2595
|
-
export declare abstract class
|
|
2870
|
+
export declare abstract class GPUShaderStage {
|
|
2596
2871
|
static readonly VERTEX: number;
|
|
2597
2872
|
static readonly FRAGMENT: number;
|
|
2598
2873
|
static readonly COMPUTE: number;
|
|
2599
2874
|
}
|
|
2600
|
-
export interface
|
|
2875
|
+
export interface GPUBindGroupLayoutDescriptor {
|
|
2601
2876
|
label?: string;
|
|
2602
|
-
entries:
|
|
2877
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
2603
2878
|
}
|
|
2604
|
-
export interface
|
|
2879
|
+
export interface GPUBindGroupLayoutEntry {
|
|
2605
2880
|
binding: number;
|
|
2606
2881
|
visibility: number;
|
|
2607
|
-
buffer?:
|
|
2608
|
-
sampler?:
|
|
2609
|
-
texture?:
|
|
2610
|
-
storageTexture?:
|
|
2882
|
+
buffer?: GPUBufferBindingLayout;
|
|
2883
|
+
sampler?: GPUSamplerBindingLayout;
|
|
2884
|
+
texture?: GPUTextureBindingLayout;
|
|
2885
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
2611
2886
|
}
|
|
2612
|
-
export interface
|
|
2887
|
+
export interface GPUStorageTextureBindingLayout {
|
|
2613
2888
|
access?: string;
|
|
2614
2889
|
format: string;
|
|
2615
2890
|
viewDimension?: string;
|
|
2616
2891
|
}
|
|
2617
|
-
export interface
|
|
2892
|
+
export interface GPUTextureBindingLayout {
|
|
2618
2893
|
sampleType?: string;
|
|
2619
2894
|
viewDimension?: string;
|
|
2620
2895
|
multisampled?: boolean;
|
|
2621
2896
|
}
|
|
2622
|
-
export interface
|
|
2897
|
+
export interface GPUSamplerBindingLayout {
|
|
2623
2898
|
type?: string;
|
|
2624
2899
|
}
|
|
2625
|
-
export interface
|
|
2900
|
+
export interface GPUBufferBindingLayout {
|
|
2626
2901
|
type?: string;
|
|
2627
2902
|
hasDynamicOffset?: boolean;
|
|
2628
2903
|
minBindingSize?: number | bigint;
|
|
2629
2904
|
}
|
|
2630
|
-
export interface
|
|
2631
|
-
export interface
|
|
2632
|
-
export interface
|
|
2905
|
+
export interface GPUBindGroupLayout {}
|
|
2906
|
+
export interface GPUBindGroup {}
|
|
2907
|
+
export interface GPUBindGroupDescriptor {
|
|
2633
2908
|
label?: string;
|
|
2634
|
-
layout:
|
|
2635
|
-
entries:
|
|
2909
|
+
layout: GPUBindGroupLayout;
|
|
2910
|
+
entries: GPUBindGroupEntry[];
|
|
2636
2911
|
}
|
|
2637
|
-
export interface
|
|
2912
|
+
export interface GPUBindGroupEntry {
|
|
2638
2913
|
binding: number;
|
|
2639
|
-
resource:
|
|
2914
|
+
resource: GPUBufferBinding | GPUSampler;
|
|
2640
2915
|
}
|
|
2641
|
-
export interface
|
|
2642
|
-
buffer:
|
|
2916
|
+
export interface GPUBufferBinding {
|
|
2917
|
+
buffer: GPUBuffer;
|
|
2643
2918
|
offset?: number | bigint;
|
|
2644
2919
|
size?: number | bigint;
|
|
2645
2920
|
}
|
|
2646
|
-
export interface
|
|
2647
|
-
export interface
|
|
2921
|
+
export interface GPUSampler {}
|
|
2922
|
+
export interface GPUSamplerDescriptor {
|
|
2648
2923
|
label?: string;
|
|
2649
2924
|
addressModeU?: string;
|
|
2650
2925
|
addressModeV?: string;
|
|
@@ -2657,76 +2932,74 @@ export interface gpuGPUSamplerDescriptor {
|
|
|
2657
2932
|
compare: string;
|
|
2658
2933
|
maxAnisotropy?: number;
|
|
2659
2934
|
}
|
|
2660
|
-
export interface
|
|
2661
|
-
getCompilationInfo(): Promise<
|
|
2935
|
+
export interface GPUShaderModule {
|
|
2936
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
2662
2937
|
}
|
|
2663
|
-
export interface
|
|
2938
|
+
export interface GPUShaderModuleDescriptor {
|
|
2664
2939
|
label?: string;
|
|
2665
2940
|
code: string;
|
|
2666
2941
|
}
|
|
2667
|
-
export interface
|
|
2668
|
-
export interface
|
|
2942
|
+
export interface GPUPipelineLayout {}
|
|
2943
|
+
export interface GPUPipelineLayoutDescriptor {
|
|
2669
2944
|
label?: string;
|
|
2670
|
-
bindGroupLayouts:
|
|
2945
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
2671
2946
|
}
|
|
2672
|
-
export interface
|
|
2673
|
-
getBindGroupLayout(index: number):
|
|
2947
|
+
export interface GPUComputePipeline {
|
|
2948
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2674
2949
|
}
|
|
2675
|
-
export interface
|
|
2950
|
+
export interface GPUComputePipelineDescriptor {
|
|
2676
2951
|
label?: string;
|
|
2677
|
-
compute:
|
|
2678
|
-
layout: string |
|
|
2952
|
+
compute: GPUProgrammableStage;
|
|
2953
|
+
layout: string | GPUPipelineLayout;
|
|
2679
2954
|
}
|
|
2680
|
-
export interface
|
|
2681
|
-
module:
|
|
2955
|
+
export interface GPUProgrammableStage {
|
|
2956
|
+
module: GPUShaderModule;
|
|
2682
2957
|
entryPoint: string;
|
|
2683
2958
|
constants?: Record<string, number>;
|
|
2684
2959
|
}
|
|
2685
|
-
export interface
|
|
2960
|
+
export interface GPUCommandEncoder {
|
|
2686
2961
|
get label(): string;
|
|
2687
2962
|
beginComputePass(
|
|
2688
|
-
descriptor?:
|
|
2689
|
-
):
|
|
2690
|
-
beginRenderPass(
|
|
2691
|
-
descriptor: gpuGPURenderPassDescriptor,
|
|
2692
|
-
): gpuGPURenderPassEncoder;
|
|
2963
|
+
descriptor?: GPUComputePassDescriptor,
|
|
2964
|
+
): GPUComputePassEncoder;
|
|
2965
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
2693
2966
|
copyBufferToBuffer(
|
|
2694
|
-
source:
|
|
2967
|
+
source: GPUBuffer,
|
|
2695
2968
|
sourceOffset: number | bigint,
|
|
2696
|
-
destination:
|
|
2969
|
+
destination: GPUBuffer,
|
|
2697
2970
|
destinationOffset: number | bigint,
|
|
2698
2971
|
size: number | bigint,
|
|
2699
2972
|
): void;
|
|
2700
|
-
finish(param0?:
|
|
2973
|
+
finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
2701
2974
|
copyTextureToBuffer(
|
|
2702
|
-
source:
|
|
2703
|
-
destination:
|
|
2704
|
-
copySize: Iterable<number> |
|
|
2975
|
+
source: GPUImageCopyTexture,
|
|
2976
|
+
destination: GPUImageCopyBuffer,
|
|
2977
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2705
2978
|
): void;
|
|
2706
2979
|
copyBufferToTexture(
|
|
2707
|
-
source:
|
|
2708
|
-
destination:
|
|
2709
|
-
copySize: Iterable<number> |
|
|
2980
|
+
source: GPUImageCopyBuffer,
|
|
2981
|
+
destination: GPUImageCopyTexture,
|
|
2982
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2710
2983
|
): void;
|
|
2711
2984
|
copyTextureToTexture(
|
|
2712
|
-
source:
|
|
2713
|
-
destination:
|
|
2714
|
-
copySize: Iterable<number> |
|
|
2985
|
+
source: GPUImageCopyTexture,
|
|
2986
|
+
destination: GPUImageCopyTexture,
|
|
2987
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2715
2988
|
): void;
|
|
2716
2989
|
clearBuffer(
|
|
2717
|
-
buffer:
|
|
2990
|
+
buffer: GPUBuffer,
|
|
2718
2991
|
offset?: number | bigint,
|
|
2719
2992
|
size?: number | bigint,
|
|
2720
2993
|
): void;
|
|
2721
2994
|
}
|
|
2722
|
-
export interface
|
|
2995
|
+
export interface GPUCommandEncoderDescriptor {
|
|
2723
2996
|
label?: string;
|
|
2724
2997
|
}
|
|
2725
|
-
export interface
|
|
2726
|
-
setPipeline(pipeline:
|
|
2998
|
+
export interface GPUComputePassEncoder {
|
|
2999
|
+
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2727
3000
|
setBindGroup(
|
|
2728
3001
|
index: number,
|
|
2729
|
-
bindGroup:
|
|
3002
|
+
bindGroup: GPUBindGroup | null,
|
|
2730
3003
|
dynamicOffsets?: Iterable<number>,
|
|
2731
3004
|
): void;
|
|
2732
3005
|
dispatchWorkgroups(
|
|
@@ -2736,52 +3009,52 @@ export interface gpuGPUComputePassEncoder {
|
|
|
2736
3009
|
): void;
|
|
2737
3010
|
end(): void;
|
|
2738
3011
|
}
|
|
2739
|
-
export interface
|
|
3012
|
+
export interface GPUComputePassDescriptor {
|
|
2740
3013
|
label?: string;
|
|
2741
|
-
timestampWrites?:
|
|
3014
|
+
timestampWrites?: GPUComputePassTimestampWrites;
|
|
2742
3015
|
}
|
|
2743
|
-
export interface
|
|
2744
|
-
export interface
|
|
3016
|
+
export interface GPUQuerySet {}
|
|
3017
|
+
export interface GPUQuerySetDescriptor {
|
|
2745
3018
|
label?: string;
|
|
2746
3019
|
}
|
|
2747
|
-
export interface
|
|
2748
|
-
querySet:
|
|
3020
|
+
export interface GPUComputePassTimestampWrites {
|
|
3021
|
+
querySet: GPUQuerySet;
|
|
2749
3022
|
beginningOfPassWriteIndex?: number;
|
|
2750
3023
|
endOfPassWriteIndex?: number;
|
|
2751
3024
|
}
|
|
2752
|
-
export interface
|
|
3025
|
+
export interface GPUCommandBufferDescriptor {
|
|
2753
3026
|
label?: string;
|
|
2754
3027
|
}
|
|
2755
|
-
export interface
|
|
2756
|
-
export interface
|
|
2757
|
-
submit(commandBuffers:
|
|
3028
|
+
export interface GPUCommandBuffer {}
|
|
3029
|
+
export interface GPUQueue {
|
|
3030
|
+
submit(commandBuffers: GPUCommandBuffer[]): void;
|
|
2758
3031
|
writeBuffer(
|
|
2759
|
-
buffer:
|
|
3032
|
+
buffer: GPUBuffer,
|
|
2760
3033
|
bufferOffset: number | bigint,
|
|
2761
3034
|
data: ArrayBuffer | ArrayBufferView,
|
|
2762
3035
|
dataOffset?: number | bigint,
|
|
2763
3036
|
size?: number | bigint,
|
|
2764
3037
|
): void;
|
|
2765
3038
|
}
|
|
2766
|
-
export declare abstract class
|
|
3039
|
+
export declare abstract class GPUMapMode {
|
|
2767
3040
|
static readonly READ: number;
|
|
2768
3041
|
static readonly WRITE: number;
|
|
2769
3042
|
}
|
|
2770
|
-
export interface
|
|
3043
|
+
export interface GPURequestAdapterOptions {
|
|
2771
3044
|
powerPreference: string;
|
|
2772
3045
|
forceFallbackAdapter?: boolean;
|
|
2773
3046
|
}
|
|
2774
|
-
export interface
|
|
3047
|
+
export interface GPUAdapterInfo {
|
|
2775
3048
|
get vendor(): string;
|
|
2776
3049
|
get architecture(): string;
|
|
2777
3050
|
get device(): string;
|
|
2778
3051
|
get description(): string;
|
|
2779
3052
|
}
|
|
2780
|
-
export interface
|
|
3053
|
+
export interface GPUSupportedFeatures {
|
|
2781
3054
|
has(name: string): boolean;
|
|
2782
3055
|
keys(): string[];
|
|
2783
3056
|
}
|
|
2784
|
-
export interface
|
|
3057
|
+
export interface GPUSupportedLimits {
|
|
2785
3058
|
get maxTextureDimension1D(): number;
|
|
2786
3059
|
get maxTextureDimension2D(): number;
|
|
2787
3060
|
get maxTextureDimension3D(): number;
|
|
@@ -2814,17 +3087,17 @@ export interface gpuGPUSupportedLimits {
|
|
|
2814
3087
|
get maxComputeWorkgroupSizeZ(): number;
|
|
2815
3088
|
get maxComputeWorkgroupsPerDimension(): number;
|
|
2816
3089
|
}
|
|
2817
|
-
export declare abstract class
|
|
3090
|
+
export declare abstract class GPUError {
|
|
2818
3091
|
get message(): string;
|
|
2819
3092
|
}
|
|
2820
|
-
export declare abstract class
|
|
2821
|
-
export declare abstract class
|
|
2822
|
-
export declare abstract class
|
|
2823
|
-
export declare abstract class
|
|
3093
|
+
export declare abstract class GPUOutOfMemoryError extends GPUError {}
|
|
3094
|
+
export declare abstract class GPUInternalError extends GPUError {}
|
|
3095
|
+
export declare abstract class GPUValidationError extends GPUError {}
|
|
3096
|
+
export declare abstract class GPUDeviceLostInfo {
|
|
2824
3097
|
get message(): string;
|
|
2825
3098
|
get reason(): string;
|
|
2826
3099
|
}
|
|
2827
|
-
export interface
|
|
3100
|
+
export interface GPUCompilationMessage {
|
|
2828
3101
|
get message(): string;
|
|
2829
3102
|
get type(): string;
|
|
2830
3103
|
get lineNum(): number;
|
|
@@ -2832,19 +3105,19 @@ export interface gpuGPUCompilationMessage {
|
|
|
2832
3105
|
get offset(): number;
|
|
2833
3106
|
get length(): number;
|
|
2834
3107
|
}
|
|
2835
|
-
export interface
|
|
2836
|
-
get messages():
|
|
3108
|
+
export interface GPUCompilationInfo {
|
|
3109
|
+
get messages(): GPUCompilationMessage[];
|
|
2837
3110
|
}
|
|
2838
|
-
export declare abstract class
|
|
3111
|
+
export declare abstract class GPUTextureUsage {
|
|
2839
3112
|
static readonly COPY_SRC: number;
|
|
2840
3113
|
static readonly COPY_DST: number;
|
|
2841
3114
|
static readonly TEXTURE_BINDING: number;
|
|
2842
3115
|
static readonly STORAGE_BINDING: number;
|
|
2843
3116
|
static readonly RENDER_ATTACHMENT: number;
|
|
2844
3117
|
}
|
|
2845
|
-
export interface
|
|
3118
|
+
export interface GPUTextureDescriptor {
|
|
2846
3119
|
label: string;
|
|
2847
|
-
size: number[] |
|
|
3120
|
+
size: number[] | GPUExtent3DDict;
|
|
2848
3121
|
mipLevelCount?: number;
|
|
2849
3122
|
sampleCount?: number;
|
|
2850
3123
|
dimension?: string;
|
|
@@ -2852,13 +3125,13 @@ export interface gpuGPUTextureDescriptor {
|
|
|
2852
3125
|
usage: number;
|
|
2853
3126
|
viewFormats?: string[];
|
|
2854
3127
|
}
|
|
2855
|
-
export interface
|
|
3128
|
+
export interface GPUExtent3DDict {
|
|
2856
3129
|
width: number;
|
|
2857
3130
|
height?: number;
|
|
2858
3131
|
depthOrArrayLayers?: number;
|
|
2859
3132
|
}
|
|
2860
|
-
export interface
|
|
2861
|
-
createView(descriptor?:
|
|
3133
|
+
export interface GPUTexture {
|
|
3134
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
2862
3135
|
destroy(): void;
|
|
2863
3136
|
get width(): number;
|
|
2864
3137
|
get height(): number;
|
|
@@ -2868,8 +3141,8 @@ export interface gpuGPUTexture {
|
|
|
2868
3141
|
get format(): string;
|
|
2869
3142
|
get usage(): number;
|
|
2870
3143
|
}
|
|
2871
|
-
export interface
|
|
2872
|
-
export interface
|
|
3144
|
+
export interface GPUTextureView {}
|
|
3145
|
+
export interface GPUTextureViewDescriptor {
|
|
2873
3146
|
label: string;
|
|
2874
3147
|
format: string;
|
|
2875
3148
|
dimension: string;
|
|
@@ -2879,91 +3152,91 @@ export interface gpuGPUTextureViewDescriptor {
|
|
|
2879
3152
|
baseArrayLayer?: number;
|
|
2880
3153
|
arrayLayerCount: number;
|
|
2881
3154
|
}
|
|
2882
|
-
export declare abstract class
|
|
3155
|
+
export declare abstract class GPUColorWrite {
|
|
2883
3156
|
static readonly RED: number;
|
|
2884
3157
|
static readonly GREEN: number;
|
|
2885
3158
|
static readonly BLUE: number;
|
|
2886
3159
|
static readonly ALPHA: number;
|
|
2887
3160
|
static readonly ALL: number;
|
|
2888
3161
|
}
|
|
2889
|
-
export interface
|
|
2890
|
-
export interface
|
|
3162
|
+
export interface GPURenderPipeline {}
|
|
3163
|
+
export interface GPURenderPipelineDescriptor {
|
|
2891
3164
|
label?: string;
|
|
2892
|
-
layout: string |
|
|
2893
|
-
vertex:
|
|
2894
|
-
primitive?:
|
|
2895
|
-
depthStencil?:
|
|
2896
|
-
multisample?:
|
|
2897
|
-
fragment?:
|
|
2898
|
-
}
|
|
2899
|
-
export interface
|
|
2900
|
-
module:
|
|
3165
|
+
layout: string | GPUPipelineLayout;
|
|
3166
|
+
vertex: GPUVertexState;
|
|
3167
|
+
primitive?: GPUPrimitiveState;
|
|
3168
|
+
depthStencil?: GPUDepthStencilState;
|
|
3169
|
+
multisample?: GPUMultisampleState;
|
|
3170
|
+
fragment?: GPUFragmentState;
|
|
3171
|
+
}
|
|
3172
|
+
export interface GPUVertexState {
|
|
3173
|
+
module: GPUShaderModule;
|
|
2901
3174
|
entryPoint: string;
|
|
2902
3175
|
constants?: Record<string, number>;
|
|
2903
|
-
buffers?:
|
|
3176
|
+
buffers?: GPUVertexBufferLayout[];
|
|
2904
3177
|
}
|
|
2905
|
-
export interface
|
|
3178
|
+
export interface GPUVertexBufferLayout {
|
|
2906
3179
|
arrayStride: number | bigint;
|
|
2907
3180
|
stepMode?: string;
|
|
2908
|
-
attributes:
|
|
3181
|
+
attributes: GPUVertexAttribute[];
|
|
2909
3182
|
}
|
|
2910
|
-
export interface
|
|
3183
|
+
export interface GPUVertexAttribute {
|
|
2911
3184
|
format: string;
|
|
2912
3185
|
offset: number | bigint;
|
|
2913
3186
|
shaderLocation: number;
|
|
2914
3187
|
}
|
|
2915
|
-
export interface
|
|
3188
|
+
export interface GPUPrimitiveState {
|
|
2916
3189
|
topology?: string;
|
|
2917
3190
|
stripIndexFormat?: string;
|
|
2918
3191
|
frontFace?: string;
|
|
2919
3192
|
cullMode?: string;
|
|
2920
3193
|
unclippedDepth?: boolean;
|
|
2921
3194
|
}
|
|
2922
|
-
export interface
|
|
3195
|
+
export interface GPUStencilFaceState {
|
|
2923
3196
|
compare?: string;
|
|
2924
3197
|
failOp?: string;
|
|
2925
3198
|
depthFailOp?: string;
|
|
2926
3199
|
passOp?: string;
|
|
2927
3200
|
}
|
|
2928
|
-
export interface
|
|
3201
|
+
export interface GPUDepthStencilState {
|
|
2929
3202
|
format: string;
|
|
2930
3203
|
depthWriteEnabled: boolean;
|
|
2931
3204
|
depthCompare: string;
|
|
2932
|
-
stencilFront?:
|
|
2933
|
-
stencilBack?:
|
|
3205
|
+
stencilFront?: GPUStencilFaceState;
|
|
3206
|
+
stencilBack?: GPUStencilFaceState;
|
|
2934
3207
|
stencilReadMask?: number;
|
|
2935
3208
|
stencilWriteMask?: number;
|
|
2936
3209
|
depthBias?: number;
|
|
2937
3210
|
depthBiasSlopeScale?: number;
|
|
2938
3211
|
depthBiasClamp?: number;
|
|
2939
3212
|
}
|
|
2940
|
-
export interface
|
|
3213
|
+
export interface GPUMultisampleState {
|
|
2941
3214
|
count?: number;
|
|
2942
3215
|
mask?: number;
|
|
2943
3216
|
alphaToCoverageEnabled?: boolean;
|
|
2944
3217
|
}
|
|
2945
|
-
export interface
|
|
2946
|
-
module:
|
|
3218
|
+
export interface GPUFragmentState {
|
|
3219
|
+
module: GPUShaderModule;
|
|
2947
3220
|
entryPoint: string;
|
|
2948
3221
|
constants?: Record<string, number>;
|
|
2949
|
-
targets:
|
|
3222
|
+
targets: GPUColorTargetState[];
|
|
2950
3223
|
}
|
|
2951
|
-
export interface
|
|
3224
|
+
export interface GPUColorTargetState {
|
|
2952
3225
|
format: string;
|
|
2953
|
-
blend:
|
|
3226
|
+
blend: GPUBlendState;
|
|
2954
3227
|
writeMask?: number;
|
|
2955
3228
|
}
|
|
2956
|
-
export interface
|
|
2957
|
-
color:
|
|
2958
|
-
alpha:
|
|
3229
|
+
export interface GPUBlendState {
|
|
3230
|
+
color: GPUBlendComponent;
|
|
3231
|
+
alpha: GPUBlendComponent;
|
|
2959
3232
|
}
|
|
2960
|
-
export interface
|
|
3233
|
+
export interface GPUBlendComponent {
|
|
2961
3234
|
operation?: string;
|
|
2962
3235
|
srcFactor?: string;
|
|
2963
3236
|
dstFactor?: string;
|
|
2964
3237
|
}
|
|
2965
|
-
export interface
|
|
2966
|
-
setPipeline(pipeline:
|
|
3238
|
+
export interface GPURenderPassEncoder {
|
|
3239
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2967
3240
|
draw(
|
|
2968
3241
|
vertexCount: number,
|
|
2969
3242
|
instanceCount?: number,
|
|
@@ -2972,30 +3245,30 @@ export interface gpuGPURenderPassEncoder {
|
|
|
2972
3245
|
): void;
|
|
2973
3246
|
end(): void;
|
|
2974
3247
|
}
|
|
2975
|
-
export interface
|
|
3248
|
+
export interface GPURenderPassDescriptor {
|
|
2976
3249
|
label?: string;
|
|
2977
|
-
colorAttachments:
|
|
2978
|
-
depthStencilAttachment?:
|
|
2979
|
-
occlusionQuerySet?:
|
|
2980
|
-
timestampWrites?:
|
|
3250
|
+
colorAttachments: GPURenderPassColorAttachment[];
|
|
3251
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
3252
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
3253
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
2981
3254
|
maxDrawCount?: number | bigint;
|
|
2982
3255
|
}
|
|
2983
|
-
export interface
|
|
2984
|
-
view:
|
|
3256
|
+
export interface GPURenderPassColorAttachment {
|
|
3257
|
+
view: GPUTextureView;
|
|
2985
3258
|
depthSlice?: number;
|
|
2986
|
-
resolveTarget?:
|
|
2987
|
-
clearValue?: number[] |
|
|
3259
|
+
resolveTarget?: GPUTextureView;
|
|
3260
|
+
clearValue?: number[] | GPUColorDict;
|
|
2988
3261
|
loadOp: string;
|
|
2989
3262
|
storeOp: string;
|
|
2990
3263
|
}
|
|
2991
|
-
export interface
|
|
3264
|
+
export interface GPUColorDict {
|
|
2992
3265
|
r: number;
|
|
2993
3266
|
g: number;
|
|
2994
3267
|
b: number;
|
|
2995
3268
|
a: number;
|
|
2996
3269
|
}
|
|
2997
|
-
export interface
|
|
2998
|
-
view:
|
|
3270
|
+
export interface GPURenderPassDepthStencilAttachment {
|
|
3271
|
+
view: GPUTextureView;
|
|
2999
3272
|
depthClearValue?: number;
|
|
3000
3273
|
depthLoadOp?: string;
|
|
3001
3274
|
depthStoreOp?: string;
|
|
@@ -3005,28 +3278,373 @@ export interface gpuGPURenderPassDepthStencilAttachment {
|
|
|
3005
3278
|
stencilStoreOp?: string;
|
|
3006
3279
|
stencilReadOnly?: boolean;
|
|
3007
3280
|
}
|
|
3008
|
-
export interface
|
|
3009
|
-
querySet:
|
|
3281
|
+
export interface GPURenderPassTimestampWrites {
|
|
3282
|
+
querySet: GPUQuerySet;
|
|
3010
3283
|
beginningOfPassWriteIndex?: number;
|
|
3011
3284
|
endOfPassWriteIndex?: number;
|
|
3012
3285
|
}
|
|
3013
|
-
export interface
|
|
3014
|
-
texture:
|
|
3286
|
+
export interface GPUImageCopyTexture {
|
|
3287
|
+
texture: GPUTexture;
|
|
3015
3288
|
mipLevel?: number;
|
|
3016
|
-
origin?: number[] |
|
|
3289
|
+
origin?: number[] | GPUOrigin3DDict;
|
|
3017
3290
|
aspect?: string;
|
|
3018
3291
|
}
|
|
3019
|
-
export interface
|
|
3020
|
-
buffer:
|
|
3292
|
+
export interface GPUImageCopyBuffer {
|
|
3293
|
+
buffer: GPUBuffer;
|
|
3021
3294
|
offset?: number | bigint;
|
|
3022
3295
|
bytesPerRow?: number;
|
|
3023
3296
|
rowsPerImage?: number;
|
|
3024
3297
|
}
|
|
3025
|
-
export interface
|
|
3298
|
+
export interface GPUOrigin3DDict {
|
|
3026
3299
|
x?: number;
|
|
3027
3300
|
y?: number;
|
|
3028
3301
|
z?: number;
|
|
3029
3302
|
}
|
|
3303
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3304
|
+
export declare class EventSource {
|
|
3305
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3306
|
+
/**
|
|
3307
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
3308
|
+
*
|
|
3309
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3310
|
+
*/
|
|
3311
|
+
close(): void;
|
|
3312
|
+
/**
|
|
3313
|
+
* Returns the URL providing the event stream.
|
|
3314
|
+
*
|
|
3315
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3316
|
+
*/
|
|
3317
|
+
get url(): string;
|
|
3318
|
+
/**
|
|
3319
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3320
|
+
*
|
|
3321
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3322
|
+
*/
|
|
3323
|
+
get withCredentials(): boolean;
|
|
3324
|
+
/**
|
|
3325
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3326
|
+
*
|
|
3327
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3328
|
+
*/
|
|
3329
|
+
get readyState(): number;
|
|
3330
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3331
|
+
get onopen(): any | null;
|
|
3332
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3333
|
+
set onopen(value: any | null);
|
|
3334
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3335
|
+
get onmessage(): any | null;
|
|
3336
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3337
|
+
set onmessage(value: any | null);
|
|
3338
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3339
|
+
get onerror(): any | null;
|
|
3340
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3341
|
+
set onerror(value: any | null);
|
|
3342
|
+
static readonly CONNECTING: number;
|
|
3343
|
+
static readonly OPEN: number;
|
|
3344
|
+
static readonly CLOSED: number;
|
|
3345
|
+
static from(stream: ReadableStream): EventSource;
|
|
3346
|
+
}
|
|
3347
|
+
export interface EventSourceEventSourceInit {
|
|
3348
|
+
withCredentials?: boolean;
|
|
3349
|
+
fetcher?: Fetcher;
|
|
3350
|
+
}
|
|
3351
|
+
export type AiImageClassificationInput = {
|
|
3352
|
+
image: number[];
|
|
3353
|
+
};
|
|
3354
|
+
export type AiImageClassificationOutput = {
|
|
3355
|
+
score?: number;
|
|
3356
|
+
label?: string;
|
|
3357
|
+
}[];
|
|
3358
|
+
export declare abstract class BaseAiImageClassification {
|
|
3359
|
+
inputs: AiImageClassificationInput;
|
|
3360
|
+
postProcessedOutputs: AiImageClassificationOutput;
|
|
3361
|
+
}
|
|
3362
|
+
export type AiImageToTextInput = {
|
|
3363
|
+
image: number[];
|
|
3364
|
+
prompt?: string;
|
|
3365
|
+
max_tokens?: number;
|
|
3366
|
+
temperature?: number;
|
|
3367
|
+
top_p?: number;
|
|
3368
|
+
top_k?: number;
|
|
3369
|
+
seed?: number;
|
|
3370
|
+
repetition_penalty?: number;
|
|
3371
|
+
frequency_penalty?: number;
|
|
3372
|
+
presence_penalty?: number;
|
|
3373
|
+
raw?: boolean;
|
|
3374
|
+
messages?: RoleScopedChatInput[];
|
|
3375
|
+
};
|
|
3376
|
+
export type AiImageToTextOutput = {
|
|
3377
|
+
description: string;
|
|
3378
|
+
};
|
|
3379
|
+
export declare abstract class BaseAiImageToText {
|
|
3380
|
+
inputs: AiImageToTextInput;
|
|
3381
|
+
postProcessedOutputs: AiImageToTextOutput;
|
|
3382
|
+
}
|
|
3383
|
+
export type AiObjectDetectionInput = {
|
|
3384
|
+
image: number[];
|
|
3385
|
+
};
|
|
3386
|
+
export type AiObjectDetectionOutput = {
|
|
3387
|
+
score?: number;
|
|
3388
|
+
label?: string;
|
|
3389
|
+
}[];
|
|
3390
|
+
export declare abstract class BaseAiObjectDetection {
|
|
3391
|
+
inputs: AiObjectDetectionInput;
|
|
3392
|
+
postProcessedOutputs: AiObjectDetectionOutput;
|
|
3393
|
+
}
|
|
3394
|
+
export type AiSentenceSimilarityInput = {
|
|
3395
|
+
source: string;
|
|
3396
|
+
sentences: string[];
|
|
3397
|
+
};
|
|
3398
|
+
export type AiSentenceSimilarityOutput = number[];
|
|
3399
|
+
export declare abstract class BaseAiSentenceSimilarity {
|
|
3400
|
+
inputs: AiSentenceSimilarityInput;
|
|
3401
|
+
postProcessedOutputs: AiSentenceSimilarityOutput;
|
|
3402
|
+
}
|
|
3403
|
+
export type AiSpeechRecognitionInput = {
|
|
3404
|
+
audio: number[];
|
|
3405
|
+
};
|
|
3406
|
+
export type AiSpeechRecognitionOutput = {
|
|
3407
|
+
text?: string;
|
|
3408
|
+
words?: {
|
|
3409
|
+
word: string;
|
|
3410
|
+
start: number;
|
|
3411
|
+
end: number;
|
|
3412
|
+
}[];
|
|
3413
|
+
vtt?: string;
|
|
3414
|
+
};
|
|
3415
|
+
export declare abstract class BaseAiSpeechRecognition {
|
|
3416
|
+
inputs: AiSpeechRecognitionInput;
|
|
3417
|
+
postProcessedOutputs: AiSpeechRecognitionOutput;
|
|
3418
|
+
}
|
|
3419
|
+
export type AiSummarizationInput = {
|
|
3420
|
+
input_text: string;
|
|
3421
|
+
max_length?: number;
|
|
3422
|
+
};
|
|
3423
|
+
export type AiSummarizationOutput = {
|
|
3424
|
+
summary: string;
|
|
3425
|
+
};
|
|
3426
|
+
export declare abstract class BaseAiSummarization {
|
|
3427
|
+
inputs: AiSummarizationInput;
|
|
3428
|
+
postProcessedOutputs: AiSummarizationOutput;
|
|
3429
|
+
}
|
|
3430
|
+
export type AiTextClassificationInput = {
|
|
3431
|
+
text: string;
|
|
3432
|
+
};
|
|
3433
|
+
export type AiTextClassificationOutput = {
|
|
3434
|
+
score?: number;
|
|
3435
|
+
label?: string;
|
|
3436
|
+
}[];
|
|
3437
|
+
export declare abstract class BaseAiTextClassification {
|
|
3438
|
+
inputs: AiTextClassificationInput;
|
|
3439
|
+
postProcessedOutputs: AiTextClassificationOutput;
|
|
3440
|
+
}
|
|
3441
|
+
export type AiTextEmbeddingsInput = {
|
|
3442
|
+
text: string | string[];
|
|
3443
|
+
};
|
|
3444
|
+
export type AiTextEmbeddingsOutput = {
|
|
3445
|
+
shape: number[];
|
|
3446
|
+
data: number[][];
|
|
3447
|
+
};
|
|
3448
|
+
export declare abstract class BaseAiTextEmbeddings {
|
|
3449
|
+
inputs: AiTextEmbeddingsInput;
|
|
3450
|
+
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3451
|
+
}
|
|
3452
|
+
export type RoleScopedChatInput = {
|
|
3453
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3454
|
+
content: string;
|
|
3455
|
+
};
|
|
3456
|
+
export type AiTextGenerationToolInput = {
|
|
3457
|
+
type: "function";
|
|
3458
|
+
function: {
|
|
3459
|
+
name: string;
|
|
3460
|
+
description: string;
|
|
3461
|
+
parameters?: {
|
|
3462
|
+
type: "object";
|
|
3463
|
+
properties: {
|
|
3464
|
+
[key: string]: {
|
|
3465
|
+
type: string;
|
|
3466
|
+
description?: string;
|
|
3467
|
+
};
|
|
3468
|
+
};
|
|
3469
|
+
required: string[];
|
|
3470
|
+
};
|
|
3471
|
+
};
|
|
3472
|
+
};
|
|
3473
|
+
export type AiTextGenerationInput = {
|
|
3474
|
+
prompt?: string;
|
|
3475
|
+
raw?: boolean;
|
|
3476
|
+
stream?: boolean;
|
|
3477
|
+
max_tokens?: number;
|
|
3478
|
+
temperature?: number;
|
|
3479
|
+
top_p?: number;
|
|
3480
|
+
top_k?: number;
|
|
3481
|
+
seed?: number;
|
|
3482
|
+
repetition_penalty?: number;
|
|
3483
|
+
frequency_penalty?: number;
|
|
3484
|
+
presence_penalty?: number;
|
|
3485
|
+
messages?: RoleScopedChatInput[];
|
|
3486
|
+
tools?: AiTextGenerationToolInput[];
|
|
3487
|
+
};
|
|
3488
|
+
export type AiTextGenerationOutput =
|
|
3489
|
+
| {
|
|
3490
|
+
response?: string;
|
|
3491
|
+
tool_calls?: {
|
|
3492
|
+
name: string;
|
|
3493
|
+
arguments: unknown;
|
|
3494
|
+
}[];
|
|
3495
|
+
}
|
|
3496
|
+
| ReadableStream;
|
|
3497
|
+
export declare abstract class BaseAiTextGeneration {
|
|
3498
|
+
inputs: AiTextGenerationInput;
|
|
3499
|
+
postProcessedOutputs: AiTextGenerationOutput;
|
|
3500
|
+
}
|
|
3501
|
+
export type AiTextToImageInput = {
|
|
3502
|
+
prompt: string;
|
|
3503
|
+
image?: number[];
|
|
3504
|
+
mask?: number[];
|
|
3505
|
+
num_steps?: number;
|
|
3506
|
+
strength?: number;
|
|
3507
|
+
guidance?: number;
|
|
3508
|
+
};
|
|
3509
|
+
export type AiTextToImageOutput = Uint8Array;
|
|
3510
|
+
export declare abstract class BaseAiTextToImage {
|
|
3511
|
+
inputs: AiTextToImageInput;
|
|
3512
|
+
postProcessedOutputs: AiTextToImageOutput;
|
|
3513
|
+
}
|
|
3514
|
+
export type AiTranslationInput = {
|
|
3515
|
+
text: string;
|
|
3516
|
+
target_lang: string;
|
|
3517
|
+
source_lang?: string;
|
|
3518
|
+
};
|
|
3519
|
+
export type AiTranslationOutput = {
|
|
3520
|
+
translated_text?: string;
|
|
3521
|
+
};
|
|
3522
|
+
export declare abstract class BaseAiTranslation {
|
|
3523
|
+
inputs: AiTranslationInput;
|
|
3524
|
+
postProcessedOutputs: AiTranslationOutput;
|
|
3525
|
+
}
|
|
3526
|
+
export type GatewayOptions = {
|
|
3527
|
+
id: string;
|
|
3528
|
+
cacheTtl?: number;
|
|
3529
|
+
skipCache?: boolean;
|
|
3530
|
+
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
3531
|
+
};
|
|
3532
|
+
export type AiOptions = {
|
|
3533
|
+
gateway?: GatewayOptions;
|
|
3534
|
+
prefix?: string;
|
|
3535
|
+
extraHeaders?: object;
|
|
3536
|
+
};
|
|
3537
|
+
export type BaseAiTextClassificationModels =
|
|
3538
|
+
"@cf/huggingface/distilbert-sst-2-int8";
|
|
3539
|
+
export type BaseAiTextToImageModels =
|
|
3540
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3541
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3542
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3543
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3544
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3545
|
+
export type BaseAiTextEmbeddingsModels =
|
|
3546
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3547
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3548
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3549
|
+
export type BaseAiSpeechRecognitionModels =
|
|
3550
|
+
| "@cf/openai/whisper"
|
|
3551
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3552
|
+
| "@cf/openai/whisper-sherpa";
|
|
3553
|
+
export type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3554
|
+
export type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3555
|
+
export type BaseAiTextGenerationModels =
|
|
3556
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3557
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3558
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3559
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3560
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3561
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3562
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3563
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3564
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3565
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3566
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3567
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3568
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3569
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3570
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3571
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3572
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3573
|
+
| "@hf/google/gemma-7b-it"
|
|
3574
|
+
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3575
|
+
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3576
|
+
| "@cf/defog/sqlcoder-7b-2"
|
|
3577
|
+
| "@cf/openchat/openchat-3.5-0106"
|
|
3578
|
+
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3579
|
+
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3580
|
+
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3581
|
+
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3582
|
+
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3583
|
+
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3584
|
+
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3585
|
+
| "@cf/microsoft/phi-2"
|
|
3586
|
+
| "@cf/google/gemma-2b-it-lora"
|
|
3587
|
+
| "@cf/google/gemma-7b-it-lora"
|
|
3588
|
+
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3589
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3590
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3591
|
+
export type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3592
|
+
export type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3593
|
+
export type BaseAiImageToTextModels =
|
|
3594
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3595
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3596
|
+
export declare abstract class Ai {
|
|
3597
|
+
run(
|
|
3598
|
+
model: BaseAiTextClassificationModels,
|
|
3599
|
+
inputs: BaseAiTextClassification["inputs"],
|
|
3600
|
+
options?: AiOptions,
|
|
3601
|
+
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3602
|
+
run(
|
|
3603
|
+
model: BaseAiTextToImageModels,
|
|
3604
|
+
inputs: BaseAiTextToImage["inputs"],
|
|
3605
|
+
options?: AiOptions,
|
|
3606
|
+
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3607
|
+
run(
|
|
3608
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3609
|
+
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3610
|
+
options?: AiOptions,
|
|
3611
|
+
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3612
|
+
run(
|
|
3613
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3614
|
+
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3615
|
+
options?: AiOptions,
|
|
3616
|
+
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3617
|
+
run(
|
|
3618
|
+
model: BaseAiImageClassificationModels,
|
|
3619
|
+
inputs: BaseAiImageClassification["inputs"],
|
|
3620
|
+
options?: AiOptions,
|
|
3621
|
+
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3622
|
+
run(
|
|
3623
|
+
model: BaseAiObjectDetectionModels,
|
|
3624
|
+
inputs: BaseAiObjectDetection["inputs"],
|
|
3625
|
+
options?: AiOptions,
|
|
3626
|
+
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3627
|
+
run(
|
|
3628
|
+
model: BaseAiTextGenerationModels,
|
|
3629
|
+
inputs: BaseAiTextGeneration["inputs"],
|
|
3630
|
+
options?: AiOptions,
|
|
3631
|
+
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3632
|
+
run(
|
|
3633
|
+
model: BaseAiTranslationModels,
|
|
3634
|
+
inputs: BaseAiTranslation["inputs"],
|
|
3635
|
+
options?: AiOptions,
|
|
3636
|
+
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3637
|
+
run(
|
|
3638
|
+
model: BaseAiSummarizationModels,
|
|
3639
|
+
inputs: BaseAiSummarization["inputs"],
|
|
3640
|
+
options?: AiOptions,
|
|
3641
|
+
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3642
|
+
run(
|
|
3643
|
+
model: BaseAiImageToTextModels,
|
|
3644
|
+
inputs: BaseAiImageToText["inputs"],
|
|
3645
|
+
options?: AiOptions,
|
|
3646
|
+
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
3647
|
+
}
|
|
3030
3648
|
export interface BasicImageTransformations {
|
|
3031
3649
|
/**
|
|
3032
3650
|
* Maximum width in image pixels. The value must be an integer.
|
|
@@ -3141,6 +3759,7 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3141
3759
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
3142
3760
|
mirage?: boolean;
|
|
3143
3761
|
polish?: "lossy" | "lossless" | "off";
|
|
3762
|
+
r2?: RequestInitCfPropertiesR2;
|
|
3144
3763
|
/**
|
|
3145
3764
|
* Redirects the request to an alternate origin server. You can use this,
|
|
3146
3765
|
* for example, to implement load balancing across several origins.
|
|
@@ -3325,6 +3944,12 @@ export interface RequestInitCfPropertiesImageMinify {
|
|
|
3325
3944
|
css?: boolean;
|
|
3326
3945
|
html?: boolean;
|
|
3327
3946
|
}
|
|
3947
|
+
export interface RequestInitCfPropertiesR2 {
|
|
3948
|
+
/**
|
|
3949
|
+
* Colo id of bucket that an object is stored in
|
|
3950
|
+
*/
|
|
3951
|
+
bucketColoId?: number;
|
|
3952
|
+
}
|
|
3328
3953
|
/**
|
|
3329
3954
|
* Request metadata provided by Cloudflare's edge.
|
|
3330
3955
|
*/
|
|
@@ -3717,7 +4342,7 @@ export interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
|
|
|
3717
4342
|
certNotAfter: "";
|
|
3718
4343
|
}
|
|
3719
4344
|
/** Possible outcomes of TLS verification */
|
|
3720
|
-
export type CertVerificationStatus =
|
|
4345
|
+
export declare type CertVerificationStatus =
|
|
3721
4346
|
/** Authentication succeeded */
|
|
3722
4347
|
| "SUCCESS"
|
|
3723
4348
|
/** No certificate was presented */
|
|
@@ -3735,7 +4360,7 @@ export type CertVerificationStatus =
|
|
|
3735
4360
|
/**
|
|
3736
4361
|
* An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.
|
|
3737
4362
|
*/
|
|
3738
|
-
export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
4363
|
+
export declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
3739
4364
|
| 0 /** Unknown */
|
|
3740
4365
|
| 1 /** no keepalives (not found) */
|
|
3741
4366
|
| 2 /** no connection re-use, opening keepalive connection failed */
|
|
@@ -3743,7 +4368,7 @@ export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
|
3743
4368
|
| 4 /** connection re-use, refused by the origin server (`TCP FIN`) */
|
|
3744
4369
|
| 5; /** connection re-use, accepted by the origin server */
|
|
3745
4370
|
/** ISO 3166-1 Alpha-2 codes */
|
|
3746
|
-
export type Iso3166Alpha2Code =
|
|
4371
|
+
export declare type Iso3166Alpha2Code =
|
|
3747
4372
|
| "AD"
|
|
3748
4373
|
| "AE"
|
|
3749
4374
|
| "AF"
|
|
@@ -3994,7 +4619,14 @@ export type Iso3166Alpha2Code =
|
|
|
3994
4619
|
| "ZM"
|
|
3995
4620
|
| "ZW";
|
|
3996
4621
|
/** The 2-letter continent codes Cloudflare uses */
|
|
3997
|
-
export type ContinentCode =
|
|
4622
|
+
export declare type ContinentCode =
|
|
4623
|
+
| "AF"
|
|
4624
|
+
| "AN"
|
|
4625
|
+
| "AS"
|
|
4626
|
+
| "EU"
|
|
4627
|
+
| "NA"
|
|
4628
|
+
| "OC"
|
|
4629
|
+
| "SA";
|
|
3998
4630
|
export type CfProperties<HostMetadata = unknown> =
|
|
3999
4631
|
| IncomingRequestCfProperties<HostMetadata>
|
|
4000
4632
|
| RequestInitCfProperties;
|
|
@@ -4095,7 +4727,7 @@ export interface SendEmail {
|
|
|
4095
4727
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
4096
4728
|
readonly message: ForwardableEmailMessage;
|
|
4097
4729
|
}
|
|
4098
|
-
export type EmailExportedHandler<Env = unknown> = (
|
|
4730
|
+
export declare type EmailExportedHandler<Env = unknown> = (
|
|
4099
4731
|
message: ForwardableEmailMessage,
|
|
4100
4732
|
env: Env,
|
|
4101
4733
|
ctx: ExecutionContext,
|
|
@@ -4224,6 +4856,20 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
|
|
|
4224
4856
|
// Key Identifier of the JWK
|
|
4225
4857
|
readonly kid: string;
|
|
4226
4858
|
}
|
|
4859
|
+
export interface RateLimitOptions {
|
|
4860
|
+
key: string;
|
|
4861
|
+
}
|
|
4862
|
+
export interface RateLimitOutcome {
|
|
4863
|
+
success: boolean;
|
|
4864
|
+
}
|
|
4865
|
+
export interface RateLimit {
|
|
4866
|
+
/**
|
|
4867
|
+
* Rate limit a request based on the provided options.
|
|
4868
|
+
* @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
|
|
4869
|
+
* @returns A promise that resolves with the outcome of the rate limit.
|
|
4870
|
+
*/
|
|
4871
|
+
limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
|
|
4872
|
+
}
|
|
4227
4873
|
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4228
4874
|
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4229
4875
|
// strips all `module` blocks.
|
|
@@ -4487,6 +5133,15 @@ export interface VectorizeVectorMutation {
|
|
|
4487
5133
|
/* Total count of the number of processed vectors. */
|
|
4488
5134
|
count: number;
|
|
4489
5135
|
}
|
|
5136
|
+
/**
|
|
5137
|
+
* Results of an operation that performed a mutation on a set of vectors
|
|
5138
|
+
* with the v2 version of Vectorize.
|
|
5139
|
+
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
5140
|
+
*/
|
|
5141
|
+
export interface VectorizeVectorMutationV2 {
|
|
5142
|
+
/* The identifier for the last mutation processed by Vectorize. */
|
|
5143
|
+
mutationId: string;
|
|
5144
|
+
}
|
|
4490
5145
|
export declare abstract class VectorizeIndex {
|
|
4491
5146
|
/**
|
|
4492
5147
|
* Get information about the currently bound index.
|
|
@@ -4537,6 +5192,8 @@ export type WorkerVersionMetadata = {
|
|
|
4537
5192
|
id: string;
|
|
4538
5193
|
/** The tag of the Worker Version using this binding */
|
|
4539
5194
|
tag: string;
|
|
5195
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
5196
|
+
timestamp: string;
|
|
4540
5197
|
};
|
|
4541
5198
|
export interface DynamicDispatchLimits {
|
|
4542
5199
|
/**
|