@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/2021-11-03/index.d.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
|
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 @@ 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,8 +56,10 @@ 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
|
+
type WorkerGlobalScopeEventMap = {
|
|
57
63
|
fetch: FetchEvent;
|
|
58
64
|
scheduled: ScheduledEvent;
|
|
59
65
|
queue: QueueEvent;
|
|
@@ -63,50 +69,50 @@ declare type WorkerGlobalScopeEventMap = {
|
|
|
63
69
|
declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
|
|
64
70
|
EventTarget: typeof EventTarget;
|
|
65
71
|
}
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
|
|
73
|
+
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
|
declare const console: Console;
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
115
|
+
type TypedArray =
|
|
110
116
|
| Int8Array
|
|
111
117
|
| Uint8Array
|
|
112
118
|
| Uint8ClampedArray
|
|
@@ -194,10 +200,11 @@ 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
|
*/
|
|
200
|
-
|
|
207
|
+
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
201
208
|
DOMException: typeof DOMException;
|
|
202
209
|
WorkerGlobalScope: typeof WorkerGlobalScope;
|
|
203
210
|
btoa(data: string): string;
|
|
@@ -218,6 +225,7 @@ declare 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,6 +254,8 @@ declare 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
|
CompressionStream: typeof CompressionStream;
|
|
250
260
|
DecompressionStream: typeof DecompressionStream;
|
|
251
261
|
TextEncoderStream: typeof TextEncoderStream;
|
|
@@ -275,16 +285,16 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
275
285
|
FixedLengthStream: typeof FixedLengthStream;
|
|
276
286
|
IdentityTransformStream: typeof IdentityTransformStream;
|
|
277
287
|
HTMLRewriter: typeof HTMLRewriter;
|
|
278
|
-
GPUAdapter: typeof
|
|
279
|
-
GPUOutOfMemoryError: typeof
|
|
280
|
-
GPUValidationError: typeof
|
|
281
|
-
GPUInternalError: typeof
|
|
282
|
-
GPUDeviceLostInfo: typeof
|
|
283
|
-
GPUBufferUsage: typeof
|
|
284
|
-
GPUShaderStage: typeof
|
|
285
|
-
GPUMapMode: typeof
|
|
286
|
-
GPUTextureUsage: typeof
|
|
287
|
-
GPUColorWrite: typeof
|
|
288
|
+
GPUAdapter: typeof GPUAdapter;
|
|
289
|
+
GPUOutOfMemoryError: typeof GPUOutOfMemoryError;
|
|
290
|
+
GPUValidationError: typeof GPUValidationError;
|
|
291
|
+
GPUInternalError: typeof GPUInternalError;
|
|
292
|
+
GPUDeviceLostInfo: typeof GPUDeviceLostInfo;
|
|
293
|
+
GPUBufferUsage: typeof GPUBufferUsage;
|
|
294
|
+
GPUShaderStage: typeof GPUShaderStage;
|
|
295
|
+
GPUMapMode: typeof GPUMapMode;
|
|
296
|
+
GPUTextureUsage: typeof GPUTextureUsage;
|
|
297
|
+
GPUColorWrite: typeof GPUColorWrite;
|
|
288
298
|
}
|
|
289
299
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
|
|
290
300
|
type: Type,
|
|
@@ -306,93 +316,111 @@ declare function removeEventListener<
|
|
|
306
316
|
declare function dispatchEvent(
|
|
307
317
|
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
|
|
308
318
|
): boolean;
|
|
309
|
-
|
|
319
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
|
310
320
|
declare function btoa(data: string): string;
|
|
311
|
-
|
|
321
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
|
312
322
|
declare function atob(data: string): string;
|
|
313
|
-
|
|
323
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
314
324
|
declare function setTimeout(
|
|
315
325
|
callback: (...args: any[]) => void,
|
|
316
326
|
msDelay?: number,
|
|
317
327
|
): number;
|
|
318
|
-
|
|
328
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
319
329
|
declare function setTimeout<Args extends any[]>(
|
|
320
330
|
callback: (...args: Args) => void,
|
|
321
331
|
msDelay?: number,
|
|
322
332
|
...args: Args
|
|
323
333
|
): number;
|
|
324
|
-
|
|
334
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
|
|
325
335
|
declare function clearTimeout(timeoutId: number | null): void;
|
|
326
|
-
|
|
336
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
327
337
|
declare function setInterval(
|
|
328
338
|
callback: (...args: any[]) => void,
|
|
329
339
|
msDelay?: number,
|
|
330
340
|
): number;
|
|
331
|
-
|
|
341
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
332
342
|
declare function setInterval<Args extends any[]>(
|
|
333
343
|
callback: (...args: Args) => void,
|
|
334
344
|
msDelay?: number,
|
|
335
345
|
...args: Args
|
|
336
346
|
): number;
|
|
337
|
-
|
|
347
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
|
338
348
|
declare function clearInterval(timeoutId: number | null): void;
|
|
339
|
-
|
|
349
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
|
|
340
350
|
declare function queueMicrotask(task: Function): void;
|
|
341
|
-
|
|
351
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
|
|
342
352
|
declare function structuredClone<T>(
|
|
343
353
|
value: T,
|
|
344
354
|
options?: StructuredSerializeOptions,
|
|
345
355
|
): T;
|
|
346
|
-
|
|
356
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/reportError) */
|
|
357
|
+
declare function reportError(error: any): void;
|
|
358
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
|
|
347
359
|
declare function fetch(
|
|
348
360
|
input: RequestInfo,
|
|
349
361
|
init?: RequestInit<RequestInitCfProperties>,
|
|
350
362
|
): Promise<Response>;
|
|
351
363
|
declare const self: ServiceWorkerGlobalScope;
|
|
364
|
+
/**
|
|
365
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
366
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
367
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
368
|
+
* compared to those implemented in most browsers.
|
|
369
|
+
*
|
|
370
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
371
|
+
*/
|
|
352
372
|
declare const crypto: Crypto;
|
|
373
|
+
/**
|
|
374
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
375
|
+
*
|
|
376
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
377
|
+
*/
|
|
353
378
|
declare const caches: CacheStorage;
|
|
354
379
|
declare const scheduler: Scheduler;
|
|
380
|
+
/**
|
|
381
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
382
|
+
* as well as timing of subrequests and other operations.
|
|
383
|
+
*
|
|
384
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
385
|
+
*/
|
|
355
386
|
declare const performance: Performance;
|
|
356
387
|
declare const origin: string;
|
|
357
|
-
|
|
358
|
-
|
|
388
|
+
interface TestController {}
|
|
389
|
+
interface ExecutionContext {
|
|
359
390
|
waitUntil(promise: Promise<any>): void;
|
|
360
391
|
passThroughOnException(): void;
|
|
361
392
|
}
|
|
362
|
-
|
|
363
|
-
Env = unknown,
|
|
364
|
-
CfHostMetadata = unknown,
|
|
365
|
-
> = (
|
|
393
|
+
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (
|
|
366
394
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
367
395
|
env: Env,
|
|
368
396
|
ctx: ExecutionContext,
|
|
369
397
|
) => Response | Promise<Response>;
|
|
370
|
-
|
|
398
|
+
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
371
399
|
events: TraceItem[],
|
|
372
400
|
env: Env,
|
|
373
401
|
ctx: ExecutionContext,
|
|
374
402
|
) => void | Promise<void>;
|
|
375
|
-
|
|
403
|
+
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
376
404
|
traces: TraceItem[],
|
|
377
405
|
env: Env,
|
|
378
406
|
ctx: ExecutionContext,
|
|
379
407
|
) => void | Promise<void>;
|
|
380
|
-
|
|
408
|
+
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
381
409
|
controller: ScheduledController,
|
|
382
410
|
env: Env,
|
|
383
411
|
ctx: ExecutionContext,
|
|
384
412
|
) => void | Promise<void>;
|
|
385
|
-
|
|
413
|
+
type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
|
|
386
414
|
batch: MessageBatch<Message>,
|
|
387
415
|
env: Env,
|
|
388
416
|
ctx: ExecutionContext,
|
|
389
417
|
) => void | Promise<void>;
|
|
390
|
-
|
|
418
|
+
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
391
419
|
controller: TestController,
|
|
392
420
|
env: Env,
|
|
393
421
|
ctx: ExecutionContext,
|
|
394
422
|
) => void | Promise<void>;
|
|
395
|
-
|
|
423
|
+
interface ExportedHandler<
|
|
396
424
|
Env = unknown,
|
|
397
425
|
QueueHandlerMessage = unknown,
|
|
398
426
|
CfHostMetadata = unknown,
|
|
@@ -405,31 +433,33 @@ declare interface ExportedHandler<
|
|
|
405
433
|
email?: EmailExportedHandler<Env>;
|
|
406
434
|
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
407
435
|
}
|
|
408
|
-
|
|
436
|
+
interface StructuredSerializeOptions {
|
|
409
437
|
transfer?: any[];
|
|
410
438
|
}
|
|
439
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
|
|
411
440
|
declare abstract class PromiseRejectionEvent extends Event {
|
|
412
|
-
|
|
441
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
|
|
413
442
|
readonly promise: Promise<any>;
|
|
414
|
-
|
|
443
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
|
|
415
444
|
readonly reason: any;
|
|
416
445
|
}
|
|
417
446
|
/**
|
|
418
|
-
*
|
|
447
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
448
|
+
* as well as timing of subrequests and other operations.
|
|
419
449
|
*
|
|
420
|
-
* [
|
|
450
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
421
451
|
*/
|
|
422
|
-
|
|
423
|
-
|
|
452
|
+
interface Performance {
|
|
453
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
|
|
424
454
|
readonly timeOrigin: number;
|
|
425
|
-
|
|
455
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
426
456
|
now(): number;
|
|
427
457
|
}
|
|
428
|
-
|
|
458
|
+
interface AlarmInvocationInfo {
|
|
429
459
|
readonly isRetry: boolean;
|
|
430
460
|
readonly retryCount: number;
|
|
431
461
|
}
|
|
432
|
-
|
|
462
|
+
interface DurableObject {
|
|
433
463
|
fetch(request: Request): Response | Promise<Response>;
|
|
434
464
|
alarm?(): void | Promise<void>;
|
|
435
465
|
webSocketMessage?(
|
|
@@ -444,7 +474,7 @@ declare interface DurableObject {
|
|
|
444
474
|
): void | Promise<void>;
|
|
445
475
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
446
476
|
}
|
|
447
|
-
|
|
477
|
+
type DurableObjectStub<
|
|
448
478
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
449
479
|
> = Fetcher<
|
|
450
480
|
T,
|
|
@@ -453,12 +483,12 @@ declare type DurableObjectStub<
|
|
|
453
483
|
readonly id: DurableObjectId;
|
|
454
484
|
readonly name?: string;
|
|
455
485
|
};
|
|
456
|
-
|
|
486
|
+
interface DurableObjectId {
|
|
457
487
|
toString(): string;
|
|
458
488
|
equals(other: DurableObjectId): boolean;
|
|
459
489
|
readonly name?: string;
|
|
460
490
|
}
|
|
461
|
-
|
|
491
|
+
interface DurableObjectNamespace<
|
|
462
492
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
463
493
|
> {
|
|
464
494
|
newUniqueId(
|
|
@@ -474,11 +504,11 @@ declare interface DurableObjectNamespace<
|
|
|
474
504
|
jurisdiction: DurableObjectJurisdiction,
|
|
475
505
|
): DurableObjectNamespace<T>;
|
|
476
506
|
}
|
|
477
|
-
|
|
478
|
-
|
|
507
|
+
type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
508
|
+
interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
479
509
|
jurisdiction?: DurableObjectJurisdiction;
|
|
480
510
|
}
|
|
481
|
-
|
|
511
|
+
type DurableObjectLocationHint =
|
|
482
512
|
| "wnam"
|
|
483
513
|
| "enam"
|
|
484
514
|
| "sam"
|
|
@@ -488,10 +518,10 @@ declare type DurableObjectLocationHint =
|
|
|
488
518
|
| "oc"
|
|
489
519
|
| "afr"
|
|
490
520
|
| "me";
|
|
491
|
-
|
|
521
|
+
interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
492
522
|
locationHint?: DurableObjectLocationHint;
|
|
493
523
|
}
|
|
494
|
-
|
|
524
|
+
interface DurableObjectState {
|
|
495
525
|
waitUntil(promise: Promise<any>): void;
|
|
496
526
|
readonly id: DurableObjectId;
|
|
497
527
|
readonly storage: DurableObjectStorage;
|
|
@@ -505,7 +535,7 @@ declare interface DurableObjectState {
|
|
|
505
535
|
getHibernatableWebSocketEventTimeout(): number | null;
|
|
506
536
|
getTags(ws: WebSocket): string[];
|
|
507
537
|
}
|
|
508
|
-
|
|
538
|
+
interface DurableObjectTransaction {
|
|
509
539
|
get<T = unknown>(
|
|
510
540
|
key: string,
|
|
511
541
|
options?: DurableObjectGetOptions,
|
|
@@ -536,7 +566,7 @@ declare interface DurableObjectTransaction {
|
|
|
536
566
|
): Promise<void>;
|
|
537
567
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
538
568
|
}
|
|
539
|
-
|
|
569
|
+
interface DurableObjectStorage {
|
|
540
570
|
get<T = unknown>(
|
|
541
571
|
key: string,
|
|
542
572
|
options?: DurableObjectGetOptions,
|
|
@@ -572,7 +602,7 @@ declare interface DurableObjectStorage {
|
|
|
572
602
|
sync(): Promise<void>;
|
|
573
603
|
transactionSync<T>(closure: () => T): T;
|
|
574
604
|
}
|
|
575
|
-
|
|
605
|
+
interface DurableObjectListOptions {
|
|
576
606
|
start?: string;
|
|
577
607
|
startAfter?: string;
|
|
578
608
|
end?: string;
|
|
@@ -582,19 +612,19 @@ declare interface DurableObjectListOptions {
|
|
|
582
612
|
allowConcurrency?: boolean;
|
|
583
613
|
noCache?: boolean;
|
|
584
614
|
}
|
|
585
|
-
|
|
615
|
+
interface DurableObjectGetOptions {
|
|
586
616
|
allowConcurrency?: boolean;
|
|
587
617
|
noCache?: boolean;
|
|
588
618
|
}
|
|
589
|
-
|
|
619
|
+
interface DurableObjectGetAlarmOptions {
|
|
590
620
|
allowConcurrency?: boolean;
|
|
591
621
|
}
|
|
592
|
-
|
|
622
|
+
interface DurableObjectPutOptions {
|
|
593
623
|
allowConcurrency?: boolean;
|
|
594
624
|
allowUnconfirmed?: boolean;
|
|
595
625
|
noCache?: boolean;
|
|
596
626
|
}
|
|
597
|
-
|
|
627
|
+
interface DurableObjectSetAlarmOptions {
|
|
598
628
|
allowConcurrency?: boolean;
|
|
599
629
|
allowUnconfirmed?: boolean;
|
|
600
630
|
}
|
|
@@ -603,14 +633,19 @@ declare class WebSocketRequestResponsePair {
|
|
|
603
633
|
get request(): string;
|
|
604
634
|
get response(): string;
|
|
605
635
|
}
|
|
606
|
-
|
|
636
|
+
interface AnalyticsEngineDataset {
|
|
607
637
|
writeDataPoint(event?: AnalyticsEngineDataPoint): void;
|
|
608
638
|
}
|
|
609
|
-
|
|
639
|
+
interface AnalyticsEngineDataPoint {
|
|
610
640
|
indexes?: ((ArrayBuffer | string) | null)[];
|
|
611
641
|
doubles?: number[];
|
|
612
642
|
blobs?: ((ArrayBuffer | string) | null)[];
|
|
613
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* An event which takes place in the DOM.
|
|
646
|
+
*
|
|
647
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
|
648
|
+
*/
|
|
614
649
|
declare class Event {
|
|
615
650
|
constructor(type: string, init?: EventInit);
|
|
616
651
|
/**
|
|
@@ -714,20 +749,25 @@ declare class Event {
|
|
|
714
749
|
static readonly AT_TARGET: number;
|
|
715
750
|
static readonly BUBBLING_PHASE: number;
|
|
716
751
|
}
|
|
717
|
-
|
|
752
|
+
interface EventInit {
|
|
718
753
|
bubbles?: boolean;
|
|
719
754
|
cancelable?: boolean;
|
|
720
755
|
composed?: boolean;
|
|
721
756
|
}
|
|
722
|
-
|
|
757
|
+
type EventListener<EventType extends Event = Event> = (
|
|
723
758
|
event: EventType,
|
|
724
759
|
) => void;
|
|
725
|
-
|
|
760
|
+
interface EventListenerObject<EventType extends Event = Event> {
|
|
726
761
|
handleEvent(event: EventType): void;
|
|
727
762
|
}
|
|
728
|
-
|
|
729
|
-
EventType
|
|
730
|
-
|
|
763
|
+
type EventListenerOrEventListenerObject<EventType extends Event = Event> =
|
|
764
|
+
| EventListener<EventType>
|
|
765
|
+
| EventListenerObject<EventType>;
|
|
766
|
+
/**
|
|
767
|
+
* EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
|
|
768
|
+
*
|
|
769
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
|
770
|
+
*/
|
|
731
771
|
declare class EventTarget<
|
|
732
772
|
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
733
773
|
> {
|
|
@@ -771,18 +811,23 @@ declare class EventTarget<
|
|
|
771
811
|
*/
|
|
772
812
|
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
|
|
773
813
|
}
|
|
774
|
-
|
|
814
|
+
interface EventTargetEventListenerOptions {
|
|
775
815
|
capture?: boolean;
|
|
776
816
|
}
|
|
777
|
-
|
|
817
|
+
interface EventTargetAddEventListenerOptions {
|
|
778
818
|
capture?: boolean;
|
|
779
819
|
passive?: boolean;
|
|
780
820
|
once?: boolean;
|
|
781
821
|
signal?: AbortSignal;
|
|
782
822
|
}
|
|
783
|
-
|
|
823
|
+
interface EventTargetHandlerObject {
|
|
784
824
|
handleEvent: (event: Event) => any | undefined;
|
|
785
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* A controller object that allows you to abort one or more DOM requests as and when desired.
|
|
828
|
+
*
|
|
829
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
|
|
830
|
+
*/
|
|
786
831
|
declare class AbortController {
|
|
787
832
|
constructor();
|
|
788
833
|
/**
|
|
@@ -798,11 +843,17 @@ declare class AbortController {
|
|
|
798
843
|
*/
|
|
799
844
|
abort(reason?: any): void;
|
|
800
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* 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.
|
|
848
|
+
*
|
|
849
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
|
|
850
|
+
*/
|
|
801
851
|
declare abstract class AbortSignal extends EventTarget {
|
|
802
|
-
|
|
852
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
803
853
|
static abort(reason?: any): AbortSignal;
|
|
804
|
-
|
|
854
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
805
855
|
static timeout(delay: number): AbortSignal;
|
|
856
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
|
|
806
857
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
807
858
|
/**
|
|
808
859
|
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
@@ -810,25 +861,31 @@ declare abstract class AbortSignal extends EventTarget {
|
|
|
810
861
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
811
862
|
*/
|
|
812
863
|
readonly aborted: boolean;
|
|
813
|
-
|
|
864
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
814
865
|
readonly reason: any;
|
|
815
|
-
|
|
866
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
816
867
|
get onabort(): any | null;
|
|
817
|
-
|
|
868
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
818
869
|
set onabort(value: any | null);
|
|
819
|
-
|
|
870
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
820
871
|
throwIfAborted(): void;
|
|
821
872
|
}
|
|
822
|
-
|
|
873
|
+
interface Scheduler {
|
|
823
874
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
|
824
875
|
}
|
|
825
|
-
|
|
876
|
+
interface SchedulerWaitOptions {
|
|
826
877
|
signal?: AbortSignal;
|
|
827
878
|
}
|
|
879
|
+
/**
|
|
880
|
+
* 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.
|
|
881
|
+
*
|
|
882
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
|
883
|
+
*/
|
|
828
884
|
declare abstract class ExtendableEvent extends Event {
|
|
829
|
-
|
|
885
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
830
886
|
waitUntil(promise: Promise<any>): void;
|
|
831
887
|
}
|
|
888
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
|
|
832
889
|
declare class CustomEvent<T = any> extends Event {
|
|
833
890
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
834
891
|
/**
|
|
@@ -838,64 +895,96 @@ declare class CustomEvent<T = any> extends Event {
|
|
|
838
895
|
*/
|
|
839
896
|
get detail(): T;
|
|
840
897
|
}
|
|
841
|
-
|
|
898
|
+
interface CustomEventCustomEventInit {
|
|
842
899
|
bubbles?: boolean;
|
|
843
900
|
cancelable?: boolean;
|
|
844
901
|
composed?: boolean;
|
|
845
902
|
detail?: any;
|
|
846
903
|
}
|
|
904
|
+
/**
|
|
905
|
+
* 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.
|
|
906
|
+
*
|
|
907
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
|
|
908
|
+
*/
|
|
847
909
|
declare class Blob {
|
|
848
910
|
constructor(
|
|
849
|
-
|
|
911
|
+
type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
850
912
|
options?: BlobOptions,
|
|
851
913
|
);
|
|
852
|
-
|
|
914
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
853
915
|
readonly size: number;
|
|
854
|
-
|
|
916
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
855
917
|
readonly type: string;
|
|
856
|
-
|
|
918
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
857
919
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
858
|
-
|
|
920
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
859
921
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
860
|
-
|
|
922
|
+
bytes(): Promise<Uint8Array>;
|
|
923
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
861
924
|
text(): Promise<string>;
|
|
862
|
-
|
|
925
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
863
926
|
stream(): ReadableStream;
|
|
864
927
|
}
|
|
865
|
-
|
|
928
|
+
interface BlobOptions {
|
|
866
929
|
type?: string;
|
|
867
930
|
}
|
|
931
|
+
/**
|
|
932
|
+
* Provides information about files and allows JavaScript in a web page to access their content.
|
|
933
|
+
*
|
|
934
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
|
|
935
|
+
*/
|
|
868
936
|
declare class File extends Blob {
|
|
869
937
|
constructor(
|
|
870
938
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
871
939
|
name: string,
|
|
872
940
|
options?: FileOptions,
|
|
873
941
|
);
|
|
874
|
-
|
|
942
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
875
943
|
readonly name: string;
|
|
876
|
-
|
|
944
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
877
945
|
readonly lastModified: number;
|
|
878
946
|
}
|
|
879
|
-
|
|
947
|
+
interface FileOptions {
|
|
880
948
|
type?: string;
|
|
881
949
|
lastModified?: number;
|
|
882
950
|
}
|
|
951
|
+
/**
|
|
952
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
953
|
+
*
|
|
954
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
955
|
+
*/
|
|
883
956
|
declare abstract class CacheStorage {
|
|
884
|
-
|
|
957
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
885
958
|
open(cacheName: string): Promise<Cache>;
|
|
886
959
|
readonly default: Cache;
|
|
887
960
|
}
|
|
961
|
+
/**
|
|
962
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
963
|
+
*
|
|
964
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
965
|
+
*/
|
|
888
966
|
declare abstract class Cache {
|
|
967
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
|
|
889
968
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
969
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
|
|
890
970
|
match(
|
|
891
971
|
request: RequestInfo,
|
|
892
972
|
options?: CacheQueryOptions,
|
|
893
973
|
): Promise<Response | undefined>;
|
|
974
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
|
|
894
975
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
895
976
|
}
|
|
896
|
-
|
|
977
|
+
interface CacheQueryOptions {
|
|
897
978
|
ignoreMethod?: boolean;
|
|
898
979
|
}
|
|
980
|
+
/**
|
|
981
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
982
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
983
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
984
|
+
* compared to those implemented in most browsers.
|
|
985
|
+
*
|
|
986
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
987
|
+
*/
|
|
899
988
|
declare abstract class Crypto {
|
|
900
989
|
/**
|
|
901
990
|
* Available only in secure contexts.
|
|
@@ -903,7 +992,7 @@ declare abstract class Crypto {
|
|
|
903
992
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
904
993
|
*/
|
|
905
994
|
readonly subtle: SubtleCrypto;
|
|
906
|
-
|
|
995
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
907
996
|
getRandomValues<
|
|
908
997
|
T extends
|
|
909
998
|
| Int8Array
|
|
@@ -923,39 +1012,50 @@ declare abstract class Crypto {
|
|
|
923
1012
|
randomUUID(): string;
|
|
924
1013
|
DigestStream: typeof DigestStream;
|
|
925
1014
|
}
|
|
1015
|
+
/**
|
|
1016
|
+
* 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).
|
|
1017
|
+
* Available only in secure contexts.
|
|
1018
|
+
*
|
|
1019
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
|
|
1020
|
+
*/
|
|
926
1021
|
declare abstract class SubtleCrypto {
|
|
1022
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
|
|
927
1023
|
encrypt(
|
|
928
1024
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
929
1025
|
key: CryptoKey,
|
|
930
1026
|
plainText: ArrayBuffer | ArrayBufferView,
|
|
931
1027
|
): Promise<ArrayBuffer>;
|
|
1028
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
|
|
932
1029
|
decrypt(
|
|
933
1030
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
934
1031
|
key: CryptoKey,
|
|
935
1032
|
cipherText: ArrayBuffer | ArrayBufferView,
|
|
936
1033
|
): Promise<ArrayBuffer>;
|
|
1034
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
|
|
937
1035
|
sign(
|
|
938
1036
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
939
1037
|
key: CryptoKey,
|
|
940
1038
|
data: ArrayBuffer | ArrayBufferView,
|
|
941
1039
|
): Promise<ArrayBuffer>;
|
|
1040
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
|
|
942
1041
|
verify(
|
|
943
1042
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
944
1043
|
key: CryptoKey,
|
|
945
1044
|
signature: ArrayBuffer | ArrayBufferView,
|
|
946
1045
|
data: ArrayBuffer | ArrayBufferView,
|
|
947
1046
|
): Promise<boolean>;
|
|
1047
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
|
|
948
1048
|
digest(
|
|
949
1049
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
950
1050
|
data: ArrayBuffer | ArrayBufferView,
|
|
951
1051
|
): Promise<ArrayBuffer>;
|
|
952
|
-
|
|
1052
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
953
1053
|
generateKey(
|
|
954
1054
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
955
1055
|
extractable: boolean,
|
|
956
1056
|
keyUsages: string[],
|
|
957
1057
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
958
|
-
|
|
1058
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
959
1059
|
deriveKey(
|
|
960
1060
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
961
1061
|
baseKey: CryptoKey,
|
|
@@ -963,12 +1063,13 @@ declare abstract class SubtleCrypto {
|
|
|
963
1063
|
extractable: boolean,
|
|
964
1064
|
keyUsages: string[],
|
|
965
1065
|
): Promise<CryptoKey>;
|
|
1066
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
|
|
966
1067
|
deriveBits(
|
|
967
1068
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
968
1069
|
baseKey: CryptoKey,
|
|
969
|
-
length
|
|
1070
|
+
length?: number | null,
|
|
970
1071
|
): Promise<ArrayBuffer>;
|
|
971
|
-
|
|
1072
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
972
1073
|
importKey(
|
|
973
1074
|
format: string,
|
|
974
1075
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
@@ -976,14 +1077,16 @@ declare abstract class SubtleCrypto {
|
|
|
976
1077
|
extractable: boolean,
|
|
977
1078
|
keyUsages: string[],
|
|
978
1079
|
): Promise<CryptoKey>;
|
|
1080
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
|
|
979
1081
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
1082
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
|
|
980
1083
|
wrapKey(
|
|
981
1084
|
format: string,
|
|
982
1085
|
key: CryptoKey,
|
|
983
1086
|
wrappingKey: CryptoKey,
|
|
984
1087
|
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
985
1088
|
): Promise<ArrayBuffer>;
|
|
986
|
-
|
|
1089
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
987
1090
|
unwrapKey(
|
|
988
1091
|
format: string,
|
|
989
1092
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -998,12 +1101,18 @@ declare abstract class SubtleCrypto {
|
|
|
998
1101
|
b: ArrayBuffer | ArrayBufferView,
|
|
999
1102
|
): boolean;
|
|
1000
1103
|
}
|
|
1104
|
+
/**
|
|
1105
|
+
* The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
|
|
1106
|
+
* Available only in secure contexts.
|
|
1107
|
+
*
|
|
1108
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
|
1109
|
+
*/
|
|
1001
1110
|
declare abstract class CryptoKey {
|
|
1002
|
-
|
|
1111
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
1003
1112
|
readonly type: string;
|
|
1004
|
-
|
|
1113
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
1005
1114
|
readonly extractable: boolean;
|
|
1006
|
-
|
|
1115
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
1007
1116
|
readonly algorithm:
|
|
1008
1117
|
| CryptoKeyKeyAlgorithm
|
|
1009
1118
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -1011,14 +1120,14 @@ declare abstract class CryptoKey {
|
|
|
1011
1120
|
| CryptoKeyRsaKeyAlgorithm
|
|
1012
1121
|
| CryptoKeyEllipticKeyAlgorithm
|
|
1013
1122
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1014
|
-
|
|
1123
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
1015
1124
|
readonly usages: string[];
|
|
1016
1125
|
}
|
|
1017
|
-
|
|
1126
|
+
interface CryptoKeyPair {
|
|
1018
1127
|
publicKey: CryptoKey;
|
|
1019
1128
|
privateKey: CryptoKey;
|
|
1020
1129
|
}
|
|
1021
|
-
|
|
1130
|
+
interface JsonWebKey {
|
|
1022
1131
|
kty: string;
|
|
1023
1132
|
use?: string;
|
|
1024
1133
|
key_ops?: string[];
|
|
@@ -1038,12 +1147,12 @@ declare interface JsonWebKey {
|
|
|
1038
1147
|
oth?: RsaOtherPrimesInfo[];
|
|
1039
1148
|
k?: string;
|
|
1040
1149
|
}
|
|
1041
|
-
|
|
1150
|
+
interface RsaOtherPrimesInfo {
|
|
1042
1151
|
r?: string;
|
|
1043
1152
|
d?: string;
|
|
1044
1153
|
t?: string;
|
|
1045
1154
|
}
|
|
1046
|
-
|
|
1155
|
+
interface SubtleCryptoDeriveKeyAlgorithm {
|
|
1047
1156
|
name: string;
|
|
1048
1157
|
salt?: ArrayBuffer;
|
|
1049
1158
|
iterations?: number;
|
|
@@ -1051,7 +1160,7 @@ declare interface SubtleCryptoDeriveKeyAlgorithm {
|
|
|
1051
1160
|
$public?: CryptoKey;
|
|
1052
1161
|
info?: ArrayBuffer;
|
|
1053
1162
|
}
|
|
1054
|
-
|
|
1163
|
+
interface SubtleCryptoEncryptAlgorithm {
|
|
1055
1164
|
name: string;
|
|
1056
1165
|
iv?: ArrayBuffer;
|
|
1057
1166
|
additionalData?: ArrayBuffer;
|
|
@@ -1060,7 +1169,7 @@ declare interface SubtleCryptoEncryptAlgorithm {
|
|
|
1060
1169
|
length?: number;
|
|
1061
1170
|
label?: ArrayBuffer;
|
|
1062
1171
|
}
|
|
1063
|
-
|
|
1172
|
+
interface SubtleCryptoGenerateKeyAlgorithm {
|
|
1064
1173
|
name: string;
|
|
1065
1174
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1066
1175
|
modulusLength?: number;
|
|
@@ -1068,45 +1177,45 @@ declare interface SubtleCryptoGenerateKeyAlgorithm {
|
|
|
1068
1177
|
length?: number;
|
|
1069
1178
|
namedCurve?: string;
|
|
1070
1179
|
}
|
|
1071
|
-
|
|
1180
|
+
interface SubtleCryptoHashAlgorithm {
|
|
1072
1181
|
name: string;
|
|
1073
1182
|
}
|
|
1074
|
-
|
|
1183
|
+
interface SubtleCryptoImportKeyAlgorithm {
|
|
1075
1184
|
name: string;
|
|
1076
1185
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1077
1186
|
length?: number;
|
|
1078
1187
|
namedCurve?: string;
|
|
1079
1188
|
compressed?: boolean;
|
|
1080
1189
|
}
|
|
1081
|
-
|
|
1190
|
+
interface SubtleCryptoSignAlgorithm {
|
|
1082
1191
|
name: string;
|
|
1083
1192
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1084
1193
|
dataLength?: number;
|
|
1085
1194
|
saltLength?: number;
|
|
1086
1195
|
}
|
|
1087
|
-
|
|
1196
|
+
interface CryptoKeyKeyAlgorithm {
|
|
1088
1197
|
name: string;
|
|
1089
1198
|
}
|
|
1090
|
-
|
|
1199
|
+
interface CryptoKeyAesKeyAlgorithm {
|
|
1091
1200
|
name: string;
|
|
1092
1201
|
length: number;
|
|
1093
1202
|
}
|
|
1094
|
-
|
|
1203
|
+
interface CryptoKeyHmacKeyAlgorithm {
|
|
1095
1204
|
name: string;
|
|
1096
1205
|
hash: CryptoKeyKeyAlgorithm;
|
|
1097
1206
|
length: number;
|
|
1098
1207
|
}
|
|
1099
|
-
|
|
1208
|
+
interface CryptoKeyRsaKeyAlgorithm {
|
|
1100
1209
|
name: string;
|
|
1101
1210
|
modulusLength: number;
|
|
1102
1211
|
publicExponent: ArrayBuffer | (ArrayBuffer | ArrayBufferView);
|
|
1103
1212
|
hash?: CryptoKeyKeyAlgorithm;
|
|
1104
1213
|
}
|
|
1105
|
-
|
|
1214
|
+
interface CryptoKeyEllipticKeyAlgorithm {
|
|
1106
1215
|
name: string;
|
|
1107
1216
|
namedCurve: string;
|
|
1108
1217
|
}
|
|
1109
|
-
|
|
1218
|
+
interface CryptoKeyArbitraryKeyAlgorithm {
|
|
1110
1219
|
name: string;
|
|
1111
1220
|
hash?: CryptoKeyKeyAlgorithm;
|
|
1112
1221
|
namedCurve?: string;
|
|
@@ -1117,7 +1226,13 @@ declare class DigestStream extends WritableStream<
|
|
|
1117
1226
|
> {
|
|
1118
1227
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
|
1119
1228
|
readonly digest: Promise<ArrayBuffer>;
|
|
1229
|
+
get bytesWritten(): number | bigint;
|
|
1120
1230
|
}
|
|
1231
|
+
/**
|
|
1232
|
+
* 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.
|
|
1233
|
+
*
|
|
1234
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
|
1235
|
+
*/
|
|
1121
1236
|
declare class TextDecoder {
|
|
1122
1237
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1123
1238
|
/**
|
|
@@ -1143,6 +1258,11 @@ declare class TextDecoder {
|
|
|
1143
1258
|
readonly fatal: boolean;
|
|
1144
1259
|
readonly ignoreBOM: boolean;
|
|
1145
1260
|
}
|
|
1261
|
+
/**
|
|
1262
|
+
* 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.
|
|
1263
|
+
*
|
|
1264
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
|
1265
|
+
*/
|
|
1146
1266
|
declare class TextEncoder {
|
|
1147
1267
|
constructor();
|
|
1148
1268
|
/**
|
|
@@ -1162,32 +1282,70 @@ declare class TextEncoder {
|
|
|
1162
1282
|
): TextEncoderEncodeIntoResult;
|
|
1163
1283
|
readonly encoding: string;
|
|
1164
1284
|
}
|
|
1165
|
-
|
|
1285
|
+
interface TextDecoderConstructorOptions {
|
|
1166
1286
|
fatal: boolean;
|
|
1167
1287
|
ignoreBOM: boolean;
|
|
1168
1288
|
}
|
|
1169
|
-
|
|
1289
|
+
interface TextDecoderDecodeOptions {
|
|
1170
1290
|
stream: boolean;
|
|
1171
1291
|
}
|
|
1172
|
-
|
|
1292
|
+
interface TextEncoderEncodeIntoResult {
|
|
1173
1293
|
read: number;
|
|
1174
1294
|
written: number;
|
|
1175
1295
|
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Events providing information related to errors in scripts or in files.
|
|
1298
|
+
*
|
|
1299
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
1300
|
+
*/
|
|
1301
|
+
declare class ErrorEvent extends Event {
|
|
1302
|
+
constructor(type: string, init?: ErrorEventErrorEventInit);
|
|
1303
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1304
|
+
get filename(): string;
|
|
1305
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1306
|
+
get message(): string;
|
|
1307
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1308
|
+
get lineno(): number;
|
|
1309
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1310
|
+
get colno(): number;
|
|
1311
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1312
|
+
get error(): any;
|
|
1313
|
+
}
|
|
1314
|
+
interface ErrorEventErrorEventInit {
|
|
1315
|
+
message?: string;
|
|
1316
|
+
filename?: string;
|
|
1317
|
+
lineno?: number;
|
|
1318
|
+
colno?: number;
|
|
1319
|
+
error?: any;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* 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".
|
|
1323
|
+
*
|
|
1324
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
|
1325
|
+
*/
|
|
1176
1326
|
declare class FormData {
|
|
1177
1327
|
constructor();
|
|
1328
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1178
1329
|
append(name: string, value: string): void;
|
|
1330
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1179
1331
|
append(name: string, value: Blob, filename?: string): void;
|
|
1332
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
|
|
1180
1333
|
delete(name: string): void;
|
|
1334
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
|
|
1181
1335
|
get(name: string): (File | string) | null;
|
|
1336
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
|
|
1182
1337
|
getAll(name: string): (File | string)[];
|
|
1338
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
|
|
1183
1339
|
has(name: string): boolean;
|
|
1340
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1184
1341
|
set(name: string, value: string): void;
|
|
1342
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1185
1343
|
set(name: string, value: Blob, filename?: string): void;
|
|
1186
|
-
|
|
1344
|
+
/* Returns an array of key, value pairs for every entry in the list. */
|
|
1187
1345
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1188
|
-
|
|
1346
|
+
/* Returns a list of keys in the list. */
|
|
1189
1347
|
keys(): IterableIterator<string>;
|
|
1190
|
-
|
|
1348
|
+
/* Returns a list of values in the list. */
|
|
1191
1349
|
values(): IterableIterator<File | string>;
|
|
1192
1350
|
forEach<This = unknown>(
|
|
1193
1351
|
callback: (
|
|
@@ -1200,7 +1358,7 @@ declare class FormData {
|
|
|
1200
1358
|
): void;
|
|
1201
1359
|
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
|
|
1202
1360
|
}
|
|
1203
|
-
|
|
1361
|
+
interface ContentOptions {
|
|
1204
1362
|
html?: boolean;
|
|
1205
1363
|
}
|
|
1206
1364
|
declare class HTMLRewriter {
|
|
@@ -1212,23 +1370,23 @@ declare class HTMLRewriter {
|
|
|
1212
1370
|
onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
|
|
1213
1371
|
transform(response: Response): Response;
|
|
1214
1372
|
}
|
|
1215
|
-
|
|
1373
|
+
interface HTMLRewriterElementContentHandlers {
|
|
1216
1374
|
element?(element: Element): void | Promise<void>;
|
|
1217
1375
|
comments?(comment: Comment): void | Promise<void>;
|
|
1218
1376
|
text?(element: Text): void | Promise<void>;
|
|
1219
1377
|
}
|
|
1220
|
-
|
|
1378
|
+
interface HTMLRewriterDocumentContentHandlers {
|
|
1221
1379
|
doctype?(doctype: Doctype): void | Promise<void>;
|
|
1222
1380
|
comments?(comment: Comment): void | Promise<void>;
|
|
1223
1381
|
text?(text: Text): void | Promise<void>;
|
|
1224
1382
|
end?(end: DocumentEnd): void | Promise<void>;
|
|
1225
1383
|
}
|
|
1226
|
-
|
|
1384
|
+
interface Doctype {
|
|
1227
1385
|
readonly name: string | null;
|
|
1228
1386
|
readonly publicId: string | null;
|
|
1229
1387
|
readonly systemId: string | null;
|
|
1230
1388
|
}
|
|
1231
|
-
|
|
1389
|
+
interface Element {
|
|
1232
1390
|
tagName: string;
|
|
1233
1391
|
readonly attributes: IterableIterator<string[]>;
|
|
1234
1392
|
readonly removed: boolean;
|
|
@@ -1247,13 +1405,13 @@ declare interface Element {
|
|
|
1247
1405
|
setInnerContent(content: string, options?: ContentOptions): Element;
|
|
1248
1406
|
onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
|
|
1249
1407
|
}
|
|
1250
|
-
|
|
1408
|
+
interface EndTag {
|
|
1251
1409
|
name: string;
|
|
1252
1410
|
before(content: string, options?: ContentOptions): EndTag;
|
|
1253
1411
|
after(content: string, options?: ContentOptions): EndTag;
|
|
1254
1412
|
remove(): EndTag;
|
|
1255
1413
|
}
|
|
1256
|
-
|
|
1414
|
+
interface Comment {
|
|
1257
1415
|
text: string;
|
|
1258
1416
|
readonly removed: boolean;
|
|
1259
1417
|
before(content: string, options?: ContentOptions): Comment;
|
|
@@ -1261,7 +1419,7 @@ declare interface Comment {
|
|
|
1261
1419
|
replace(content: string, options?: ContentOptions): Comment;
|
|
1262
1420
|
remove(): Comment;
|
|
1263
1421
|
}
|
|
1264
|
-
|
|
1422
|
+
interface Text {
|
|
1265
1423
|
readonly text: string;
|
|
1266
1424
|
readonly lastInTextNode: boolean;
|
|
1267
1425
|
readonly removed: boolean;
|
|
@@ -1270,41 +1428,56 @@ declare interface Text {
|
|
|
1270
1428
|
replace(content: string, options?: ContentOptions): Text;
|
|
1271
1429
|
remove(): Text;
|
|
1272
1430
|
}
|
|
1273
|
-
|
|
1431
|
+
interface DocumentEnd {
|
|
1274
1432
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
1275
1433
|
}
|
|
1434
|
+
/**
|
|
1435
|
+
* 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.
|
|
1436
|
+
*
|
|
1437
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
|
1438
|
+
*/
|
|
1276
1439
|
declare abstract class FetchEvent extends ExtendableEvent {
|
|
1277
|
-
|
|
1440
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
1278
1441
|
readonly request: Request;
|
|
1279
|
-
|
|
1442
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
1280
1443
|
respondWith(promise: Response | Promise<Response>): void;
|
|
1281
1444
|
passThroughOnException(): void;
|
|
1282
1445
|
}
|
|
1283
|
-
|
|
1446
|
+
type HeadersInit =
|
|
1284
1447
|
| Headers
|
|
1285
1448
|
| Iterable<Iterable<string>>
|
|
1286
1449
|
| Record<string, string>;
|
|
1450
|
+
/**
|
|
1451
|
+
* 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.
|
|
1452
|
+
*
|
|
1453
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
1454
|
+
*/
|
|
1287
1455
|
declare class Headers {
|
|
1288
1456
|
constructor(init?: HeadersInit);
|
|
1457
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
|
|
1289
1458
|
get(name: string): string | null;
|
|
1290
1459
|
getAll(name: string): string[];
|
|
1460
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
|
|
1291
1461
|
has(name: string): boolean;
|
|
1462
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
|
|
1292
1463
|
set(name: string, value: string): void;
|
|
1464
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
|
|
1293
1465
|
append(name: string, value: string): void;
|
|
1466
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
|
|
1294
1467
|
delete(name: string): void;
|
|
1295
1468
|
forEach<This = unknown>(
|
|
1296
1469
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
1297
1470
|
thisArg?: This,
|
|
1298
1471
|
): void;
|
|
1299
|
-
|
|
1472
|
+
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
1300
1473
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1301
|
-
|
|
1474
|
+
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
1302
1475
|
keys(): IterableIterator<string>;
|
|
1303
|
-
|
|
1476
|
+
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
1304
1477
|
values(): IterableIterator<string>;
|
|
1305
1478
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1306
1479
|
}
|
|
1307
|
-
|
|
1480
|
+
type BodyInit =
|
|
1308
1481
|
| ReadableStream<Uint8Array>
|
|
1309
1482
|
| string
|
|
1310
1483
|
| ArrayBuffer
|
|
@@ -1313,38 +1486,51 @@ declare type BodyInit =
|
|
|
1313
1486
|
| URLSearchParams
|
|
1314
1487
|
| FormData;
|
|
1315
1488
|
declare abstract class Body {
|
|
1489
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
|
1316
1490
|
readonly body: ReadableStream | null;
|
|
1491
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
1317
1492
|
readonly bodyUsed: boolean;
|
|
1493
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
1318
1494
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1495
|
+
bytes(): Promise<Uint8Array>;
|
|
1496
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
|
|
1319
1497
|
text(): Promise<string>;
|
|
1498
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
|
|
1320
1499
|
json<T>(): Promise<T>;
|
|
1500
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
|
|
1321
1501
|
formData(): Promise<FormData>;
|
|
1502
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
1322
1503
|
blob(): Promise<Blob>;
|
|
1323
1504
|
}
|
|
1505
|
+
/**
|
|
1506
|
+
* This Fetch API interface represents the response to a request.
|
|
1507
|
+
*
|
|
1508
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1509
|
+
*/
|
|
1324
1510
|
declare class Response extends Body {
|
|
1325
1511
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1326
|
-
|
|
1512
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1327
1513
|
static redirect(url: string, status?: number): Response;
|
|
1328
|
-
|
|
1514
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1329
1515
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1330
|
-
|
|
1516
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1331
1517
|
clone(): Response;
|
|
1332
|
-
|
|
1518
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1333
1519
|
readonly status: number;
|
|
1334
|
-
|
|
1520
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1335
1521
|
readonly statusText: string;
|
|
1336
|
-
|
|
1522
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1337
1523
|
readonly headers: Headers;
|
|
1338
|
-
|
|
1524
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1339
1525
|
readonly ok: boolean;
|
|
1340
|
-
|
|
1526
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1341
1527
|
readonly redirected: boolean;
|
|
1342
|
-
|
|
1528
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1343
1529
|
readonly url: string;
|
|
1344
1530
|
readonly webSocket: WebSocket | null;
|
|
1345
1531
|
readonly cf?: any;
|
|
1346
1532
|
}
|
|
1347
|
-
|
|
1533
|
+
interface ResponseInit {
|
|
1348
1534
|
status?: number;
|
|
1349
1535
|
statusText?: string;
|
|
1350
1536
|
headers?: HeadersInit;
|
|
@@ -1352,16 +1538,21 @@ declare interface ResponseInit {
|
|
|
1352
1538
|
webSocket?: WebSocket | null;
|
|
1353
1539
|
encodeBody?: "automatic" | "manual";
|
|
1354
1540
|
}
|
|
1355
|
-
|
|
1356
|
-
CfHostMetadata
|
|
1357
|
-
|
|
1358
|
-
|
|
1541
|
+
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
1542
|
+
| Request<CfHostMetadata, Cf>
|
|
1543
|
+
| string
|
|
1544
|
+
| URL;
|
|
1545
|
+
/**
|
|
1546
|
+
* This Fetch API interface represents a resource request.
|
|
1547
|
+
*
|
|
1548
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1549
|
+
*/
|
|
1359
1550
|
declare class Request<
|
|
1360
1551
|
CfHostMetadata = unknown,
|
|
1361
1552
|
Cf = CfProperties<CfHostMetadata>,
|
|
1362
1553
|
> extends Body {
|
|
1363
1554
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1364
|
-
|
|
1555
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1365
1556
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1366
1557
|
/**
|
|
1367
1558
|
* Returns request's HTTP method, which is "GET" by default.
|
|
@@ -1408,26 +1599,25 @@ declare class Request<
|
|
|
1408
1599
|
*/
|
|
1409
1600
|
readonly keepalive: boolean;
|
|
1410
1601
|
}
|
|
1411
|
-
|
|
1412
|
-
|
|
1602
|
+
interface RequestInit<Cf = CfProperties> {
|
|
1603
|
+
/* A string to set request's method. */
|
|
1413
1604
|
method?: string;
|
|
1414
|
-
|
|
1605
|
+
/* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
|
|
1415
1606
|
headers?: HeadersInit;
|
|
1416
|
-
|
|
1607
|
+
/* A BodyInit object or null to set request's body. */
|
|
1417
1608
|
body?: BodyInit | null;
|
|
1418
|
-
|
|
1609
|
+
/* 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. */
|
|
1419
1610
|
redirect?: string;
|
|
1420
1611
|
fetcher?: Fetcher | null;
|
|
1421
1612
|
cf?: Cf;
|
|
1422
|
-
|
|
1613
|
+
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1423
1614
|
integrity?: string;
|
|
1424
|
-
|
|
1615
|
+
/* An AbortSignal to set request's signal. */
|
|
1425
1616
|
signal?: AbortSignal | null;
|
|
1426
1617
|
}
|
|
1427
|
-
|
|
1428
|
-
T
|
|
1429
|
-
|
|
1430
|
-
declare type Fetcher<
|
|
1618
|
+
type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> =
|
|
1619
|
+
Fetcher<T>;
|
|
1620
|
+
type Fetcher<
|
|
1431
1621
|
T extends Rpc.EntrypointBranded | undefined = undefined,
|
|
1432
1622
|
Reserved extends string = never,
|
|
1433
1623
|
> = (T extends Rpc.EntrypointBranded
|
|
@@ -1436,16 +1626,16 @@ declare type Fetcher<
|
|
|
1436
1626
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1437
1627
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1438
1628
|
};
|
|
1439
|
-
|
|
1629
|
+
interface FetcherPutOptions {
|
|
1440
1630
|
expiration?: number;
|
|
1441
1631
|
expirationTtl?: number;
|
|
1442
1632
|
}
|
|
1443
|
-
|
|
1633
|
+
interface KVNamespaceListKey<Metadata, Key extends string = string> {
|
|
1444
1634
|
name: Key;
|
|
1445
1635
|
expiration?: number;
|
|
1446
1636
|
metadata?: Metadata;
|
|
1447
1637
|
}
|
|
1448
|
-
|
|
1638
|
+
type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
1449
1639
|
| {
|
|
1450
1640
|
list_complete: false;
|
|
1451
1641
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
@@ -1457,7 +1647,7 @@ declare type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
|
1457
1647
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
1458
1648
|
cacheStatus: string | null;
|
|
1459
1649
|
};
|
|
1460
|
-
|
|
1650
|
+
interface KVNamespace<Key extends string = string> {
|
|
1461
1651
|
get(
|
|
1462
1652
|
key: Key,
|
|
1463
1653
|
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
@@ -1531,49 +1721,49 @@ declare interface KVNamespace<Key extends string = string> {
|
|
|
1531
1721
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1532
1722
|
delete(key: Key): Promise<void>;
|
|
1533
1723
|
}
|
|
1534
|
-
|
|
1724
|
+
interface KVNamespaceListOptions {
|
|
1535
1725
|
limit?: number;
|
|
1536
1726
|
prefix?: string | null;
|
|
1537
1727
|
cursor?: string | null;
|
|
1538
1728
|
}
|
|
1539
|
-
|
|
1729
|
+
interface KVNamespaceGetOptions<Type> {
|
|
1540
1730
|
type: Type;
|
|
1541
1731
|
cacheTtl?: number;
|
|
1542
1732
|
}
|
|
1543
|
-
|
|
1733
|
+
interface KVNamespacePutOptions {
|
|
1544
1734
|
expiration?: number;
|
|
1545
1735
|
expirationTtl?: number;
|
|
1546
1736
|
metadata?: any | null;
|
|
1547
1737
|
}
|
|
1548
|
-
|
|
1738
|
+
interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
1549
1739
|
value: Value | null;
|
|
1550
1740
|
metadata: Metadata | null;
|
|
1551
1741
|
cacheStatus: string | null;
|
|
1552
1742
|
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1743
|
+
type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1744
|
+
interface Queue<Body = unknown> {
|
|
1555
1745
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1556
1746
|
sendBatch(
|
|
1557
1747
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
1558
1748
|
options?: QueueSendBatchOptions,
|
|
1559
1749
|
): Promise<void>;
|
|
1560
1750
|
}
|
|
1561
|
-
|
|
1751
|
+
interface QueueSendOptions {
|
|
1562
1752
|
contentType?: QueueContentType;
|
|
1563
1753
|
delaySeconds?: number;
|
|
1564
1754
|
}
|
|
1565
|
-
|
|
1755
|
+
interface QueueSendBatchOptions {
|
|
1566
1756
|
delaySeconds?: number;
|
|
1567
1757
|
}
|
|
1568
|
-
|
|
1758
|
+
interface MessageSendRequest<Body = unknown> {
|
|
1569
1759
|
body: Body;
|
|
1570
1760
|
contentType?: QueueContentType;
|
|
1571
1761
|
delaySeconds?: number;
|
|
1572
1762
|
}
|
|
1573
|
-
|
|
1763
|
+
interface QueueRetryOptions {
|
|
1574
1764
|
delaySeconds?: number;
|
|
1575
1765
|
}
|
|
1576
|
-
|
|
1766
|
+
interface Message<Body = unknown> {
|
|
1577
1767
|
readonly id: string;
|
|
1578
1768
|
readonly timestamp: Date;
|
|
1579
1769
|
readonly body: Body;
|
|
@@ -1581,26 +1771,26 @@ declare interface Message<Body = unknown> {
|
|
|
1581
1771
|
retry(options?: QueueRetryOptions): void;
|
|
1582
1772
|
ack(): void;
|
|
1583
1773
|
}
|
|
1584
|
-
|
|
1774
|
+
interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1585
1775
|
readonly messages: readonly Message<Body>[];
|
|
1586
1776
|
readonly queue: string;
|
|
1587
1777
|
retryAll(options?: QueueRetryOptions): void;
|
|
1588
1778
|
ackAll(): void;
|
|
1589
1779
|
}
|
|
1590
|
-
|
|
1780
|
+
interface MessageBatch<Body = unknown> {
|
|
1591
1781
|
readonly messages: readonly Message<Body>[];
|
|
1592
1782
|
readonly queue: string;
|
|
1593
1783
|
retryAll(options?: QueueRetryOptions): void;
|
|
1594
1784
|
ackAll(): void;
|
|
1595
1785
|
}
|
|
1596
|
-
|
|
1786
|
+
interface R2Error extends Error {
|
|
1597
1787
|
readonly name: string;
|
|
1598
1788
|
readonly code: number;
|
|
1599
1789
|
readonly message: string;
|
|
1600
1790
|
readonly action: string;
|
|
1601
1791
|
readonly stack: any;
|
|
1602
1792
|
}
|
|
1603
|
-
|
|
1793
|
+
interface R2ListOptions {
|
|
1604
1794
|
limit?: number;
|
|
1605
1795
|
prefix?: string;
|
|
1606
1796
|
cursor?: string;
|
|
@@ -1648,7 +1838,7 @@ declare abstract class R2Bucket {
|
|
|
1648
1838
|
delete(keys: string | string[]): Promise<void>;
|
|
1649
1839
|
list(options?: R2ListOptions): Promise<R2Objects>;
|
|
1650
1840
|
}
|
|
1651
|
-
|
|
1841
|
+
interface R2MultipartUpload {
|
|
1652
1842
|
readonly key: string;
|
|
1653
1843
|
readonly uploadId: string;
|
|
1654
1844
|
uploadPart(
|
|
@@ -1658,7 +1848,7 @@ declare interface R2MultipartUpload {
|
|
|
1658
1848
|
abort(): Promise<void>;
|
|
1659
1849
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
1660
1850
|
}
|
|
1661
|
-
|
|
1851
|
+
interface R2UploadedPart {
|
|
1662
1852
|
partNumber: number;
|
|
1663
1853
|
etag: string;
|
|
1664
1854
|
}
|
|
@@ -1676,7 +1866,7 @@ declare abstract class R2Object {
|
|
|
1676
1866
|
readonly storageClass: string;
|
|
1677
1867
|
writeHttpMetadata(headers: Headers): void;
|
|
1678
1868
|
}
|
|
1679
|
-
|
|
1869
|
+
interface R2ObjectBody extends R2Object {
|
|
1680
1870
|
get body(): ReadableStream;
|
|
1681
1871
|
get bodyUsed(): boolean;
|
|
1682
1872
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
@@ -1684,7 +1874,7 @@ declare interface R2ObjectBody extends R2Object {
|
|
|
1684
1874
|
json<T>(): Promise<T>;
|
|
1685
1875
|
blob(): Promise<Blob>;
|
|
1686
1876
|
}
|
|
1687
|
-
|
|
1877
|
+
type R2Range =
|
|
1688
1878
|
| {
|
|
1689
1879
|
offset: number;
|
|
1690
1880
|
length?: number;
|
|
@@ -1696,18 +1886,18 @@ declare type R2Range =
|
|
|
1696
1886
|
| {
|
|
1697
1887
|
suffix: number;
|
|
1698
1888
|
};
|
|
1699
|
-
|
|
1889
|
+
interface R2Conditional {
|
|
1700
1890
|
etagMatches?: string;
|
|
1701
1891
|
etagDoesNotMatch?: string;
|
|
1702
1892
|
uploadedBefore?: Date;
|
|
1703
1893
|
uploadedAfter?: Date;
|
|
1704
1894
|
secondsGranularity?: boolean;
|
|
1705
1895
|
}
|
|
1706
|
-
|
|
1896
|
+
interface R2GetOptions {
|
|
1707
1897
|
onlyIf?: R2Conditional | Headers;
|
|
1708
1898
|
range?: R2Range | Headers;
|
|
1709
1899
|
}
|
|
1710
|
-
|
|
1900
|
+
interface R2PutOptions {
|
|
1711
1901
|
onlyIf?: R2Conditional | Headers;
|
|
1712
1902
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1713
1903
|
customMetadata?: Record<string, string>;
|
|
@@ -1718,12 +1908,12 @@ declare interface R2PutOptions {
|
|
|
1718
1908
|
sha512?: ArrayBuffer | string;
|
|
1719
1909
|
storageClass?: string;
|
|
1720
1910
|
}
|
|
1721
|
-
|
|
1911
|
+
interface R2MultipartOptions {
|
|
1722
1912
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1723
1913
|
customMetadata?: Record<string, string>;
|
|
1724
1914
|
storageClass?: string;
|
|
1725
1915
|
}
|
|
1726
|
-
|
|
1916
|
+
interface R2Checksums {
|
|
1727
1917
|
readonly md5?: ArrayBuffer;
|
|
1728
1918
|
readonly sha1?: ArrayBuffer;
|
|
1729
1919
|
readonly sha256?: ArrayBuffer;
|
|
@@ -1731,14 +1921,14 @@ declare interface R2Checksums {
|
|
|
1731
1921
|
readonly sha512?: ArrayBuffer;
|
|
1732
1922
|
toJSON(): R2StringChecksums;
|
|
1733
1923
|
}
|
|
1734
|
-
|
|
1924
|
+
interface R2StringChecksums {
|
|
1735
1925
|
md5?: string;
|
|
1736
1926
|
sha1?: string;
|
|
1737
1927
|
sha256?: string;
|
|
1738
1928
|
sha384?: string;
|
|
1739
1929
|
sha512?: string;
|
|
1740
1930
|
}
|
|
1741
|
-
|
|
1931
|
+
interface R2HTTPMetadata {
|
|
1742
1932
|
contentType?: string;
|
|
1743
1933
|
contentLanguage?: string;
|
|
1744
1934
|
contentDisposition?: string;
|
|
@@ -1746,7 +1936,7 @@ declare interface R2HTTPMetadata {
|
|
|
1746
1936
|
cacheControl?: string;
|
|
1747
1937
|
cacheExpiry?: Date;
|
|
1748
1938
|
}
|
|
1749
|
-
|
|
1939
|
+
type R2Objects = {
|
|
1750
1940
|
objects: R2Object[];
|
|
1751
1941
|
delimitedPrefixes: string[];
|
|
1752
1942
|
} & (
|
|
@@ -1763,16 +1953,16 @@ declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
|
1763
1953
|
readonly cron: string;
|
|
1764
1954
|
noRetry(): void;
|
|
1765
1955
|
}
|
|
1766
|
-
|
|
1956
|
+
interface ScheduledController {
|
|
1767
1957
|
readonly scheduledTime: number;
|
|
1768
1958
|
readonly cron: string;
|
|
1769
1959
|
noRetry(): void;
|
|
1770
1960
|
}
|
|
1771
|
-
|
|
1961
|
+
interface QueuingStrategy<T = any> {
|
|
1772
1962
|
highWaterMark?: number | bigint;
|
|
1773
1963
|
size?: (chunk: T) => number | bigint;
|
|
1774
1964
|
}
|
|
1775
|
-
|
|
1965
|
+
interface UnderlyingSink<W = any> {
|
|
1776
1966
|
type?: string;
|
|
1777
1967
|
start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
|
|
1778
1968
|
write?: (
|
|
@@ -1782,14 +1972,14 @@ declare interface UnderlyingSink<W = any> {
|
|
|
1782
1972
|
abort?: (reason: any) => void | Promise<void>;
|
|
1783
1973
|
close?: () => void | Promise<void>;
|
|
1784
1974
|
}
|
|
1785
|
-
|
|
1975
|
+
interface UnderlyingByteSource {
|
|
1786
1976
|
type: "bytes";
|
|
1787
1977
|
autoAllocateChunkSize?: number;
|
|
1788
1978
|
start?: (controller: ReadableByteStreamController) => void | Promise<void>;
|
|
1789
1979
|
pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
|
|
1790
1980
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1791
1981
|
}
|
|
1792
|
-
|
|
1982
|
+
interface UnderlyingSource<R = any> {
|
|
1793
1983
|
type?: "" | undefined;
|
|
1794
1984
|
start?: (
|
|
1795
1985
|
controller: ReadableStreamDefaultController<R>,
|
|
@@ -1800,7 +1990,7 @@ declare interface UnderlyingSource<R = any> {
|
|
|
1800
1990
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1801
1991
|
expectedLength?: number | bigint;
|
|
1802
1992
|
}
|
|
1803
|
-
|
|
1993
|
+
interface Transformer<I = any, O = any> {
|
|
1804
1994
|
readableType?: string;
|
|
1805
1995
|
writableType?: string;
|
|
1806
1996
|
start?: (
|
|
@@ -1816,7 +2006,7 @@ declare interface Transformer<I = any, O = any> {
|
|
|
1816
2006
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1817
2007
|
expectedLength?: number;
|
|
1818
2008
|
}
|
|
1819
|
-
|
|
2009
|
+
interface StreamPipeOptions {
|
|
1820
2010
|
/**
|
|
1821
2011
|
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
|
1822
2012
|
*
|
|
@@ -1839,7 +2029,7 @@ declare interface StreamPipeOptions {
|
|
|
1839
2029
|
preventCancel?: boolean;
|
|
1840
2030
|
signal?: AbortSignal;
|
|
1841
2031
|
}
|
|
1842
|
-
|
|
2032
|
+
type ReadableStreamReadResult<R = any> =
|
|
1843
2033
|
| {
|
|
1844
2034
|
done: false;
|
|
1845
2035
|
value: R;
|
|
@@ -1853,32 +2043,37 @@ declare type ReadableStreamReadResult<R = any> =
|
|
|
1853
2043
|
*
|
|
1854
2044
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1855
2045
|
*/
|
|
1856
|
-
|
|
1857
|
-
|
|
2046
|
+
interface ReadableStream<R = any> {
|
|
2047
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1858
2048
|
readonly locked: boolean;
|
|
1859
|
-
|
|
2049
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1860
2050
|
cancel(reason?: any): Promise<void>;
|
|
1861
|
-
|
|
2051
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1862
2052
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1863
|
-
|
|
2053
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1864
2054
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1865
|
-
|
|
2055
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1866
2056
|
pipeThrough<T>(
|
|
1867
2057
|
transform: ReadableWritablePair<T, R>,
|
|
1868
2058
|
options?: StreamPipeOptions,
|
|
1869
2059
|
): ReadableStream<T>;
|
|
1870
|
-
|
|
2060
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1871
2061
|
pipeTo(
|
|
1872
2062
|
destination: WritableStream<R>,
|
|
1873
2063
|
options?: StreamPipeOptions,
|
|
1874
2064
|
): Promise<void>;
|
|
1875
|
-
|
|
2065
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1876
2066
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1877
2067
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1878
2068
|
[Symbol.asyncIterator](
|
|
1879
2069
|
options?: ReadableStreamValuesOptions,
|
|
1880
2070
|
): AsyncIterableIterator<R>;
|
|
1881
2071
|
}
|
|
2072
|
+
/**
|
|
2073
|
+
* 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.
|
|
2074
|
+
*
|
|
2075
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
2076
|
+
*/
|
|
1882
2077
|
declare const ReadableStream: {
|
|
1883
2078
|
prototype: ReadableStream;
|
|
1884
2079
|
new (
|
|
@@ -1890,34 +2085,36 @@ declare const ReadableStream: {
|
|
|
1890
2085
|
strategy?: QueuingStrategy<R>,
|
|
1891
2086
|
): ReadableStream<R>;
|
|
1892
2087
|
};
|
|
2088
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
|
|
1893
2089
|
declare class ReadableStreamDefaultReader<R = any> {
|
|
1894
2090
|
constructor(stream: ReadableStream);
|
|
1895
2091
|
readonly closed: Promise<void>;
|
|
1896
2092
|
cancel(reason?: any): Promise<void>;
|
|
1897
|
-
|
|
2093
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1898
2094
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1899
|
-
|
|
2095
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1900
2096
|
releaseLock(): void;
|
|
1901
2097
|
}
|
|
2098
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
|
1902
2099
|
declare class ReadableStreamBYOBReader {
|
|
1903
2100
|
constructor(stream: ReadableStream);
|
|
1904
2101
|
readonly closed: Promise<void>;
|
|
1905
2102
|
cancel(reason?: any): Promise<void>;
|
|
1906
|
-
|
|
2103
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1907
2104
|
read<T extends ArrayBufferView>(
|
|
1908
2105
|
view: T,
|
|
1909
2106
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1910
|
-
|
|
2107
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1911
2108
|
releaseLock(): void;
|
|
1912
2109
|
readAtLeast<T extends ArrayBufferView>(
|
|
1913
2110
|
minElements: number,
|
|
1914
2111
|
view: T,
|
|
1915
2112
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1916
2113
|
}
|
|
1917
|
-
|
|
2114
|
+
interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1918
2115
|
min?: number;
|
|
1919
2116
|
}
|
|
1920
|
-
|
|
2117
|
+
interface ReadableStreamGetReaderOptions {
|
|
1921
2118
|
/**
|
|
1922
2119
|
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
|
1923
2120
|
*
|
|
@@ -1925,38 +2122,38 @@ declare interface ReadableStreamGetReaderOptions {
|
|
|
1925
2122
|
*/
|
|
1926
2123
|
mode: "byob";
|
|
1927
2124
|
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2125
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
2126
|
+
interface ReadableStreamBYOBRequest {
|
|
2127
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1931
2128
|
get view(): Uint8Array | null;
|
|
1932
|
-
|
|
2129
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1933
2130
|
respond(bytesWritten: number): void;
|
|
1934
|
-
|
|
2131
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1935
2132
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1936
2133
|
get atLeast(): number | null;
|
|
1937
2134
|
}
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2135
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
2136
|
+
interface ReadableStreamDefaultController<R = any> {
|
|
2137
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1941
2138
|
get desiredSize(): number | null;
|
|
1942
|
-
|
|
2139
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1943
2140
|
close(): void;
|
|
1944
|
-
|
|
2141
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1945
2142
|
enqueue(chunk?: R): void;
|
|
1946
|
-
|
|
2143
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1947
2144
|
error(reason: any): void;
|
|
1948
2145
|
}
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
2146
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
2147
|
+
interface ReadableByteStreamController {
|
|
2148
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1952
2149
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
|
1953
|
-
|
|
2150
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1954
2151
|
get desiredSize(): number | null;
|
|
1955
|
-
|
|
2152
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1956
2153
|
close(): void;
|
|
1957
|
-
|
|
2154
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1958
2155
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1959
|
-
|
|
2156
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1960
2157
|
error(reason: any): void;
|
|
1961
2158
|
}
|
|
1962
2159
|
/**
|
|
@@ -1964,24 +2161,24 @@ declare interface ReadableByteStreamController {
|
|
|
1964
2161
|
*
|
|
1965
2162
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
1966
2163
|
*/
|
|
1967
|
-
|
|
1968
|
-
|
|
2164
|
+
interface WritableStreamDefaultController {
|
|
2165
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1969
2166
|
get signal(): AbortSignal;
|
|
1970
|
-
|
|
2167
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1971
2168
|
error(reason?: any): void;
|
|
1972
2169
|
}
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
2170
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
2171
|
+
interface TransformStreamDefaultController<O = any> {
|
|
2172
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1976
2173
|
get desiredSize(): number | null;
|
|
1977
|
-
|
|
2174
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
1978
2175
|
enqueue(chunk?: O): void;
|
|
1979
|
-
|
|
2176
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
1980
2177
|
error(reason: any): void;
|
|
1981
|
-
|
|
2178
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
1982
2179
|
terminate(): void;
|
|
1983
2180
|
}
|
|
1984
|
-
|
|
2181
|
+
interface ReadableWritablePair<R = any, W = any> {
|
|
1985
2182
|
/**
|
|
1986
2183
|
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
|
|
1987
2184
|
*
|
|
@@ -1990,46 +2187,57 @@ declare interface ReadableWritablePair<R = any, W = any> {
|
|
|
1990
2187
|
writable: WritableStream<W>;
|
|
1991
2188
|
readable: ReadableStream<R>;
|
|
1992
2189
|
}
|
|
2190
|
+
/**
|
|
2191
|
+
* 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.
|
|
2192
|
+
*
|
|
2193
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
|
2194
|
+
*/
|
|
1993
2195
|
declare class WritableStream<W = any> {
|
|
1994
2196
|
constructor(
|
|
1995
2197
|
underlyingSink?: UnderlyingSink,
|
|
1996
2198
|
queuingStrategy?: QueuingStrategy,
|
|
1997
2199
|
);
|
|
1998
|
-
|
|
2200
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
1999
2201
|
readonly locked: boolean;
|
|
2000
|
-
|
|
2202
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
2001
2203
|
abort(reason?: any): Promise<void>;
|
|
2002
|
-
|
|
2204
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
2003
2205
|
close(): Promise<void>;
|
|
2004
|
-
|
|
2206
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
2005
2207
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
2006
2208
|
}
|
|
2209
|
+
/**
|
|
2210
|
+
* 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.
|
|
2211
|
+
*
|
|
2212
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
|
2213
|
+
*/
|
|
2007
2214
|
declare class WritableStreamDefaultWriter<W = any> {
|
|
2008
2215
|
constructor(stream: WritableStream);
|
|
2009
|
-
|
|
2216
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
2010
2217
|
readonly closed: Promise<void>;
|
|
2011
|
-
|
|
2218
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
2012
2219
|
readonly ready: Promise<void>;
|
|
2013
|
-
|
|
2220
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
2014
2221
|
readonly desiredSize: number | null;
|
|
2015
|
-
|
|
2222
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
2016
2223
|
abort(reason?: any): Promise<void>;
|
|
2017
|
-
|
|
2224
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
2018
2225
|
close(): Promise<void>;
|
|
2019
|
-
|
|
2226
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
2020
2227
|
write(chunk?: W): Promise<void>;
|
|
2021
|
-
|
|
2228
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
2022
2229
|
releaseLock(): void;
|
|
2023
2230
|
}
|
|
2231
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
|
|
2024
2232
|
declare class TransformStream<I = any, O = any> {
|
|
2025
2233
|
constructor(
|
|
2026
2234
|
transformer?: Transformer<I, O>,
|
|
2027
2235
|
writableStrategy?: QueuingStrategy<I>,
|
|
2028
2236
|
readableStrategy?: QueuingStrategy<O>,
|
|
2029
2237
|
);
|
|
2030
|
-
|
|
2238
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
2031
2239
|
readonly readable: ReadableStream<O>;
|
|
2032
|
-
|
|
2240
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
2033
2241
|
readonly writable: WritableStream<I>;
|
|
2034
2242
|
}
|
|
2035
2243
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
@@ -2044,28 +2252,32 @@ declare class IdentityTransformStream extends TransformStream<
|
|
|
2044
2252
|
> {
|
|
2045
2253
|
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2046
2254
|
}
|
|
2047
|
-
|
|
2255
|
+
interface IdentityTransformStreamQueuingStrategy {
|
|
2048
2256
|
highWaterMark?: number | bigint;
|
|
2049
2257
|
}
|
|
2050
|
-
|
|
2258
|
+
interface ReadableStreamValuesOptions {
|
|
2051
2259
|
preventCancel?: boolean;
|
|
2052
2260
|
}
|
|
2261
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
|
|
2053
2262
|
declare class CompressionStream extends TransformStream<
|
|
2054
2263
|
ArrayBuffer | ArrayBufferView,
|
|
2055
2264
|
Uint8Array
|
|
2056
2265
|
> {
|
|
2057
2266
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2058
2267
|
}
|
|
2268
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
|
|
2059
2269
|
declare class DecompressionStream extends TransformStream<
|
|
2060
2270
|
ArrayBuffer | ArrayBufferView,
|
|
2061
2271
|
Uint8Array
|
|
2062
2272
|
> {
|
|
2063
2273
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2064
2274
|
}
|
|
2275
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
|
|
2065
2276
|
declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
|
|
2066
2277
|
constructor();
|
|
2067
2278
|
get encoding(): string;
|
|
2068
2279
|
}
|
|
2280
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
|
|
2069
2281
|
declare class TextDecoderStream extends TransformStream<
|
|
2070
2282
|
ArrayBuffer | ArrayBufferView,
|
|
2071
2283
|
string
|
|
@@ -2075,27 +2287,37 @@ declare class TextDecoderStream extends TransformStream<
|
|
|
2075
2287
|
get fatal(): boolean;
|
|
2076
2288
|
get ignoreBOM(): boolean;
|
|
2077
2289
|
}
|
|
2078
|
-
|
|
2290
|
+
interface TextDecoderStreamTextDecoderStreamInit {
|
|
2079
2291
|
fatal?: boolean;
|
|
2080
2292
|
ignoreBOM?: boolean;
|
|
2081
2293
|
}
|
|
2294
|
+
/**
|
|
2295
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2296
|
+
*
|
|
2297
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
|
|
2298
|
+
*/
|
|
2082
2299
|
declare class ByteLengthQueuingStrategy
|
|
2083
2300
|
implements QueuingStrategy<ArrayBufferView>
|
|
2084
2301
|
{
|
|
2085
2302
|
constructor(init: QueuingStrategyInit);
|
|
2086
|
-
|
|
2303
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
2087
2304
|
get highWaterMark(): number;
|
|
2088
|
-
|
|
2305
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
2089
2306
|
get size(): (chunk?: any) => number;
|
|
2090
2307
|
}
|
|
2308
|
+
/**
|
|
2309
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2310
|
+
*
|
|
2311
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
|
|
2312
|
+
*/
|
|
2091
2313
|
declare class CountQueuingStrategy implements QueuingStrategy {
|
|
2092
2314
|
constructor(init: QueuingStrategyInit);
|
|
2093
|
-
|
|
2315
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
2094
2316
|
get highWaterMark(): number;
|
|
2095
|
-
|
|
2317
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
2096
2318
|
get size(): (chunk?: any) => number;
|
|
2097
2319
|
}
|
|
2098
|
-
|
|
2320
|
+
interface QueuingStrategyInit {
|
|
2099
2321
|
/**
|
|
2100
2322
|
* Creates a new ByteLengthQueuingStrategy with the provided high water mark.
|
|
2101
2323
|
*
|
|
@@ -2103,7 +2325,7 @@ declare interface QueuingStrategyInit {
|
|
|
2103
2325
|
*/
|
|
2104
2326
|
highWaterMark: number;
|
|
2105
2327
|
}
|
|
2106
|
-
|
|
2328
|
+
interface ScriptVersion {
|
|
2107
2329
|
id?: string;
|
|
2108
2330
|
tag?: string;
|
|
2109
2331
|
message?: string;
|
|
@@ -2112,7 +2334,7 @@ declare abstract class TailEvent extends ExtendableEvent {
|
|
|
2112
2334
|
readonly events: TraceItem[];
|
|
2113
2335
|
readonly traces: TraceItem[];
|
|
2114
2336
|
}
|
|
2115
|
-
|
|
2337
|
+
interface TraceItem {
|
|
2116
2338
|
readonly event:
|
|
2117
2339
|
| (
|
|
2118
2340
|
| TraceItemFetchEventInfo
|
|
@@ -2137,116 +2359,123 @@ declare interface TraceItem {
|
|
|
2137
2359
|
readonly scriptTags?: string[];
|
|
2138
2360
|
readonly outcome: string;
|
|
2139
2361
|
}
|
|
2140
|
-
|
|
2362
|
+
interface TraceItemAlarmEventInfo {
|
|
2141
2363
|
readonly scheduledTime: Date;
|
|
2142
2364
|
}
|
|
2143
|
-
|
|
2144
|
-
|
|
2365
|
+
interface TraceItemCustomEventInfo {}
|
|
2366
|
+
interface TraceItemScheduledEventInfo {
|
|
2145
2367
|
readonly scheduledTime: number;
|
|
2146
2368
|
readonly cron: string;
|
|
2147
2369
|
}
|
|
2148
|
-
|
|
2370
|
+
interface TraceItemQueueEventInfo {
|
|
2149
2371
|
readonly queue: string;
|
|
2150
2372
|
readonly batchSize: number;
|
|
2151
2373
|
}
|
|
2152
|
-
|
|
2374
|
+
interface TraceItemEmailEventInfo {
|
|
2153
2375
|
readonly mailFrom: string;
|
|
2154
2376
|
readonly rcptTo: string;
|
|
2155
2377
|
readonly rawSize: number;
|
|
2156
2378
|
}
|
|
2157
|
-
|
|
2379
|
+
interface TraceItemTailEventInfo {
|
|
2158
2380
|
readonly consumedEvents: TraceItemTailEventInfoTailItem[];
|
|
2159
2381
|
}
|
|
2160
|
-
|
|
2382
|
+
interface TraceItemTailEventInfoTailItem {
|
|
2161
2383
|
readonly scriptName: string | null;
|
|
2162
2384
|
}
|
|
2163
|
-
|
|
2385
|
+
interface TraceItemFetchEventInfo {
|
|
2164
2386
|
readonly response?: TraceItemFetchEventInfoResponse;
|
|
2165
2387
|
readonly request: TraceItemFetchEventInfoRequest;
|
|
2166
2388
|
}
|
|
2167
|
-
|
|
2389
|
+
interface TraceItemFetchEventInfoRequest {
|
|
2168
2390
|
readonly cf?: any;
|
|
2169
2391
|
readonly headers: Record<string, string>;
|
|
2170
2392
|
readonly method: string;
|
|
2171
2393
|
readonly url: string;
|
|
2172
2394
|
getUnredacted(): TraceItemFetchEventInfoRequest;
|
|
2173
2395
|
}
|
|
2174
|
-
|
|
2396
|
+
interface TraceItemFetchEventInfoResponse {
|
|
2175
2397
|
readonly status: number;
|
|
2176
2398
|
}
|
|
2177
|
-
|
|
2399
|
+
interface TraceItemJsRpcEventInfo {
|
|
2178
2400
|
readonly rpcMethod: string;
|
|
2179
2401
|
}
|
|
2180
|
-
|
|
2402
|
+
interface TraceItemHibernatableWebSocketEventInfo {
|
|
2181
2403
|
readonly getWebSocketEvent:
|
|
2182
2404
|
| TraceItemHibernatableWebSocketEventInfoMessage
|
|
2183
2405
|
| TraceItemHibernatableWebSocketEventInfoClose
|
|
2184
2406
|
| TraceItemHibernatableWebSocketEventInfoError;
|
|
2185
2407
|
}
|
|
2186
|
-
|
|
2408
|
+
interface TraceItemHibernatableWebSocketEventInfoMessage {
|
|
2187
2409
|
readonly webSocketEventType: string;
|
|
2188
2410
|
}
|
|
2189
|
-
|
|
2411
|
+
interface TraceItemHibernatableWebSocketEventInfoClose {
|
|
2190
2412
|
readonly webSocketEventType: string;
|
|
2191
2413
|
readonly code: number;
|
|
2192
2414
|
readonly wasClean: boolean;
|
|
2193
2415
|
}
|
|
2194
|
-
|
|
2416
|
+
interface TraceItemHibernatableWebSocketEventInfoError {
|
|
2195
2417
|
readonly webSocketEventType: string;
|
|
2196
2418
|
}
|
|
2197
|
-
|
|
2419
|
+
interface TraceLog {
|
|
2198
2420
|
readonly timestamp: number;
|
|
2199
2421
|
readonly level: string;
|
|
2200
2422
|
readonly message: any;
|
|
2201
2423
|
}
|
|
2202
|
-
|
|
2424
|
+
interface TraceException {
|
|
2203
2425
|
readonly timestamp: number;
|
|
2204
2426
|
readonly message: string;
|
|
2205
2427
|
readonly name: string;
|
|
2206
2428
|
readonly stack?: string;
|
|
2207
2429
|
}
|
|
2208
|
-
|
|
2430
|
+
interface TraceDiagnosticChannelEvent {
|
|
2209
2431
|
readonly timestamp: number;
|
|
2210
2432
|
readonly channel: string;
|
|
2211
2433
|
readonly message: any;
|
|
2212
2434
|
}
|
|
2213
|
-
|
|
2435
|
+
interface TraceMetrics {
|
|
2214
2436
|
readonly cpuTime: number;
|
|
2215
2437
|
readonly wallTime: number;
|
|
2216
2438
|
}
|
|
2217
|
-
|
|
2439
|
+
interface UnsafeTraceMetrics {
|
|
2218
2440
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
2219
2441
|
}
|
|
2442
|
+
/**
|
|
2443
|
+
* The URL interface represents an object providing static methods used for creating object URLs.
|
|
2444
|
+
*
|
|
2445
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
|
2446
|
+
*/
|
|
2220
2447
|
declare class URL {
|
|
2221
2448
|
constructor(url: string | URL, base?: string | URL);
|
|
2222
|
-
|
|
2449
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2223
2450
|
href: string;
|
|
2224
|
-
|
|
2451
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
2225
2452
|
readonly origin: string;
|
|
2226
|
-
|
|
2453
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2227
2454
|
protocol: string;
|
|
2228
|
-
|
|
2455
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2229
2456
|
username: string;
|
|
2230
|
-
|
|
2457
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2231
2458
|
password: string;
|
|
2232
|
-
|
|
2459
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2233
2460
|
host: string;
|
|
2234
|
-
|
|
2461
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2235
2462
|
hostname: string;
|
|
2236
|
-
|
|
2463
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2237
2464
|
port: string;
|
|
2238
|
-
|
|
2465
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2239
2466
|
pathname: string;
|
|
2240
|
-
|
|
2467
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2241
2468
|
search: string;
|
|
2242
|
-
|
|
2469
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
2243
2470
|
readonly searchParams: URLSearchParams;
|
|
2244
|
-
|
|
2471
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2245
2472
|
hash: string;
|
|
2473
|
+
/*function toString() { [native code] }*/
|
|
2246
2474
|
toString(): string;
|
|
2247
|
-
|
|
2475
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
2248
2476
|
toJSON(): string;
|
|
2249
2477
|
}
|
|
2478
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2250
2479
|
declare class URLSearchParams {
|
|
2251
2480
|
constructor(
|
|
2252
2481
|
init?:
|
|
@@ -2255,19 +2484,51 @@ declare class URLSearchParams {
|
|
|
2255
2484
|
| Record<string, string>
|
|
2256
2485
|
| [key: string, value: string][],
|
|
2257
2486
|
);
|
|
2487
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2258
2488
|
get size(): number;
|
|
2489
|
+
/**
|
|
2490
|
+
* Appends a specified key/value pair as a new search parameter.
|
|
2491
|
+
*
|
|
2492
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2493
|
+
*/
|
|
2259
2494
|
append(name: string, value: string): void;
|
|
2495
|
+
/**
|
|
2496
|
+
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2497
|
+
*
|
|
2498
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
2499
|
+
*/
|
|
2260
2500
|
delete(name: string): void;
|
|
2501
|
+
/**
|
|
2502
|
+
* Returns the first value associated to the given search parameter.
|
|
2503
|
+
*
|
|
2504
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2505
|
+
*/
|
|
2261
2506
|
get(name: string): string | null;
|
|
2507
|
+
/**
|
|
2508
|
+
* Returns all the values association with a given search parameter.
|
|
2509
|
+
*
|
|
2510
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2511
|
+
*/
|
|
2262
2512
|
getAll(name: string): string[];
|
|
2513
|
+
/**
|
|
2514
|
+
* Returns a Boolean indicating if such a search parameter exists.
|
|
2515
|
+
*
|
|
2516
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
2517
|
+
*/
|
|
2263
2518
|
has(name: string): boolean;
|
|
2519
|
+
/**
|
|
2520
|
+
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
2521
|
+
*
|
|
2522
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2523
|
+
*/
|
|
2264
2524
|
set(name: string, value: string): void;
|
|
2525
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2265
2526
|
sort(): void;
|
|
2266
|
-
|
|
2527
|
+
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
2267
2528
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2268
|
-
|
|
2529
|
+
/* Returns a list of keys in the search params. */
|
|
2269
2530
|
keys(): IterableIterator<string>;
|
|
2270
|
-
|
|
2531
|
+
/* Returns a list of values in the search params. */
|
|
2271
2532
|
values(): IterableIterator<string>;
|
|
2272
2533
|
forEach<This = unknown>(
|
|
2273
2534
|
callback: (
|
|
@@ -2278,6 +2539,7 @@ declare class URLSearchParams {
|
|
|
2278
2539
|
) => void,
|
|
2279
2540
|
thisArg?: This,
|
|
2280
2541
|
): void;
|
|
2542
|
+
/*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
|
|
2281
2543
|
toString(): string;
|
|
2282
2544
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
2283
2545
|
}
|
|
@@ -2301,7 +2563,7 @@ declare class URLPattern {
|
|
|
2301
2563
|
baseURL?: string,
|
|
2302
2564
|
): URLPatternURLPatternResult | null;
|
|
2303
2565
|
}
|
|
2304
|
-
|
|
2566
|
+
interface URLPatternURLPatternInit {
|
|
2305
2567
|
protocol?: string;
|
|
2306
2568
|
username?: string;
|
|
2307
2569
|
password?: string;
|
|
@@ -2312,11 +2574,11 @@ declare interface URLPatternURLPatternInit {
|
|
|
2312
2574
|
hash?: string;
|
|
2313
2575
|
baseURL?: string;
|
|
2314
2576
|
}
|
|
2315
|
-
|
|
2577
|
+
interface URLPatternURLPatternComponentResult {
|
|
2316
2578
|
input: string;
|
|
2317
2579
|
groups: Record<string, string>;
|
|
2318
2580
|
}
|
|
2319
|
-
|
|
2581
|
+
interface URLPatternURLPatternResult {
|
|
2320
2582
|
inputs: (string | URLPatternURLPatternInit)[];
|
|
2321
2583
|
protocol: URLPatternURLPatternComponentResult;
|
|
2322
2584
|
username: URLPatternURLPatternComponentResult;
|
|
@@ -2327,9 +2589,14 @@ declare interface URLPatternURLPatternResult {
|
|
|
2327
2589
|
search: URLPatternURLPatternComponentResult;
|
|
2328
2590
|
hash: URLPatternURLPatternComponentResult;
|
|
2329
2591
|
}
|
|
2330
|
-
|
|
2592
|
+
interface URLPatternURLPatternOptions {
|
|
2331
2593
|
ignoreCase?: boolean;
|
|
2332
2594
|
}
|
|
2595
|
+
/**
|
|
2596
|
+
* 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.
|
|
2597
|
+
*
|
|
2598
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
|
2599
|
+
*/
|
|
2333
2600
|
declare class CloseEvent extends Event {
|
|
2334
2601
|
constructor(type: string, initializer?: CloseEventInit);
|
|
2335
2602
|
/**
|
|
@@ -2351,41 +2618,39 @@ declare class CloseEvent extends Event {
|
|
|
2351
2618
|
*/
|
|
2352
2619
|
readonly wasClean: boolean;
|
|
2353
2620
|
}
|
|
2354
|
-
|
|
2621
|
+
interface CloseEventInit {
|
|
2355
2622
|
code?: number;
|
|
2356
2623
|
reason?: string;
|
|
2357
2624
|
wasClean?: boolean;
|
|
2358
2625
|
}
|
|
2626
|
+
/**
|
|
2627
|
+
* A message received by a target object.
|
|
2628
|
+
*
|
|
2629
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
|
2630
|
+
*/
|
|
2359
2631
|
declare class MessageEvent extends Event {
|
|
2360
2632
|
constructor(type: string, initializer: MessageEventInit);
|
|
2633
|
+
/**
|
|
2634
|
+
* Returns the data of the message.
|
|
2635
|
+
*
|
|
2636
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
|
2637
|
+
*/
|
|
2361
2638
|
readonly data: ArrayBuffer | string;
|
|
2362
2639
|
}
|
|
2363
|
-
|
|
2640
|
+
interface MessageEventInit {
|
|
2364
2641
|
data: ArrayBuffer | string;
|
|
2365
2642
|
}
|
|
2366
|
-
|
|
2367
|
-
* Events providing information related to errors in scripts or in files.
|
|
2368
|
-
*
|
|
2369
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2370
|
-
*/
|
|
2371
|
-
declare interface ErrorEvent extends Event {
|
|
2372
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
2373
|
-
readonly filename: string;
|
|
2374
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
2375
|
-
readonly message: string;
|
|
2376
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
2377
|
-
readonly lineno: number;
|
|
2378
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
2379
|
-
readonly colno: number;
|
|
2380
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
2381
|
-
readonly error: any;
|
|
2382
|
-
}
|
|
2383
|
-
declare type WebSocketEventMap = {
|
|
2643
|
+
type WebSocketEventMap = {
|
|
2384
2644
|
close: CloseEvent;
|
|
2385
2645
|
message: MessageEvent;
|
|
2386
2646
|
open: Event;
|
|
2387
2647
|
error: ErrorEvent;
|
|
2388
2648
|
};
|
|
2649
|
+
/**
|
|
2650
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2651
|
+
*
|
|
2652
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2653
|
+
*/
|
|
2389
2654
|
declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2390
2655
|
constructor(url: string, protocols?: string[] | string);
|
|
2391
2656
|
accept(): void;
|
|
@@ -2442,7 +2707,7 @@ declare const WebSocketPair: {
|
|
|
2442
2707
|
1: WebSocket;
|
|
2443
2708
|
};
|
|
2444
2709
|
};
|
|
2445
|
-
|
|
2710
|
+
interface Socket {
|
|
2446
2711
|
get readable(): ReadableStream;
|
|
2447
2712
|
get writable(): WritableStream;
|
|
2448
2713
|
get closed(): Promise<void>;
|
|
@@ -2450,75 +2715,74 @@ declare interface Socket {
|
|
|
2450
2715
|
close(): Promise<void>;
|
|
2451
2716
|
startTls(options?: TlsOptions): Socket;
|
|
2452
2717
|
}
|
|
2453
|
-
|
|
2718
|
+
interface SocketOptions {
|
|
2454
2719
|
secureTransport?: string;
|
|
2455
2720
|
allowHalfOpen: boolean;
|
|
2721
|
+
highWaterMark?: number | bigint;
|
|
2456
2722
|
}
|
|
2457
|
-
|
|
2723
|
+
interface SocketAddress {
|
|
2458
2724
|
hostname: string;
|
|
2459
2725
|
port: number;
|
|
2460
2726
|
}
|
|
2461
|
-
|
|
2727
|
+
interface TlsOptions {
|
|
2462
2728
|
expectedServerHostname?: string;
|
|
2463
2729
|
}
|
|
2464
|
-
|
|
2730
|
+
interface SocketInfo {
|
|
2465
2731
|
remoteAddress?: string;
|
|
2466
2732
|
localAddress?: string;
|
|
2467
2733
|
}
|
|
2468
|
-
declare abstract class
|
|
2469
|
-
requestDevice(param1?:
|
|
2470
|
-
requestAdapterInfo(unmaskHints?: string[]): Promise<
|
|
2471
|
-
get features():
|
|
2472
|
-
get limits():
|
|
2734
|
+
declare abstract class GPUAdapter {
|
|
2735
|
+
requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
2736
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
|
|
2737
|
+
get features(): GPUSupportedFeatures;
|
|
2738
|
+
get limits(): GPUSupportedLimits;
|
|
2473
2739
|
}
|
|
2474
|
-
|
|
2475
|
-
createBuffer(param1:
|
|
2740
|
+
interface GPUDevice extends EventTarget {
|
|
2741
|
+
createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
|
|
2476
2742
|
createBindGroupLayout(
|
|
2477
|
-
descriptor:
|
|
2478
|
-
):
|
|
2479
|
-
createBindGroup(descriptor:
|
|
2480
|
-
createSampler(descriptor:
|
|
2481
|
-
createShaderModule(
|
|
2482
|
-
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2483
|
-
): gpuGPUShaderModule;
|
|
2743
|
+
descriptor: GPUBindGroupLayoutDescriptor,
|
|
2744
|
+
): GPUBindGroupLayout;
|
|
2745
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
2746
|
+
createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
|
|
2747
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
2484
2748
|
createPipelineLayout(
|
|
2485
|
-
descriptor:
|
|
2486
|
-
):
|
|
2749
|
+
descriptor: GPUPipelineLayoutDescriptor,
|
|
2750
|
+
): GPUPipelineLayout;
|
|
2487
2751
|
createComputePipeline(
|
|
2488
|
-
descriptor:
|
|
2489
|
-
):
|
|
2752
|
+
descriptor: GPUComputePipelineDescriptor,
|
|
2753
|
+
): GPUComputePipeline;
|
|
2490
2754
|
createRenderPipeline(
|
|
2491
|
-
descriptor:
|
|
2492
|
-
):
|
|
2755
|
+
descriptor: GPURenderPipelineDescriptor,
|
|
2756
|
+
): GPURenderPipeline;
|
|
2493
2757
|
createCommandEncoder(
|
|
2494
|
-
descriptor?:
|
|
2495
|
-
):
|
|
2496
|
-
createTexture(param1:
|
|
2758
|
+
descriptor?: GPUCommandEncoderDescriptor,
|
|
2759
|
+
): GPUCommandEncoder;
|
|
2760
|
+
createTexture(param1: GPUTextureDescriptor): GPUTexture;
|
|
2497
2761
|
destroy(): void;
|
|
2498
|
-
createQuerySet(descriptor:
|
|
2762
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
2499
2763
|
pushErrorScope(filter: string): void;
|
|
2500
|
-
popErrorScope(): Promise<
|
|
2501
|
-
get queue():
|
|
2502
|
-
get lost(): Promise<
|
|
2503
|
-
get features():
|
|
2504
|
-
get limits():
|
|
2764
|
+
popErrorScope(): Promise<GPUError | null>;
|
|
2765
|
+
get queue(): GPUQueue;
|
|
2766
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
2767
|
+
get features(): GPUSupportedFeatures;
|
|
2768
|
+
get limits(): GPUSupportedLimits;
|
|
2505
2769
|
}
|
|
2506
|
-
|
|
2770
|
+
interface GPUDeviceDescriptor {
|
|
2507
2771
|
label?: string;
|
|
2508
2772
|
requiredFeatures?: string[];
|
|
2509
2773
|
requiredLimits?: Record<string, number | bigint>;
|
|
2510
|
-
defaultQueue?:
|
|
2774
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
2511
2775
|
}
|
|
2512
|
-
|
|
2776
|
+
interface GPUBufferDescriptor {
|
|
2513
2777
|
label: string;
|
|
2514
2778
|
size: number | bigint;
|
|
2515
2779
|
usage: number;
|
|
2516
2780
|
mappedAtCreation: boolean;
|
|
2517
2781
|
}
|
|
2518
|
-
|
|
2782
|
+
interface GPUQueueDescriptor {
|
|
2519
2783
|
label?: string;
|
|
2520
2784
|
}
|
|
2521
|
-
declare abstract class
|
|
2785
|
+
declare abstract class GPUBufferUsage {
|
|
2522
2786
|
static readonly MAP_READ: number;
|
|
2523
2787
|
static readonly MAP_WRITE: number;
|
|
2524
2788
|
static readonly COPY_SRC: number;
|
|
@@ -2530,7 +2794,7 @@ declare abstract class gpuGPUBufferUsage {
|
|
|
2530
2794
|
static readonly INDIRECT: number;
|
|
2531
2795
|
static readonly QUERY_RESOLVE: number;
|
|
2532
2796
|
}
|
|
2533
|
-
|
|
2797
|
+
interface GPUBuffer {
|
|
2534
2798
|
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2535
2799
|
unmap(): void;
|
|
2536
2800
|
destroy(): void;
|
|
@@ -2543,59 +2807,59 @@ declare interface gpuGPUBuffer {
|
|
|
2543
2807
|
get usage(): number;
|
|
2544
2808
|
get mapState(): string;
|
|
2545
2809
|
}
|
|
2546
|
-
declare abstract class
|
|
2810
|
+
declare abstract class GPUShaderStage {
|
|
2547
2811
|
static readonly VERTEX: number;
|
|
2548
2812
|
static readonly FRAGMENT: number;
|
|
2549
2813
|
static readonly COMPUTE: number;
|
|
2550
2814
|
}
|
|
2551
|
-
|
|
2815
|
+
interface GPUBindGroupLayoutDescriptor {
|
|
2552
2816
|
label?: string;
|
|
2553
|
-
entries:
|
|
2817
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
2554
2818
|
}
|
|
2555
|
-
|
|
2819
|
+
interface GPUBindGroupLayoutEntry {
|
|
2556
2820
|
binding: number;
|
|
2557
2821
|
visibility: number;
|
|
2558
|
-
buffer?:
|
|
2559
|
-
sampler?:
|
|
2560
|
-
texture?:
|
|
2561
|
-
storageTexture?:
|
|
2822
|
+
buffer?: GPUBufferBindingLayout;
|
|
2823
|
+
sampler?: GPUSamplerBindingLayout;
|
|
2824
|
+
texture?: GPUTextureBindingLayout;
|
|
2825
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
2562
2826
|
}
|
|
2563
|
-
|
|
2827
|
+
interface GPUStorageTextureBindingLayout {
|
|
2564
2828
|
access?: string;
|
|
2565
2829
|
format: string;
|
|
2566
2830
|
viewDimension?: string;
|
|
2567
2831
|
}
|
|
2568
|
-
|
|
2832
|
+
interface GPUTextureBindingLayout {
|
|
2569
2833
|
sampleType?: string;
|
|
2570
2834
|
viewDimension?: string;
|
|
2571
2835
|
multisampled?: boolean;
|
|
2572
2836
|
}
|
|
2573
|
-
|
|
2837
|
+
interface GPUSamplerBindingLayout {
|
|
2574
2838
|
type?: string;
|
|
2575
2839
|
}
|
|
2576
|
-
|
|
2840
|
+
interface GPUBufferBindingLayout {
|
|
2577
2841
|
type?: string;
|
|
2578
2842
|
hasDynamicOffset?: boolean;
|
|
2579
2843
|
minBindingSize?: number | bigint;
|
|
2580
2844
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2845
|
+
interface GPUBindGroupLayout {}
|
|
2846
|
+
interface GPUBindGroup {}
|
|
2847
|
+
interface GPUBindGroupDescriptor {
|
|
2584
2848
|
label?: string;
|
|
2585
|
-
layout:
|
|
2586
|
-
entries:
|
|
2849
|
+
layout: GPUBindGroupLayout;
|
|
2850
|
+
entries: GPUBindGroupEntry[];
|
|
2587
2851
|
}
|
|
2588
|
-
|
|
2852
|
+
interface GPUBindGroupEntry {
|
|
2589
2853
|
binding: number;
|
|
2590
|
-
resource:
|
|
2854
|
+
resource: GPUBufferBinding | GPUSampler;
|
|
2591
2855
|
}
|
|
2592
|
-
|
|
2593
|
-
buffer:
|
|
2856
|
+
interface GPUBufferBinding {
|
|
2857
|
+
buffer: GPUBuffer;
|
|
2594
2858
|
offset?: number | bigint;
|
|
2595
2859
|
size?: number | bigint;
|
|
2596
2860
|
}
|
|
2597
|
-
|
|
2598
|
-
|
|
2861
|
+
interface GPUSampler {}
|
|
2862
|
+
interface GPUSamplerDescriptor {
|
|
2599
2863
|
label?: string;
|
|
2600
2864
|
addressModeU?: string;
|
|
2601
2865
|
addressModeV?: string;
|
|
@@ -2608,76 +2872,74 @@ declare interface gpuGPUSamplerDescriptor {
|
|
|
2608
2872
|
compare: string;
|
|
2609
2873
|
maxAnisotropy?: number;
|
|
2610
2874
|
}
|
|
2611
|
-
|
|
2612
|
-
getCompilationInfo(): Promise<
|
|
2875
|
+
interface GPUShaderModule {
|
|
2876
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
2613
2877
|
}
|
|
2614
|
-
|
|
2878
|
+
interface GPUShaderModuleDescriptor {
|
|
2615
2879
|
label?: string;
|
|
2616
2880
|
code: string;
|
|
2617
2881
|
}
|
|
2618
|
-
|
|
2619
|
-
|
|
2882
|
+
interface GPUPipelineLayout {}
|
|
2883
|
+
interface GPUPipelineLayoutDescriptor {
|
|
2620
2884
|
label?: string;
|
|
2621
|
-
bindGroupLayouts:
|
|
2885
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
2622
2886
|
}
|
|
2623
|
-
|
|
2624
|
-
getBindGroupLayout(index: number):
|
|
2887
|
+
interface GPUComputePipeline {
|
|
2888
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2625
2889
|
}
|
|
2626
|
-
|
|
2890
|
+
interface GPUComputePipelineDescriptor {
|
|
2627
2891
|
label?: string;
|
|
2628
|
-
compute:
|
|
2629
|
-
layout: string |
|
|
2892
|
+
compute: GPUProgrammableStage;
|
|
2893
|
+
layout: string | GPUPipelineLayout;
|
|
2630
2894
|
}
|
|
2631
|
-
|
|
2632
|
-
module:
|
|
2895
|
+
interface GPUProgrammableStage {
|
|
2896
|
+
module: GPUShaderModule;
|
|
2633
2897
|
entryPoint: string;
|
|
2634
2898
|
constants?: Record<string, number>;
|
|
2635
2899
|
}
|
|
2636
|
-
|
|
2900
|
+
interface GPUCommandEncoder {
|
|
2637
2901
|
get label(): string;
|
|
2638
2902
|
beginComputePass(
|
|
2639
|
-
descriptor?:
|
|
2640
|
-
):
|
|
2641
|
-
beginRenderPass(
|
|
2642
|
-
descriptor: gpuGPURenderPassDescriptor,
|
|
2643
|
-
): gpuGPURenderPassEncoder;
|
|
2903
|
+
descriptor?: GPUComputePassDescriptor,
|
|
2904
|
+
): GPUComputePassEncoder;
|
|
2905
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
2644
2906
|
copyBufferToBuffer(
|
|
2645
|
-
source:
|
|
2907
|
+
source: GPUBuffer,
|
|
2646
2908
|
sourceOffset: number | bigint,
|
|
2647
|
-
destination:
|
|
2909
|
+
destination: GPUBuffer,
|
|
2648
2910
|
destinationOffset: number | bigint,
|
|
2649
2911
|
size: number | bigint,
|
|
2650
2912
|
): void;
|
|
2651
|
-
finish(param0?:
|
|
2913
|
+
finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
2652
2914
|
copyTextureToBuffer(
|
|
2653
|
-
source:
|
|
2654
|
-
destination:
|
|
2655
|
-
copySize: Iterable<number> |
|
|
2915
|
+
source: GPUImageCopyTexture,
|
|
2916
|
+
destination: GPUImageCopyBuffer,
|
|
2917
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2656
2918
|
): void;
|
|
2657
2919
|
copyBufferToTexture(
|
|
2658
|
-
source:
|
|
2659
|
-
destination:
|
|
2660
|
-
copySize: Iterable<number> |
|
|
2920
|
+
source: GPUImageCopyBuffer,
|
|
2921
|
+
destination: GPUImageCopyTexture,
|
|
2922
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2661
2923
|
): void;
|
|
2662
2924
|
copyTextureToTexture(
|
|
2663
|
-
source:
|
|
2664
|
-
destination:
|
|
2665
|
-
copySize: Iterable<number> |
|
|
2925
|
+
source: GPUImageCopyTexture,
|
|
2926
|
+
destination: GPUImageCopyTexture,
|
|
2927
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2666
2928
|
): void;
|
|
2667
2929
|
clearBuffer(
|
|
2668
|
-
buffer:
|
|
2930
|
+
buffer: GPUBuffer,
|
|
2669
2931
|
offset?: number | bigint,
|
|
2670
2932
|
size?: number | bigint,
|
|
2671
2933
|
): void;
|
|
2672
2934
|
}
|
|
2673
|
-
|
|
2935
|
+
interface GPUCommandEncoderDescriptor {
|
|
2674
2936
|
label?: string;
|
|
2675
2937
|
}
|
|
2676
|
-
|
|
2677
|
-
setPipeline(pipeline:
|
|
2938
|
+
interface GPUComputePassEncoder {
|
|
2939
|
+
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2678
2940
|
setBindGroup(
|
|
2679
2941
|
index: number,
|
|
2680
|
-
bindGroup:
|
|
2942
|
+
bindGroup: GPUBindGroup | null,
|
|
2681
2943
|
dynamicOffsets?: Iterable<number>,
|
|
2682
2944
|
): void;
|
|
2683
2945
|
dispatchWorkgroups(
|
|
@@ -2687,48 +2949,48 @@ declare interface gpuGPUComputePassEncoder {
|
|
|
2687
2949
|
): void;
|
|
2688
2950
|
end(): void;
|
|
2689
2951
|
}
|
|
2690
|
-
|
|
2952
|
+
interface GPUComputePassDescriptor {
|
|
2691
2953
|
label?: string;
|
|
2692
|
-
timestampWrites?:
|
|
2954
|
+
timestampWrites?: GPUComputePassTimestampWrites;
|
|
2693
2955
|
}
|
|
2694
|
-
|
|
2695
|
-
|
|
2956
|
+
interface GPUQuerySet {}
|
|
2957
|
+
interface GPUQuerySetDescriptor {
|
|
2696
2958
|
label?: string;
|
|
2697
2959
|
}
|
|
2698
|
-
|
|
2699
|
-
querySet:
|
|
2960
|
+
interface GPUComputePassTimestampWrites {
|
|
2961
|
+
querySet: GPUQuerySet;
|
|
2700
2962
|
beginningOfPassWriteIndex?: number;
|
|
2701
2963
|
endOfPassWriteIndex?: number;
|
|
2702
2964
|
}
|
|
2703
|
-
|
|
2965
|
+
interface GPUCommandBufferDescriptor {
|
|
2704
2966
|
label?: string;
|
|
2705
2967
|
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
submit(commandBuffers:
|
|
2968
|
+
interface GPUCommandBuffer {}
|
|
2969
|
+
interface GPUQueue {
|
|
2970
|
+
submit(commandBuffers: GPUCommandBuffer[]): void;
|
|
2709
2971
|
writeBuffer(
|
|
2710
|
-
buffer:
|
|
2972
|
+
buffer: GPUBuffer,
|
|
2711
2973
|
bufferOffset: number | bigint,
|
|
2712
2974
|
data: ArrayBuffer | ArrayBufferView,
|
|
2713
2975
|
dataOffset?: number | bigint,
|
|
2714
2976
|
size?: number | bigint,
|
|
2715
2977
|
): void;
|
|
2716
2978
|
}
|
|
2717
|
-
declare abstract class
|
|
2979
|
+
declare abstract class GPUMapMode {
|
|
2718
2980
|
static readonly READ: number;
|
|
2719
2981
|
static readonly WRITE: number;
|
|
2720
2982
|
}
|
|
2721
|
-
|
|
2983
|
+
interface GPUAdapterInfo {
|
|
2722
2984
|
get vendor(): string;
|
|
2723
2985
|
get architecture(): string;
|
|
2724
2986
|
get device(): string;
|
|
2725
2987
|
get description(): string;
|
|
2726
2988
|
}
|
|
2727
|
-
|
|
2989
|
+
interface GPUSupportedFeatures {
|
|
2728
2990
|
has(name: string): boolean;
|
|
2729
2991
|
keys(): string[];
|
|
2730
2992
|
}
|
|
2731
|
-
|
|
2993
|
+
interface GPUSupportedLimits {
|
|
2732
2994
|
get maxTextureDimension1D(): number;
|
|
2733
2995
|
get maxTextureDimension2D(): number;
|
|
2734
2996
|
get maxTextureDimension3D(): number;
|
|
@@ -2761,17 +3023,17 @@ declare interface gpuGPUSupportedLimits {
|
|
|
2761
3023
|
get maxComputeWorkgroupSizeZ(): number;
|
|
2762
3024
|
get maxComputeWorkgroupsPerDimension(): number;
|
|
2763
3025
|
}
|
|
2764
|
-
declare abstract class
|
|
3026
|
+
declare abstract class GPUError {
|
|
2765
3027
|
get message(): string;
|
|
2766
3028
|
}
|
|
2767
|
-
declare abstract class
|
|
2768
|
-
declare abstract class
|
|
2769
|
-
declare abstract class
|
|
2770
|
-
declare abstract class
|
|
3029
|
+
declare abstract class GPUOutOfMemoryError extends GPUError {}
|
|
3030
|
+
declare abstract class GPUInternalError extends GPUError {}
|
|
3031
|
+
declare abstract class GPUValidationError extends GPUError {}
|
|
3032
|
+
declare abstract class GPUDeviceLostInfo {
|
|
2771
3033
|
get message(): string;
|
|
2772
3034
|
get reason(): string;
|
|
2773
3035
|
}
|
|
2774
|
-
|
|
3036
|
+
interface GPUCompilationMessage {
|
|
2775
3037
|
get message(): string;
|
|
2776
3038
|
get type(): string;
|
|
2777
3039
|
get lineNum(): number;
|
|
@@ -2779,19 +3041,19 @@ declare interface gpuGPUCompilationMessage {
|
|
|
2779
3041
|
get offset(): number;
|
|
2780
3042
|
get length(): number;
|
|
2781
3043
|
}
|
|
2782
|
-
|
|
2783
|
-
get messages():
|
|
3044
|
+
interface GPUCompilationInfo {
|
|
3045
|
+
get messages(): GPUCompilationMessage[];
|
|
2784
3046
|
}
|
|
2785
|
-
declare abstract class
|
|
3047
|
+
declare abstract class GPUTextureUsage {
|
|
2786
3048
|
static readonly COPY_SRC: number;
|
|
2787
3049
|
static readonly COPY_DST: number;
|
|
2788
3050
|
static readonly TEXTURE_BINDING: number;
|
|
2789
3051
|
static readonly STORAGE_BINDING: number;
|
|
2790
3052
|
static readonly RENDER_ATTACHMENT: number;
|
|
2791
3053
|
}
|
|
2792
|
-
|
|
3054
|
+
interface GPUTextureDescriptor {
|
|
2793
3055
|
label: string;
|
|
2794
|
-
size: number[] |
|
|
3056
|
+
size: number[] | GPUExtent3DDict;
|
|
2795
3057
|
mipLevelCount?: number;
|
|
2796
3058
|
sampleCount?: number;
|
|
2797
3059
|
dimension?: string;
|
|
@@ -2799,13 +3061,13 @@ declare interface gpuGPUTextureDescriptor {
|
|
|
2799
3061
|
usage: number;
|
|
2800
3062
|
viewFormats?: string[];
|
|
2801
3063
|
}
|
|
2802
|
-
|
|
3064
|
+
interface GPUExtent3DDict {
|
|
2803
3065
|
width: number;
|
|
2804
3066
|
height?: number;
|
|
2805
3067
|
depthOrArrayLayers?: number;
|
|
2806
3068
|
}
|
|
2807
|
-
|
|
2808
|
-
createView(descriptor?:
|
|
3069
|
+
interface GPUTexture {
|
|
3070
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
2809
3071
|
destroy(): void;
|
|
2810
3072
|
get width(): number;
|
|
2811
3073
|
get height(): number;
|
|
@@ -2815,8 +3077,8 @@ declare interface gpuGPUTexture {
|
|
|
2815
3077
|
get format(): string;
|
|
2816
3078
|
get usage(): number;
|
|
2817
3079
|
}
|
|
2818
|
-
|
|
2819
|
-
|
|
3080
|
+
interface GPUTextureView {}
|
|
3081
|
+
interface GPUTextureViewDescriptor {
|
|
2820
3082
|
label: string;
|
|
2821
3083
|
format: string;
|
|
2822
3084
|
dimension: string;
|
|
@@ -2826,91 +3088,91 @@ declare interface gpuGPUTextureViewDescriptor {
|
|
|
2826
3088
|
baseArrayLayer?: number;
|
|
2827
3089
|
arrayLayerCount: number;
|
|
2828
3090
|
}
|
|
2829
|
-
declare abstract class
|
|
3091
|
+
declare abstract class GPUColorWrite {
|
|
2830
3092
|
static readonly RED: number;
|
|
2831
3093
|
static readonly GREEN: number;
|
|
2832
3094
|
static readonly BLUE: number;
|
|
2833
3095
|
static readonly ALPHA: number;
|
|
2834
3096
|
static readonly ALL: number;
|
|
2835
3097
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
3098
|
+
interface GPURenderPipeline {}
|
|
3099
|
+
interface GPURenderPipelineDescriptor {
|
|
2838
3100
|
label?: string;
|
|
2839
|
-
layout: string |
|
|
2840
|
-
vertex:
|
|
2841
|
-
primitive?:
|
|
2842
|
-
depthStencil?:
|
|
2843
|
-
multisample?:
|
|
2844
|
-
fragment?:
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2847
|
-
module:
|
|
3101
|
+
layout: string | GPUPipelineLayout;
|
|
3102
|
+
vertex: GPUVertexState;
|
|
3103
|
+
primitive?: GPUPrimitiveState;
|
|
3104
|
+
depthStencil?: GPUDepthStencilState;
|
|
3105
|
+
multisample?: GPUMultisampleState;
|
|
3106
|
+
fragment?: GPUFragmentState;
|
|
3107
|
+
}
|
|
3108
|
+
interface GPUVertexState {
|
|
3109
|
+
module: GPUShaderModule;
|
|
2848
3110
|
entryPoint: string;
|
|
2849
3111
|
constants?: Record<string, number>;
|
|
2850
|
-
buffers?:
|
|
3112
|
+
buffers?: GPUVertexBufferLayout[];
|
|
2851
3113
|
}
|
|
2852
|
-
|
|
3114
|
+
interface GPUVertexBufferLayout {
|
|
2853
3115
|
arrayStride: number | bigint;
|
|
2854
3116
|
stepMode?: string;
|
|
2855
|
-
attributes:
|
|
3117
|
+
attributes: GPUVertexAttribute[];
|
|
2856
3118
|
}
|
|
2857
|
-
|
|
3119
|
+
interface GPUVertexAttribute {
|
|
2858
3120
|
format: string;
|
|
2859
3121
|
offset: number | bigint;
|
|
2860
3122
|
shaderLocation: number;
|
|
2861
3123
|
}
|
|
2862
|
-
|
|
3124
|
+
interface GPUPrimitiveState {
|
|
2863
3125
|
topology?: string;
|
|
2864
3126
|
stripIndexFormat?: string;
|
|
2865
3127
|
frontFace?: string;
|
|
2866
3128
|
cullMode?: string;
|
|
2867
3129
|
unclippedDepth?: boolean;
|
|
2868
3130
|
}
|
|
2869
|
-
|
|
3131
|
+
interface GPUStencilFaceState {
|
|
2870
3132
|
compare?: string;
|
|
2871
3133
|
failOp?: string;
|
|
2872
3134
|
depthFailOp?: string;
|
|
2873
3135
|
passOp?: string;
|
|
2874
3136
|
}
|
|
2875
|
-
|
|
3137
|
+
interface GPUDepthStencilState {
|
|
2876
3138
|
format: string;
|
|
2877
3139
|
depthWriteEnabled: boolean;
|
|
2878
3140
|
depthCompare: string;
|
|
2879
|
-
stencilFront?:
|
|
2880
|
-
stencilBack?:
|
|
3141
|
+
stencilFront?: GPUStencilFaceState;
|
|
3142
|
+
stencilBack?: GPUStencilFaceState;
|
|
2881
3143
|
stencilReadMask?: number;
|
|
2882
3144
|
stencilWriteMask?: number;
|
|
2883
3145
|
depthBias?: number;
|
|
2884
3146
|
depthBiasSlopeScale?: number;
|
|
2885
3147
|
depthBiasClamp?: number;
|
|
2886
3148
|
}
|
|
2887
|
-
|
|
3149
|
+
interface GPUMultisampleState {
|
|
2888
3150
|
count?: number;
|
|
2889
3151
|
mask?: number;
|
|
2890
3152
|
alphaToCoverageEnabled?: boolean;
|
|
2891
3153
|
}
|
|
2892
|
-
|
|
2893
|
-
module:
|
|
3154
|
+
interface GPUFragmentState {
|
|
3155
|
+
module: GPUShaderModule;
|
|
2894
3156
|
entryPoint: string;
|
|
2895
3157
|
constants?: Record<string, number>;
|
|
2896
|
-
targets:
|
|
3158
|
+
targets: GPUColorTargetState[];
|
|
2897
3159
|
}
|
|
2898
|
-
|
|
3160
|
+
interface GPUColorTargetState {
|
|
2899
3161
|
format: string;
|
|
2900
|
-
blend:
|
|
3162
|
+
blend: GPUBlendState;
|
|
2901
3163
|
writeMask?: number;
|
|
2902
3164
|
}
|
|
2903
|
-
|
|
2904
|
-
color:
|
|
2905
|
-
alpha:
|
|
3165
|
+
interface GPUBlendState {
|
|
3166
|
+
color: GPUBlendComponent;
|
|
3167
|
+
alpha: GPUBlendComponent;
|
|
2906
3168
|
}
|
|
2907
|
-
|
|
3169
|
+
interface GPUBlendComponent {
|
|
2908
3170
|
operation?: string;
|
|
2909
3171
|
srcFactor?: string;
|
|
2910
3172
|
dstFactor?: string;
|
|
2911
3173
|
}
|
|
2912
|
-
|
|
2913
|
-
setPipeline(pipeline:
|
|
3174
|
+
interface GPURenderPassEncoder {
|
|
3175
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2914
3176
|
draw(
|
|
2915
3177
|
vertexCount: number,
|
|
2916
3178
|
instanceCount?: number,
|
|
@@ -2919,30 +3181,30 @@ declare interface gpuGPURenderPassEncoder {
|
|
|
2919
3181
|
): void;
|
|
2920
3182
|
end(): void;
|
|
2921
3183
|
}
|
|
2922
|
-
|
|
3184
|
+
interface GPURenderPassDescriptor {
|
|
2923
3185
|
label?: string;
|
|
2924
|
-
colorAttachments:
|
|
2925
|
-
depthStencilAttachment?:
|
|
2926
|
-
occlusionQuerySet?:
|
|
2927
|
-
timestampWrites?:
|
|
3186
|
+
colorAttachments: GPURenderPassColorAttachment[];
|
|
3187
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
3188
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
3189
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
2928
3190
|
maxDrawCount?: number | bigint;
|
|
2929
3191
|
}
|
|
2930
|
-
|
|
2931
|
-
view:
|
|
3192
|
+
interface GPURenderPassColorAttachment {
|
|
3193
|
+
view: GPUTextureView;
|
|
2932
3194
|
depthSlice?: number;
|
|
2933
|
-
resolveTarget?:
|
|
2934
|
-
clearValue?: number[] |
|
|
3195
|
+
resolveTarget?: GPUTextureView;
|
|
3196
|
+
clearValue?: number[] | GPUColorDict;
|
|
2935
3197
|
loadOp: string;
|
|
2936
3198
|
storeOp: string;
|
|
2937
3199
|
}
|
|
2938
|
-
|
|
3200
|
+
interface GPUColorDict {
|
|
2939
3201
|
r: number;
|
|
2940
3202
|
g: number;
|
|
2941
3203
|
b: number;
|
|
2942
3204
|
a: number;
|
|
2943
3205
|
}
|
|
2944
|
-
|
|
2945
|
-
view:
|
|
3206
|
+
interface GPURenderPassDepthStencilAttachment {
|
|
3207
|
+
view: GPUTextureView;
|
|
2946
3208
|
depthClearValue?: number;
|
|
2947
3209
|
depthLoadOp?: string;
|
|
2948
3210
|
depthStoreOp?: string;
|
|
@@ -2952,29 +3214,373 @@ declare interface gpuGPURenderPassDepthStencilAttachment {
|
|
|
2952
3214
|
stencilStoreOp?: string;
|
|
2953
3215
|
stencilReadOnly?: boolean;
|
|
2954
3216
|
}
|
|
2955
|
-
|
|
2956
|
-
querySet:
|
|
3217
|
+
interface GPURenderPassTimestampWrites {
|
|
3218
|
+
querySet: GPUQuerySet;
|
|
2957
3219
|
beginningOfPassWriteIndex?: number;
|
|
2958
3220
|
endOfPassWriteIndex?: number;
|
|
2959
3221
|
}
|
|
2960
|
-
|
|
2961
|
-
texture:
|
|
3222
|
+
interface GPUImageCopyTexture {
|
|
3223
|
+
texture: GPUTexture;
|
|
2962
3224
|
mipLevel?: number;
|
|
2963
|
-
origin?: number[] |
|
|
3225
|
+
origin?: number[] | GPUOrigin3DDict;
|
|
2964
3226
|
aspect?: string;
|
|
2965
3227
|
}
|
|
2966
|
-
|
|
2967
|
-
buffer:
|
|
3228
|
+
interface GPUImageCopyBuffer {
|
|
3229
|
+
buffer: GPUBuffer;
|
|
2968
3230
|
offset?: number | bigint;
|
|
2969
3231
|
bytesPerRow?: number;
|
|
2970
3232
|
rowsPerImage?: number;
|
|
2971
3233
|
}
|
|
2972
|
-
|
|
3234
|
+
interface GPUOrigin3DDict {
|
|
2973
3235
|
x?: number;
|
|
2974
3236
|
y?: number;
|
|
2975
3237
|
z?: number;
|
|
2976
3238
|
}
|
|
2977
|
-
|
|
3239
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3240
|
+
declare class EventSource {
|
|
3241
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3242
|
+
/**
|
|
3243
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
3244
|
+
*
|
|
3245
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3246
|
+
*/
|
|
3247
|
+
close(): void;
|
|
3248
|
+
/**
|
|
3249
|
+
* Returns the URL providing the event stream.
|
|
3250
|
+
*
|
|
3251
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3252
|
+
*/
|
|
3253
|
+
get url(): string;
|
|
3254
|
+
/**
|
|
3255
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3256
|
+
*
|
|
3257
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3258
|
+
*/
|
|
3259
|
+
get withCredentials(): boolean;
|
|
3260
|
+
/**
|
|
3261
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3262
|
+
*
|
|
3263
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3264
|
+
*/
|
|
3265
|
+
get readyState(): number;
|
|
3266
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3267
|
+
get onopen(): any | null;
|
|
3268
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3269
|
+
set onopen(value: any | null);
|
|
3270
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3271
|
+
get onmessage(): any | null;
|
|
3272
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3273
|
+
set onmessage(value: any | null);
|
|
3274
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3275
|
+
get onerror(): any | null;
|
|
3276
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3277
|
+
set onerror(value: any | null);
|
|
3278
|
+
static readonly CONNECTING: number;
|
|
3279
|
+
static readonly OPEN: number;
|
|
3280
|
+
static readonly CLOSED: number;
|
|
3281
|
+
static from(stream: ReadableStream): EventSource;
|
|
3282
|
+
}
|
|
3283
|
+
interface EventSourceEventSourceInit {
|
|
3284
|
+
withCredentials?: boolean;
|
|
3285
|
+
fetcher?: Fetcher;
|
|
3286
|
+
}
|
|
3287
|
+
type AiImageClassificationInput = {
|
|
3288
|
+
image: number[];
|
|
3289
|
+
};
|
|
3290
|
+
type AiImageClassificationOutput = {
|
|
3291
|
+
score?: number;
|
|
3292
|
+
label?: string;
|
|
3293
|
+
}[];
|
|
3294
|
+
declare abstract class BaseAiImageClassification {
|
|
3295
|
+
inputs: AiImageClassificationInput;
|
|
3296
|
+
postProcessedOutputs: AiImageClassificationOutput;
|
|
3297
|
+
}
|
|
3298
|
+
type AiImageToTextInput = {
|
|
3299
|
+
image: number[];
|
|
3300
|
+
prompt?: string;
|
|
3301
|
+
max_tokens?: number;
|
|
3302
|
+
temperature?: number;
|
|
3303
|
+
top_p?: number;
|
|
3304
|
+
top_k?: number;
|
|
3305
|
+
seed?: number;
|
|
3306
|
+
repetition_penalty?: number;
|
|
3307
|
+
frequency_penalty?: number;
|
|
3308
|
+
presence_penalty?: number;
|
|
3309
|
+
raw?: boolean;
|
|
3310
|
+
messages?: RoleScopedChatInput[];
|
|
3311
|
+
};
|
|
3312
|
+
type AiImageToTextOutput = {
|
|
3313
|
+
description: string;
|
|
3314
|
+
};
|
|
3315
|
+
declare abstract class BaseAiImageToText {
|
|
3316
|
+
inputs: AiImageToTextInput;
|
|
3317
|
+
postProcessedOutputs: AiImageToTextOutput;
|
|
3318
|
+
}
|
|
3319
|
+
type AiObjectDetectionInput = {
|
|
3320
|
+
image: number[];
|
|
3321
|
+
};
|
|
3322
|
+
type AiObjectDetectionOutput = {
|
|
3323
|
+
score?: number;
|
|
3324
|
+
label?: string;
|
|
3325
|
+
}[];
|
|
3326
|
+
declare abstract class BaseAiObjectDetection {
|
|
3327
|
+
inputs: AiObjectDetectionInput;
|
|
3328
|
+
postProcessedOutputs: AiObjectDetectionOutput;
|
|
3329
|
+
}
|
|
3330
|
+
type AiSentenceSimilarityInput = {
|
|
3331
|
+
source: string;
|
|
3332
|
+
sentences: string[];
|
|
3333
|
+
};
|
|
3334
|
+
type AiSentenceSimilarityOutput = number[];
|
|
3335
|
+
declare abstract class BaseAiSentenceSimilarity {
|
|
3336
|
+
inputs: AiSentenceSimilarityInput;
|
|
3337
|
+
postProcessedOutputs: AiSentenceSimilarityOutput;
|
|
3338
|
+
}
|
|
3339
|
+
type AiSpeechRecognitionInput = {
|
|
3340
|
+
audio: number[];
|
|
3341
|
+
};
|
|
3342
|
+
type AiSpeechRecognitionOutput = {
|
|
3343
|
+
text?: string;
|
|
3344
|
+
words?: {
|
|
3345
|
+
word: string;
|
|
3346
|
+
start: number;
|
|
3347
|
+
end: number;
|
|
3348
|
+
}[];
|
|
3349
|
+
vtt?: string;
|
|
3350
|
+
};
|
|
3351
|
+
declare abstract class BaseAiSpeechRecognition {
|
|
3352
|
+
inputs: AiSpeechRecognitionInput;
|
|
3353
|
+
postProcessedOutputs: AiSpeechRecognitionOutput;
|
|
3354
|
+
}
|
|
3355
|
+
type AiSummarizationInput = {
|
|
3356
|
+
input_text: string;
|
|
3357
|
+
max_length?: number;
|
|
3358
|
+
};
|
|
3359
|
+
type AiSummarizationOutput = {
|
|
3360
|
+
summary: string;
|
|
3361
|
+
};
|
|
3362
|
+
declare abstract class BaseAiSummarization {
|
|
3363
|
+
inputs: AiSummarizationInput;
|
|
3364
|
+
postProcessedOutputs: AiSummarizationOutput;
|
|
3365
|
+
}
|
|
3366
|
+
type AiTextClassificationInput = {
|
|
3367
|
+
text: string;
|
|
3368
|
+
};
|
|
3369
|
+
type AiTextClassificationOutput = {
|
|
3370
|
+
score?: number;
|
|
3371
|
+
label?: string;
|
|
3372
|
+
}[];
|
|
3373
|
+
declare abstract class BaseAiTextClassification {
|
|
3374
|
+
inputs: AiTextClassificationInput;
|
|
3375
|
+
postProcessedOutputs: AiTextClassificationOutput;
|
|
3376
|
+
}
|
|
3377
|
+
type AiTextEmbeddingsInput = {
|
|
3378
|
+
text: string | string[];
|
|
3379
|
+
};
|
|
3380
|
+
type AiTextEmbeddingsOutput = {
|
|
3381
|
+
shape: number[];
|
|
3382
|
+
data: number[][];
|
|
3383
|
+
};
|
|
3384
|
+
declare abstract class BaseAiTextEmbeddings {
|
|
3385
|
+
inputs: AiTextEmbeddingsInput;
|
|
3386
|
+
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3387
|
+
}
|
|
3388
|
+
type RoleScopedChatInput = {
|
|
3389
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3390
|
+
content: string;
|
|
3391
|
+
};
|
|
3392
|
+
type AiTextGenerationToolInput = {
|
|
3393
|
+
type: "function";
|
|
3394
|
+
function: {
|
|
3395
|
+
name: string;
|
|
3396
|
+
description: string;
|
|
3397
|
+
parameters?: {
|
|
3398
|
+
type: "object";
|
|
3399
|
+
properties: {
|
|
3400
|
+
[key: string]: {
|
|
3401
|
+
type: string;
|
|
3402
|
+
description?: string;
|
|
3403
|
+
};
|
|
3404
|
+
};
|
|
3405
|
+
required: string[];
|
|
3406
|
+
};
|
|
3407
|
+
};
|
|
3408
|
+
};
|
|
3409
|
+
type AiTextGenerationInput = {
|
|
3410
|
+
prompt?: string;
|
|
3411
|
+
raw?: boolean;
|
|
3412
|
+
stream?: boolean;
|
|
3413
|
+
max_tokens?: number;
|
|
3414
|
+
temperature?: number;
|
|
3415
|
+
top_p?: number;
|
|
3416
|
+
top_k?: number;
|
|
3417
|
+
seed?: number;
|
|
3418
|
+
repetition_penalty?: number;
|
|
3419
|
+
frequency_penalty?: number;
|
|
3420
|
+
presence_penalty?: number;
|
|
3421
|
+
messages?: RoleScopedChatInput[];
|
|
3422
|
+
tools?: AiTextGenerationToolInput[];
|
|
3423
|
+
};
|
|
3424
|
+
type AiTextGenerationOutput =
|
|
3425
|
+
| {
|
|
3426
|
+
response?: string;
|
|
3427
|
+
tool_calls?: {
|
|
3428
|
+
name: string;
|
|
3429
|
+
arguments: unknown;
|
|
3430
|
+
}[];
|
|
3431
|
+
}
|
|
3432
|
+
| ReadableStream;
|
|
3433
|
+
declare abstract class BaseAiTextGeneration {
|
|
3434
|
+
inputs: AiTextGenerationInput;
|
|
3435
|
+
postProcessedOutputs: AiTextGenerationOutput;
|
|
3436
|
+
}
|
|
3437
|
+
type AiTextToImageInput = {
|
|
3438
|
+
prompt: string;
|
|
3439
|
+
image?: number[];
|
|
3440
|
+
mask?: number[];
|
|
3441
|
+
num_steps?: number;
|
|
3442
|
+
strength?: number;
|
|
3443
|
+
guidance?: number;
|
|
3444
|
+
};
|
|
3445
|
+
type AiTextToImageOutput = Uint8Array;
|
|
3446
|
+
declare abstract class BaseAiTextToImage {
|
|
3447
|
+
inputs: AiTextToImageInput;
|
|
3448
|
+
postProcessedOutputs: AiTextToImageOutput;
|
|
3449
|
+
}
|
|
3450
|
+
type AiTranslationInput = {
|
|
3451
|
+
text: string;
|
|
3452
|
+
target_lang: string;
|
|
3453
|
+
source_lang?: string;
|
|
3454
|
+
};
|
|
3455
|
+
type AiTranslationOutput = {
|
|
3456
|
+
translated_text?: string;
|
|
3457
|
+
};
|
|
3458
|
+
declare abstract class BaseAiTranslation {
|
|
3459
|
+
inputs: AiTranslationInput;
|
|
3460
|
+
postProcessedOutputs: AiTranslationOutput;
|
|
3461
|
+
}
|
|
3462
|
+
type GatewayOptions = {
|
|
3463
|
+
id: string;
|
|
3464
|
+
cacheTtl?: number;
|
|
3465
|
+
skipCache?: boolean;
|
|
3466
|
+
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
3467
|
+
};
|
|
3468
|
+
type AiOptions = {
|
|
3469
|
+
gateway?: GatewayOptions;
|
|
3470
|
+
prefix?: string;
|
|
3471
|
+
extraHeaders?: object;
|
|
3472
|
+
};
|
|
3473
|
+
type BaseAiTextClassificationModels = "@cf/huggingface/distilbert-sst-2-int8";
|
|
3474
|
+
type BaseAiTextToImageModels =
|
|
3475
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3476
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3477
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3478
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3479
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3480
|
+
type BaseAiTextEmbeddingsModels =
|
|
3481
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3482
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3483
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3484
|
+
type BaseAiSpeechRecognitionModels =
|
|
3485
|
+
| "@cf/openai/whisper"
|
|
3486
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3487
|
+
| "@cf/openai/whisper-sherpa";
|
|
3488
|
+
type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3489
|
+
type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3490
|
+
type BaseAiTextGenerationModels =
|
|
3491
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3492
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3493
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3494
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3495
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3496
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3497
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3498
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3499
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3500
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3501
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3502
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3503
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3504
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3505
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3506
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3507
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3508
|
+
| "@hf/google/gemma-7b-it"
|
|
3509
|
+
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3510
|
+
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3511
|
+
| "@cf/defog/sqlcoder-7b-2"
|
|
3512
|
+
| "@cf/openchat/openchat-3.5-0106"
|
|
3513
|
+
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3514
|
+
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3515
|
+
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3516
|
+
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3517
|
+
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3518
|
+
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3519
|
+
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3520
|
+
| "@cf/microsoft/phi-2"
|
|
3521
|
+
| "@cf/google/gemma-2b-it-lora"
|
|
3522
|
+
| "@cf/google/gemma-7b-it-lora"
|
|
3523
|
+
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3524
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3525
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3526
|
+
type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3527
|
+
type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3528
|
+
type BaseAiImageToTextModels =
|
|
3529
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3530
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3531
|
+
declare abstract class Ai {
|
|
3532
|
+
run(
|
|
3533
|
+
model: BaseAiTextClassificationModels,
|
|
3534
|
+
inputs: BaseAiTextClassification["inputs"],
|
|
3535
|
+
options?: AiOptions,
|
|
3536
|
+
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3537
|
+
run(
|
|
3538
|
+
model: BaseAiTextToImageModels,
|
|
3539
|
+
inputs: BaseAiTextToImage["inputs"],
|
|
3540
|
+
options?: AiOptions,
|
|
3541
|
+
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3542
|
+
run(
|
|
3543
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3544
|
+
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3545
|
+
options?: AiOptions,
|
|
3546
|
+
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3547
|
+
run(
|
|
3548
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3549
|
+
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3550
|
+
options?: AiOptions,
|
|
3551
|
+
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3552
|
+
run(
|
|
3553
|
+
model: BaseAiImageClassificationModels,
|
|
3554
|
+
inputs: BaseAiImageClassification["inputs"],
|
|
3555
|
+
options?: AiOptions,
|
|
3556
|
+
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3557
|
+
run(
|
|
3558
|
+
model: BaseAiObjectDetectionModels,
|
|
3559
|
+
inputs: BaseAiObjectDetection["inputs"],
|
|
3560
|
+
options?: AiOptions,
|
|
3561
|
+
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3562
|
+
run(
|
|
3563
|
+
model: BaseAiTextGenerationModels,
|
|
3564
|
+
inputs: BaseAiTextGeneration["inputs"],
|
|
3565
|
+
options?: AiOptions,
|
|
3566
|
+
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3567
|
+
run(
|
|
3568
|
+
model: BaseAiTranslationModels,
|
|
3569
|
+
inputs: BaseAiTranslation["inputs"],
|
|
3570
|
+
options?: AiOptions,
|
|
3571
|
+
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3572
|
+
run(
|
|
3573
|
+
model: BaseAiSummarizationModels,
|
|
3574
|
+
inputs: BaseAiSummarization["inputs"],
|
|
3575
|
+
options?: AiOptions,
|
|
3576
|
+
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3577
|
+
run(
|
|
3578
|
+
model: BaseAiImageToTextModels,
|
|
3579
|
+
inputs: BaseAiImageToText["inputs"],
|
|
3580
|
+
options?: AiOptions,
|
|
3581
|
+
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
3582
|
+
}
|
|
3583
|
+
interface BasicImageTransformations {
|
|
2978
3584
|
/**
|
|
2979
3585
|
* Maximum width in image pixels. The value must be an integer.
|
|
2980
3586
|
*/
|
|
@@ -3040,7 +3646,7 @@ declare interface BasicImageTransformations {
|
|
|
3040
3646
|
*/
|
|
3041
3647
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
3042
3648
|
}
|
|
3043
|
-
|
|
3649
|
+
interface BasicImageTransformationsGravityCoordinates {
|
|
3044
3650
|
x: number;
|
|
3045
3651
|
y: number;
|
|
3046
3652
|
}
|
|
@@ -3053,7 +3659,7 @@ declare interface BasicImageTransformationsGravityCoordinates {
|
|
|
3053
3659
|
* Note: Currently, these properties cannot be tested in the
|
|
3054
3660
|
* playground.
|
|
3055
3661
|
*/
|
|
3056
|
-
|
|
3662
|
+
interface RequestInitCfProperties extends Record<string, unknown> {
|
|
3057
3663
|
cacheEverything?: boolean;
|
|
3058
3664
|
/**
|
|
3059
3665
|
* A request's cache key is what determines if two requests are
|
|
@@ -3088,6 +3694,7 @@ declare interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3088
3694
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
3089
3695
|
mirage?: boolean;
|
|
3090
3696
|
polish?: "lossy" | "lossless" | "off";
|
|
3697
|
+
r2?: RequestInitCfPropertiesR2;
|
|
3091
3698
|
/**
|
|
3092
3699
|
* Redirects the request to an alternate origin server. You can use this,
|
|
3093
3700
|
* for example, to implement load balancing across several origins.
|
|
@@ -3103,8 +3710,7 @@ declare interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3103
3710
|
*/
|
|
3104
3711
|
resolveOverride?: string;
|
|
3105
3712
|
}
|
|
3106
|
-
|
|
3107
|
-
extends BasicImageTransformations {
|
|
3713
|
+
interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
3108
3714
|
/**
|
|
3109
3715
|
* Absolute URL of the image file to use for the drawing. It can be any of
|
|
3110
3716
|
* the supported file formats. For drawing of watermarks or non-rectangular
|
|
@@ -3141,8 +3747,7 @@ declare interface RequestInitCfPropertiesImageDraw
|
|
|
3141
3747
|
bottom?: number;
|
|
3142
3748
|
right?: number;
|
|
3143
3749
|
}
|
|
3144
|
-
|
|
3145
|
-
extends BasicImageTransformations {
|
|
3750
|
+
interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
3146
3751
|
/**
|
|
3147
3752
|
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
3148
3753
|
* easier to specify higher-DPI sizes in <img srcset>.
|
|
@@ -3267,22 +3872,27 @@ declare interface RequestInitCfPropertiesImage
|
|
|
3267
3872
|
*/
|
|
3268
3873
|
compression?: "fast";
|
|
3269
3874
|
}
|
|
3270
|
-
|
|
3875
|
+
interface RequestInitCfPropertiesImageMinify {
|
|
3271
3876
|
javascript?: boolean;
|
|
3272
3877
|
css?: boolean;
|
|
3273
3878
|
html?: boolean;
|
|
3274
3879
|
}
|
|
3880
|
+
interface RequestInitCfPropertiesR2 {
|
|
3881
|
+
/**
|
|
3882
|
+
* Colo id of bucket that an object is stored in
|
|
3883
|
+
*/
|
|
3884
|
+
bucketColoId?: number;
|
|
3885
|
+
}
|
|
3275
3886
|
/**
|
|
3276
3887
|
* Request metadata provided by Cloudflare's edge.
|
|
3277
3888
|
*/
|
|
3278
|
-
|
|
3889
|
+
type IncomingRequestCfProperties<HostMetadata = unknown> =
|
|
3279
3890
|
IncomingRequestCfPropertiesBase &
|
|
3280
3891
|
IncomingRequestCfPropertiesBotManagementEnterprise &
|
|
3281
3892
|
IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> &
|
|
3282
3893
|
IncomingRequestCfPropertiesGeographicInformation &
|
|
3283
3894
|
IncomingRequestCfPropertiesCloudflareAccessOrApiShield;
|
|
3284
|
-
|
|
3285
|
-
extends Record<string, unknown> {
|
|
3895
|
+
interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {
|
|
3286
3896
|
/**
|
|
3287
3897
|
* [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request.
|
|
3288
3898
|
*
|
|
@@ -3360,7 +3970,7 @@ declare interface IncomingRequestCfPropertiesBase
|
|
|
3360
3970
|
*/
|
|
3361
3971
|
tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata;
|
|
3362
3972
|
}
|
|
3363
|
-
|
|
3973
|
+
interface IncomingRequestCfPropertiesBotManagementBase {
|
|
3364
3974
|
/**
|
|
3365
3975
|
* Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot,
|
|
3366
3976
|
* represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human).
|
|
@@ -3387,7 +3997,7 @@ declare interface IncomingRequestCfPropertiesBotManagementBase {
|
|
|
3387
3997
|
*/
|
|
3388
3998
|
detectionIds: number[];
|
|
3389
3999
|
}
|
|
3390
|
-
|
|
4000
|
+
interface IncomingRequestCfPropertiesBotManagement {
|
|
3391
4001
|
/**
|
|
3392
4002
|
* Results of Cloudflare's Bot Management analysis
|
|
3393
4003
|
*/
|
|
@@ -3399,7 +4009,7 @@ declare interface IncomingRequestCfPropertiesBotManagement {
|
|
|
3399
4009
|
*/
|
|
3400
4010
|
clientTrustScore: number;
|
|
3401
4011
|
}
|
|
3402
|
-
|
|
4012
|
+
interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
3403
4013
|
extends IncomingRequestCfPropertiesBotManagement {
|
|
3404
4014
|
/**
|
|
3405
4015
|
* Results of Cloudflare's Bot Management analysis
|
|
@@ -3412,9 +4022,7 @@ declare interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
|
3412
4022
|
ja3Hash: string;
|
|
3413
4023
|
};
|
|
3414
4024
|
}
|
|
3415
|
-
|
|
3416
|
-
HostMetadata,
|
|
3417
|
-
> {
|
|
4025
|
+
interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {
|
|
3418
4026
|
/**
|
|
3419
4027
|
* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
|
|
3420
4028
|
*
|
|
@@ -3423,7 +4031,7 @@ declare interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
|
|
|
3423
4031
|
*/
|
|
3424
4032
|
hostMetadata: HostMetadata;
|
|
3425
4033
|
}
|
|
3426
|
-
|
|
4034
|
+
interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
|
|
3427
4035
|
/**
|
|
3428
4036
|
* Information about the client certificate presented to Cloudflare.
|
|
3429
4037
|
*
|
|
@@ -3445,7 +4053,7 @@ declare interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
|
|
|
3445
4053
|
/**
|
|
3446
4054
|
* Metadata about the request's TLS handshake
|
|
3447
4055
|
*/
|
|
3448
|
-
|
|
4056
|
+
interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
|
|
3449
4057
|
/**
|
|
3450
4058
|
* The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
|
|
3451
4059
|
*
|
|
@@ -3474,7 +4082,7 @@ declare interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
|
|
|
3474
4082
|
/**
|
|
3475
4083
|
* Geographic data about the request's origin.
|
|
3476
4084
|
*/
|
|
3477
|
-
|
|
4085
|
+
interface IncomingRequestCfPropertiesGeographicInformation {
|
|
3478
4086
|
/**
|
|
3479
4087
|
* The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
|
|
3480
4088
|
*
|
|
@@ -3551,7 +4159,7 @@ declare interface IncomingRequestCfPropertiesGeographicInformation {
|
|
|
3551
4159
|
metroCode?: string;
|
|
3552
4160
|
}
|
|
3553
4161
|
/** Data about the incoming request's TLS certificate */
|
|
3554
|
-
|
|
4162
|
+
interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
3555
4163
|
/** Always `"1"`, indicating that the certificate was presented */
|
|
3556
4164
|
certPresented: "1";
|
|
3557
4165
|
/**
|
|
@@ -3644,7 +4252,7 @@ declare interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
|
3644
4252
|
certNotAfter: string;
|
|
3645
4253
|
}
|
|
3646
4254
|
/** Placeholder values for TLS Client Authorization */
|
|
3647
|
-
|
|
4255
|
+
interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
|
|
3648
4256
|
certPresented: "0";
|
|
3649
4257
|
certVerified: "NONE";
|
|
3650
4258
|
certRevoked: "0";
|
|
@@ -3942,10 +4550,10 @@ declare type Iso3166Alpha2Code =
|
|
|
3942
4550
|
| "ZW";
|
|
3943
4551
|
/** The 2-letter continent codes Cloudflare uses */
|
|
3944
4552
|
declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
|
|
3945
|
-
|
|
4553
|
+
type CfProperties<HostMetadata = unknown> =
|
|
3946
4554
|
| IncomingRequestCfProperties<HostMetadata>
|
|
3947
4555
|
| RequestInitCfProperties;
|
|
3948
|
-
|
|
4556
|
+
interface D1Meta {
|
|
3949
4557
|
duration: number;
|
|
3950
4558
|
size_after: number;
|
|
3951
4559
|
rows_read: number;
|
|
@@ -3954,15 +4562,15 @@ declare interface D1Meta {
|
|
|
3954
4562
|
changed_db: boolean;
|
|
3955
4563
|
changes: number;
|
|
3956
4564
|
}
|
|
3957
|
-
|
|
4565
|
+
interface D1Response {
|
|
3958
4566
|
success: true;
|
|
3959
4567
|
meta: D1Meta & Record<string, unknown>;
|
|
3960
4568
|
error?: never;
|
|
3961
4569
|
}
|
|
3962
|
-
|
|
4570
|
+
type D1Result<T = unknown> = D1Response & {
|
|
3963
4571
|
results: T[];
|
|
3964
4572
|
};
|
|
3965
|
-
|
|
4573
|
+
interface D1ExecResult {
|
|
3966
4574
|
count: number;
|
|
3967
4575
|
duration: number;
|
|
3968
4576
|
}
|
|
@@ -3989,11 +4597,11 @@ declare abstract class D1PreparedStatement {
|
|
|
3989
4597
|
// but this will ensure type checking on older versions still passes.
|
|
3990
4598
|
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
3991
4599
|
// ignored when `Disposable` is included in the standard lib.
|
|
3992
|
-
|
|
4600
|
+
interface Disposable {}
|
|
3993
4601
|
/**
|
|
3994
4602
|
* An email message that can be sent from a Worker.
|
|
3995
4603
|
*/
|
|
3996
|
-
|
|
4604
|
+
interface EmailMessage {
|
|
3997
4605
|
/**
|
|
3998
4606
|
* Envelope From attribute of the email message.
|
|
3999
4607
|
*/
|
|
@@ -4006,7 +4614,7 @@ declare interface EmailMessage {
|
|
|
4006
4614
|
/**
|
|
4007
4615
|
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
4008
4616
|
*/
|
|
4009
|
-
|
|
4617
|
+
interface ForwardableEmailMessage extends EmailMessage {
|
|
4010
4618
|
/**
|
|
4011
4619
|
* Stream of the email message content.
|
|
4012
4620
|
*/
|
|
@@ -4036,7 +4644,7 @@ declare interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4036
4644
|
/**
|
|
4037
4645
|
* A binding that allows a Worker to send email messages.
|
|
4038
4646
|
*/
|
|
4039
|
-
|
|
4647
|
+
interface SendEmail {
|
|
4040
4648
|
send(message: EmailMessage): Promise<void>;
|
|
4041
4649
|
}
|
|
4042
4650
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
@@ -4054,7 +4662,7 @@ declare module "cloudflare:email" {
|
|
|
4054
4662
|
};
|
|
4055
4663
|
export { _EmailMessage as EmailMessage };
|
|
4056
4664
|
}
|
|
4057
|
-
|
|
4665
|
+
interface Hyperdrive {
|
|
4058
4666
|
/**
|
|
4059
4667
|
* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
|
|
4060
4668
|
*
|
|
@@ -4101,8 +4709,8 @@ declare interface Hyperdrive {
|
|
|
4101
4709
|
*/
|
|
4102
4710
|
readonly database: string;
|
|
4103
4711
|
}
|
|
4104
|
-
|
|
4105
|
-
|
|
4712
|
+
type Params<P extends string = any> = Record<P, string | string[]>;
|
|
4713
|
+
type EventContext<Env, P extends string, Data> = {
|
|
4106
4714
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
4107
4715
|
functionPath: string;
|
|
4108
4716
|
waitUntil: (promise: Promise<any>) => void;
|
|
@@ -4116,12 +4724,12 @@ declare type EventContext<Env, P extends string, Data> = {
|
|
|
4116
4724
|
params: Params<P>;
|
|
4117
4725
|
data: Data;
|
|
4118
4726
|
};
|
|
4119
|
-
|
|
4727
|
+
type PagesFunction<
|
|
4120
4728
|
Env = unknown,
|
|
4121
4729
|
Params extends string = any,
|
|
4122
4730
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
4123
4731
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
4124
|
-
|
|
4732
|
+
type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
4125
4733
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
4126
4734
|
functionPath: string;
|
|
4127
4735
|
waitUntil: (promise: Promise<any>) => void;
|
|
@@ -4136,7 +4744,7 @@ declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
|
4136
4744
|
data: Data;
|
|
4137
4745
|
pluginArgs: PluginArgs;
|
|
4138
4746
|
};
|
|
4139
|
-
|
|
4747
|
+
type PagesPluginFunction<
|
|
4140
4748
|
Env = unknown,
|
|
4141
4749
|
Params extends string = any,
|
|
4142
4750
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
@@ -4151,7 +4759,7 @@ declare module "assets:*" {
|
|
|
4151
4759
|
// The message includes metadata about the broker, the client, and the payload
|
|
4152
4760
|
// itself.
|
|
4153
4761
|
// https://developers.cloudflare.com/pub-sub/
|
|
4154
|
-
|
|
4762
|
+
interface PubSubMessage {
|
|
4155
4763
|
// Message ID
|
|
4156
4764
|
readonly mid: number;
|
|
4157
4765
|
// MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
|
|
@@ -4177,10 +4785,24 @@ declare interface PubSubMessage {
|
|
|
4177
4785
|
payload: string | Uint8Array;
|
|
4178
4786
|
}
|
|
4179
4787
|
// JsonWebKey extended by kid parameter
|
|
4180
|
-
|
|
4788
|
+
interface JsonWebKeyWithKid extends JsonWebKey {
|
|
4181
4789
|
// Key Identifier of the JWK
|
|
4182
4790
|
readonly kid: string;
|
|
4183
4791
|
}
|
|
4792
|
+
interface RateLimitOptions {
|
|
4793
|
+
key: string;
|
|
4794
|
+
}
|
|
4795
|
+
interface RateLimitOutcome {
|
|
4796
|
+
success: boolean;
|
|
4797
|
+
}
|
|
4798
|
+
interface RateLimit {
|
|
4799
|
+
/**
|
|
4800
|
+
* Rate limit a request based on the provided options.
|
|
4801
|
+
* @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
|
|
4802
|
+
* @returns A promise that resolves with the outcome of the rate limit.
|
|
4803
|
+
*/
|
|
4804
|
+
limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
|
|
4805
|
+
}
|
|
4184
4806
|
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4185
4807
|
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4186
4808
|
// strips all `module` blocks.
|
|
@@ -4388,19 +5010,15 @@ declare module "cloudflare:sockets" {
|
|
|
4388
5010
|
/**
|
|
4389
5011
|
* Data types supported for holding vector metadata.
|
|
4390
5012
|
*/
|
|
4391
|
-
|
|
4392
|
-
| string
|
|
4393
|
-
| number
|
|
4394
|
-
| boolean
|
|
4395
|
-
| string[];
|
|
5013
|
+
type VectorizeVectorMetadataValue = string | number | boolean | string[];
|
|
4396
5014
|
/**
|
|
4397
5015
|
* Additional information to associate with a vector.
|
|
4398
5016
|
*/
|
|
4399
|
-
|
|
5017
|
+
type VectorizeVectorMetadata =
|
|
4400
5018
|
| VectorizeVectorMetadataValue
|
|
4401
5019
|
| Record<string, VectorizeVectorMetadataValue>;
|
|
4402
|
-
|
|
4403
|
-
|
|
5020
|
+
type VectorFloatArray = Float32Array | Float64Array;
|
|
5021
|
+
interface VectorizeError {
|
|
4404
5022
|
code?: number;
|
|
4405
5023
|
error: string;
|
|
4406
5024
|
}
|
|
@@ -4409,11 +5027,11 @@ declare interface VectorizeError {
|
|
|
4409
5027
|
*
|
|
4410
5028
|
* This list is expected to grow as support for more operations are released.
|
|
4411
5029
|
*/
|
|
4412
|
-
|
|
5030
|
+
type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
|
|
4413
5031
|
/**
|
|
4414
5032
|
* Filter criteria for vector metadata used to limit the retrieved query result set.
|
|
4415
5033
|
*/
|
|
4416
|
-
|
|
5034
|
+
type VectorizeVectorMetadataFilter = {
|
|
4417
5035
|
[field: string]:
|
|
4418
5036
|
| Exclude<VectorizeVectorMetadataValue, string[]>
|
|
4419
5037
|
| null
|
|
@@ -4428,8 +5046,8 @@ declare type VectorizeVectorMetadataFilter = {
|
|
|
4428
5046
|
* Supported distance metrics for an index.
|
|
4429
5047
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
4430
5048
|
*/
|
|
4431
|
-
|
|
4432
|
-
|
|
5049
|
+
type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
5050
|
+
interface VectorizeQueryOptions {
|
|
4433
5051
|
topK?: number;
|
|
4434
5052
|
namespace?: string;
|
|
4435
5053
|
returnValues?: boolean;
|
|
@@ -4439,7 +5057,7 @@ declare interface VectorizeQueryOptions {
|
|
|
4439
5057
|
/**
|
|
4440
5058
|
* Information about the configuration of an index.
|
|
4441
5059
|
*/
|
|
4442
|
-
|
|
5060
|
+
type VectorizeIndexConfig =
|
|
4443
5061
|
| {
|
|
4444
5062
|
dimensions: number;
|
|
4445
5063
|
metric: VectorizeDistanceMetric;
|
|
@@ -4450,7 +5068,7 @@ declare type VectorizeIndexConfig =
|
|
|
4450
5068
|
/**
|
|
4451
5069
|
* Metadata about an existing index.
|
|
4452
5070
|
*/
|
|
4453
|
-
|
|
5071
|
+
interface VectorizeIndexDetails {
|
|
4454
5072
|
/** The unique ID of the index */
|
|
4455
5073
|
readonly id: string;
|
|
4456
5074
|
/** The name of the index. */
|
|
@@ -4465,7 +5083,7 @@ declare interface VectorizeIndexDetails {
|
|
|
4465
5083
|
/**
|
|
4466
5084
|
* Represents a single vector value set along with its associated metadata.
|
|
4467
5085
|
*/
|
|
4468
|
-
|
|
5086
|
+
interface VectorizeVector {
|
|
4469
5087
|
/** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */
|
|
4470
5088
|
id: string;
|
|
4471
5089
|
/** The vector values */
|
|
@@ -4478,7 +5096,7 @@ declare interface VectorizeVector {
|
|
|
4478
5096
|
/**
|
|
4479
5097
|
* Represents a matched vector for a query along with its score and (if specified) the matching vector information.
|
|
4480
5098
|
*/
|
|
4481
|
-
|
|
5099
|
+
type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
4482
5100
|
Omit<VectorizeVector, "values"> & {
|
|
4483
5101
|
/** The score or rank for similarity, when returned as a result */
|
|
4484
5102
|
score: number;
|
|
@@ -4486,7 +5104,7 @@ declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
4486
5104
|
/**
|
|
4487
5105
|
* A set of vector {@link VectorizeMatch} for a particular query.
|
|
4488
5106
|
*/
|
|
4489
|
-
|
|
5107
|
+
interface VectorizeMatches {
|
|
4490
5108
|
matches: VectorizeMatch[];
|
|
4491
5109
|
count: number;
|
|
4492
5110
|
}
|
|
@@ -4494,12 +5112,21 @@ declare interface VectorizeMatches {
|
|
|
4494
5112
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
4495
5113
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
4496
5114
|
*/
|
|
4497
|
-
|
|
5115
|
+
interface VectorizeVectorMutation {
|
|
4498
5116
|
/* List of ids of vectors that were successfully processed. */
|
|
4499
5117
|
ids: string[];
|
|
4500
5118
|
/* Total count of the number of processed vectors. */
|
|
4501
5119
|
count: number;
|
|
4502
5120
|
}
|
|
5121
|
+
/**
|
|
5122
|
+
* Results of an operation that performed a mutation on a set of vectors
|
|
5123
|
+
* with the v2 version of Vectorize.
|
|
5124
|
+
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
5125
|
+
*/
|
|
5126
|
+
interface VectorizeVectorMutationV2 {
|
|
5127
|
+
/* The identifier for the last mutation processed by Vectorize. */
|
|
5128
|
+
mutationId: string;
|
|
5129
|
+
}
|
|
4503
5130
|
declare abstract class VectorizeIndex {
|
|
4504
5131
|
/**
|
|
4505
5132
|
* Get information about the currently bound index.
|
|
@@ -4545,13 +5172,15 @@ declare abstract class VectorizeIndex {
|
|
|
4545
5172
|
* The interface for "version_metadata" binding
|
|
4546
5173
|
* providing metadata about the Worker Version using this binding.
|
|
4547
5174
|
*/
|
|
4548
|
-
|
|
5175
|
+
type WorkerVersionMetadata = {
|
|
4549
5176
|
/** The ID of the Worker Version using this binding */
|
|
4550
5177
|
id: string;
|
|
4551
5178
|
/** The tag of the Worker Version using this binding */
|
|
4552
5179
|
tag: string;
|
|
5180
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
5181
|
+
timestamp: string;
|
|
4553
5182
|
};
|
|
4554
|
-
|
|
5183
|
+
interface DynamicDispatchLimits {
|
|
4555
5184
|
/**
|
|
4556
5185
|
* Limit CPU time in milliseconds.
|
|
4557
5186
|
*/
|
|
@@ -4561,7 +5190,7 @@ declare interface DynamicDispatchLimits {
|
|
|
4561
5190
|
*/
|
|
4562
5191
|
subRequests?: number;
|
|
4563
5192
|
}
|
|
4564
|
-
|
|
5193
|
+
interface DynamicDispatchOptions {
|
|
4565
5194
|
/**
|
|
4566
5195
|
* Limit resources of invoked Worker script.
|
|
4567
5196
|
*/
|
|
@@ -4573,7 +5202,7 @@ declare interface DynamicDispatchOptions {
|
|
|
4573
5202
|
[key: string]: any;
|
|
4574
5203
|
};
|
|
4575
5204
|
}
|
|
4576
|
-
|
|
5205
|
+
interface DispatchNamespace {
|
|
4577
5206
|
/**
|
|
4578
5207
|
* @param name Name of the Worker script.
|
|
4579
5208
|
* @param args Arguments to Worker script.
|