@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/experimental/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,10 +254,13 @@ 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
|
ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
|
|
250
260
|
ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
|
|
251
261
|
ReadableByteStreamController: typeof ReadableByteStreamController;
|
|
252
262
|
WritableStreamDefaultController: typeof WritableStreamDefaultController;
|
|
263
|
+
TransformStreamDefaultController: typeof TransformStreamDefaultController;
|
|
253
264
|
CompressionStream: typeof CompressionStream;
|
|
254
265
|
DecompressionStream: typeof DecompressionStream;
|
|
255
266
|
TextEncoderStream: typeof TextEncoderStream;
|
|
@@ -281,16 +292,16 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
281
292
|
FixedLengthStream: typeof FixedLengthStream;
|
|
282
293
|
IdentityTransformStream: typeof IdentityTransformStream;
|
|
283
294
|
HTMLRewriter: typeof HTMLRewriter;
|
|
284
|
-
GPUAdapter: typeof
|
|
285
|
-
GPUOutOfMemoryError: typeof
|
|
286
|
-
GPUValidationError: typeof
|
|
287
|
-
GPUInternalError: typeof
|
|
288
|
-
GPUDeviceLostInfo: typeof
|
|
289
|
-
GPUBufferUsage: typeof
|
|
290
|
-
GPUShaderStage: typeof
|
|
291
|
-
GPUMapMode: typeof
|
|
292
|
-
GPUTextureUsage: typeof
|
|
293
|
-
GPUColorWrite: typeof
|
|
295
|
+
GPUAdapter: typeof GPUAdapter;
|
|
296
|
+
GPUOutOfMemoryError: typeof GPUOutOfMemoryError;
|
|
297
|
+
GPUValidationError: typeof GPUValidationError;
|
|
298
|
+
GPUInternalError: typeof GPUInternalError;
|
|
299
|
+
GPUDeviceLostInfo: typeof GPUDeviceLostInfo;
|
|
300
|
+
GPUBufferUsage: typeof GPUBufferUsage;
|
|
301
|
+
GPUShaderStage: typeof GPUShaderStage;
|
|
302
|
+
GPUMapMode: typeof GPUMapMode;
|
|
303
|
+
GPUTextureUsage: typeof GPUTextureUsage;
|
|
304
|
+
GPUColorWrite: typeof GPUColorWrite;
|
|
294
305
|
}
|
|
295
306
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
|
|
296
307
|
type: Type,
|
|
@@ -312,95 +323,113 @@ declare function removeEventListener<
|
|
|
312
323
|
declare function dispatchEvent(
|
|
313
324
|
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
|
|
314
325
|
): boolean;
|
|
315
|
-
|
|
326
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
|
316
327
|
declare function btoa(data: string): string;
|
|
317
|
-
|
|
328
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
|
318
329
|
declare function atob(data: string): string;
|
|
319
|
-
|
|
330
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
320
331
|
declare function setTimeout(
|
|
321
332
|
callback: (...args: any[]) => void,
|
|
322
333
|
msDelay?: number,
|
|
323
334
|
): number;
|
|
324
|
-
|
|
335
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
325
336
|
declare function setTimeout<Args extends any[]>(
|
|
326
337
|
callback: (...args: Args) => void,
|
|
327
338
|
msDelay?: number,
|
|
328
339
|
...args: Args
|
|
329
340
|
): number;
|
|
330
|
-
|
|
341
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
|
|
331
342
|
declare function clearTimeout(timeoutId: number | null): void;
|
|
332
|
-
|
|
343
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
333
344
|
declare function setInterval(
|
|
334
345
|
callback: (...args: any[]) => void,
|
|
335
346
|
msDelay?: number,
|
|
336
347
|
): number;
|
|
337
|
-
|
|
348
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
338
349
|
declare function setInterval<Args extends any[]>(
|
|
339
350
|
callback: (...args: Args) => void,
|
|
340
351
|
msDelay?: number,
|
|
341
352
|
...args: Args
|
|
342
353
|
): number;
|
|
343
|
-
|
|
354
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
|
344
355
|
declare function clearInterval(timeoutId: number | null): void;
|
|
345
|
-
|
|
356
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
|
|
346
357
|
declare function queueMicrotask(task: Function): void;
|
|
347
|
-
|
|
358
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
|
|
348
359
|
declare function structuredClone<T>(
|
|
349
360
|
value: T,
|
|
350
361
|
options?: StructuredSerializeOptions,
|
|
351
362
|
): T;
|
|
352
|
-
|
|
363
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/reportError) */
|
|
364
|
+
declare function reportError(error: any): void;
|
|
365
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
|
|
353
366
|
declare function fetch(
|
|
354
367
|
input: RequestInfo,
|
|
355
368
|
init?: RequestInit<RequestInitCfProperties>,
|
|
356
369
|
): Promise<Response>;
|
|
357
370
|
declare const self: ServiceWorkerGlobalScope;
|
|
371
|
+
/**
|
|
372
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
373
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
374
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
375
|
+
* compared to those implemented in most browsers.
|
|
376
|
+
*
|
|
377
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
378
|
+
*/
|
|
358
379
|
declare const crypto: Crypto;
|
|
380
|
+
/**
|
|
381
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
382
|
+
*
|
|
383
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
384
|
+
*/
|
|
359
385
|
declare const caches: CacheStorage;
|
|
360
386
|
declare const scheduler: Scheduler;
|
|
387
|
+
/**
|
|
388
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
389
|
+
* as well as timing of subrequests and other operations.
|
|
390
|
+
*
|
|
391
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
392
|
+
*/
|
|
361
393
|
declare const performance: Performance;
|
|
362
394
|
declare const origin: string;
|
|
363
395
|
declare const navigator: Navigator;
|
|
364
|
-
|
|
365
|
-
|
|
396
|
+
interface TestController {}
|
|
397
|
+
interface ExecutionContext {
|
|
366
398
|
waitUntil(promise: Promise<any>): void;
|
|
367
399
|
passThroughOnException(): void;
|
|
368
400
|
abort(reason?: any): void;
|
|
369
401
|
}
|
|
370
|
-
|
|
371
|
-
Env = unknown,
|
|
372
|
-
CfHostMetadata = unknown,
|
|
373
|
-
> = (
|
|
402
|
+
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (
|
|
374
403
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
375
404
|
env: Env,
|
|
376
405
|
ctx: ExecutionContext,
|
|
377
406
|
) => Response | Promise<Response>;
|
|
378
|
-
|
|
407
|
+
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
379
408
|
events: TraceItem[],
|
|
380
409
|
env: Env,
|
|
381
410
|
ctx: ExecutionContext,
|
|
382
411
|
) => void | Promise<void>;
|
|
383
|
-
|
|
412
|
+
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
384
413
|
traces: TraceItem[],
|
|
385
414
|
env: Env,
|
|
386
415
|
ctx: ExecutionContext,
|
|
387
416
|
) => void | Promise<void>;
|
|
388
|
-
|
|
417
|
+
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
389
418
|
controller: ScheduledController,
|
|
390
419
|
env: Env,
|
|
391
420
|
ctx: ExecutionContext,
|
|
392
421
|
) => void | Promise<void>;
|
|
393
|
-
|
|
422
|
+
type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
|
|
394
423
|
batch: MessageBatch<Message>,
|
|
395
424
|
env: Env,
|
|
396
425
|
ctx: ExecutionContext,
|
|
397
426
|
) => void | Promise<void>;
|
|
398
|
-
|
|
427
|
+
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
399
428
|
controller: TestController,
|
|
400
429
|
env: Env,
|
|
401
430
|
ctx: ExecutionContext,
|
|
402
431
|
) => void | Promise<void>;
|
|
403
|
-
|
|
432
|
+
interface ExportedHandler<
|
|
404
433
|
Env = unknown,
|
|
405
434
|
QueueHandlerMessage = unknown,
|
|
406
435
|
CfHostMetadata = unknown,
|
|
@@ -413,13 +442,14 @@ declare interface ExportedHandler<
|
|
|
413
442
|
email?: EmailExportedHandler<Env>;
|
|
414
443
|
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
415
444
|
}
|
|
416
|
-
|
|
445
|
+
interface StructuredSerializeOptions {
|
|
417
446
|
transfer?: any[];
|
|
418
447
|
}
|
|
448
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
|
|
419
449
|
declare abstract class PromiseRejectionEvent extends Event {
|
|
420
|
-
|
|
450
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
|
|
421
451
|
readonly promise: Promise<any>;
|
|
422
|
-
|
|
452
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
|
|
423
453
|
readonly reason: any;
|
|
424
454
|
}
|
|
425
455
|
declare abstract class Navigator {
|
|
@@ -434,24 +464,25 @@ declare abstract class Navigator {
|
|
|
434
464
|
| FormData,
|
|
435
465
|
): boolean;
|
|
436
466
|
readonly userAgent: string;
|
|
437
|
-
readonly gpu:
|
|
467
|
+
readonly gpu: GPU;
|
|
438
468
|
}
|
|
439
469
|
/**
|
|
440
|
-
*
|
|
470
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
471
|
+
* as well as timing of subrequests and other operations.
|
|
441
472
|
*
|
|
442
|
-
* [
|
|
473
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
443
474
|
*/
|
|
444
|
-
|
|
445
|
-
|
|
475
|
+
interface Performance {
|
|
476
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
|
|
446
477
|
readonly timeOrigin: number;
|
|
447
|
-
|
|
478
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
448
479
|
now(): number;
|
|
449
480
|
}
|
|
450
|
-
|
|
481
|
+
interface AlarmInvocationInfo {
|
|
451
482
|
readonly isRetry: boolean;
|
|
452
483
|
readonly retryCount: number;
|
|
453
484
|
}
|
|
454
|
-
|
|
485
|
+
interface DurableObject {
|
|
455
486
|
fetch(request: Request): Response | Promise<Response>;
|
|
456
487
|
alarm?(): void | Promise<void>;
|
|
457
488
|
webSocketMessage?(
|
|
@@ -466,7 +497,7 @@ declare interface DurableObject {
|
|
|
466
497
|
): void | Promise<void>;
|
|
467
498
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
468
499
|
}
|
|
469
|
-
|
|
500
|
+
type DurableObjectStub<
|
|
470
501
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
471
502
|
> = Fetcher<
|
|
472
503
|
T,
|
|
@@ -475,12 +506,12 @@ declare type DurableObjectStub<
|
|
|
475
506
|
readonly id: DurableObjectId;
|
|
476
507
|
readonly name?: string;
|
|
477
508
|
};
|
|
478
|
-
|
|
509
|
+
interface DurableObjectId {
|
|
479
510
|
toString(): string;
|
|
480
511
|
equals(other: DurableObjectId): boolean;
|
|
481
512
|
readonly name?: string;
|
|
482
513
|
}
|
|
483
|
-
|
|
514
|
+
interface DurableObjectNamespace<
|
|
484
515
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
485
516
|
> {
|
|
486
517
|
newUniqueId(
|
|
@@ -500,11 +531,11 @@ declare interface DurableObjectNamespace<
|
|
|
500
531
|
jurisdiction: DurableObjectJurisdiction,
|
|
501
532
|
): DurableObjectNamespace<T>;
|
|
502
533
|
}
|
|
503
|
-
|
|
504
|
-
|
|
534
|
+
type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
535
|
+
interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
505
536
|
jurisdiction?: DurableObjectJurisdiction;
|
|
506
537
|
}
|
|
507
|
-
|
|
538
|
+
type DurableObjectLocationHint =
|
|
508
539
|
| "wnam"
|
|
509
540
|
| "enam"
|
|
510
541
|
| "sam"
|
|
@@ -514,10 +545,10 @@ declare type DurableObjectLocationHint =
|
|
|
514
545
|
| "oc"
|
|
515
546
|
| "afr"
|
|
516
547
|
| "me";
|
|
517
|
-
|
|
548
|
+
interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
518
549
|
locationHint?: DurableObjectLocationHint;
|
|
519
550
|
}
|
|
520
|
-
|
|
551
|
+
interface DurableObjectState {
|
|
521
552
|
waitUntil(promise: Promise<any>): void;
|
|
522
553
|
readonly id: DurableObjectId;
|
|
523
554
|
readonly storage: DurableObjectStorage;
|
|
@@ -532,7 +563,7 @@ declare interface DurableObjectState {
|
|
|
532
563
|
getTags(ws: WebSocket): string[];
|
|
533
564
|
abort(reason?: string): void;
|
|
534
565
|
}
|
|
535
|
-
|
|
566
|
+
interface DurableObjectTransaction {
|
|
536
567
|
get<T = unknown>(
|
|
537
568
|
key: string,
|
|
538
569
|
options?: DurableObjectGetOptions,
|
|
@@ -563,7 +594,7 @@ declare interface DurableObjectTransaction {
|
|
|
563
594
|
): Promise<void>;
|
|
564
595
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
565
596
|
}
|
|
566
|
-
|
|
597
|
+
interface DurableObjectStorage {
|
|
567
598
|
get<T = unknown>(
|
|
568
599
|
key: string,
|
|
569
600
|
options?: DurableObjectGetOptions,
|
|
@@ -603,7 +634,7 @@ declare interface DurableObjectStorage {
|
|
|
603
634
|
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
|
604
635
|
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
|
605
636
|
}
|
|
606
|
-
|
|
637
|
+
interface DurableObjectListOptions {
|
|
607
638
|
start?: string;
|
|
608
639
|
startAfter?: string;
|
|
609
640
|
end?: string;
|
|
@@ -613,19 +644,19 @@ declare interface DurableObjectListOptions {
|
|
|
613
644
|
allowConcurrency?: boolean;
|
|
614
645
|
noCache?: boolean;
|
|
615
646
|
}
|
|
616
|
-
|
|
647
|
+
interface DurableObjectGetOptions {
|
|
617
648
|
allowConcurrency?: boolean;
|
|
618
649
|
noCache?: boolean;
|
|
619
650
|
}
|
|
620
|
-
|
|
651
|
+
interface DurableObjectGetAlarmOptions {
|
|
621
652
|
allowConcurrency?: boolean;
|
|
622
653
|
}
|
|
623
|
-
|
|
654
|
+
interface DurableObjectPutOptions {
|
|
624
655
|
allowConcurrency?: boolean;
|
|
625
656
|
allowUnconfirmed?: boolean;
|
|
626
657
|
noCache?: boolean;
|
|
627
658
|
}
|
|
628
|
-
|
|
659
|
+
interface DurableObjectSetAlarmOptions {
|
|
629
660
|
allowConcurrency?: boolean;
|
|
630
661
|
allowUnconfirmed?: boolean;
|
|
631
662
|
}
|
|
@@ -634,14 +665,19 @@ declare class WebSocketRequestResponsePair {
|
|
|
634
665
|
get request(): string;
|
|
635
666
|
get response(): string;
|
|
636
667
|
}
|
|
637
|
-
|
|
668
|
+
interface AnalyticsEngineDataset {
|
|
638
669
|
writeDataPoint(event?: AnalyticsEngineDataPoint): void;
|
|
639
670
|
}
|
|
640
|
-
|
|
671
|
+
interface AnalyticsEngineDataPoint {
|
|
641
672
|
indexes?: ((ArrayBuffer | string) | null)[];
|
|
642
673
|
doubles?: number[];
|
|
643
674
|
blobs?: ((ArrayBuffer | string) | null)[];
|
|
644
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* An event which takes place in the DOM.
|
|
678
|
+
*
|
|
679
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
|
680
|
+
*/
|
|
645
681
|
declare class Event {
|
|
646
682
|
constructor(type: string, init?: EventInit);
|
|
647
683
|
/**
|
|
@@ -751,20 +787,25 @@ declare class Event {
|
|
|
751
787
|
static readonly AT_TARGET: number;
|
|
752
788
|
static readonly BUBBLING_PHASE: number;
|
|
753
789
|
}
|
|
754
|
-
|
|
790
|
+
interface EventInit {
|
|
755
791
|
bubbles?: boolean;
|
|
756
792
|
cancelable?: boolean;
|
|
757
793
|
composed?: boolean;
|
|
758
794
|
}
|
|
759
|
-
|
|
795
|
+
type EventListener<EventType extends Event = Event> = (
|
|
760
796
|
event: EventType,
|
|
761
797
|
) => void;
|
|
762
|
-
|
|
798
|
+
interface EventListenerObject<EventType extends Event = Event> {
|
|
763
799
|
handleEvent(event: EventType): void;
|
|
764
800
|
}
|
|
765
|
-
|
|
766
|
-
EventType
|
|
767
|
-
|
|
801
|
+
type EventListenerOrEventListenerObject<EventType extends Event = Event> =
|
|
802
|
+
| EventListener<EventType>
|
|
803
|
+
| EventListenerObject<EventType>;
|
|
804
|
+
/**
|
|
805
|
+
* EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
|
|
806
|
+
*
|
|
807
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
|
808
|
+
*/
|
|
768
809
|
declare class EventTarget<
|
|
769
810
|
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
770
811
|
> {
|
|
@@ -808,18 +849,23 @@ declare class EventTarget<
|
|
|
808
849
|
*/
|
|
809
850
|
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
|
|
810
851
|
}
|
|
811
|
-
|
|
852
|
+
interface EventTargetEventListenerOptions {
|
|
812
853
|
capture?: boolean;
|
|
813
854
|
}
|
|
814
|
-
|
|
855
|
+
interface EventTargetAddEventListenerOptions {
|
|
815
856
|
capture?: boolean;
|
|
816
857
|
passive?: boolean;
|
|
817
858
|
once?: boolean;
|
|
818
859
|
signal?: AbortSignal;
|
|
819
860
|
}
|
|
820
|
-
|
|
861
|
+
interface EventTargetHandlerObject {
|
|
821
862
|
handleEvent: (event: Event) => any | undefined;
|
|
822
863
|
}
|
|
864
|
+
/**
|
|
865
|
+
* A controller object that allows you to abort one or more DOM requests as and when desired.
|
|
866
|
+
*
|
|
867
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
|
|
868
|
+
*/
|
|
823
869
|
declare class AbortController {
|
|
824
870
|
constructor();
|
|
825
871
|
/**
|
|
@@ -835,11 +881,17 @@ declare class AbortController {
|
|
|
835
881
|
*/
|
|
836
882
|
abort(reason?: any): void;
|
|
837
883
|
}
|
|
884
|
+
/**
|
|
885
|
+
* 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.
|
|
886
|
+
*
|
|
887
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
|
|
888
|
+
*/
|
|
838
889
|
declare abstract class AbortSignal extends EventTarget {
|
|
839
|
-
|
|
890
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
840
891
|
static abort(reason?: any): AbortSignal;
|
|
841
|
-
|
|
892
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
842
893
|
static timeout(delay: number): AbortSignal;
|
|
894
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
|
|
843
895
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
844
896
|
/**
|
|
845
897
|
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
@@ -847,25 +899,31 @@ declare abstract class AbortSignal extends EventTarget {
|
|
|
847
899
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
848
900
|
*/
|
|
849
901
|
get aborted(): boolean;
|
|
850
|
-
|
|
902
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
851
903
|
get reason(): any;
|
|
852
|
-
|
|
904
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
853
905
|
get onabort(): any | null;
|
|
854
|
-
|
|
906
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
855
907
|
set onabort(value: any | null);
|
|
856
|
-
|
|
908
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
857
909
|
throwIfAborted(): void;
|
|
858
910
|
}
|
|
859
|
-
|
|
911
|
+
interface Scheduler {
|
|
860
912
|
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
|
|
861
913
|
}
|
|
862
|
-
|
|
914
|
+
interface SchedulerWaitOptions {
|
|
863
915
|
signal?: AbortSignal;
|
|
864
916
|
}
|
|
917
|
+
/**
|
|
918
|
+
* 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.
|
|
919
|
+
*
|
|
920
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
|
921
|
+
*/
|
|
865
922
|
declare abstract class ExtendableEvent extends Event {
|
|
866
|
-
|
|
923
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
867
924
|
waitUntil(promise: Promise<any>): void;
|
|
868
925
|
}
|
|
926
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
|
|
869
927
|
declare class CustomEvent<T = any> extends Event {
|
|
870
928
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
871
929
|
/**
|
|
@@ -875,64 +933,96 @@ declare class CustomEvent<T = any> extends Event {
|
|
|
875
933
|
*/
|
|
876
934
|
get detail(): T;
|
|
877
935
|
}
|
|
878
|
-
|
|
936
|
+
interface CustomEventCustomEventInit {
|
|
879
937
|
bubbles?: boolean;
|
|
880
938
|
cancelable?: boolean;
|
|
881
939
|
composed?: boolean;
|
|
882
940
|
detail?: any;
|
|
883
941
|
}
|
|
942
|
+
/**
|
|
943
|
+
* 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.
|
|
944
|
+
*
|
|
945
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
|
|
946
|
+
*/
|
|
884
947
|
declare class Blob {
|
|
885
948
|
constructor(
|
|
886
|
-
|
|
949
|
+
type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
887
950
|
options?: BlobOptions,
|
|
888
951
|
);
|
|
889
|
-
|
|
952
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
890
953
|
get size(): number;
|
|
891
|
-
|
|
954
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
892
955
|
get type(): string;
|
|
893
|
-
|
|
956
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
894
957
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
895
|
-
|
|
958
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
896
959
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
897
|
-
|
|
960
|
+
bytes(): Promise<Uint8Array>;
|
|
961
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
898
962
|
text(): Promise<string>;
|
|
899
|
-
|
|
963
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
900
964
|
stream(): ReadableStream;
|
|
901
965
|
}
|
|
902
|
-
|
|
966
|
+
interface BlobOptions {
|
|
903
967
|
type?: string;
|
|
904
968
|
}
|
|
969
|
+
/**
|
|
970
|
+
* Provides information about files and allows JavaScript in a web page to access their content.
|
|
971
|
+
*
|
|
972
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
|
|
973
|
+
*/
|
|
905
974
|
declare class File extends Blob {
|
|
906
975
|
constructor(
|
|
907
976
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
908
977
|
name: string,
|
|
909
978
|
options?: FileOptions,
|
|
910
979
|
);
|
|
911
|
-
|
|
980
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
912
981
|
get name(): string;
|
|
913
|
-
|
|
982
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
914
983
|
get lastModified(): number;
|
|
915
984
|
}
|
|
916
|
-
|
|
985
|
+
interface FileOptions {
|
|
917
986
|
type?: string;
|
|
918
987
|
lastModified?: number;
|
|
919
988
|
}
|
|
989
|
+
/**
|
|
990
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
991
|
+
*
|
|
992
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
993
|
+
*/
|
|
920
994
|
declare abstract class CacheStorage {
|
|
921
|
-
|
|
995
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
922
996
|
open(cacheName: string): Promise<Cache>;
|
|
923
997
|
readonly default: Cache;
|
|
924
998
|
}
|
|
999
|
+
/**
|
|
1000
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
1001
|
+
*
|
|
1002
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
1003
|
+
*/
|
|
925
1004
|
declare abstract class Cache {
|
|
1005
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
|
|
926
1006
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
1007
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
|
|
927
1008
|
match(
|
|
928
1009
|
request: RequestInfo,
|
|
929
1010
|
options?: CacheQueryOptions,
|
|
930
1011
|
): Promise<Response | undefined>;
|
|
1012
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
|
|
931
1013
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
932
1014
|
}
|
|
933
|
-
|
|
1015
|
+
interface CacheQueryOptions {
|
|
934
1016
|
ignoreMethod?: boolean;
|
|
935
1017
|
}
|
|
1018
|
+
/**
|
|
1019
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
1020
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
1021
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
1022
|
+
* compared to those implemented in most browsers.
|
|
1023
|
+
*
|
|
1024
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
1025
|
+
*/
|
|
936
1026
|
declare abstract class Crypto {
|
|
937
1027
|
/**
|
|
938
1028
|
* Available only in secure contexts.
|
|
@@ -940,7 +1030,7 @@ declare abstract class Crypto {
|
|
|
940
1030
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
941
1031
|
*/
|
|
942
1032
|
get subtle(): SubtleCrypto;
|
|
943
|
-
|
|
1033
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
944
1034
|
getRandomValues<
|
|
945
1035
|
T extends
|
|
946
1036
|
| Int8Array
|
|
@@ -960,39 +1050,50 @@ declare abstract class Crypto {
|
|
|
960
1050
|
randomUUID(): string;
|
|
961
1051
|
DigestStream: typeof DigestStream;
|
|
962
1052
|
}
|
|
1053
|
+
/**
|
|
1054
|
+
* 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).
|
|
1055
|
+
* Available only in secure contexts.
|
|
1056
|
+
*
|
|
1057
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
|
|
1058
|
+
*/
|
|
963
1059
|
declare abstract class SubtleCrypto {
|
|
1060
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
|
|
964
1061
|
encrypt(
|
|
965
1062
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
966
1063
|
key: CryptoKey,
|
|
967
1064
|
plainText: ArrayBuffer | ArrayBufferView,
|
|
968
1065
|
): Promise<ArrayBuffer>;
|
|
1066
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
|
|
969
1067
|
decrypt(
|
|
970
1068
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
971
1069
|
key: CryptoKey,
|
|
972
1070
|
cipherText: ArrayBuffer | ArrayBufferView,
|
|
973
1071
|
): Promise<ArrayBuffer>;
|
|
1072
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
|
|
974
1073
|
sign(
|
|
975
1074
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
976
1075
|
key: CryptoKey,
|
|
977
1076
|
data: ArrayBuffer | ArrayBufferView,
|
|
978
1077
|
): Promise<ArrayBuffer>;
|
|
1078
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
|
|
979
1079
|
verify(
|
|
980
1080
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
981
1081
|
key: CryptoKey,
|
|
982
1082
|
signature: ArrayBuffer | ArrayBufferView,
|
|
983
1083
|
data: ArrayBuffer | ArrayBufferView,
|
|
984
1084
|
): Promise<boolean>;
|
|
1085
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
|
|
985
1086
|
digest(
|
|
986
1087
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
987
1088
|
data: ArrayBuffer | ArrayBufferView,
|
|
988
1089
|
): Promise<ArrayBuffer>;
|
|
989
|
-
|
|
1090
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
990
1091
|
generateKey(
|
|
991
1092
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
992
1093
|
extractable: boolean,
|
|
993
1094
|
keyUsages: string[],
|
|
994
1095
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
995
|
-
|
|
1096
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
996
1097
|
deriveKey(
|
|
997
1098
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
998
1099
|
baseKey: CryptoKey,
|
|
@@ -1000,12 +1101,13 @@ declare abstract class SubtleCrypto {
|
|
|
1000
1101
|
extractable: boolean,
|
|
1001
1102
|
keyUsages: string[],
|
|
1002
1103
|
): Promise<CryptoKey>;
|
|
1104
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
|
|
1003
1105
|
deriveBits(
|
|
1004
1106
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
1005
1107
|
baseKey: CryptoKey,
|
|
1006
|
-
length
|
|
1108
|
+
length?: number | null,
|
|
1007
1109
|
): Promise<ArrayBuffer>;
|
|
1008
|
-
|
|
1110
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
1009
1111
|
importKey(
|
|
1010
1112
|
format: string,
|
|
1011
1113
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
@@ -1013,14 +1115,16 @@ declare abstract class SubtleCrypto {
|
|
|
1013
1115
|
extractable: boolean,
|
|
1014
1116
|
keyUsages: string[],
|
|
1015
1117
|
): Promise<CryptoKey>;
|
|
1118
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
|
|
1016
1119
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
1120
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
|
|
1017
1121
|
wrapKey(
|
|
1018
1122
|
format: string,
|
|
1019
1123
|
key: CryptoKey,
|
|
1020
1124
|
wrappingKey: CryptoKey,
|
|
1021
1125
|
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
1022
1126
|
): Promise<ArrayBuffer>;
|
|
1023
|
-
|
|
1127
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
1024
1128
|
unwrapKey(
|
|
1025
1129
|
format: string,
|
|
1026
1130
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -1035,12 +1139,18 @@ declare abstract class SubtleCrypto {
|
|
|
1035
1139
|
b: ArrayBuffer | ArrayBufferView,
|
|
1036
1140
|
): boolean;
|
|
1037
1141
|
}
|
|
1142
|
+
/**
|
|
1143
|
+
* The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
|
|
1144
|
+
* Available only in secure contexts.
|
|
1145
|
+
*
|
|
1146
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
|
1147
|
+
*/
|
|
1038
1148
|
declare abstract class CryptoKey {
|
|
1039
|
-
|
|
1149
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
1040
1150
|
readonly type: string;
|
|
1041
|
-
|
|
1151
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
1042
1152
|
readonly extractable: boolean;
|
|
1043
|
-
|
|
1153
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
1044
1154
|
readonly algorithm:
|
|
1045
1155
|
| CryptoKeyKeyAlgorithm
|
|
1046
1156
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -1048,14 +1158,14 @@ declare abstract class CryptoKey {
|
|
|
1048
1158
|
| CryptoKeyRsaKeyAlgorithm
|
|
1049
1159
|
| CryptoKeyEllipticKeyAlgorithm
|
|
1050
1160
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1051
|
-
|
|
1161
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
1052
1162
|
readonly usages: string[];
|
|
1053
1163
|
}
|
|
1054
|
-
|
|
1164
|
+
interface CryptoKeyPair {
|
|
1055
1165
|
publicKey: CryptoKey;
|
|
1056
1166
|
privateKey: CryptoKey;
|
|
1057
1167
|
}
|
|
1058
|
-
|
|
1168
|
+
interface JsonWebKey {
|
|
1059
1169
|
kty: string;
|
|
1060
1170
|
use?: string;
|
|
1061
1171
|
key_ops?: string[];
|
|
@@ -1075,12 +1185,12 @@ declare interface JsonWebKey {
|
|
|
1075
1185
|
oth?: RsaOtherPrimesInfo[];
|
|
1076
1186
|
k?: string;
|
|
1077
1187
|
}
|
|
1078
|
-
|
|
1188
|
+
interface RsaOtherPrimesInfo {
|
|
1079
1189
|
r?: string;
|
|
1080
1190
|
d?: string;
|
|
1081
1191
|
t?: string;
|
|
1082
1192
|
}
|
|
1083
|
-
|
|
1193
|
+
interface SubtleCryptoDeriveKeyAlgorithm {
|
|
1084
1194
|
name: string;
|
|
1085
1195
|
salt?: ArrayBuffer;
|
|
1086
1196
|
iterations?: number;
|
|
@@ -1088,7 +1198,7 @@ declare interface SubtleCryptoDeriveKeyAlgorithm {
|
|
|
1088
1198
|
$public?: CryptoKey;
|
|
1089
1199
|
info?: ArrayBuffer;
|
|
1090
1200
|
}
|
|
1091
|
-
|
|
1201
|
+
interface SubtleCryptoEncryptAlgorithm {
|
|
1092
1202
|
name: string;
|
|
1093
1203
|
iv?: ArrayBuffer;
|
|
1094
1204
|
additionalData?: ArrayBuffer;
|
|
@@ -1097,7 +1207,7 @@ declare interface SubtleCryptoEncryptAlgorithm {
|
|
|
1097
1207
|
length?: number;
|
|
1098
1208
|
label?: ArrayBuffer;
|
|
1099
1209
|
}
|
|
1100
|
-
|
|
1210
|
+
interface SubtleCryptoGenerateKeyAlgorithm {
|
|
1101
1211
|
name: string;
|
|
1102
1212
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1103
1213
|
modulusLength?: number;
|
|
@@ -1105,45 +1215,45 @@ declare interface SubtleCryptoGenerateKeyAlgorithm {
|
|
|
1105
1215
|
length?: number;
|
|
1106
1216
|
namedCurve?: string;
|
|
1107
1217
|
}
|
|
1108
|
-
|
|
1218
|
+
interface SubtleCryptoHashAlgorithm {
|
|
1109
1219
|
name: string;
|
|
1110
1220
|
}
|
|
1111
|
-
|
|
1221
|
+
interface SubtleCryptoImportKeyAlgorithm {
|
|
1112
1222
|
name: string;
|
|
1113
1223
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1114
1224
|
length?: number;
|
|
1115
1225
|
namedCurve?: string;
|
|
1116
1226
|
compressed?: boolean;
|
|
1117
1227
|
}
|
|
1118
|
-
|
|
1228
|
+
interface SubtleCryptoSignAlgorithm {
|
|
1119
1229
|
name: string;
|
|
1120
1230
|
hash?: string | SubtleCryptoHashAlgorithm;
|
|
1121
1231
|
dataLength?: number;
|
|
1122
1232
|
saltLength?: number;
|
|
1123
1233
|
}
|
|
1124
|
-
|
|
1234
|
+
interface CryptoKeyKeyAlgorithm {
|
|
1125
1235
|
name: string;
|
|
1126
1236
|
}
|
|
1127
|
-
|
|
1237
|
+
interface CryptoKeyAesKeyAlgorithm {
|
|
1128
1238
|
name: string;
|
|
1129
1239
|
length: number;
|
|
1130
1240
|
}
|
|
1131
|
-
|
|
1241
|
+
interface CryptoKeyHmacKeyAlgorithm {
|
|
1132
1242
|
name: string;
|
|
1133
1243
|
hash: CryptoKeyKeyAlgorithm;
|
|
1134
1244
|
length: number;
|
|
1135
1245
|
}
|
|
1136
|
-
|
|
1246
|
+
interface CryptoKeyRsaKeyAlgorithm {
|
|
1137
1247
|
name: string;
|
|
1138
1248
|
modulusLength: number;
|
|
1139
1249
|
publicExponent: ArrayBuffer | (ArrayBuffer | ArrayBufferView);
|
|
1140
1250
|
hash?: CryptoKeyKeyAlgorithm;
|
|
1141
1251
|
}
|
|
1142
|
-
|
|
1252
|
+
interface CryptoKeyEllipticKeyAlgorithm {
|
|
1143
1253
|
name: string;
|
|
1144
1254
|
namedCurve: string;
|
|
1145
1255
|
}
|
|
1146
|
-
|
|
1256
|
+
interface CryptoKeyArbitraryKeyAlgorithm {
|
|
1147
1257
|
name: string;
|
|
1148
1258
|
hash?: CryptoKeyKeyAlgorithm;
|
|
1149
1259
|
namedCurve?: string;
|
|
@@ -1154,7 +1264,13 @@ declare class DigestStream extends WritableStream<
|
|
|
1154
1264
|
> {
|
|
1155
1265
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
|
1156
1266
|
get digest(): Promise<ArrayBuffer>;
|
|
1267
|
+
get bytesWritten(): number | bigint;
|
|
1157
1268
|
}
|
|
1269
|
+
/**
|
|
1270
|
+
* 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.
|
|
1271
|
+
*
|
|
1272
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
|
1273
|
+
*/
|
|
1158
1274
|
declare class TextDecoder {
|
|
1159
1275
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1160
1276
|
/**
|
|
@@ -1180,6 +1296,11 @@ declare class TextDecoder {
|
|
|
1180
1296
|
get fatal(): boolean;
|
|
1181
1297
|
get ignoreBOM(): boolean;
|
|
1182
1298
|
}
|
|
1299
|
+
/**
|
|
1300
|
+
* 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.
|
|
1301
|
+
*
|
|
1302
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
|
1303
|
+
*/
|
|
1183
1304
|
declare class TextEncoder {
|
|
1184
1305
|
constructor();
|
|
1185
1306
|
/**
|
|
@@ -1199,32 +1320,70 @@ declare class TextEncoder {
|
|
|
1199
1320
|
): TextEncoderEncodeIntoResult;
|
|
1200
1321
|
get encoding(): string;
|
|
1201
1322
|
}
|
|
1202
|
-
|
|
1323
|
+
interface TextDecoderConstructorOptions {
|
|
1203
1324
|
fatal: boolean;
|
|
1204
1325
|
ignoreBOM: boolean;
|
|
1205
1326
|
}
|
|
1206
|
-
|
|
1327
|
+
interface TextDecoderDecodeOptions {
|
|
1207
1328
|
stream: boolean;
|
|
1208
1329
|
}
|
|
1209
|
-
|
|
1330
|
+
interface TextEncoderEncodeIntoResult {
|
|
1210
1331
|
read: number;
|
|
1211
1332
|
written: number;
|
|
1212
1333
|
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Events providing information related to errors in scripts or in files.
|
|
1336
|
+
*
|
|
1337
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
1338
|
+
*/
|
|
1339
|
+
declare class ErrorEvent extends Event {
|
|
1340
|
+
constructor(type: string, init?: ErrorEventErrorEventInit);
|
|
1341
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1342
|
+
get filename(): string;
|
|
1343
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1344
|
+
get message(): string;
|
|
1345
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1346
|
+
get lineno(): number;
|
|
1347
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1348
|
+
get colno(): number;
|
|
1349
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1350
|
+
get error(): any;
|
|
1351
|
+
}
|
|
1352
|
+
interface ErrorEventErrorEventInit {
|
|
1353
|
+
message?: string;
|
|
1354
|
+
filename?: string;
|
|
1355
|
+
lineno?: number;
|
|
1356
|
+
colno?: number;
|
|
1357
|
+
error?: any;
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* 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".
|
|
1361
|
+
*
|
|
1362
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
|
1363
|
+
*/
|
|
1213
1364
|
declare class FormData {
|
|
1214
1365
|
constructor();
|
|
1366
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1215
1367
|
append(name: string, value: string): void;
|
|
1368
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1216
1369
|
append(name: string, value: Blob, filename?: string): void;
|
|
1370
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
|
|
1217
1371
|
delete(name: string): void;
|
|
1372
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
|
|
1218
1373
|
get(name: string): (File | string) | null;
|
|
1374
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
|
|
1219
1375
|
getAll(name: string): (File | string)[];
|
|
1376
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
|
|
1220
1377
|
has(name: string): boolean;
|
|
1378
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1221
1379
|
set(name: string, value: string): void;
|
|
1380
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1222
1381
|
set(name: string, value: Blob, filename?: string): void;
|
|
1223
|
-
|
|
1382
|
+
/* Returns an array of key, value pairs for every entry in the list. */
|
|
1224
1383
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1225
|
-
|
|
1384
|
+
/* Returns a list of keys in the list. */
|
|
1226
1385
|
keys(): IterableIterator<string>;
|
|
1227
|
-
|
|
1386
|
+
/* Returns a list of values in the list. */
|
|
1228
1387
|
values(): IterableIterator<File | string>;
|
|
1229
1388
|
forEach<This = unknown>(
|
|
1230
1389
|
callback: (
|
|
@@ -1237,7 +1396,7 @@ declare class FormData {
|
|
|
1237
1396
|
): void;
|
|
1238
1397
|
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
|
|
1239
1398
|
}
|
|
1240
|
-
|
|
1399
|
+
interface ContentOptions {
|
|
1241
1400
|
html?: boolean;
|
|
1242
1401
|
}
|
|
1243
1402
|
declare class HTMLRewriter {
|
|
@@ -1249,23 +1408,23 @@ declare class HTMLRewriter {
|
|
|
1249
1408
|
onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
|
|
1250
1409
|
transform(response: Response): Response;
|
|
1251
1410
|
}
|
|
1252
|
-
|
|
1411
|
+
interface HTMLRewriterElementContentHandlers {
|
|
1253
1412
|
element?(element: Element): void | Promise<void>;
|
|
1254
1413
|
comments?(comment: Comment): void | Promise<void>;
|
|
1255
1414
|
text?(element: Text): void | Promise<void>;
|
|
1256
1415
|
}
|
|
1257
|
-
|
|
1416
|
+
interface HTMLRewriterDocumentContentHandlers {
|
|
1258
1417
|
doctype?(doctype: Doctype): void | Promise<void>;
|
|
1259
1418
|
comments?(comment: Comment): void | Promise<void>;
|
|
1260
1419
|
text?(text: Text): void | Promise<void>;
|
|
1261
1420
|
end?(end: DocumentEnd): void | Promise<void>;
|
|
1262
1421
|
}
|
|
1263
|
-
|
|
1422
|
+
interface Doctype {
|
|
1264
1423
|
readonly name: string | null;
|
|
1265
1424
|
readonly publicId: string | null;
|
|
1266
1425
|
readonly systemId: string | null;
|
|
1267
1426
|
}
|
|
1268
|
-
|
|
1427
|
+
interface Element {
|
|
1269
1428
|
tagName: string;
|
|
1270
1429
|
readonly attributes: IterableIterator<string[]>;
|
|
1271
1430
|
readonly removed: boolean;
|
|
@@ -1284,13 +1443,13 @@ declare interface Element {
|
|
|
1284
1443
|
setInnerContent(content: string, options?: ContentOptions): Element;
|
|
1285
1444
|
onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
|
|
1286
1445
|
}
|
|
1287
|
-
|
|
1446
|
+
interface EndTag {
|
|
1288
1447
|
name: string;
|
|
1289
1448
|
before(content: string, options?: ContentOptions): EndTag;
|
|
1290
1449
|
after(content: string, options?: ContentOptions): EndTag;
|
|
1291
1450
|
remove(): EndTag;
|
|
1292
1451
|
}
|
|
1293
|
-
|
|
1452
|
+
interface Comment {
|
|
1294
1453
|
text: string;
|
|
1295
1454
|
readonly removed: boolean;
|
|
1296
1455
|
before(content: string, options?: ContentOptions): Comment;
|
|
@@ -1298,7 +1457,7 @@ declare interface Comment {
|
|
|
1298
1457
|
replace(content: string, options?: ContentOptions): Comment;
|
|
1299
1458
|
remove(): Comment;
|
|
1300
1459
|
}
|
|
1301
|
-
|
|
1460
|
+
interface Text {
|
|
1302
1461
|
readonly text: string;
|
|
1303
1462
|
readonly lastInTextNode: boolean;
|
|
1304
1463
|
readonly removed: boolean;
|
|
@@ -1307,42 +1466,58 @@ declare interface Text {
|
|
|
1307
1466
|
replace(content: string, options?: ContentOptions): Text;
|
|
1308
1467
|
remove(): Text;
|
|
1309
1468
|
}
|
|
1310
|
-
|
|
1469
|
+
interface DocumentEnd {
|
|
1311
1470
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
1312
1471
|
}
|
|
1472
|
+
/**
|
|
1473
|
+
* 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.
|
|
1474
|
+
*
|
|
1475
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
|
1476
|
+
*/
|
|
1313
1477
|
declare abstract class FetchEvent extends ExtendableEvent {
|
|
1314
|
-
|
|
1478
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
1315
1479
|
readonly request: Request;
|
|
1316
|
-
|
|
1480
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
1317
1481
|
respondWith(promise: Response | Promise<Response>): void;
|
|
1318
1482
|
passThroughOnException(): void;
|
|
1319
1483
|
}
|
|
1320
|
-
|
|
1484
|
+
type HeadersInit =
|
|
1321
1485
|
| Headers
|
|
1322
1486
|
| Iterable<Iterable<string>>
|
|
1323
1487
|
| Record<string, string>;
|
|
1488
|
+
/**
|
|
1489
|
+
* 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.
|
|
1490
|
+
*
|
|
1491
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
1492
|
+
*/
|
|
1324
1493
|
declare class Headers {
|
|
1325
1494
|
constructor(init?: HeadersInit);
|
|
1495
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
|
|
1326
1496
|
get(name: string): string | null;
|
|
1327
1497
|
getAll(name: string): string[];
|
|
1498
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
|
|
1328
1499
|
getSetCookie(): string[];
|
|
1500
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
|
|
1329
1501
|
has(name: string): boolean;
|
|
1502
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
|
|
1330
1503
|
set(name: string, value: string): void;
|
|
1504
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
|
|
1331
1505
|
append(name: string, value: string): void;
|
|
1506
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
|
|
1332
1507
|
delete(name: string): void;
|
|
1333
1508
|
forEach<This = unknown>(
|
|
1334
1509
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
1335
1510
|
thisArg?: This,
|
|
1336
1511
|
): void;
|
|
1337
|
-
|
|
1512
|
+
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
1338
1513
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1339
|
-
|
|
1514
|
+
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
1340
1515
|
keys(): IterableIterator<string>;
|
|
1341
|
-
|
|
1516
|
+
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
1342
1517
|
values(): IterableIterator<string>;
|
|
1343
1518
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1344
1519
|
}
|
|
1345
|
-
|
|
1520
|
+
type BodyInit =
|
|
1346
1521
|
| ReadableStream<Uint8Array>
|
|
1347
1522
|
| string
|
|
1348
1523
|
| ArrayBuffer
|
|
@@ -1351,38 +1526,51 @@ declare type BodyInit =
|
|
|
1351
1526
|
| URLSearchParams
|
|
1352
1527
|
| FormData;
|
|
1353
1528
|
declare abstract class Body {
|
|
1529
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
|
1354
1530
|
get body(): ReadableStream | null;
|
|
1531
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
1355
1532
|
get bodyUsed(): boolean;
|
|
1533
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
1356
1534
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1535
|
+
bytes(): Promise<Uint8Array>;
|
|
1536
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
|
|
1357
1537
|
text(): Promise<string>;
|
|
1538
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
|
|
1358
1539
|
json<T>(): Promise<T>;
|
|
1540
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
|
|
1359
1541
|
formData(): Promise<FormData>;
|
|
1542
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
1360
1543
|
blob(): Promise<Blob>;
|
|
1361
1544
|
}
|
|
1545
|
+
/**
|
|
1546
|
+
* This Fetch API interface represents the response to a request.
|
|
1547
|
+
*
|
|
1548
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1549
|
+
*/
|
|
1362
1550
|
declare class Response extends Body {
|
|
1363
1551
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1364
|
-
|
|
1552
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1365
1553
|
static redirect(url: string, status?: number): Response;
|
|
1366
|
-
|
|
1554
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1367
1555
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1368
|
-
|
|
1556
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1369
1557
|
clone(): Response;
|
|
1370
|
-
|
|
1558
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1371
1559
|
get status(): number;
|
|
1372
|
-
|
|
1560
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1373
1561
|
get statusText(): string;
|
|
1374
|
-
|
|
1562
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1375
1563
|
get headers(): Headers;
|
|
1376
|
-
|
|
1564
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1377
1565
|
get ok(): boolean;
|
|
1378
|
-
|
|
1566
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1379
1567
|
get redirected(): boolean;
|
|
1380
|
-
|
|
1568
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1381
1569
|
get url(): string;
|
|
1382
1570
|
get webSocket(): WebSocket | null;
|
|
1383
1571
|
get cf(): any | undefined;
|
|
1384
1572
|
}
|
|
1385
|
-
|
|
1573
|
+
interface ResponseInit {
|
|
1386
1574
|
status?: number;
|
|
1387
1575
|
statusText?: string;
|
|
1388
1576
|
headers?: HeadersInit;
|
|
@@ -1390,16 +1578,21 @@ declare interface ResponseInit {
|
|
|
1390
1578
|
webSocket?: WebSocket | null;
|
|
1391
1579
|
encodeBody?: "automatic" | "manual";
|
|
1392
1580
|
}
|
|
1393
|
-
|
|
1394
|
-
CfHostMetadata
|
|
1395
|
-
|
|
1396
|
-
|
|
1581
|
+
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
1582
|
+
| Request<CfHostMetadata, Cf>
|
|
1583
|
+
| string
|
|
1584
|
+
| URL;
|
|
1585
|
+
/**
|
|
1586
|
+
* This Fetch API interface represents a resource request.
|
|
1587
|
+
*
|
|
1588
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1589
|
+
*/
|
|
1397
1590
|
declare class Request<
|
|
1398
1591
|
CfHostMetadata = unknown,
|
|
1399
1592
|
Cf = CfProperties<CfHostMetadata>,
|
|
1400
1593
|
> extends Body {
|
|
1401
1594
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1402
|
-
|
|
1595
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1403
1596
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1404
1597
|
/**
|
|
1405
1598
|
* Returns request's HTTP method, which is "GET" by default.
|
|
@@ -1446,26 +1639,25 @@ declare class Request<
|
|
|
1446
1639
|
*/
|
|
1447
1640
|
get keepalive(): boolean;
|
|
1448
1641
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1642
|
+
interface RequestInit<Cf = CfProperties> {
|
|
1643
|
+
/* A string to set request's method. */
|
|
1451
1644
|
method?: string;
|
|
1452
|
-
|
|
1645
|
+
/* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
|
|
1453
1646
|
headers?: HeadersInit;
|
|
1454
|
-
|
|
1647
|
+
/* A BodyInit object or null to set request's body. */
|
|
1455
1648
|
body?: BodyInit | null;
|
|
1456
|
-
|
|
1649
|
+
/* 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. */
|
|
1457
1650
|
redirect?: string;
|
|
1458
1651
|
fetcher?: Fetcher | null;
|
|
1459
1652
|
cf?: Cf;
|
|
1460
|
-
|
|
1653
|
+
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1461
1654
|
integrity?: string;
|
|
1462
|
-
|
|
1655
|
+
/* An AbortSignal to set request's signal. */
|
|
1463
1656
|
signal?: AbortSignal | null;
|
|
1464
1657
|
}
|
|
1465
|
-
|
|
1466
|
-
T
|
|
1467
|
-
|
|
1468
|
-
declare type Fetcher<
|
|
1658
|
+
type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> =
|
|
1659
|
+
Fetcher<T>;
|
|
1660
|
+
type Fetcher<
|
|
1469
1661
|
T extends Rpc.EntrypointBranded | undefined = undefined,
|
|
1470
1662
|
Reserved extends string = never,
|
|
1471
1663
|
> = (T extends Rpc.EntrypointBranded
|
|
@@ -1479,22 +1671,22 @@ declare type Fetcher<
|
|
|
1479
1671
|
): Promise<FetcherQueueResult>;
|
|
1480
1672
|
scheduled(options?: FetcherScheduledOptions): Promise<FetcherScheduledResult>;
|
|
1481
1673
|
};
|
|
1482
|
-
|
|
1674
|
+
interface FetcherScheduledOptions {
|
|
1483
1675
|
scheduledTime?: Date;
|
|
1484
1676
|
cron?: string;
|
|
1485
1677
|
}
|
|
1486
|
-
|
|
1678
|
+
interface FetcherScheduledResult {
|
|
1487
1679
|
outcome: string;
|
|
1488
1680
|
noRetry: boolean;
|
|
1489
1681
|
}
|
|
1490
|
-
|
|
1682
|
+
interface FetcherQueueResult {
|
|
1491
1683
|
outcome: string;
|
|
1492
1684
|
ackAll: boolean;
|
|
1493
1685
|
retryBatch: QueueRetryBatch;
|
|
1494
1686
|
explicitAcks: string[];
|
|
1495
1687
|
retryMessages: QueueRetryMessage[];
|
|
1496
1688
|
}
|
|
1497
|
-
|
|
1689
|
+
type ServiceBindingQueueMessage<Body = unknown> = {
|
|
1498
1690
|
id: string;
|
|
1499
1691
|
timestamp: Date;
|
|
1500
1692
|
attempts: number;
|
|
@@ -1506,12 +1698,12 @@ declare type ServiceBindingQueueMessage<Body = unknown> = {
|
|
|
1506
1698
|
serializedBody: ArrayBuffer | ArrayBufferView;
|
|
1507
1699
|
}
|
|
1508
1700
|
);
|
|
1509
|
-
|
|
1701
|
+
interface KVNamespaceListKey<Metadata, Key extends string = string> {
|
|
1510
1702
|
name: Key;
|
|
1511
1703
|
expiration?: number;
|
|
1512
1704
|
metadata?: Metadata;
|
|
1513
1705
|
}
|
|
1514
|
-
|
|
1706
|
+
type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
1515
1707
|
| {
|
|
1516
1708
|
list_complete: false;
|
|
1517
1709
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
@@ -1523,7 +1715,7 @@ declare type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
|
1523
1715
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
1524
1716
|
cacheStatus: string | null;
|
|
1525
1717
|
};
|
|
1526
|
-
|
|
1718
|
+
interface KVNamespace<Key extends string = string> {
|
|
1527
1719
|
get(
|
|
1528
1720
|
key: Key,
|
|
1529
1721
|
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
@@ -1597,57 +1789,57 @@ declare interface KVNamespace<Key extends string = string> {
|
|
|
1597
1789
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1598
1790
|
delete(key: Key): Promise<void>;
|
|
1599
1791
|
}
|
|
1600
|
-
|
|
1792
|
+
interface KVNamespaceListOptions {
|
|
1601
1793
|
limit?: number;
|
|
1602
1794
|
prefix?: string | null;
|
|
1603
1795
|
cursor?: string | null;
|
|
1604
1796
|
}
|
|
1605
|
-
|
|
1797
|
+
interface KVNamespaceGetOptions<Type> {
|
|
1606
1798
|
type: Type;
|
|
1607
1799
|
cacheTtl?: number;
|
|
1608
1800
|
}
|
|
1609
|
-
|
|
1801
|
+
interface KVNamespacePutOptions {
|
|
1610
1802
|
expiration?: number;
|
|
1611
1803
|
expirationTtl?: number;
|
|
1612
1804
|
metadata?: any | null;
|
|
1613
1805
|
}
|
|
1614
|
-
|
|
1806
|
+
interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
1615
1807
|
value: Value | null;
|
|
1616
1808
|
metadata: Metadata | null;
|
|
1617
1809
|
cacheStatus: string | null;
|
|
1618
1810
|
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1811
|
+
type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1812
|
+
interface Queue<Body = unknown> {
|
|
1621
1813
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1622
1814
|
sendBatch(
|
|
1623
1815
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
1624
1816
|
options?: QueueSendBatchOptions,
|
|
1625
1817
|
): Promise<void>;
|
|
1626
1818
|
}
|
|
1627
|
-
|
|
1819
|
+
interface QueueSendOptions {
|
|
1628
1820
|
contentType?: QueueContentType;
|
|
1629
1821
|
delaySeconds?: number;
|
|
1630
1822
|
}
|
|
1631
|
-
|
|
1823
|
+
interface QueueSendBatchOptions {
|
|
1632
1824
|
delaySeconds?: number;
|
|
1633
1825
|
}
|
|
1634
|
-
|
|
1826
|
+
interface MessageSendRequest<Body = unknown> {
|
|
1635
1827
|
body: Body;
|
|
1636
1828
|
contentType?: QueueContentType;
|
|
1637
1829
|
delaySeconds?: number;
|
|
1638
1830
|
}
|
|
1639
|
-
|
|
1831
|
+
interface QueueRetryBatch {
|
|
1640
1832
|
retry: boolean;
|
|
1641
1833
|
delaySeconds?: number;
|
|
1642
1834
|
}
|
|
1643
|
-
|
|
1835
|
+
interface QueueRetryMessage {
|
|
1644
1836
|
msgId: string;
|
|
1645
1837
|
delaySeconds?: number;
|
|
1646
1838
|
}
|
|
1647
|
-
|
|
1839
|
+
interface QueueRetryOptions {
|
|
1648
1840
|
delaySeconds?: number;
|
|
1649
1841
|
}
|
|
1650
|
-
|
|
1842
|
+
interface Message<Body = unknown> {
|
|
1651
1843
|
readonly id: string;
|
|
1652
1844
|
readonly timestamp: Date;
|
|
1653
1845
|
readonly body: Body;
|
|
@@ -1655,26 +1847,26 @@ declare interface Message<Body = unknown> {
|
|
|
1655
1847
|
retry(options?: QueueRetryOptions): void;
|
|
1656
1848
|
ack(): void;
|
|
1657
1849
|
}
|
|
1658
|
-
|
|
1850
|
+
interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1659
1851
|
readonly messages: readonly Message<Body>[];
|
|
1660
1852
|
readonly queue: string;
|
|
1661
1853
|
retryAll(options?: QueueRetryOptions): void;
|
|
1662
1854
|
ackAll(): void;
|
|
1663
1855
|
}
|
|
1664
|
-
|
|
1856
|
+
interface MessageBatch<Body = unknown> {
|
|
1665
1857
|
readonly messages: readonly Message<Body>[];
|
|
1666
1858
|
readonly queue: string;
|
|
1667
1859
|
retryAll(options?: QueueRetryOptions): void;
|
|
1668
1860
|
ackAll(): void;
|
|
1669
1861
|
}
|
|
1670
|
-
|
|
1862
|
+
interface R2Error extends Error {
|
|
1671
1863
|
readonly name: string;
|
|
1672
1864
|
readonly code: number;
|
|
1673
1865
|
readonly message: string;
|
|
1674
1866
|
readonly action: string;
|
|
1675
1867
|
readonly stack: any;
|
|
1676
1868
|
}
|
|
1677
|
-
|
|
1869
|
+
interface R2ListOptions {
|
|
1678
1870
|
limit?: number;
|
|
1679
1871
|
prefix?: string;
|
|
1680
1872
|
cursor?: string;
|
|
@@ -1723,7 +1915,7 @@ declare abstract class R2Bucket {
|
|
|
1723
1915
|
delete(keys: string | string[]): Promise<void>;
|
|
1724
1916
|
list(options?: R2ListOptions): Promise<R2Objects>;
|
|
1725
1917
|
}
|
|
1726
|
-
|
|
1918
|
+
interface R2MultipartUpload {
|
|
1727
1919
|
readonly key: string;
|
|
1728
1920
|
readonly uploadId: string;
|
|
1729
1921
|
uploadPart(
|
|
@@ -1733,7 +1925,7 @@ declare interface R2MultipartUpload {
|
|
|
1733
1925
|
abort(): Promise<void>;
|
|
1734
1926
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
1735
1927
|
}
|
|
1736
|
-
|
|
1928
|
+
interface R2UploadedPart {
|
|
1737
1929
|
partNumber: number;
|
|
1738
1930
|
etag: string;
|
|
1739
1931
|
}
|
|
@@ -1751,7 +1943,7 @@ declare abstract class R2Object {
|
|
|
1751
1943
|
readonly storageClass: string;
|
|
1752
1944
|
writeHttpMetadata(headers: Headers): void;
|
|
1753
1945
|
}
|
|
1754
|
-
|
|
1946
|
+
interface R2ObjectBody extends R2Object {
|
|
1755
1947
|
get body(): ReadableStream;
|
|
1756
1948
|
get bodyUsed(): boolean;
|
|
1757
1949
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
@@ -1759,7 +1951,7 @@ declare interface R2ObjectBody extends R2Object {
|
|
|
1759
1951
|
json<T>(): Promise<T>;
|
|
1760
1952
|
blob(): Promise<Blob>;
|
|
1761
1953
|
}
|
|
1762
|
-
|
|
1954
|
+
type R2Range =
|
|
1763
1955
|
| {
|
|
1764
1956
|
offset: number;
|
|
1765
1957
|
length?: number;
|
|
@@ -1771,18 +1963,18 @@ declare type R2Range =
|
|
|
1771
1963
|
| {
|
|
1772
1964
|
suffix: number;
|
|
1773
1965
|
};
|
|
1774
|
-
|
|
1966
|
+
interface R2Conditional {
|
|
1775
1967
|
etagMatches?: string;
|
|
1776
1968
|
etagDoesNotMatch?: string;
|
|
1777
1969
|
uploadedBefore?: Date;
|
|
1778
1970
|
uploadedAfter?: Date;
|
|
1779
1971
|
secondsGranularity?: boolean;
|
|
1780
1972
|
}
|
|
1781
|
-
|
|
1973
|
+
interface R2GetOptions {
|
|
1782
1974
|
onlyIf?: R2Conditional | Headers;
|
|
1783
1975
|
range?: R2Range | Headers;
|
|
1784
1976
|
}
|
|
1785
|
-
|
|
1977
|
+
interface R2PutOptions {
|
|
1786
1978
|
onlyIf?: R2Conditional | Headers;
|
|
1787
1979
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1788
1980
|
customMetadata?: Record<string, string>;
|
|
@@ -1793,12 +1985,12 @@ declare interface R2PutOptions {
|
|
|
1793
1985
|
sha512?: ArrayBuffer | string;
|
|
1794
1986
|
storageClass?: string;
|
|
1795
1987
|
}
|
|
1796
|
-
|
|
1988
|
+
interface R2MultipartOptions {
|
|
1797
1989
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1798
1990
|
customMetadata?: Record<string, string>;
|
|
1799
1991
|
storageClass?: string;
|
|
1800
1992
|
}
|
|
1801
|
-
|
|
1993
|
+
interface R2Checksums {
|
|
1802
1994
|
readonly md5?: ArrayBuffer;
|
|
1803
1995
|
readonly sha1?: ArrayBuffer;
|
|
1804
1996
|
readonly sha256?: ArrayBuffer;
|
|
@@ -1806,14 +1998,14 @@ declare interface R2Checksums {
|
|
|
1806
1998
|
readonly sha512?: ArrayBuffer;
|
|
1807
1999
|
toJSON(): R2StringChecksums;
|
|
1808
2000
|
}
|
|
1809
|
-
|
|
2001
|
+
interface R2StringChecksums {
|
|
1810
2002
|
md5?: string;
|
|
1811
2003
|
sha1?: string;
|
|
1812
2004
|
sha256?: string;
|
|
1813
2005
|
sha384?: string;
|
|
1814
2006
|
sha512?: string;
|
|
1815
2007
|
}
|
|
1816
|
-
|
|
2008
|
+
interface R2HTTPMetadata {
|
|
1817
2009
|
contentType?: string;
|
|
1818
2010
|
contentLanguage?: string;
|
|
1819
2011
|
contentDisposition?: string;
|
|
@@ -1821,7 +2013,7 @@ declare interface R2HTTPMetadata {
|
|
|
1821
2013
|
cacheControl?: string;
|
|
1822
2014
|
cacheExpiry?: Date;
|
|
1823
2015
|
}
|
|
1824
|
-
|
|
2016
|
+
type R2Objects = {
|
|
1825
2017
|
objects: R2Object[];
|
|
1826
2018
|
delimitedPrefixes: string[];
|
|
1827
2019
|
} & (
|
|
@@ -1843,16 +2035,16 @@ declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
|
1843
2035
|
readonly cron: string;
|
|
1844
2036
|
noRetry(): void;
|
|
1845
2037
|
}
|
|
1846
|
-
|
|
2038
|
+
interface ScheduledController {
|
|
1847
2039
|
readonly scheduledTime: number;
|
|
1848
2040
|
readonly cron: string;
|
|
1849
2041
|
noRetry(): void;
|
|
1850
2042
|
}
|
|
1851
|
-
|
|
2043
|
+
interface QueuingStrategy<T = any> {
|
|
1852
2044
|
highWaterMark?: number | bigint;
|
|
1853
2045
|
size?: (chunk: T) => number | bigint;
|
|
1854
2046
|
}
|
|
1855
|
-
|
|
2047
|
+
interface UnderlyingSink<W = any> {
|
|
1856
2048
|
type?: string;
|
|
1857
2049
|
start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
|
|
1858
2050
|
write?: (
|
|
@@ -1862,14 +2054,14 @@ declare interface UnderlyingSink<W = any> {
|
|
|
1862
2054
|
abort?: (reason: any) => void | Promise<void>;
|
|
1863
2055
|
close?: () => void | Promise<void>;
|
|
1864
2056
|
}
|
|
1865
|
-
|
|
2057
|
+
interface UnderlyingByteSource {
|
|
1866
2058
|
type: "bytes";
|
|
1867
2059
|
autoAllocateChunkSize?: number;
|
|
1868
2060
|
start?: (controller: ReadableByteStreamController) => void | Promise<void>;
|
|
1869
2061
|
pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
|
|
1870
2062
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1871
2063
|
}
|
|
1872
|
-
|
|
2064
|
+
interface UnderlyingSource<R = any> {
|
|
1873
2065
|
type?: "" | undefined;
|
|
1874
2066
|
start?: (
|
|
1875
2067
|
controller: ReadableStreamDefaultController<R>,
|
|
@@ -1880,7 +2072,7 @@ declare interface UnderlyingSource<R = any> {
|
|
|
1880
2072
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1881
2073
|
expectedLength?: number | bigint;
|
|
1882
2074
|
}
|
|
1883
|
-
|
|
2075
|
+
interface Transformer<I = any, O = any> {
|
|
1884
2076
|
readableType?: string;
|
|
1885
2077
|
writableType?: string;
|
|
1886
2078
|
start?: (
|
|
@@ -1896,7 +2088,7 @@ declare interface Transformer<I = any, O = any> {
|
|
|
1896
2088
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1897
2089
|
expectedLength?: number;
|
|
1898
2090
|
}
|
|
1899
|
-
|
|
2091
|
+
interface StreamPipeOptions {
|
|
1900
2092
|
/**
|
|
1901
2093
|
* 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.
|
|
1902
2094
|
*
|
|
@@ -1919,7 +2111,7 @@ declare interface StreamPipeOptions {
|
|
|
1919
2111
|
preventCancel?: boolean;
|
|
1920
2112
|
signal?: AbortSignal;
|
|
1921
2113
|
}
|
|
1922
|
-
|
|
2114
|
+
type ReadableStreamReadResult<R = any> =
|
|
1923
2115
|
| {
|
|
1924
2116
|
done: false;
|
|
1925
2117
|
value: R;
|
|
@@ -1933,32 +2125,37 @@ declare type ReadableStreamReadResult<R = any> =
|
|
|
1933
2125
|
*
|
|
1934
2126
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1935
2127
|
*/
|
|
1936
|
-
|
|
1937
|
-
|
|
2128
|
+
interface ReadableStream<R = any> {
|
|
2129
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1938
2130
|
get locked(): boolean;
|
|
1939
|
-
|
|
2131
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1940
2132
|
cancel(reason?: any): Promise<void>;
|
|
1941
|
-
|
|
2133
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1942
2134
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1943
|
-
|
|
2135
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1944
2136
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1945
|
-
|
|
2137
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1946
2138
|
pipeThrough<T>(
|
|
1947
2139
|
transform: ReadableWritablePair<T, R>,
|
|
1948
2140
|
options?: StreamPipeOptions,
|
|
1949
2141
|
): ReadableStream<T>;
|
|
1950
|
-
|
|
2142
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1951
2143
|
pipeTo(
|
|
1952
2144
|
destination: WritableStream<R>,
|
|
1953
2145
|
options?: StreamPipeOptions,
|
|
1954
2146
|
): Promise<void>;
|
|
1955
|
-
|
|
2147
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1956
2148
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1957
2149
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1958
2150
|
[Symbol.asyncIterator](
|
|
1959
2151
|
options?: ReadableStreamValuesOptions,
|
|
1960
2152
|
): AsyncIterableIterator<R>;
|
|
1961
2153
|
}
|
|
2154
|
+
/**
|
|
2155
|
+
* 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.
|
|
2156
|
+
*
|
|
2157
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
2158
|
+
*/
|
|
1962
2159
|
declare const ReadableStream: {
|
|
1963
2160
|
prototype: ReadableStream;
|
|
1964
2161
|
new (
|
|
@@ -1970,34 +2167,36 @@ declare const ReadableStream: {
|
|
|
1970
2167
|
strategy?: QueuingStrategy<R>,
|
|
1971
2168
|
): ReadableStream<R>;
|
|
1972
2169
|
};
|
|
2170
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
|
|
1973
2171
|
declare class ReadableStreamDefaultReader<R = any> {
|
|
1974
2172
|
constructor(stream: ReadableStream);
|
|
1975
2173
|
get closed(): Promise<void>;
|
|
1976
2174
|
cancel(reason?: any): Promise<void>;
|
|
1977
|
-
|
|
2175
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1978
2176
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1979
|
-
|
|
2177
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1980
2178
|
releaseLock(): void;
|
|
1981
2179
|
}
|
|
2180
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
|
1982
2181
|
declare class ReadableStreamBYOBReader {
|
|
1983
2182
|
constructor(stream: ReadableStream);
|
|
1984
2183
|
get closed(): Promise<void>;
|
|
1985
2184
|
cancel(reason?: any): Promise<void>;
|
|
1986
|
-
|
|
2185
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1987
2186
|
read<T extends ArrayBufferView>(
|
|
1988
2187
|
view: T,
|
|
1989
2188
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1990
|
-
|
|
2189
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1991
2190
|
releaseLock(): void;
|
|
1992
2191
|
readAtLeast<T extends ArrayBufferView>(
|
|
1993
2192
|
minElements: number,
|
|
1994
2193
|
view: T,
|
|
1995
2194
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1996
2195
|
}
|
|
1997
|
-
|
|
2196
|
+
interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1998
2197
|
min?: number;
|
|
1999
2198
|
}
|
|
2000
|
-
|
|
2199
|
+
interface ReadableStreamGetReaderOptions {
|
|
2001
2200
|
/**
|
|
2002
2201
|
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
|
2003
2202
|
*
|
|
@@ -2005,55 +2204,63 @@ declare interface ReadableStreamGetReaderOptions {
|
|
|
2005
2204
|
*/
|
|
2006
2205
|
mode: "byob";
|
|
2007
2206
|
}
|
|
2207
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
2008
2208
|
declare abstract class ReadableStreamBYOBRequest {
|
|
2009
|
-
|
|
2209
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
2010
2210
|
get view(): Uint8Array | null;
|
|
2011
|
-
|
|
2211
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
2012
2212
|
respond(bytesWritten: number): void;
|
|
2013
|
-
|
|
2213
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
2014
2214
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
2015
2215
|
get atLeast(): number | null;
|
|
2016
2216
|
}
|
|
2217
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
2017
2218
|
declare abstract class ReadableStreamDefaultController<R = any> {
|
|
2018
|
-
|
|
2219
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
2019
2220
|
get desiredSize(): number | null;
|
|
2020
|
-
|
|
2221
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
2021
2222
|
close(): void;
|
|
2022
|
-
|
|
2223
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
2023
2224
|
enqueue(chunk?: R): void;
|
|
2024
|
-
|
|
2225
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
2025
2226
|
error(reason: any): void;
|
|
2026
2227
|
}
|
|
2228
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
2027
2229
|
declare abstract class ReadableByteStreamController {
|
|
2028
|
-
|
|
2230
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
2029
2231
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
|
2030
|
-
|
|
2232
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
2031
2233
|
get desiredSize(): number | null;
|
|
2032
|
-
|
|
2234
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
2033
2235
|
close(): void;
|
|
2034
|
-
|
|
2236
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
2035
2237
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
2036
|
-
|
|
2238
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
2037
2239
|
error(reason: any): void;
|
|
2038
2240
|
}
|
|
2241
|
+
/**
|
|
2242
|
+
* This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
|
|
2243
|
+
*
|
|
2244
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
2245
|
+
*/
|
|
2039
2246
|
declare abstract class WritableStreamDefaultController {
|
|
2040
|
-
|
|
2247
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
2041
2248
|
get signal(): AbortSignal;
|
|
2042
|
-
|
|
2249
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
2043
2250
|
error(reason?: any): void;
|
|
2044
2251
|
}
|
|
2045
|
-
|
|
2046
|
-
declare
|
|
2047
|
-
|
|
2252
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
2253
|
+
declare abstract class TransformStreamDefaultController<O = any> {
|
|
2254
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
2048
2255
|
get desiredSize(): number | null;
|
|
2049
|
-
|
|
2256
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
2050
2257
|
enqueue(chunk?: O): void;
|
|
2051
|
-
|
|
2258
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
2052
2259
|
error(reason: any): void;
|
|
2053
|
-
|
|
2260
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
2054
2261
|
terminate(): void;
|
|
2055
2262
|
}
|
|
2056
|
-
|
|
2263
|
+
interface ReadableWritablePair<R = any, W = any> {
|
|
2057
2264
|
/**
|
|
2058
2265
|
* 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.
|
|
2059
2266
|
*
|
|
@@ -2062,46 +2269,57 @@ declare interface ReadableWritablePair<R = any, W = any> {
|
|
|
2062
2269
|
writable: WritableStream<W>;
|
|
2063
2270
|
readable: ReadableStream<R>;
|
|
2064
2271
|
}
|
|
2272
|
+
/**
|
|
2273
|
+
* 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.
|
|
2274
|
+
*
|
|
2275
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
|
2276
|
+
*/
|
|
2065
2277
|
declare class WritableStream<W = any> {
|
|
2066
2278
|
constructor(
|
|
2067
2279
|
underlyingSink?: UnderlyingSink,
|
|
2068
2280
|
queuingStrategy?: QueuingStrategy,
|
|
2069
2281
|
);
|
|
2070
|
-
|
|
2282
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
2071
2283
|
get locked(): boolean;
|
|
2072
|
-
|
|
2284
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
2073
2285
|
abort(reason?: any): Promise<void>;
|
|
2074
|
-
|
|
2286
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
2075
2287
|
close(): Promise<void>;
|
|
2076
|
-
|
|
2288
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
2077
2289
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
2078
2290
|
}
|
|
2291
|
+
/**
|
|
2292
|
+
* 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.
|
|
2293
|
+
*
|
|
2294
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
|
2295
|
+
*/
|
|
2079
2296
|
declare class WritableStreamDefaultWriter<W = any> {
|
|
2080
2297
|
constructor(stream: WritableStream);
|
|
2081
|
-
|
|
2298
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
2082
2299
|
get closed(): Promise<void>;
|
|
2083
|
-
|
|
2300
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
2084
2301
|
get ready(): Promise<void>;
|
|
2085
|
-
|
|
2302
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
2086
2303
|
get desiredSize(): number | null;
|
|
2087
|
-
|
|
2304
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
2088
2305
|
abort(reason?: any): Promise<void>;
|
|
2089
|
-
|
|
2306
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
2090
2307
|
close(): Promise<void>;
|
|
2091
|
-
|
|
2308
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
2092
2309
|
write(chunk?: W): Promise<void>;
|
|
2093
|
-
|
|
2310
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
2094
2311
|
releaseLock(): void;
|
|
2095
2312
|
}
|
|
2313
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
|
|
2096
2314
|
declare class TransformStream<I = any, O = any> {
|
|
2097
2315
|
constructor(
|
|
2098
2316
|
transformer?: Transformer<I, O>,
|
|
2099
2317
|
writableStrategy?: QueuingStrategy<I>,
|
|
2100
2318
|
readableStrategy?: QueuingStrategy<O>,
|
|
2101
2319
|
);
|
|
2102
|
-
|
|
2320
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
2103
2321
|
get readable(): ReadableStream<O>;
|
|
2104
|
-
|
|
2322
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
2105
2323
|
get writable(): WritableStream<I>;
|
|
2106
2324
|
}
|
|
2107
2325
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
@@ -2116,28 +2334,32 @@ declare class IdentityTransformStream extends TransformStream<
|
|
|
2116
2334
|
> {
|
|
2117
2335
|
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2118
2336
|
}
|
|
2119
|
-
|
|
2337
|
+
interface IdentityTransformStreamQueuingStrategy {
|
|
2120
2338
|
highWaterMark?: number | bigint;
|
|
2121
2339
|
}
|
|
2122
|
-
|
|
2340
|
+
interface ReadableStreamValuesOptions {
|
|
2123
2341
|
preventCancel?: boolean;
|
|
2124
2342
|
}
|
|
2343
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
|
|
2125
2344
|
declare class CompressionStream extends TransformStream<
|
|
2126
2345
|
ArrayBuffer | ArrayBufferView,
|
|
2127
2346
|
Uint8Array
|
|
2128
2347
|
> {
|
|
2129
2348
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2130
2349
|
}
|
|
2350
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
|
|
2131
2351
|
declare class DecompressionStream extends TransformStream<
|
|
2132
2352
|
ArrayBuffer | ArrayBufferView,
|
|
2133
2353
|
Uint8Array
|
|
2134
2354
|
> {
|
|
2135
2355
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2136
2356
|
}
|
|
2357
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
|
|
2137
2358
|
declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
|
|
2138
2359
|
constructor();
|
|
2139
2360
|
get encoding(): string;
|
|
2140
2361
|
}
|
|
2362
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
|
|
2141
2363
|
declare class TextDecoderStream extends TransformStream<
|
|
2142
2364
|
ArrayBuffer | ArrayBufferView,
|
|
2143
2365
|
string
|
|
@@ -2147,27 +2369,37 @@ declare class TextDecoderStream extends TransformStream<
|
|
|
2147
2369
|
get fatal(): boolean;
|
|
2148
2370
|
get ignoreBOM(): boolean;
|
|
2149
2371
|
}
|
|
2150
|
-
|
|
2372
|
+
interface TextDecoderStreamTextDecoderStreamInit {
|
|
2151
2373
|
fatal?: boolean;
|
|
2152
2374
|
ignoreBOM?: boolean;
|
|
2153
2375
|
}
|
|
2376
|
+
/**
|
|
2377
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2378
|
+
*
|
|
2379
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
|
|
2380
|
+
*/
|
|
2154
2381
|
declare class ByteLengthQueuingStrategy
|
|
2155
2382
|
implements QueuingStrategy<ArrayBufferView>
|
|
2156
2383
|
{
|
|
2157
2384
|
constructor(init: QueuingStrategyInit);
|
|
2158
|
-
|
|
2385
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
2159
2386
|
get highWaterMark(): number;
|
|
2160
|
-
|
|
2387
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
2161
2388
|
get size(): (chunk?: any) => number;
|
|
2162
2389
|
}
|
|
2390
|
+
/**
|
|
2391
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2392
|
+
*
|
|
2393
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
|
|
2394
|
+
*/
|
|
2163
2395
|
declare class CountQueuingStrategy implements QueuingStrategy {
|
|
2164
2396
|
constructor(init: QueuingStrategyInit);
|
|
2165
|
-
|
|
2397
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
2166
2398
|
get highWaterMark(): number;
|
|
2167
|
-
|
|
2399
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
2168
2400
|
get size(): (chunk?: any) => number;
|
|
2169
2401
|
}
|
|
2170
|
-
|
|
2402
|
+
interface QueuingStrategyInit {
|
|
2171
2403
|
/**
|
|
2172
2404
|
* Creates a new ByteLengthQueuingStrategy with the provided high water mark.
|
|
2173
2405
|
*
|
|
@@ -2175,7 +2407,7 @@ declare interface QueuingStrategyInit {
|
|
|
2175
2407
|
*/
|
|
2176
2408
|
highWaterMark: number;
|
|
2177
2409
|
}
|
|
2178
|
-
|
|
2410
|
+
interface ScriptVersion {
|
|
2179
2411
|
id?: string;
|
|
2180
2412
|
tag?: string;
|
|
2181
2413
|
message?: string;
|
|
@@ -2184,7 +2416,7 @@ declare abstract class TailEvent extends ExtendableEvent {
|
|
|
2184
2416
|
readonly events: TraceItem[];
|
|
2185
2417
|
readonly traces: TraceItem[];
|
|
2186
2418
|
}
|
|
2187
|
-
|
|
2419
|
+
interface TraceItem {
|
|
2188
2420
|
readonly event:
|
|
2189
2421
|
| (
|
|
2190
2422
|
| TraceItemFetchEventInfo
|
|
@@ -2209,156 +2441,195 @@ declare interface TraceItem {
|
|
|
2209
2441
|
readonly scriptTags?: string[];
|
|
2210
2442
|
readonly outcome: string;
|
|
2211
2443
|
}
|
|
2212
|
-
|
|
2444
|
+
interface TraceItemAlarmEventInfo {
|
|
2213
2445
|
readonly scheduledTime: Date;
|
|
2214
2446
|
}
|
|
2215
|
-
|
|
2216
|
-
|
|
2447
|
+
interface TraceItemCustomEventInfo {}
|
|
2448
|
+
interface TraceItemScheduledEventInfo {
|
|
2217
2449
|
readonly scheduledTime: number;
|
|
2218
2450
|
readonly cron: string;
|
|
2219
2451
|
}
|
|
2220
|
-
|
|
2452
|
+
interface TraceItemQueueEventInfo {
|
|
2221
2453
|
readonly queue: string;
|
|
2222
2454
|
readonly batchSize: number;
|
|
2223
2455
|
}
|
|
2224
|
-
|
|
2456
|
+
interface TraceItemEmailEventInfo {
|
|
2225
2457
|
readonly mailFrom: string;
|
|
2226
2458
|
readonly rcptTo: string;
|
|
2227
2459
|
readonly rawSize: number;
|
|
2228
2460
|
}
|
|
2229
|
-
|
|
2461
|
+
interface TraceItemTailEventInfo {
|
|
2230
2462
|
readonly consumedEvents: TraceItemTailEventInfoTailItem[];
|
|
2231
2463
|
}
|
|
2232
|
-
|
|
2464
|
+
interface TraceItemTailEventInfoTailItem {
|
|
2233
2465
|
readonly scriptName: string | null;
|
|
2234
2466
|
}
|
|
2235
|
-
|
|
2467
|
+
interface TraceItemFetchEventInfo {
|
|
2236
2468
|
readonly response?: TraceItemFetchEventInfoResponse;
|
|
2237
2469
|
readonly request: TraceItemFetchEventInfoRequest;
|
|
2238
2470
|
}
|
|
2239
|
-
|
|
2471
|
+
interface TraceItemFetchEventInfoRequest {
|
|
2240
2472
|
readonly cf?: any;
|
|
2241
2473
|
readonly headers: Record<string, string>;
|
|
2242
2474
|
readonly method: string;
|
|
2243
2475
|
readonly url: string;
|
|
2244
2476
|
getUnredacted(): TraceItemFetchEventInfoRequest;
|
|
2245
2477
|
}
|
|
2246
|
-
|
|
2478
|
+
interface TraceItemFetchEventInfoResponse {
|
|
2247
2479
|
readonly status: number;
|
|
2248
2480
|
}
|
|
2249
|
-
|
|
2481
|
+
interface TraceItemJsRpcEventInfo {
|
|
2250
2482
|
readonly rpcMethod: string;
|
|
2251
2483
|
}
|
|
2252
|
-
|
|
2484
|
+
interface TraceItemHibernatableWebSocketEventInfo {
|
|
2253
2485
|
readonly getWebSocketEvent:
|
|
2254
2486
|
| TraceItemHibernatableWebSocketEventInfoMessage
|
|
2255
2487
|
| TraceItemHibernatableWebSocketEventInfoClose
|
|
2256
2488
|
| TraceItemHibernatableWebSocketEventInfoError;
|
|
2257
2489
|
}
|
|
2258
|
-
|
|
2490
|
+
interface TraceItemHibernatableWebSocketEventInfoMessage {
|
|
2259
2491
|
readonly webSocketEventType: string;
|
|
2260
2492
|
}
|
|
2261
|
-
|
|
2493
|
+
interface TraceItemHibernatableWebSocketEventInfoClose {
|
|
2262
2494
|
readonly webSocketEventType: string;
|
|
2263
2495
|
readonly code: number;
|
|
2264
2496
|
readonly wasClean: boolean;
|
|
2265
2497
|
}
|
|
2266
|
-
|
|
2498
|
+
interface TraceItemHibernatableWebSocketEventInfoError {
|
|
2267
2499
|
readonly webSocketEventType: string;
|
|
2268
2500
|
}
|
|
2269
|
-
|
|
2501
|
+
interface TraceLog {
|
|
2270
2502
|
readonly timestamp: number;
|
|
2271
2503
|
readonly level: string;
|
|
2272
2504
|
readonly message: any;
|
|
2273
2505
|
}
|
|
2274
|
-
|
|
2506
|
+
interface TraceException {
|
|
2275
2507
|
readonly timestamp: number;
|
|
2276
2508
|
readonly message: string;
|
|
2277
2509
|
readonly name: string;
|
|
2278
2510
|
readonly stack?: string;
|
|
2279
2511
|
}
|
|
2280
|
-
|
|
2512
|
+
interface TraceDiagnosticChannelEvent {
|
|
2281
2513
|
readonly timestamp: number;
|
|
2282
2514
|
readonly channel: string;
|
|
2283
2515
|
readonly message: any;
|
|
2284
2516
|
}
|
|
2285
|
-
|
|
2517
|
+
interface TraceMetrics {
|
|
2286
2518
|
readonly cpuTime: number;
|
|
2287
2519
|
readonly wallTime: number;
|
|
2288
2520
|
}
|
|
2289
|
-
|
|
2521
|
+
interface UnsafeTraceMetrics {
|
|
2290
2522
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
2291
2523
|
}
|
|
2524
|
+
/**
|
|
2525
|
+
* The URL interface represents an object providing static methods used for creating object URLs.
|
|
2526
|
+
*
|
|
2527
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
|
2528
|
+
*/
|
|
2292
2529
|
declare class URL {
|
|
2293
2530
|
constructor(url: string | URL, base?: string | URL);
|
|
2294
|
-
|
|
2531
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
2295
2532
|
get origin(): string;
|
|
2296
|
-
|
|
2533
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2297
2534
|
get href(): string;
|
|
2298
|
-
|
|
2535
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2299
2536
|
set href(value: string);
|
|
2300
|
-
|
|
2537
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2301
2538
|
get protocol(): string;
|
|
2302
|
-
|
|
2539
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2303
2540
|
set protocol(value: string);
|
|
2304
|
-
|
|
2541
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2305
2542
|
get username(): string;
|
|
2306
|
-
|
|
2543
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2307
2544
|
set username(value: string);
|
|
2308
|
-
|
|
2545
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2309
2546
|
get password(): string;
|
|
2310
|
-
|
|
2547
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2311
2548
|
set password(value: string);
|
|
2312
|
-
|
|
2549
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2313
2550
|
get host(): string;
|
|
2314
|
-
|
|
2551
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2315
2552
|
set host(value: string);
|
|
2316
|
-
|
|
2553
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2317
2554
|
get hostname(): string;
|
|
2318
|
-
|
|
2555
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2319
2556
|
set hostname(value: string);
|
|
2320
|
-
|
|
2557
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2321
2558
|
get port(): string;
|
|
2322
|
-
|
|
2559
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2323
2560
|
set port(value: string);
|
|
2324
|
-
|
|
2561
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2325
2562
|
get pathname(): string;
|
|
2326
|
-
|
|
2563
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2327
2564
|
set pathname(value: string);
|
|
2328
|
-
|
|
2565
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2329
2566
|
get search(): string;
|
|
2330
|
-
|
|
2567
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2331
2568
|
set search(value: string);
|
|
2332
|
-
|
|
2569
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2333
2570
|
get hash(): string;
|
|
2334
|
-
|
|
2571
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2335
2572
|
set hash(value: string);
|
|
2336
|
-
|
|
2573
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
2337
2574
|
get searchParams(): URLSearchParams;
|
|
2338
|
-
|
|
2575
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
2339
2576
|
toJSON(): string;
|
|
2577
|
+
/*function toString() { [native code] }*/
|
|
2340
2578
|
toString(): string;
|
|
2341
|
-
|
|
2579
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2342
2580
|
static canParse(url: string, base?: string): boolean;
|
|
2343
2581
|
static parse(url: string, base?: string): URL | null;
|
|
2344
2582
|
}
|
|
2583
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2345
2584
|
declare class URLSearchParams {
|
|
2346
2585
|
constructor(
|
|
2347
2586
|
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2348
2587
|
);
|
|
2588
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2349
2589
|
get size(): number;
|
|
2590
|
+
/**
|
|
2591
|
+
* Appends a specified key/value pair as a new search parameter.
|
|
2592
|
+
*
|
|
2593
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2594
|
+
*/
|
|
2350
2595
|
append(name: string, value: string): void;
|
|
2596
|
+
/**
|
|
2597
|
+
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2598
|
+
*
|
|
2599
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
2600
|
+
*/
|
|
2351
2601
|
delete(name: string, value?: string): void;
|
|
2602
|
+
/**
|
|
2603
|
+
* Returns the first value associated to the given search parameter.
|
|
2604
|
+
*
|
|
2605
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2606
|
+
*/
|
|
2352
2607
|
get(name: string): string | null;
|
|
2608
|
+
/**
|
|
2609
|
+
* Returns all the values association with a given search parameter.
|
|
2610
|
+
*
|
|
2611
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2612
|
+
*/
|
|
2353
2613
|
getAll(name: string): string[];
|
|
2614
|
+
/**
|
|
2615
|
+
* Returns a Boolean indicating if such a search parameter exists.
|
|
2616
|
+
*
|
|
2617
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
2618
|
+
*/
|
|
2354
2619
|
has(name: string, value?: string): boolean;
|
|
2620
|
+
/**
|
|
2621
|
+
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
2622
|
+
*
|
|
2623
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2624
|
+
*/
|
|
2355
2625
|
set(name: string, value: string): void;
|
|
2626
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2356
2627
|
sort(): void;
|
|
2357
|
-
|
|
2628
|
+
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
2358
2629
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2359
|
-
|
|
2630
|
+
/* Returns a list of keys in the search params. */
|
|
2360
2631
|
keys(): IterableIterator<string>;
|
|
2361
|
-
|
|
2632
|
+
/* Returns a list of values in the search params. */
|
|
2362
2633
|
values(): IterableIterator<string>;
|
|
2363
2634
|
forEach<This = unknown>(
|
|
2364
2635
|
callback: (
|
|
@@ -2369,6 +2640,7 @@ declare class URLSearchParams {
|
|
|
2369
2640
|
) => void,
|
|
2370
2641
|
thisArg?: This,
|
|
2371
2642
|
): void;
|
|
2643
|
+
/*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
|
|
2372
2644
|
toString(): string;
|
|
2373
2645
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
2374
2646
|
}
|
|
@@ -2392,7 +2664,7 @@ declare class URLPattern {
|
|
|
2392
2664
|
baseURL?: string,
|
|
2393
2665
|
): URLPatternURLPatternResult | null;
|
|
2394
2666
|
}
|
|
2395
|
-
|
|
2667
|
+
interface URLPatternURLPatternInit {
|
|
2396
2668
|
protocol?: string;
|
|
2397
2669
|
username?: string;
|
|
2398
2670
|
password?: string;
|
|
@@ -2403,11 +2675,11 @@ declare interface URLPatternURLPatternInit {
|
|
|
2403
2675
|
hash?: string;
|
|
2404
2676
|
baseURL?: string;
|
|
2405
2677
|
}
|
|
2406
|
-
|
|
2678
|
+
interface URLPatternURLPatternComponentResult {
|
|
2407
2679
|
input: string;
|
|
2408
2680
|
groups: Record<string, string>;
|
|
2409
2681
|
}
|
|
2410
|
-
|
|
2682
|
+
interface URLPatternURLPatternResult {
|
|
2411
2683
|
inputs: (string | URLPatternURLPatternInit)[];
|
|
2412
2684
|
protocol: URLPatternURLPatternComponentResult;
|
|
2413
2685
|
username: URLPatternURLPatternComponentResult;
|
|
@@ -2418,9 +2690,14 @@ declare interface URLPatternURLPatternResult {
|
|
|
2418
2690
|
search: URLPatternURLPatternComponentResult;
|
|
2419
2691
|
hash: URLPatternURLPatternComponentResult;
|
|
2420
2692
|
}
|
|
2421
|
-
|
|
2693
|
+
interface URLPatternURLPatternOptions {
|
|
2422
2694
|
ignoreCase?: boolean;
|
|
2423
2695
|
}
|
|
2696
|
+
/**
|
|
2697
|
+
* 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.
|
|
2698
|
+
*
|
|
2699
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
|
2700
|
+
*/
|
|
2424
2701
|
declare class CloseEvent extends Event {
|
|
2425
2702
|
constructor(type: string, initializer?: CloseEventInit);
|
|
2426
2703
|
/**
|
|
@@ -2442,41 +2719,39 @@ declare class CloseEvent extends Event {
|
|
|
2442
2719
|
*/
|
|
2443
2720
|
readonly wasClean: boolean;
|
|
2444
2721
|
}
|
|
2445
|
-
|
|
2722
|
+
interface CloseEventInit {
|
|
2446
2723
|
code?: number;
|
|
2447
2724
|
reason?: string;
|
|
2448
2725
|
wasClean?: boolean;
|
|
2449
2726
|
}
|
|
2727
|
+
/**
|
|
2728
|
+
* A message received by a target object.
|
|
2729
|
+
*
|
|
2730
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
|
2731
|
+
*/
|
|
2450
2732
|
declare class MessageEvent extends Event {
|
|
2451
2733
|
constructor(type: string, initializer: MessageEventInit);
|
|
2734
|
+
/**
|
|
2735
|
+
* Returns the data of the message.
|
|
2736
|
+
*
|
|
2737
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
|
2738
|
+
*/
|
|
2452
2739
|
readonly data: ArrayBuffer | string;
|
|
2453
2740
|
}
|
|
2454
|
-
|
|
2741
|
+
interface MessageEventInit {
|
|
2455
2742
|
data: ArrayBuffer | string;
|
|
2456
2743
|
}
|
|
2457
|
-
|
|
2458
|
-
* Events providing information related to errors in scripts or in files.
|
|
2459
|
-
*
|
|
2460
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2461
|
-
*/
|
|
2462
|
-
declare interface ErrorEvent extends Event {
|
|
2463
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
2464
|
-
readonly filename: string;
|
|
2465
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
2466
|
-
readonly message: string;
|
|
2467
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
2468
|
-
readonly lineno: number;
|
|
2469
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
2470
|
-
readonly colno: number;
|
|
2471
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
2472
|
-
readonly error: any;
|
|
2473
|
-
}
|
|
2474
|
-
declare type WebSocketEventMap = {
|
|
2744
|
+
type WebSocketEventMap = {
|
|
2475
2745
|
close: CloseEvent;
|
|
2476
2746
|
message: MessageEvent;
|
|
2477
2747
|
open: Event;
|
|
2478
2748
|
error: ErrorEvent;
|
|
2479
2749
|
};
|
|
2750
|
+
/**
|
|
2751
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2752
|
+
*
|
|
2753
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2754
|
+
*/
|
|
2480
2755
|
declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2481
2756
|
constructor(url: string, protocols?: string[] | string);
|
|
2482
2757
|
accept(): void;
|
|
@@ -2533,10 +2808,10 @@ declare const WebSocketPair: {
|
|
|
2533
2808
|
1: WebSocket;
|
|
2534
2809
|
};
|
|
2535
2810
|
};
|
|
2536
|
-
|
|
2811
|
+
interface SqlStorage {
|
|
2537
2812
|
exec(query: string, ...bindings: any[]): SqlStorageCursor;
|
|
2538
2813
|
prepare(query: string): SqlStorageStatement;
|
|
2539
|
-
ingest(query: string):
|
|
2814
|
+
ingest(query: string): SqlStorageIngestResult;
|
|
2540
2815
|
get databaseSize(): number;
|
|
2541
2816
|
Cursor: typeof SqlStorageCursor;
|
|
2542
2817
|
Statement: typeof SqlStorageStatement;
|
|
@@ -2551,7 +2826,13 @@ declare abstract class SqlStorageCursor {
|
|
|
2551
2826
|
Record<string, (ArrayBuffer | string | number) | null>
|
|
2552
2827
|
>;
|
|
2553
2828
|
}
|
|
2554
|
-
|
|
2829
|
+
interface SqlStorageIngestResult {
|
|
2830
|
+
remainder: string;
|
|
2831
|
+
rowsRead: number;
|
|
2832
|
+
rowsWritten: number;
|
|
2833
|
+
statementCount: number;
|
|
2834
|
+
}
|
|
2835
|
+
interface Socket {
|
|
2555
2836
|
get readable(): ReadableStream;
|
|
2556
2837
|
get writable(): WritableStream;
|
|
2557
2838
|
get closed(): Promise<void>;
|
|
@@ -2559,80 +2840,77 @@ declare interface Socket {
|
|
|
2559
2840
|
close(): Promise<void>;
|
|
2560
2841
|
startTls(options?: TlsOptions): Socket;
|
|
2561
2842
|
}
|
|
2562
|
-
|
|
2843
|
+
interface SocketOptions {
|
|
2563
2844
|
secureTransport?: string;
|
|
2564
2845
|
allowHalfOpen: boolean;
|
|
2846
|
+
highWaterMark?: number | bigint;
|
|
2565
2847
|
}
|
|
2566
|
-
|
|
2848
|
+
interface SocketAddress {
|
|
2567
2849
|
hostname: string;
|
|
2568
2850
|
port: number;
|
|
2569
2851
|
}
|
|
2570
|
-
|
|
2852
|
+
interface TlsOptions {
|
|
2571
2853
|
expectedServerHostname?: string;
|
|
2572
2854
|
}
|
|
2573
|
-
|
|
2855
|
+
interface SocketInfo {
|
|
2574
2856
|
remoteAddress?: string;
|
|
2575
2857
|
localAddress?: string;
|
|
2576
2858
|
}
|
|
2577
|
-
|
|
2578
|
-
requestAdapter(
|
|
2579
|
-
param1?: gpuGPURequestAdapterOptions,
|
|
2580
|
-
): Promise<gpuGPUAdapter | null>;
|
|
2859
|
+
interface GPU {
|
|
2860
|
+
requestAdapter(param1?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
2581
2861
|
}
|
|
2582
|
-
declare abstract class
|
|
2583
|
-
requestDevice(param1?:
|
|
2584
|
-
requestAdapterInfo(unmaskHints?: string[]): Promise<
|
|
2585
|
-
get features():
|
|
2586
|
-
get limits():
|
|
2862
|
+
declare abstract class GPUAdapter {
|
|
2863
|
+
requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
2864
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
|
|
2865
|
+
get features(): GPUSupportedFeatures;
|
|
2866
|
+
get limits(): GPUSupportedLimits;
|
|
2587
2867
|
}
|
|
2588
|
-
|
|
2589
|
-
createBuffer(param1:
|
|
2868
|
+
interface GPUDevice extends EventTarget {
|
|
2869
|
+
createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
|
|
2590
2870
|
createBindGroupLayout(
|
|
2591
|
-
descriptor:
|
|
2592
|
-
):
|
|
2593
|
-
createBindGroup(descriptor:
|
|
2594
|
-
createSampler(descriptor:
|
|
2595
|
-
createShaderModule(
|
|
2596
|
-
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2597
|
-
): gpuGPUShaderModule;
|
|
2871
|
+
descriptor: GPUBindGroupLayoutDescriptor,
|
|
2872
|
+
): GPUBindGroupLayout;
|
|
2873
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
2874
|
+
createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
|
|
2875
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
2598
2876
|
createPipelineLayout(
|
|
2599
|
-
descriptor:
|
|
2600
|
-
):
|
|
2877
|
+
descriptor: GPUPipelineLayoutDescriptor,
|
|
2878
|
+
): GPUPipelineLayout;
|
|
2601
2879
|
createComputePipeline(
|
|
2602
|
-
descriptor:
|
|
2603
|
-
):
|
|
2880
|
+
descriptor: GPUComputePipelineDescriptor,
|
|
2881
|
+
): GPUComputePipeline;
|
|
2604
2882
|
createRenderPipeline(
|
|
2605
|
-
descriptor:
|
|
2606
|
-
):
|
|
2883
|
+
descriptor: GPURenderPipelineDescriptor,
|
|
2884
|
+
): GPURenderPipeline;
|
|
2607
2885
|
createCommandEncoder(
|
|
2608
|
-
descriptor?:
|
|
2609
|
-
):
|
|
2610
|
-
createTexture(param1:
|
|
2886
|
+
descriptor?: GPUCommandEncoderDescriptor,
|
|
2887
|
+
): GPUCommandEncoder;
|
|
2888
|
+
createTexture(param1: GPUTextureDescriptor): GPUTexture;
|
|
2611
2889
|
destroy(): void;
|
|
2612
|
-
createQuerySet(descriptor:
|
|
2890
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
2613
2891
|
pushErrorScope(filter: string): void;
|
|
2614
|
-
popErrorScope(): Promise<
|
|
2615
|
-
get queue():
|
|
2616
|
-
get lost(): Promise<
|
|
2617
|
-
get features():
|
|
2618
|
-
get limits():
|
|
2892
|
+
popErrorScope(): Promise<GPUError | null>;
|
|
2893
|
+
get queue(): GPUQueue;
|
|
2894
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
2895
|
+
get features(): GPUSupportedFeatures;
|
|
2896
|
+
get limits(): GPUSupportedLimits;
|
|
2619
2897
|
}
|
|
2620
|
-
|
|
2898
|
+
interface GPUDeviceDescriptor {
|
|
2621
2899
|
label?: string;
|
|
2622
2900
|
requiredFeatures?: string[];
|
|
2623
2901
|
requiredLimits?: Record<string, number | bigint>;
|
|
2624
|
-
defaultQueue?:
|
|
2902
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
2625
2903
|
}
|
|
2626
|
-
|
|
2904
|
+
interface GPUBufferDescriptor {
|
|
2627
2905
|
label: string;
|
|
2628
2906
|
size: number | bigint;
|
|
2629
2907
|
usage: number;
|
|
2630
2908
|
mappedAtCreation: boolean;
|
|
2631
2909
|
}
|
|
2632
|
-
|
|
2910
|
+
interface GPUQueueDescriptor {
|
|
2633
2911
|
label?: string;
|
|
2634
2912
|
}
|
|
2635
|
-
declare abstract class
|
|
2913
|
+
declare abstract class GPUBufferUsage {
|
|
2636
2914
|
static readonly MAP_READ: number;
|
|
2637
2915
|
static readonly MAP_WRITE: number;
|
|
2638
2916
|
static readonly COPY_SRC: number;
|
|
@@ -2644,7 +2922,7 @@ declare abstract class gpuGPUBufferUsage {
|
|
|
2644
2922
|
static readonly INDIRECT: number;
|
|
2645
2923
|
static readonly QUERY_RESOLVE: number;
|
|
2646
2924
|
}
|
|
2647
|
-
|
|
2925
|
+
interface GPUBuffer {
|
|
2648
2926
|
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2649
2927
|
unmap(): void;
|
|
2650
2928
|
destroy(): void;
|
|
@@ -2657,59 +2935,59 @@ declare interface gpuGPUBuffer {
|
|
|
2657
2935
|
get usage(): number;
|
|
2658
2936
|
get mapState(): string;
|
|
2659
2937
|
}
|
|
2660
|
-
declare abstract class
|
|
2938
|
+
declare abstract class GPUShaderStage {
|
|
2661
2939
|
static readonly VERTEX: number;
|
|
2662
2940
|
static readonly FRAGMENT: number;
|
|
2663
2941
|
static readonly COMPUTE: number;
|
|
2664
2942
|
}
|
|
2665
|
-
|
|
2943
|
+
interface GPUBindGroupLayoutDescriptor {
|
|
2666
2944
|
label?: string;
|
|
2667
|
-
entries:
|
|
2945
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
2668
2946
|
}
|
|
2669
|
-
|
|
2947
|
+
interface GPUBindGroupLayoutEntry {
|
|
2670
2948
|
binding: number;
|
|
2671
2949
|
visibility: number;
|
|
2672
|
-
buffer?:
|
|
2673
|
-
sampler?:
|
|
2674
|
-
texture?:
|
|
2675
|
-
storageTexture?:
|
|
2950
|
+
buffer?: GPUBufferBindingLayout;
|
|
2951
|
+
sampler?: GPUSamplerBindingLayout;
|
|
2952
|
+
texture?: GPUTextureBindingLayout;
|
|
2953
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
2676
2954
|
}
|
|
2677
|
-
|
|
2955
|
+
interface GPUStorageTextureBindingLayout {
|
|
2678
2956
|
access?: string;
|
|
2679
2957
|
format: string;
|
|
2680
2958
|
viewDimension?: string;
|
|
2681
2959
|
}
|
|
2682
|
-
|
|
2960
|
+
interface GPUTextureBindingLayout {
|
|
2683
2961
|
sampleType?: string;
|
|
2684
2962
|
viewDimension?: string;
|
|
2685
2963
|
multisampled?: boolean;
|
|
2686
2964
|
}
|
|
2687
|
-
|
|
2965
|
+
interface GPUSamplerBindingLayout {
|
|
2688
2966
|
type?: string;
|
|
2689
2967
|
}
|
|
2690
|
-
|
|
2968
|
+
interface GPUBufferBindingLayout {
|
|
2691
2969
|
type?: string;
|
|
2692
2970
|
hasDynamicOffset?: boolean;
|
|
2693
2971
|
minBindingSize?: number | bigint;
|
|
2694
2972
|
}
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2973
|
+
interface GPUBindGroupLayout {}
|
|
2974
|
+
interface GPUBindGroup {}
|
|
2975
|
+
interface GPUBindGroupDescriptor {
|
|
2698
2976
|
label?: string;
|
|
2699
|
-
layout:
|
|
2700
|
-
entries:
|
|
2977
|
+
layout: GPUBindGroupLayout;
|
|
2978
|
+
entries: GPUBindGroupEntry[];
|
|
2701
2979
|
}
|
|
2702
|
-
|
|
2980
|
+
interface GPUBindGroupEntry {
|
|
2703
2981
|
binding: number;
|
|
2704
|
-
resource:
|
|
2982
|
+
resource: GPUBufferBinding | GPUSampler;
|
|
2705
2983
|
}
|
|
2706
|
-
|
|
2707
|
-
buffer:
|
|
2984
|
+
interface GPUBufferBinding {
|
|
2985
|
+
buffer: GPUBuffer;
|
|
2708
2986
|
offset?: number | bigint;
|
|
2709
2987
|
size?: number | bigint;
|
|
2710
2988
|
}
|
|
2711
|
-
|
|
2712
|
-
|
|
2989
|
+
interface GPUSampler {}
|
|
2990
|
+
interface GPUSamplerDescriptor {
|
|
2713
2991
|
label?: string;
|
|
2714
2992
|
addressModeU?: string;
|
|
2715
2993
|
addressModeV?: string;
|
|
@@ -2722,76 +3000,74 @@ declare interface gpuGPUSamplerDescriptor {
|
|
|
2722
3000
|
compare: string;
|
|
2723
3001
|
maxAnisotropy?: number;
|
|
2724
3002
|
}
|
|
2725
|
-
|
|
2726
|
-
getCompilationInfo(): Promise<
|
|
3003
|
+
interface GPUShaderModule {
|
|
3004
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
2727
3005
|
}
|
|
2728
|
-
|
|
3006
|
+
interface GPUShaderModuleDescriptor {
|
|
2729
3007
|
label?: string;
|
|
2730
3008
|
code: string;
|
|
2731
3009
|
}
|
|
2732
|
-
|
|
2733
|
-
|
|
3010
|
+
interface GPUPipelineLayout {}
|
|
3011
|
+
interface GPUPipelineLayoutDescriptor {
|
|
2734
3012
|
label?: string;
|
|
2735
|
-
bindGroupLayouts:
|
|
3013
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
2736
3014
|
}
|
|
2737
|
-
|
|
2738
|
-
getBindGroupLayout(index: number):
|
|
3015
|
+
interface GPUComputePipeline {
|
|
3016
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2739
3017
|
}
|
|
2740
|
-
|
|
3018
|
+
interface GPUComputePipelineDescriptor {
|
|
2741
3019
|
label?: string;
|
|
2742
|
-
compute:
|
|
2743
|
-
layout: string |
|
|
3020
|
+
compute: GPUProgrammableStage;
|
|
3021
|
+
layout: string | GPUPipelineLayout;
|
|
2744
3022
|
}
|
|
2745
|
-
|
|
2746
|
-
module:
|
|
3023
|
+
interface GPUProgrammableStage {
|
|
3024
|
+
module: GPUShaderModule;
|
|
2747
3025
|
entryPoint: string;
|
|
2748
3026
|
constants?: Record<string, number>;
|
|
2749
3027
|
}
|
|
2750
|
-
|
|
3028
|
+
interface GPUCommandEncoder {
|
|
2751
3029
|
get label(): string;
|
|
2752
3030
|
beginComputePass(
|
|
2753
|
-
descriptor?:
|
|
2754
|
-
):
|
|
2755
|
-
beginRenderPass(
|
|
2756
|
-
descriptor: gpuGPURenderPassDescriptor,
|
|
2757
|
-
): gpuGPURenderPassEncoder;
|
|
3031
|
+
descriptor?: GPUComputePassDescriptor,
|
|
3032
|
+
): GPUComputePassEncoder;
|
|
3033
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
2758
3034
|
copyBufferToBuffer(
|
|
2759
|
-
source:
|
|
3035
|
+
source: GPUBuffer,
|
|
2760
3036
|
sourceOffset: number | bigint,
|
|
2761
|
-
destination:
|
|
3037
|
+
destination: GPUBuffer,
|
|
2762
3038
|
destinationOffset: number | bigint,
|
|
2763
3039
|
size: number | bigint,
|
|
2764
3040
|
): void;
|
|
2765
|
-
finish(param0?:
|
|
3041
|
+
finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
2766
3042
|
copyTextureToBuffer(
|
|
2767
|
-
source:
|
|
2768
|
-
destination:
|
|
2769
|
-
copySize: Iterable<number> |
|
|
3043
|
+
source: GPUImageCopyTexture,
|
|
3044
|
+
destination: GPUImageCopyBuffer,
|
|
3045
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2770
3046
|
): void;
|
|
2771
3047
|
copyBufferToTexture(
|
|
2772
|
-
source:
|
|
2773
|
-
destination:
|
|
2774
|
-
copySize: Iterable<number> |
|
|
3048
|
+
source: GPUImageCopyBuffer,
|
|
3049
|
+
destination: GPUImageCopyTexture,
|
|
3050
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2775
3051
|
): void;
|
|
2776
3052
|
copyTextureToTexture(
|
|
2777
|
-
source:
|
|
2778
|
-
destination:
|
|
2779
|
-
copySize: Iterable<number> |
|
|
3053
|
+
source: GPUImageCopyTexture,
|
|
3054
|
+
destination: GPUImageCopyTexture,
|
|
3055
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2780
3056
|
): void;
|
|
2781
3057
|
clearBuffer(
|
|
2782
|
-
buffer:
|
|
3058
|
+
buffer: GPUBuffer,
|
|
2783
3059
|
offset?: number | bigint,
|
|
2784
3060
|
size?: number | bigint,
|
|
2785
3061
|
): void;
|
|
2786
3062
|
}
|
|
2787
|
-
|
|
3063
|
+
interface GPUCommandEncoderDescriptor {
|
|
2788
3064
|
label?: string;
|
|
2789
3065
|
}
|
|
2790
|
-
|
|
2791
|
-
setPipeline(pipeline:
|
|
3066
|
+
interface GPUComputePassEncoder {
|
|
3067
|
+
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2792
3068
|
setBindGroup(
|
|
2793
3069
|
index: number,
|
|
2794
|
-
bindGroup:
|
|
3070
|
+
bindGroup: GPUBindGroup | null,
|
|
2795
3071
|
dynamicOffsets?: Iterable<number>,
|
|
2796
3072
|
): void;
|
|
2797
3073
|
dispatchWorkgroups(
|
|
@@ -2801,52 +3077,52 @@ declare interface gpuGPUComputePassEncoder {
|
|
|
2801
3077
|
): void;
|
|
2802
3078
|
end(): void;
|
|
2803
3079
|
}
|
|
2804
|
-
|
|
3080
|
+
interface GPUComputePassDescriptor {
|
|
2805
3081
|
label?: string;
|
|
2806
|
-
timestampWrites?:
|
|
3082
|
+
timestampWrites?: GPUComputePassTimestampWrites;
|
|
2807
3083
|
}
|
|
2808
|
-
|
|
2809
|
-
|
|
3084
|
+
interface GPUQuerySet {}
|
|
3085
|
+
interface GPUQuerySetDescriptor {
|
|
2810
3086
|
label?: string;
|
|
2811
3087
|
}
|
|
2812
|
-
|
|
2813
|
-
querySet:
|
|
3088
|
+
interface GPUComputePassTimestampWrites {
|
|
3089
|
+
querySet: GPUQuerySet;
|
|
2814
3090
|
beginningOfPassWriteIndex?: number;
|
|
2815
3091
|
endOfPassWriteIndex?: number;
|
|
2816
3092
|
}
|
|
2817
|
-
|
|
3093
|
+
interface GPUCommandBufferDescriptor {
|
|
2818
3094
|
label?: string;
|
|
2819
3095
|
}
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
submit(commandBuffers:
|
|
3096
|
+
interface GPUCommandBuffer {}
|
|
3097
|
+
interface GPUQueue {
|
|
3098
|
+
submit(commandBuffers: GPUCommandBuffer[]): void;
|
|
2823
3099
|
writeBuffer(
|
|
2824
|
-
buffer:
|
|
3100
|
+
buffer: GPUBuffer,
|
|
2825
3101
|
bufferOffset: number | bigint,
|
|
2826
3102
|
data: ArrayBuffer | ArrayBufferView,
|
|
2827
3103
|
dataOffset?: number | bigint,
|
|
2828
3104
|
size?: number | bigint,
|
|
2829
3105
|
): void;
|
|
2830
3106
|
}
|
|
2831
|
-
declare abstract class
|
|
3107
|
+
declare abstract class GPUMapMode {
|
|
2832
3108
|
static readonly READ: number;
|
|
2833
3109
|
static readonly WRITE: number;
|
|
2834
3110
|
}
|
|
2835
|
-
|
|
3111
|
+
interface GPURequestAdapterOptions {
|
|
2836
3112
|
powerPreference: string;
|
|
2837
3113
|
forceFallbackAdapter?: boolean;
|
|
2838
3114
|
}
|
|
2839
|
-
|
|
3115
|
+
interface GPUAdapterInfo {
|
|
2840
3116
|
get vendor(): string;
|
|
2841
3117
|
get architecture(): string;
|
|
2842
3118
|
get device(): string;
|
|
2843
3119
|
get description(): string;
|
|
2844
3120
|
}
|
|
2845
|
-
|
|
3121
|
+
interface GPUSupportedFeatures {
|
|
2846
3122
|
has(name: string): boolean;
|
|
2847
3123
|
keys(): string[];
|
|
2848
3124
|
}
|
|
2849
|
-
|
|
3125
|
+
interface GPUSupportedLimits {
|
|
2850
3126
|
get maxTextureDimension1D(): number;
|
|
2851
3127
|
get maxTextureDimension2D(): number;
|
|
2852
3128
|
get maxTextureDimension3D(): number;
|
|
@@ -2879,17 +3155,17 @@ declare interface gpuGPUSupportedLimits {
|
|
|
2879
3155
|
get maxComputeWorkgroupSizeZ(): number;
|
|
2880
3156
|
get maxComputeWorkgroupsPerDimension(): number;
|
|
2881
3157
|
}
|
|
2882
|
-
declare abstract class
|
|
3158
|
+
declare abstract class GPUError {
|
|
2883
3159
|
get message(): string;
|
|
2884
3160
|
}
|
|
2885
|
-
declare abstract class
|
|
2886
|
-
declare abstract class
|
|
2887
|
-
declare abstract class
|
|
2888
|
-
declare abstract class
|
|
3161
|
+
declare abstract class GPUOutOfMemoryError extends GPUError {}
|
|
3162
|
+
declare abstract class GPUInternalError extends GPUError {}
|
|
3163
|
+
declare abstract class GPUValidationError extends GPUError {}
|
|
3164
|
+
declare abstract class GPUDeviceLostInfo {
|
|
2889
3165
|
get message(): string;
|
|
2890
3166
|
get reason(): string;
|
|
2891
3167
|
}
|
|
2892
|
-
|
|
3168
|
+
interface GPUCompilationMessage {
|
|
2893
3169
|
get message(): string;
|
|
2894
3170
|
get type(): string;
|
|
2895
3171
|
get lineNum(): number;
|
|
@@ -2897,19 +3173,19 @@ declare interface gpuGPUCompilationMessage {
|
|
|
2897
3173
|
get offset(): number;
|
|
2898
3174
|
get length(): number;
|
|
2899
3175
|
}
|
|
2900
|
-
|
|
2901
|
-
get messages():
|
|
3176
|
+
interface GPUCompilationInfo {
|
|
3177
|
+
get messages(): GPUCompilationMessage[];
|
|
2902
3178
|
}
|
|
2903
|
-
declare abstract class
|
|
3179
|
+
declare abstract class GPUTextureUsage {
|
|
2904
3180
|
static readonly COPY_SRC: number;
|
|
2905
3181
|
static readonly COPY_DST: number;
|
|
2906
3182
|
static readonly TEXTURE_BINDING: number;
|
|
2907
3183
|
static readonly STORAGE_BINDING: number;
|
|
2908
3184
|
static readonly RENDER_ATTACHMENT: number;
|
|
2909
3185
|
}
|
|
2910
|
-
|
|
3186
|
+
interface GPUTextureDescriptor {
|
|
2911
3187
|
label: string;
|
|
2912
|
-
size: number[] |
|
|
3188
|
+
size: number[] | GPUExtent3DDict;
|
|
2913
3189
|
mipLevelCount?: number;
|
|
2914
3190
|
sampleCount?: number;
|
|
2915
3191
|
dimension?: string;
|
|
@@ -2917,13 +3193,13 @@ declare interface gpuGPUTextureDescriptor {
|
|
|
2917
3193
|
usage: number;
|
|
2918
3194
|
viewFormats?: string[];
|
|
2919
3195
|
}
|
|
2920
|
-
|
|
3196
|
+
interface GPUExtent3DDict {
|
|
2921
3197
|
width: number;
|
|
2922
3198
|
height?: number;
|
|
2923
3199
|
depthOrArrayLayers?: number;
|
|
2924
3200
|
}
|
|
2925
|
-
|
|
2926
|
-
createView(descriptor?:
|
|
3201
|
+
interface GPUTexture {
|
|
3202
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
2927
3203
|
destroy(): void;
|
|
2928
3204
|
get width(): number;
|
|
2929
3205
|
get height(): number;
|
|
@@ -2933,8 +3209,8 @@ declare interface gpuGPUTexture {
|
|
|
2933
3209
|
get format(): string;
|
|
2934
3210
|
get usage(): number;
|
|
2935
3211
|
}
|
|
2936
|
-
|
|
2937
|
-
|
|
3212
|
+
interface GPUTextureView {}
|
|
3213
|
+
interface GPUTextureViewDescriptor {
|
|
2938
3214
|
label: string;
|
|
2939
3215
|
format: string;
|
|
2940
3216
|
dimension: string;
|
|
@@ -2944,91 +3220,91 @@ declare interface gpuGPUTextureViewDescriptor {
|
|
|
2944
3220
|
baseArrayLayer?: number;
|
|
2945
3221
|
arrayLayerCount: number;
|
|
2946
3222
|
}
|
|
2947
|
-
declare abstract class
|
|
3223
|
+
declare abstract class GPUColorWrite {
|
|
2948
3224
|
static readonly RED: number;
|
|
2949
3225
|
static readonly GREEN: number;
|
|
2950
3226
|
static readonly BLUE: number;
|
|
2951
3227
|
static readonly ALPHA: number;
|
|
2952
3228
|
static readonly ALL: number;
|
|
2953
3229
|
}
|
|
2954
|
-
|
|
2955
|
-
|
|
3230
|
+
interface GPURenderPipeline {}
|
|
3231
|
+
interface GPURenderPipelineDescriptor {
|
|
2956
3232
|
label?: string;
|
|
2957
|
-
layout: string |
|
|
2958
|
-
vertex:
|
|
2959
|
-
primitive?:
|
|
2960
|
-
depthStencil?:
|
|
2961
|
-
multisample?:
|
|
2962
|
-
fragment?:
|
|
2963
|
-
}
|
|
2964
|
-
|
|
2965
|
-
module:
|
|
3233
|
+
layout: string | GPUPipelineLayout;
|
|
3234
|
+
vertex: GPUVertexState;
|
|
3235
|
+
primitive?: GPUPrimitiveState;
|
|
3236
|
+
depthStencil?: GPUDepthStencilState;
|
|
3237
|
+
multisample?: GPUMultisampleState;
|
|
3238
|
+
fragment?: GPUFragmentState;
|
|
3239
|
+
}
|
|
3240
|
+
interface GPUVertexState {
|
|
3241
|
+
module: GPUShaderModule;
|
|
2966
3242
|
entryPoint: string;
|
|
2967
3243
|
constants?: Record<string, number>;
|
|
2968
|
-
buffers?:
|
|
3244
|
+
buffers?: GPUVertexBufferLayout[];
|
|
2969
3245
|
}
|
|
2970
|
-
|
|
3246
|
+
interface GPUVertexBufferLayout {
|
|
2971
3247
|
arrayStride: number | bigint;
|
|
2972
3248
|
stepMode?: string;
|
|
2973
|
-
attributes:
|
|
3249
|
+
attributes: GPUVertexAttribute[];
|
|
2974
3250
|
}
|
|
2975
|
-
|
|
3251
|
+
interface GPUVertexAttribute {
|
|
2976
3252
|
format: string;
|
|
2977
3253
|
offset: number | bigint;
|
|
2978
3254
|
shaderLocation: number;
|
|
2979
3255
|
}
|
|
2980
|
-
|
|
3256
|
+
interface GPUPrimitiveState {
|
|
2981
3257
|
topology?: string;
|
|
2982
3258
|
stripIndexFormat?: string;
|
|
2983
3259
|
frontFace?: string;
|
|
2984
3260
|
cullMode?: string;
|
|
2985
3261
|
unclippedDepth?: boolean;
|
|
2986
3262
|
}
|
|
2987
|
-
|
|
3263
|
+
interface GPUStencilFaceState {
|
|
2988
3264
|
compare?: string;
|
|
2989
3265
|
failOp?: string;
|
|
2990
3266
|
depthFailOp?: string;
|
|
2991
3267
|
passOp?: string;
|
|
2992
3268
|
}
|
|
2993
|
-
|
|
3269
|
+
interface GPUDepthStencilState {
|
|
2994
3270
|
format: string;
|
|
2995
3271
|
depthWriteEnabled: boolean;
|
|
2996
3272
|
depthCompare: string;
|
|
2997
|
-
stencilFront?:
|
|
2998
|
-
stencilBack?:
|
|
3273
|
+
stencilFront?: GPUStencilFaceState;
|
|
3274
|
+
stencilBack?: GPUStencilFaceState;
|
|
2999
3275
|
stencilReadMask?: number;
|
|
3000
3276
|
stencilWriteMask?: number;
|
|
3001
3277
|
depthBias?: number;
|
|
3002
3278
|
depthBiasSlopeScale?: number;
|
|
3003
3279
|
depthBiasClamp?: number;
|
|
3004
3280
|
}
|
|
3005
|
-
|
|
3281
|
+
interface GPUMultisampleState {
|
|
3006
3282
|
count?: number;
|
|
3007
3283
|
mask?: number;
|
|
3008
3284
|
alphaToCoverageEnabled?: boolean;
|
|
3009
3285
|
}
|
|
3010
|
-
|
|
3011
|
-
module:
|
|
3286
|
+
interface GPUFragmentState {
|
|
3287
|
+
module: GPUShaderModule;
|
|
3012
3288
|
entryPoint: string;
|
|
3013
3289
|
constants?: Record<string, number>;
|
|
3014
|
-
targets:
|
|
3290
|
+
targets: GPUColorTargetState[];
|
|
3015
3291
|
}
|
|
3016
|
-
|
|
3292
|
+
interface GPUColorTargetState {
|
|
3017
3293
|
format: string;
|
|
3018
|
-
blend:
|
|
3294
|
+
blend: GPUBlendState;
|
|
3019
3295
|
writeMask?: number;
|
|
3020
3296
|
}
|
|
3021
|
-
|
|
3022
|
-
color:
|
|
3023
|
-
alpha:
|
|
3297
|
+
interface GPUBlendState {
|
|
3298
|
+
color: GPUBlendComponent;
|
|
3299
|
+
alpha: GPUBlendComponent;
|
|
3024
3300
|
}
|
|
3025
|
-
|
|
3301
|
+
interface GPUBlendComponent {
|
|
3026
3302
|
operation?: string;
|
|
3027
3303
|
srcFactor?: string;
|
|
3028
3304
|
dstFactor?: string;
|
|
3029
3305
|
}
|
|
3030
|
-
|
|
3031
|
-
setPipeline(pipeline:
|
|
3306
|
+
interface GPURenderPassEncoder {
|
|
3307
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
3032
3308
|
draw(
|
|
3033
3309
|
vertexCount: number,
|
|
3034
3310
|
instanceCount?: number,
|
|
@@ -3037,30 +3313,30 @@ declare interface gpuGPURenderPassEncoder {
|
|
|
3037
3313
|
): void;
|
|
3038
3314
|
end(): void;
|
|
3039
3315
|
}
|
|
3040
|
-
|
|
3316
|
+
interface GPURenderPassDescriptor {
|
|
3041
3317
|
label?: string;
|
|
3042
|
-
colorAttachments:
|
|
3043
|
-
depthStencilAttachment?:
|
|
3044
|
-
occlusionQuerySet?:
|
|
3045
|
-
timestampWrites?:
|
|
3318
|
+
colorAttachments: GPURenderPassColorAttachment[];
|
|
3319
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
3320
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
3321
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
3046
3322
|
maxDrawCount?: number | bigint;
|
|
3047
3323
|
}
|
|
3048
|
-
|
|
3049
|
-
view:
|
|
3324
|
+
interface GPURenderPassColorAttachment {
|
|
3325
|
+
view: GPUTextureView;
|
|
3050
3326
|
depthSlice?: number;
|
|
3051
|
-
resolveTarget?:
|
|
3052
|
-
clearValue?: number[] |
|
|
3327
|
+
resolveTarget?: GPUTextureView;
|
|
3328
|
+
clearValue?: number[] | GPUColorDict;
|
|
3053
3329
|
loadOp: string;
|
|
3054
3330
|
storeOp: string;
|
|
3055
3331
|
}
|
|
3056
|
-
|
|
3332
|
+
interface GPUColorDict {
|
|
3057
3333
|
r: number;
|
|
3058
3334
|
g: number;
|
|
3059
3335
|
b: number;
|
|
3060
3336
|
a: number;
|
|
3061
3337
|
}
|
|
3062
|
-
|
|
3063
|
-
view:
|
|
3338
|
+
interface GPURenderPassDepthStencilAttachment {
|
|
3339
|
+
view: GPUTextureView;
|
|
3064
3340
|
depthClearValue?: number;
|
|
3065
3341
|
depthLoadOp?: string;
|
|
3066
3342
|
depthStoreOp?: string;
|
|
@@ -3070,29 +3346,373 @@ declare interface gpuGPURenderPassDepthStencilAttachment {
|
|
|
3070
3346
|
stencilStoreOp?: string;
|
|
3071
3347
|
stencilReadOnly?: boolean;
|
|
3072
3348
|
}
|
|
3073
|
-
|
|
3074
|
-
querySet:
|
|
3349
|
+
interface GPURenderPassTimestampWrites {
|
|
3350
|
+
querySet: GPUQuerySet;
|
|
3075
3351
|
beginningOfPassWriteIndex?: number;
|
|
3076
3352
|
endOfPassWriteIndex?: number;
|
|
3077
3353
|
}
|
|
3078
|
-
|
|
3079
|
-
texture:
|
|
3354
|
+
interface GPUImageCopyTexture {
|
|
3355
|
+
texture: GPUTexture;
|
|
3080
3356
|
mipLevel?: number;
|
|
3081
|
-
origin?: number[] |
|
|
3357
|
+
origin?: number[] | GPUOrigin3DDict;
|
|
3082
3358
|
aspect?: string;
|
|
3083
3359
|
}
|
|
3084
|
-
|
|
3085
|
-
buffer:
|
|
3360
|
+
interface GPUImageCopyBuffer {
|
|
3361
|
+
buffer: GPUBuffer;
|
|
3086
3362
|
offset?: number | bigint;
|
|
3087
3363
|
bytesPerRow?: number;
|
|
3088
3364
|
rowsPerImage?: number;
|
|
3089
3365
|
}
|
|
3090
|
-
|
|
3366
|
+
interface GPUOrigin3DDict {
|
|
3091
3367
|
x?: number;
|
|
3092
3368
|
y?: number;
|
|
3093
3369
|
z?: number;
|
|
3094
3370
|
}
|
|
3095
|
-
|
|
3371
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3372
|
+
declare class EventSource {
|
|
3373
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3374
|
+
/**
|
|
3375
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
3376
|
+
*
|
|
3377
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3378
|
+
*/
|
|
3379
|
+
close(): void;
|
|
3380
|
+
/**
|
|
3381
|
+
* Returns the URL providing the event stream.
|
|
3382
|
+
*
|
|
3383
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3384
|
+
*/
|
|
3385
|
+
get url(): string;
|
|
3386
|
+
/**
|
|
3387
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3388
|
+
*
|
|
3389
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3390
|
+
*/
|
|
3391
|
+
get withCredentials(): boolean;
|
|
3392
|
+
/**
|
|
3393
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3394
|
+
*
|
|
3395
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3396
|
+
*/
|
|
3397
|
+
get readyState(): number;
|
|
3398
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3399
|
+
get onopen(): any | null;
|
|
3400
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3401
|
+
set onopen(value: any | null);
|
|
3402
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3403
|
+
get onmessage(): any | null;
|
|
3404
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3405
|
+
set onmessage(value: any | null);
|
|
3406
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3407
|
+
get onerror(): any | null;
|
|
3408
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3409
|
+
set onerror(value: any | null);
|
|
3410
|
+
static readonly CONNECTING: number;
|
|
3411
|
+
static readonly OPEN: number;
|
|
3412
|
+
static readonly CLOSED: number;
|
|
3413
|
+
static from(stream: ReadableStream): EventSource;
|
|
3414
|
+
}
|
|
3415
|
+
interface EventSourceEventSourceInit {
|
|
3416
|
+
withCredentials?: boolean;
|
|
3417
|
+
fetcher?: Fetcher;
|
|
3418
|
+
}
|
|
3419
|
+
type AiImageClassificationInput = {
|
|
3420
|
+
image: number[];
|
|
3421
|
+
};
|
|
3422
|
+
type AiImageClassificationOutput = {
|
|
3423
|
+
score?: number;
|
|
3424
|
+
label?: string;
|
|
3425
|
+
}[];
|
|
3426
|
+
declare abstract class BaseAiImageClassification {
|
|
3427
|
+
inputs: AiImageClassificationInput;
|
|
3428
|
+
postProcessedOutputs: AiImageClassificationOutput;
|
|
3429
|
+
}
|
|
3430
|
+
type AiImageToTextInput = {
|
|
3431
|
+
image: number[];
|
|
3432
|
+
prompt?: string;
|
|
3433
|
+
max_tokens?: number;
|
|
3434
|
+
temperature?: number;
|
|
3435
|
+
top_p?: number;
|
|
3436
|
+
top_k?: number;
|
|
3437
|
+
seed?: number;
|
|
3438
|
+
repetition_penalty?: number;
|
|
3439
|
+
frequency_penalty?: number;
|
|
3440
|
+
presence_penalty?: number;
|
|
3441
|
+
raw?: boolean;
|
|
3442
|
+
messages?: RoleScopedChatInput[];
|
|
3443
|
+
};
|
|
3444
|
+
type AiImageToTextOutput = {
|
|
3445
|
+
description: string;
|
|
3446
|
+
};
|
|
3447
|
+
declare abstract class BaseAiImageToText {
|
|
3448
|
+
inputs: AiImageToTextInput;
|
|
3449
|
+
postProcessedOutputs: AiImageToTextOutput;
|
|
3450
|
+
}
|
|
3451
|
+
type AiObjectDetectionInput = {
|
|
3452
|
+
image: number[];
|
|
3453
|
+
};
|
|
3454
|
+
type AiObjectDetectionOutput = {
|
|
3455
|
+
score?: number;
|
|
3456
|
+
label?: string;
|
|
3457
|
+
}[];
|
|
3458
|
+
declare abstract class BaseAiObjectDetection {
|
|
3459
|
+
inputs: AiObjectDetectionInput;
|
|
3460
|
+
postProcessedOutputs: AiObjectDetectionOutput;
|
|
3461
|
+
}
|
|
3462
|
+
type AiSentenceSimilarityInput = {
|
|
3463
|
+
source: string;
|
|
3464
|
+
sentences: string[];
|
|
3465
|
+
};
|
|
3466
|
+
type AiSentenceSimilarityOutput = number[];
|
|
3467
|
+
declare abstract class BaseAiSentenceSimilarity {
|
|
3468
|
+
inputs: AiSentenceSimilarityInput;
|
|
3469
|
+
postProcessedOutputs: AiSentenceSimilarityOutput;
|
|
3470
|
+
}
|
|
3471
|
+
type AiSpeechRecognitionInput = {
|
|
3472
|
+
audio: number[];
|
|
3473
|
+
};
|
|
3474
|
+
type AiSpeechRecognitionOutput = {
|
|
3475
|
+
text?: string;
|
|
3476
|
+
words?: {
|
|
3477
|
+
word: string;
|
|
3478
|
+
start: number;
|
|
3479
|
+
end: number;
|
|
3480
|
+
}[];
|
|
3481
|
+
vtt?: string;
|
|
3482
|
+
};
|
|
3483
|
+
declare abstract class BaseAiSpeechRecognition {
|
|
3484
|
+
inputs: AiSpeechRecognitionInput;
|
|
3485
|
+
postProcessedOutputs: AiSpeechRecognitionOutput;
|
|
3486
|
+
}
|
|
3487
|
+
type AiSummarizationInput = {
|
|
3488
|
+
input_text: string;
|
|
3489
|
+
max_length?: number;
|
|
3490
|
+
};
|
|
3491
|
+
type AiSummarizationOutput = {
|
|
3492
|
+
summary: string;
|
|
3493
|
+
};
|
|
3494
|
+
declare abstract class BaseAiSummarization {
|
|
3495
|
+
inputs: AiSummarizationInput;
|
|
3496
|
+
postProcessedOutputs: AiSummarizationOutput;
|
|
3497
|
+
}
|
|
3498
|
+
type AiTextClassificationInput = {
|
|
3499
|
+
text: string;
|
|
3500
|
+
};
|
|
3501
|
+
type AiTextClassificationOutput = {
|
|
3502
|
+
score?: number;
|
|
3503
|
+
label?: string;
|
|
3504
|
+
}[];
|
|
3505
|
+
declare abstract class BaseAiTextClassification {
|
|
3506
|
+
inputs: AiTextClassificationInput;
|
|
3507
|
+
postProcessedOutputs: AiTextClassificationOutput;
|
|
3508
|
+
}
|
|
3509
|
+
type AiTextEmbeddingsInput = {
|
|
3510
|
+
text: string | string[];
|
|
3511
|
+
};
|
|
3512
|
+
type AiTextEmbeddingsOutput = {
|
|
3513
|
+
shape: number[];
|
|
3514
|
+
data: number[][];
|
|
3515
|
+
};
|
|
3516
|
+
declare abstract class BaseAiTextEmbeddings {
|
|
3517
|
+
inputs: AiTextEmbeddingsInput;
|
|
3518
|
+
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3519
|
+
}
|
|
3520
|
+
type RoleScopedChatInput = {
|
|
3521
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3522
|
+
content: string;
|
|
3523
|
+
};
|
|
3524
|
+
type AiTextGenerationToolInput = {
|
|
3525
|
+
type: "function";
|
|
3526
|
+
function: {
|
|
3527
|
+
name: string;
|
|
3528
|
+
description: string;
|
|
3529
|
+
parameters?: {
|
|
3530
|
+
type: "object";
|
|
3531
|
+
properties: {
|
|
3532
|
+
[key: string]: {
|
|
3533
|
+
type: string;
|
|
3534
|
+
description?: string;
|
|
3535
|
+
};
|
|
3536
|
+
};
|
|
3537
|
+
required: string[];
|
|
3538
|
+
};
|
|
3539
|
+
};
|
|
3540
|
+
};
|
|
3541
|
+
type AiTextGenerationInput = {
|
|
3542
|
+
prompt?: string;
|
|
3543
|
+
raw?: boolean;
|
|
3544
|
+
stream?: boolean;
|
|
3545
|
+
max_tokens?: number;
|
|
3546
|
+
temperature?: number;
|
|
3547
|
+
top_p?: number;
|
|
3548
|
+
top_k?: number;
|
|
3549
|
+
seed?: number;
|
|
3550
|
+
repetition_penalty?: number;
|
|
3551
|
+
frequency_penalty?: number;
|
|
3552
|
+
presence_penalty?: number;
|
|
3553
|
+
messages?: RoleScopedChatInput[];
|
|
3554
|
+
tools?: AiTextGenerationToolInput[];
|
|
3555
|
+
};
|
|
3556
|
+
type AiTextGenerationOutput =
|
|
3557
|
+
| {
|
|
3558
|
+
response?: string;
|
|
3559
|
+
tool_calls?: {
|
|
3560
|
+
name: string;
|
|
3561
|
+
arguments: unknown;
|
|
3562
|
+
}[];
|
|
3563
|
+
}
|
|
3564
|
+
| ReadableStream;
|
|
3565
|
+
declare abstract class BaseAiTextGeneration {
|
|
3566
|
+
inputs: AiTextGenerationInput;
|
|
3567
|
+
postProcessedOutputs: AiTextGenerationOutput;
|
|
3568
|
+
}
|
|
3569
|
+
type AiTextToImageInput = {
|
|
3570
|
+
prompt: string;
|
|
3571
|
+
image?: number[];
|
|
3572
|
+
mask?: number[];
|
|
3573
|
+
num_steps?: number;
|
|
3574
|
+
strength?: number;
|
|
3575
|
+
guidance?: number;
|
|
3576
|
+
};
|
|
3577
|
+
type AiTextToImageOutput = Uint8Array;
|
|
3578
|
+
declare abstract class BaseAiTextToImage {
|
|
3579
|
+
inputs: AiTextToImageInput;
|
|
3580
|
+
postProcessedOutputs: AiTextToImageOutput;
|
|
3581
|
+
}
|
|
3582
|
+
type AiTranslationInput = {
|
|
3583
|
+
text: string;
|
|
3584
|
+
target_lang: string;
|
|
3585
|
+
source_lang?: string;
|
|
3586
|
+
};
|
|
3587
|
+
type AiTranslationOutput = {
|
|
3588
|
+
translated_text?: string;
|
|
3589
|
+
};
|
|
3590
|
+
declare abstract class BaseAiTranslation {
|
|
3591
|
+
inputs: AiTranslationInput;
|
|
3592
|
+
postProcessedOutputs: AiTranslationOutput;
|
|
3593
|
+
}
|
|
3594
|
+
type GatewayOptions = {
|
|
3595
|
+
id: string;
|
|
3596
|
+
cacheTtl?: number;
|
|
3597
|
+
skipCache?: boolean;
|
|
3598
|
+
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
3599
|
+
};
|
|
3600
|
+
type AiOptions = {
|
|
3601
|
+
gateway?: GatewayOptions;
|
|
3602
|
+
prefix?: string;
|
|
3603
|
+
extraHeaders?: object;
|
|
3604
|
+
};
|
|
3605
|
+
type BaseAiTextClassificationModels = "@cf/huggingface/distilbert-sst-2-int8";
|
|
3606
|
+
type BaseAiTextToImageModels =
|
|
3607
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3608
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3609
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3610
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3611
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3612
|
+
type BaseAiTextEmbeddingsModels =
|
|
3613
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3614
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3615
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3616
|
+
type BaseAiSpeechRecognitionModels =
|
|
3617
|
+
| "@cf/openai/whisper"
|
|
3618
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3619
|
+
| "@cf/openai/whisper-sherpa";
|
|
3620
|
+
type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3621
|
+
type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3622
|
+
type BaseAiTextGenerationModels =
|
|
3623
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3624
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3625
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3626
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3627
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3628
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3629
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3630
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3631
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3632
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3633
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3634
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3635
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3636
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3637
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3638
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3639
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3640
|
+
| "@hf/google/gemma-7b-it"
|
|
3641
|
+
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3642
|
+
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3643
|
+
| "@cf/defog/sqlcoder-7b-2"
|
|
3644
|
+
| "@cf/openchat/openchat-3.5-0106"
|
|
3645
|
+
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3646
|
+
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3647
|
+
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3648
|
+
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3649
|
+
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3650
|
+
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3651
|
+
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3652
|
+
| "@cf/microsoft/phi-2"
|
|
3653
|
+
| "@cf/google/gemma-2b-it-lora"
|
|
3654
|
+
| "@cf/google/gemma-7b-it-lora"
|
|
3655
|
+
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3656
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3657
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3658
|
+
type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3659
|
+
type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3660
|
+
type BaseAiImageToTextModels =
|
|
3661
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3662
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3663
|
+
declare abstract class Ai {
|
|
3664
|
+
run(
|
|
3665
|
+
model: BaseAiTextClassificationModels,
|
|
3666
|
+
inputs: BaseAiTextClassification["inputs"],
|
|
3667
|
+
options?: AiOptions,
|
|
3668
|
+
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3669
|
+
run(
|
|
3670
|
+
model: BaseAiTextToImageModels,
|
|
3671
|
+
inputs: BaseAiTextToImage["inputs"],
|
|
3672
|
+
options?: AiOptions,
|
|
3673
|
+
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3674
|
+
run(
|
|
3675
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3676
|
+
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3677
|
+
options?: AiOptions,
|
|
3678
|
+
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3679
|
+
run(
|
|
3680
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3681
|
+
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3682
|
+
options?: AiOptions,
|
|
3683
|
+
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3684
|
+
run(
|
|
3685
|
+
model: BaseAiImageClassificationModels,
|
|
3686
|
+
inputs: BaseAiImageClassification["inputs"],
|
|
3687
|
+
options?: AiOptions,
|
|
3688
|
+
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3689
|
+
run(
|
|
3690
|
+
model: BaseAiObjectDetectionModels,
|
|
3691
|
+
inputs: BaseAiObjectDetection["inputs"],
|
|
3692
|
+
options?: AiOptions,
|
|
3693
|
+
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3694
|
+
run(
|
|
3695
|
+
model: BaseAiTextGenerationModels,
|
|
3696
|
+
inputs: BaseAiTextGeneration["inputs"],
|
|
3697
|
+
options?: AiOptions,
|
|
3698
|
+
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3699
|
+
run(
|
|
3700
|
+
model: BaseAiTranslationModels,
|
|
3701
|
+
inputs: BaseAiTranslation["inputs"],
|
|
3702
|
+
options?: AiOptions,
|
|
3703
|
+
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3704
|
+
run(
|
|
3705
|
+
model: BaseAiSummarizationModels,
|
|
3706
|
+
inputs: BaseAiSummarization["inputs"],
|
|
3707
|
+
options?: AiOptions,
|
|
3708
|
+
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3709
|
+
run(
|
|
3710
|
+
model: BaseAiImageToTextModels,
|
|
3711
|
+
inputs: BaseAiImageToText["inputs"],
|
|
3712
|
+
options?: AiOptions,
|
|
3713
|
+
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
3714
|
+
}
|
|
3715
|
+
interface BasicImageTransformations {
|
|
3096
3716
|
/**
|
|
3097
3717
|
* Maximum width in image pixels. The value must be an integer.
|
|
3098
3718
|
*/
|
|
@@ -3158,7 +3778,7 @@ declare interface BasicImageTransformations {
|
|
|
3158
3778
|
*/
|
|
3159
3779
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
3160
3780
|
}
|
|
3161
|
-
|
|
3781
|
+
interface BasicImageTransformationsGravityCoordinates {
|
|
3162
3782
|
x: number;
|
|
3163
3783
|
y: number;
|
|
3164
3784
|
}
|
|
@@ -3171,7 +3791,7 @@ declare interface BasicImageTransformationsGravityCoordinates {
|
|
|
3171
3791
|
* Note: Currently, these properties cannot be tested in the
|
|
3172
3792
|
* playground.
|
|
3173
3793
|
*/
|
|
3174
|
-
|
|
3794
|
+
interface RequestInitCfProperties extends Record<string, unknown> {
|
|
3175
3795
|
cacheEverything?: boolean;
|
|
3176
3796
|
/**
|
|
3177
3797
|
* A request's cache key is what determines if two requests are
|
|
@@ -3206,6 +3826,7 @@ declare interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3206
3826
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
3207
3827
|
mirage?: boolean;
|
|
3208
3828
|
polish?: "lossy" | "lossless" | "off";
|
|
3829
|
+
r2?: RequestInitCfPropertiesR2;
|
|
3209
3830
|
/**
|
|
3210
3831
|
* Redirects the request to an alternate origin server. You can use this,
|
|
3211
3832
|
* for example, to implement load balancing across several origins.
|
|
@@ -3221,8 +3842,7 @@ declare interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3221
3842
|
*/
|
|
3222
3843
|
resolveOverride?: string;
|
|
3223
3844
|
}
|
|
3224
|
-
|
|
3225
|
-
extends BasicImageTransformations {
|
|
3845
|
+
interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
3226
3846
|
/**
|
|
3227
3847
|
* Absolute URL of the image file to use for the drawing. It can be any of
|
|
3228
3848
|
* the supported file formats. For drawing of watermarks or non-rectangular
|
|
@@ -3259,8 +3879,7 @@ declare interface RequestInitCfPropertiesImageDraw
|
|
|
3259
3879
|
bottom?: number;
|
|
3260
3880
|
right?: number;
|
|
3261
3881
|
}
|
|
3262
|
-
|
|
3263
|
-
extends BasicImageTransformations {
|
|
3882
|
+
interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
3264
3883
|
/**
|
|
3265
3884
|
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
3266
3885
|
* easier to specify higher-DPI sizes in <img srcset>.
|
|
@@ -3385,22 +4004,27 @@ declare interface RequestInitCfPropertiesImage
|
|
|
3385
4004
|
*/
|
|
3386
4005
|
compression?: "fast";
|
|
3387
4006
|
}
|
|
3388
|
-
|
|
4007
|
+
interface RequestInitCfPropertiesImageMinify {
|
|
3389
4008
|
javascript?: boolean;
|
|
3390
4009
|
css?: boolean;
|
|
3391
4010
|
html?: boolean;
|
|
3392
4011
|
}
|
|
4012
|
+
interface RequestInitCfPropertiesR2 {
|
|
4013
|
+
/**
|
|
4014
|
+
* Colo id of bucket that an object is stored in
|
|
4015
|
+
*/
|
|
4016
|
+
bucketColoId?: number;
|
|
4017
|
+
}
|
|
3393
4018
|
/**
|
|
3394
4019
|
* Request metadata provided by Cloudflare's edge.
|
|
3395
4020
|
*/
|
|
3396
|
-
|
|
4021
|
+
type IncomingRequestCfProperties<HostMetadata = unknown> =
|
|
3397
4022
|
IncomingRequestCfPropertiesBase &
|
|
3398
4023
|
IncomingRequestCfPropertiesBotManagementEnterprise &
|
|
3399
4024
|
IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> &
|
|
3400
4025
|
IncomingRequestCfPropertiesGeographicInformation &
|
|
3401
4026
|
IncomingRequestCfPropertiesCloudflareAccessOrApiShield;
|
|
3402
|
-
|
|
3403
|
-
extends Record<string, unknown> {
|
|
4027
|
+
interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {
|
|
3404
4028
|
/**
|
|
3405
4029
|
* [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request.
|
|
3406
4030
|
*
|
|
@@ -3478,7 +4102,7 @@ declare interface IncomingRequestCfPropertiesBase
|
|
|
3478
4102
|
*/
|
|
3479
4103
|
tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata;
|
|
3480
4104
|
}
|
|
3481
|
-
|
|
4105
|
+
interface IncomingRequestCfPropertiesBotManagementBase {
|
|
3482
4106
|
/**
|
|
3483
4107
|
* Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot,
|
|
3484
4108
|
* represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human).
|
|
@@ -3505,7 +4129,7 @@ declare interface IncomingRequestCfPropertiesBotManagementBase {
|
|
|
3505
4129
|
*/
|
|
3506
4130
|
detectionIds: number[];
|
|
3507
4131
|
}
|
|
3508
|
-
|
|
4132
|
+
interface IncomingRequestCfPropertiesBotManagement {
|
|
3509
4133
|
/**
|
|
3510
4134
|
* Results of Cloudflare's Bot Management analysis
|
|
3511
4135
|
*/
|
|
@@ -3517,7 +4141,7 @@ declare interface IncomingRequestCfPropertiesBotManagement {
|
|
|
3517
4141
|
*/
|
|
3518
4142
|
clientTrustScore: number;
|
|
3519
4143
|
}
|
|
3520
|
-
|
|
4144
|
+
interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
3521
4145
|
extends IncomingRequestCfPropertiesBotManagement {
|
|
3522
4146
|
/**
|
|
3523
4147
|
* Results of Cloudflare's Bot Management analysis
|
|
@@ -3530,9 +4154,7 @@ declare interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
|
3530
4154
|
ja3Hash: string;
|
|
3531
4155
|
};
|
|
3532
4156
|
}
|
|
3533
|
-
|
|
3534
|
-
HostMetadata,
|
|
3535
|
-
> {
|
|
4157
|
+
interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {
|
|
3536
4158
|
/**
|
|
3537
4159
|
* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
|
|
3538
4160
|
*
|
|
@@ -3541,7 +4163,7 @@ declare interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
|
|
|
3541
4163
|
*/
|
|
3542
4164
|
hostMetadata: HostMetadata;
|
|
3543
4165
|
}
|
|
3544
|
-
|
|
4166
|
+
interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
|
|
3545
4167
|
/**
|
|
3546
4168
|
* Information about the client certificate presented to Cloudflare.
|
|
3547
4169
|
*
|
|
@@ -3563,7 +4185,7 @@ declare interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
|
|
|
3563
4185
|
/**
|
|
3564
4186
|
* Metadata about the request's TLS handshake
|
|
3565
4187
|
*/
|
|
3566
|
-
|
|
4188
|
+
interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
|
|
3567
4189
|
/**
|
|
3568
4190
|
* The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
|
|
3569
4191
|
*
|
|
@@ -3592,7 +4214,7 @@ declare interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
|
|
|
3592
4214
|
/**
|
|
3593
4215
|
* Geographic data about the request's origin.
|
|
3594
4216
|
*/
|
|
3595
|
-
|
|
4217
|
+
interface IncomingRequestCfPropertiesGeographicInformation {
|
|
3596
4218
|
/**
|
|
3597
4219
|
* The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
|
|
3598
4220
|
*
|
|
@@ -3669,7 +4291,7 @@ declare interface IncomingRequestCfPropertiesGeographicInformation {
|
|
|
3669
4291
|
metroCode?: string;
|
|
3670
4292
|
}
|
|
3671
4293
|
/** Data about the incoming request's TLS certificate */
|
|
3672
|
-
|
|
4294
|
+
interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
3673
4295
|
/** Always `"1"`, indicating that the certificate was presented */
|
|
3674
4296
|
certPresented: "1";
|
|
3675
4297
|
/**
|
|
@@ -3762,7 +4384,7 @@ declare interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
|
3762
4384
|
certNotAfter: string;
|
|
3763
4385
|
}
|
|
3764
4386
|
/** Placeholder values for TLS Client Authorization */
|
|
3765
|
-
|
|
4387
|
+
interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
|
|
3766
4388
|
certPresented: "0";
|
|
3767
4389
|
certVerified: "NONE";
|
|
3768
4390
|
certRevoked: "0";
|
|
@@ -4060,10 +4682,10 @@ declare type Iso3166Alpha2Code =
|
|
|
4060
4682
|
| "ZW";
|
|
4061
4683
|
/** The 2-letter continent codes Cloudflare uses */
|
|
4062
4684
|
declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
|
|
4063
|
-
|
|
4685
|
+
type CfProperties<HostMetadata = unknown> =
|
|
4064
4686
|
| IncomingRequestCfProperties<HostMetadata>
|
|
4065
4687
|
| RequestInitCfProperties;
|
|
4066
|
-
|
|
4688
|
+
interface D1Meta {
|
|
4067
4689
|
duration: number;
|
|
4068
4690
|
size_after: number;
|
|
4069
4691
|
rows_read: number;
|
|
@@ -4072,15 +4694,15 @@ declare interface D1Meta {
|
|
|
4072
4694
|
changed_db: boolean;
|
|
4073
4695
|
changes: number;
|
|
4074
4696
|
}
|
|
4075
|
-
|
|
4697
|
+
interface D1Response {
|
|
4076
4698
|
success: true;
|
|
4077
4699
|
meta: D1Meta & Record<string, unknown>;
|
|
4078
4700
|
error?: never;
|
|
4079
4701
|
}
|
|
4080
|
-
|
|
4702
|
+
type D1Result<T = unknown> = D1Response & {
|
|
4081
4703
|
results: T[];
|
|
4082
4704
|
};
|
|
4083
|
-
|
|
4705
|
+
interface D1ExecResult {
|
|
4084
4706
|
count: number;
|
|
4085
4707
|
duration: number;
|
|
4086
4708
|
}
|
|
@@ -4107,11 +4729,11 @@ declare abstract class D1PreparedStatement {
|
|
|
4107
4729
|
// but this will ensure type checking on older versions still passes.
|
|
4108
4730
|
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
4109
4731
|
// ignored when `Disposable` is included in the standard lib.
|
|
4110
|
-
|
|
4732
|
+
interface Disposable {}
|
|
4111
4733
|
/**
|
|
4112
4734
|
* An email message that can be sent from a Worker.
|
|
4113
4735
|
*/
|
|
4114
|
-
|
|
4736
|
+
interface EmailMessage {
|
|
4115
4737
|
/**
|
|
4116
4738
|
* Envelope From attribute of the email message.
|
|
4117
4739
|
*/
|
|
@@ -4124,7 +4746,7 @@ declare interface EmailMessage {
|
|
|
4124
4746
|
/**
|
|
4125
4747
|
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
4126
4748
|
*/
|
|
4127
|
-
|
|
4749
|
+
interface ForwardableEmailMessage extends EmailMessage {
|
|
4128
4750
|
/**
|
|
4129
4751
|
* Stream of the email message content.
|
|
4130
4752
|
*/
|
|
@@ -4154,7 +4776,7 @@ declare interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4154
4776
|
/**
|
|
4155
4777
|
* A binding that allows a Worker to send email messages.
|
|
4156
4778
|
*/
|
|
4157
|
-
|
|
4779
|
+
interface SendEmail {
|
|
4158
4780
|
send(message: EmailMessage): Promise<void>;
|
|
4159
4781
|
}
|
|
4160
4782
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
@@ -4172,7 +4794,7 @@ declare module "cloudflare:email" {
|
|
|
4172
4794
|
};
|
|
4173
4795
|
export { _EmailMessage as EmailMessage };
|
|
4174
4796
|
}
|
|
4175
|
-
|
|
4797
|
+
interface Hyperdrive {
|
|
4176
4798
|
/**
|
|
4177
4799
|
* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
|
|
4178
4800
|
*
|
|
@@ -4219,8 +4841,8 @@ declare interface Hyperdrive {
|
|
|
4219
4841
|
*/
|
|
4220
4842
|
readonly database: string;
|
|
4221
4843
|
}
|
|
4222
|
-
|
|
4223
|
-
|
|
4844
|
+
type Params<P extends string = any> = Record<P, string | string[]>;
|
|
4845
|
+
type EventContext<Env, P extends string, Data> = {
|
|
4224
4846
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
4225
4847
|
functionPath: string;
|
|
4226
4848
|
waitUntil: (promise: Promise<any>) => void;
|
|
@@ -4234,12 +4856,12 @@ declare type EventContext<Env, P extends string, Data> = {
|
|
|
4234
4856
|
params: Params<P>;
|
|
4235
4857
|
data: Data;
|
|
4236
4858
|
};
|
|
4237
|
-
|
|
4859
|
+
type PagesFunction<
|
|
4238
4860
|
Env = unknown,
|
|
4239
4861
|
Params extends string = any,
|
|
4240
4862
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
4241
4863
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
4242
|
-
|
|
4864
|
+
type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
4243
4865
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
4244
4866
|
functionPath: string;
|
|
4245
4867
|
waitUntil: (promise: Promise<any>) => void;
|
|
@@ -4254,7 +4876,7 @@ declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
|
4254
4876
|
data: Data;
|
|
4255
4877
|
pluginArgs: PluginArgs;
|
|
4256
4878
|
};
|
|
4257
|
-
|
|
4879
|
+
type PagesPluginFunction<
|
|
4258
4880
|
Env = unknown,
|
|
4259
4881
|
Params extends string = any,
|
|
4260
4882
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
@@ -4269,7 +4891,7 @@ declare module "assets:*" {
|
|
|
4269
4891
|
// The message includes metadata about the broker, the client, and the payload
|
|
4270
4892
|
// itself.
|
|
4271
4893
|
// https://developers.cloudflare.com/pub-sub/
|
|
4272
|
-
|
|
4894
|
+
interface PubSubMessage {
|
|
4273
4895
|
// Message ID
|
|
4274
4896
|
readonly mid: number;
|
|
4275
4897
|
// MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
|
|
@@ -4295,10 +4917,24 @@ declare interface PubSubMessage {
|
|
|
4295
4917
|
payload: string | Uint8Array;
|
|
4296
4918
|
}
|
|
4297
4919
|
// JsonWebKey extended by kid parameter
|
|
4298
|
-
|
|
4920
|
+
interface JsonWebKeyWithKid extends JsonWebKey {
|
|
4299
4921
|
// Key Identifier of the JWK
|
|
4300
4922
|
readonly kid: string;
|
|
4301
4923
|
}
|
|
4924
|
+
interface RateLimitOptions {
|
|
4925
|
+
key: string;
|
|
4926
|
+
}
|
|
4927
|
+
interface RateLimitOutcome {
|
|
4928
|
+
success: boolean;
|
|
4929
|
+
}
|
|
4930
|
+
interface RateLimit {
|
|
4931
|
+
/**
|
|
4932
|
+
* Rate limit a request based on the provided options.
|
|
4933
|
+
* @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
|
|
4934
|
+
* @returns A promise that resolves with the outcome of the rate limit.
|
|
4935
|
+
*/
|
|
4936
|
+
limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
|
|
4937
|
+
}
|
|
4302
4938
|
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4303
4939
|
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4304
4940
|
// strips all `module` blocks.
|
|
@@ -4506,19 +5142,15 @@ declare module "cloudflare:sockets" {
|
|
|
4506
5142
|
/**
|
|
4507
5143
|
* Data types supported for holding vector metadata.
|
|
4508
5144
|
*/
|
|
4509
|
-
|
|
4510
|
-
| string
|
|
4511
|
-
| number
|
|
4512
|
-
| boolean
|
|
4513
|
-
| string[];
|
|
5145
|
+
type VectorizeVectorMetadataValue = string | number | boolean | string[];
|
|
4514
5146
|
/**
|
|
4515
5147
|
* Additional information to associate with a vector.
|
|
4516
5148
|
*/
|
|
4517
|
-
|
|
5149
|
+
type VectorizeVectorMetadata =
|
|
4518
5150
|
| VectorizeVectorMetadataValue
|
|
4519
5151
|
| Record<string, VectorizeVectorMetadataValue>;
|
|
4520
|
-
|
|
4521
|
-
|
|
5152
|
+
type VectorFloatArray = Float32Array | Float64Array;
|
|
5153
|
+
interface VectorizeError {
|
|
4522
5154
|
code?: number;
|
|
4523
5155
|
error: string;
|
|
4524
5156
|
}
|
|
@@ -4527,11 +5159,11 @@ declare interface VectorizeError {
|
|
|
4527
5159
|
*
|
|
4528
5160
|
* This list is expected to grow as support for more operations are released.
|
|
4529
5161
|
*/
|
|
4530
|
-
|
|
5162
|
+
type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
|
|
4531
5163
|
/**
|
|
4532
5164
|
* Filter criteria for vector metadata used to limit the retrieved query result set.
|
|
4533
5165
|
*/
|
|
4534
|
-
|
|
5166
|
+
type VectorizeVectorMetadataFilter = {
|
|
4535
5167
|
[field: string]:
|
|
4536
5168
|
| Exclude<VectorizeVectorMetadataValue, string[]>
|
|
4537
5169
|
| null
|
|
@@ -4546,8 +5178,8 @@ declare type VectorizeVectorMetadataFilter = {
|
|
|
4546
5178
|
* Supported distance metrics for an index.
|
|
4547
5179
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
4548
5180
|
*/
|
|
4549
|
-
|
|
4550
|
-
|
|
5181
|
+
type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
5182
|
+
interface VectorizeQueryOptions {
|
|
4551
5183
|
topK?: number;
|
|
4552
5184
|
namespace?: string;
|
|
4553
5185
|
returnValues?: boolean;
|
|
@@ -4557,7 +5189,7 @@ declare interface VectorizeQueryOptions {
|
|
|
4557
5189
|
/**
|
|
4558
5190
|
* Information about the configuration of an index.
|
|
4559
5191
|
*/
|
|
4560
|
-
|
|
5192
|
+
type VectorizeIndexConfig =
|
|
4561
5193
|
| {
|
|
4562
5194
|
dimensions: number;
|
|
4563
5195
|
metric: VectorizeDistanceMetric;
|
|
@@ -4568,7 +5200,7 @@ declare type VectorizeIndexConfig =
|
|
|
4568
5200
|
/**
|
|
4569
5201
|
* Metadata about an existing index.
|
|
4570
5202
|
*/
|
|
4571
|
-
|
|
5203
|
+
interface VectorizeIndexDetails {
|
|
4572
5204
|
/** The unique ID of the index */
|
|
4573
5205
|
readonly id: string;
|
|
4574
5206
|
/** The name of the index. */
|
|
@@ -4583,7 +5215,7 @@ declare interface VectorizeIndexDetails {
|
|
|
4583
5215
|
/**
|
|
4584
5216
|
* Represents a single vector value set along with its associated metadata.
|
|
4585
5217
|
*/
|
|
4586
|
-
|
|
5218
|
+
interface VectorizeVector {
|
|
4587
5219
|
/** 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. */
|
|
4588
5220
|
id: string;
|
|
4589
5221
|
/** The vector values */
|
|
@@ -4596,7 +5228,7 @@ declare interface VectorizeVector {
|
|
|
4596
5228
|
/**
|
|
4597
5229
|
* Represents a matched vector for a query along with its score and (if specified) the matching vector information.
|
|
4598
5230
|
*/
|
|
4599
|
-
|
|
5231
|
+
type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
4600
5232
|
Omit<VectorizeVector, "values"> & {
|
|
4601
5233
|
/** The score or rank for similarity, when returned as a result */
|
|
4602
5234
|
score: number;
|
|
@@ -4604,7 +5236,7 @@ declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
4604
5236
|
/**
|
|
4605
5237
|
* A set of vector {@link VectorizeMatch} for a particular query.
|
|
4606
5238
|
*/
|
|
4607
|
-
|
|
5239
|
+
interface VectorizeMatches {
|
|
4608
5240
|
matches: VectorizeMatch[];
|
|
4609
5241
|
count: number;
|
|
4610
5242
|
}
|
|
@@ -4612,12 +5244,21 @@ declare interface VectorizeMatches {
|
|
|
4612
5244
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
4613
5245
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
4614
5246
|
*/
|
|
4615
|
-
|
|
5247
|
+
interface VectorizeVectorMutation {
|
|
4616
5248
|
/* List of ids of vectors that were successfully processed. */
|
|
4617
5249
|
ids: string[];
|
|
4618
5250
|
/* Total count of the number of processed vectors. */
|
|
4619
5251
|
count: number;
|
|
4620
5252
|
}
|
|
5253
|
+
/**
|
|
5254
|
+
* Results of an operation that performed a mutation on a set of vectors
|
|
5255
|
+
* with the v2 version of Vectorize.
|
|
5256
|
+
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
5257
|
+
*/
|
|
5258
|
+
interface VectorizeVectorMutationV2 {
|
|
5259
|
+
/* The identifier for the last mutation processed by Vectorize. */
|
|
5260
|
+
mutationId: string;
|
|
5261
|
+
}
|
|
4621
5262
|
declare abstract class VectorizeIndex {
|
|
4622
5263
|
/**
|
|
4623
5264
|
* Get information about the currently bound index.
|
|
@@ -4663,13 +5304,15 @@ declare abstract class VectorizeIndex {
|
|
|
4663
5304
|
* The interface for "version_metadata" binding
|
|
4664
5305
|
* providing metadata about the Worker Version using this binding.
|
|
4665
5306
|
*/
|
|
4666
|
-
|
|
5307
|
+
type WorkerVersionMetadata = {
|
|
4667
5308
|
/** The ID of the Worker Version using this binding */
|
|
4668
5309
|
id: string;
|
|
4669
5310
|
/** The tag of the Worker Version using this binding */
|
|
4670
5311
|
tag: string;
|
|
5312
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
5313
|
+
timestamp: string;
|
|
4671
5314
|
};
|
|
4672
|
-
|
|
5315
|
+
interface DynamicDispatchLimits {
|
|
4673
5316
|
/**
|
|
4674
5317
|
* Limit CPU time in milliseconds.
|
|
4675
5318
|
*/
|
|
@@ -4679,7 +5322,7 @@ declare interface DynamicDispatchLimits {
|
|
|
4679
5322
|
*/
|
|
4680
5323
|
subRequests?: number;
|
|
4681
5324
|
}
|
|
4682
|
-
|
|
5325
|
+
interface DynamicDispatchOptions {
|
|
4683
5326
|
/**
|
|
4684
5327
|
* Limit resources of invoked Worker script.
|
|
4685
5328
|
*/
|
|
@@ -4691,7 +5334,7 @@ declare interface DynamicDispatchOptions {
|
|
|
4691
5334
|
[key: string]: any;
|
|
4692
5335
|
};
|
|
4693
5336
|
}
|
|
4694
|
-
|
|
5337
|
+
interface DispatchNamespace {
|
|
4695
5338
|
/**
|
|
4696
5339
|
* @param name Name of the Worker script.
|
|
4697
5340
|
* @param args Arguments to Worker script.
|