@cloudflare/workers-types 4.20240314.0 → 4.20240329.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 +822 -178
- package/2021-11-03/index.ts +774 -178
- package/2022-01-31/index.d.ts +837 -153
- package/2022-01-31/index.ts +789 -153
- package/2022-03-21/index.d.ts +839 -155
- package/2022-03-21/index.ts +791 -155
- package/2022-08-04/index.d.ts +839 -155
- package/2022-08-04/index.ts +791 -155
- package/2022-10-31/index.d.ts +840 -155
- package/2022-10-31/index.ts +792 -155
- package/2022-11-30/index.d.ts +832 -154
- package/2022-11-30/index.ts +784 -154
- package/2023-03-01/index.d.ts +832 -154
- package/2023-03-01/index.ts +784 -154
- package/2023-07-01/index.d.ts +832 -154
- package/2023-07-01/index.ts +784 -154
- package/README.md +0 -3
- package/experimental/index.d.ts +838 -159
- package/experimental/index.ts +790 -159
- package/index.d.ts +822 -178
- package/index.ts +774 -178
- package/oldest/index.d.ts +822 -178
- package/oldest/index.ts +774 -178
- package/package.json +1 -1
package/2022-08-04/index.d.ts
CHANGED
|
@@ -16,8 +16,15 @@ and limitations under the License.
|
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
17
|
declare class DOMException extends Error {
|
|
18
18
|
constructor(message?: string, name?: string);
|
|
19
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
|
|
19
20
|
readonly message: string;
|
|
21
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
|
|
20
22
|
readonly name: string;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated
|
|
25
|
+
*
|
|
26
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
|
27
|
+
*/
|
|
21
28
|
readonly code: number;
|
|
22
29
|
readonly stack: any;
|
|
23
30
|
static readonly INDEX_SIZE_ERR: number;
|
|
@@ -56,30 +63,61 @@ declare type WorkerGlobalScopeEventMap = {
|
|
|
56
63
|
declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
|
|
57
64
|
EventTarget: typeof EventTarget;
|
|
58
65
|
}
|
|
66
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
|
|
59
67
|
declare interface Console {
|
|
60
68
|
"assert"(condition?: boolean, ...data: any[]): void;
|
|
69
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
|
|
61
70
|
clear(): void;
|
|
71
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
|
|
62
72
|
count(label?: string): void;
|
|
73
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
|
|
63
74
|
countReset(label?: string): void;
|
|
75
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
|
|
64
76
|
debug(...data: any[]): void;
|
|
77
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
|
|
65
78
|
dir(item?: any, options?: any): void;
|
|
79
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
|
|
66
80
|
dirxml(...data: any[]): void;
|
|
81
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
|
|
67
82
|
error(...data: any[]): void;
|
|
83
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
|
|
68
84
|
group(...data: any[]): void;
|
|
85
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
|
|
69
86
|
groupCollapsed(...data: any[]): void;
|
|
87
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
|
|
70
88
|
groupEnd(): void;
|
|
89
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
|
|
71
90
|
info(...data: any[]): void;
|
|
91
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
|
|
72
92
|
log(...data: any[]): void;
|
|
93
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
|
|
73
94
|
table(tabularData?: any, properties?: string[]): void;
|
|
95
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
|
|
74
96
|
time(label?: string): void;
|
|
97
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
|
|
75
98
|
timeEnd(label?: string): void;
|
|
99
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
|
|
76
100
|
timeLog(label?: string, ...data: any[]): void;
|
|
77
101
|
timeStamp(label?: string): void;
|
|
102
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
|
|
78
103
|
trace(...data: any[]): void;
|
|
104
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
|
|
79
105
|
warn(...data: any[]): void;
|
|
80
106
|
}
|
|
81
107
|
declare const console: Console;
|
|
82
108
|
declare type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
109
|
+
declare type TypedArray =
|
|
110
|
+
| Int8Array
|
|
111
|
+
| Uint8Array
|
|
112
|
+
| Uint8ClampedArray
|
|
113
|
+
| Int16Array
|
|
114
|
+
| Uint16Array
|
|
115
|
+
| Int32Array
|
|
116
|
+
| Uint32Array
|
|
117
|
+
| Float32Array
|
|
118
|
+
| Float64Array
|
|
119
|
+
| BigInt64Array
|
|
120
|
+
| BigUint64Array;
|
|
83
121
|
declare namespace WebAssembly {
|
|
84
122
|
class CompileError extends Error {
|
|
85
123
|
constructor(message?: string);
|
|
@@ -154,7 +192,11 @@ declare namespace WebAssembly {
|
|
|
154
192
|
function instantiate(module: Module, imports?: Imports): Promise<Instance>;
|
|
155
193
|
function validate(bytes: BufferSource): boolean;
|
|
156
194
|
}
|
|
157
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* This ServiceWorker API interface represents the global execution context of a service worker.
|
|
197
|
+
*
|
|
198
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
|
|
199
|
+
*/
|
|
158
200
|
declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
159
201
|
DOMException: typeof DOMException;
|
|
160
202
|
WorkerGlobalScope: typeof WorkerGlobalScope;
|
|
@@ -178,7 +220,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
178
220
|
structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
|
|
179
221
|
fetch(
|
|
180
222
|
input: RequestInfo,
|
|
181
|
-
init?: RequestInit<RequestInitCfProperties
|
|
223
|
+
init?: RequestInit<RequestInitCfProperties>,
|
|
182
224
|
): Promise<Response>;
|
|
183
225
|
self: ServiceWorkerGlobalScope;
|
|
184
226
|
crypto: Crypto;
|
|
@@ -249,49 +291,64 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
249
291
|
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
|
|
250
292
|
type: Type,
|
|
251
293
|
handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
|
|
252
|
-
options?: EventTargetAddEventListenerOptions | boolean
|
|
294
|
+
options?: EventTargetAddEventListenerOptions | boolean,
|
|
253
295
|
): void;
|
|
254
296
|
declare function removeEventListener<
|
|
255
|
-
Type extends keyof WorkerGlobalScopeEventMap
|
|
297
|
+
Type extends keyof WorkerGlobalScopeEventMap,
|
|
256
298
|
>(
|
|
257
299
|
type: Type,
|
|
258
300
|
handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
|
|
259
|
-
options?: EventTargetEventListenerOptions | boolean
|
|
301
|
+
options?: EventTargetEventListenerOptions | boolean,
|
|
260
302
|
): void;
|
|
261
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
|
|
305
|
+
*
|
|
306
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
307
|
+
*/
|
|
262
308
|
declare function dispatchEvent(
|
|
263
|
-
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]
|
|
309
|
+
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
|
|
264
310
|
): boolean;
|
|
311
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
|
265
312
|
declare function btoa(data: string): string;
|
|
313
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
|
266
314
|
declare function atob(data: string): string;
|
|
315
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
267
316
|
declare function setTimeout(
|
|
268
317
|
callback: (...args: any[]) => void,
|
|
269
|
-
msDelay?: number
|
|
318
|
+
msDelay?: number,
|
|
270
319
|
): number;
|
|
320
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
271
321
|
declare function setTimeout<Args extends any[]>(
|
|
272
322
|
callback: (...args: Args) => void,
|
|
273
323
|
msDelay?: number,
|
|
274
324
|
...args: Args
|
|
275
325
|
): number;
|
|
326
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
|
|
276
327
|
declare function clearTimeout(timeoutId: number | null): void;
|
|
328
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
277
329
|
declare function setInterval(
|
|
278
330
|
callback: (...args: any[]) => void,
|
|
279
|
-
msDelay?: number
|
|
331
|
+
msDelay?: number,
|
|
280
332
|
): number;
|
|
333
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
281
334
|
declare function setInterval<Args extends any[]>(
|
|
282
335
|
callback: (...args: Args) => void,
|
|
283
336
|
msDelay?: number,
|
|
284
337
|
...args: Args
|
|
285
338
|
): number;
|
|
339
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
|
286
340
|
declare function clearInterval(timeoutId: number | null): void;
|
|
341
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
|
|
287
342
|
declare function queueMicrotask(task: Function): void;
|
|
343
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
|
|
288
344
|
declare function structuredClone<T>(
|
|
289
345
|
value: T,
|
|
290
|
-
options?: StructuredSerializeOptions
|
|
346
|
+
options?: StructuredSerializeOptions,
|
|
291
347
|
): T;
|
|
348
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
|
|
292
349
|
declare function fetch(
|
|
293
350
|
input: RequestInfo,
|
|
294
|
-
init?: RequestInit<RequestInitCfProperties
|
|
351
|
+
init?: RequestInit<RequestInitCfProperties>,
|
|
295
352
|
): Promise<Response>;
|
|
296
353
|
declare const self: ServiceWorkerGlobalScope;
|
|
297
354
|
declare const crypto: Crypto;
|
|
@@ -307,41 +364,41 @@ declare interface ExecutionContext {
|
|
|
307
364
|
}
|
|
308
365
|
declare type ExportedHandlerFetchHandler<
|
|
309
366
|
Env = unknown,
|
|
310
|
-
CfHostMetadata = unknown
|
|
367
|
+
CfHostMetadata = unknown,
|
|
311
368
|
> = (
|
|
312
369
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
313
370
|
env: Env,
|
|
314
|
-
ctx: ExecutionContext
|
|
371
|
+
ctx: ExecutionContext,
|
|
315
372
|
) => Response | Promise<Response>;
|
|
316
373
|
declare type ExportedHandlerTailHandler<Env = unknown> = (
|
|
317
374
|
events: TraceItem[],
|
|
318
375
|
env: Env,
|
|
319
|
-
ctx: ExecutionContext
|
|
376
|
+
ctx: ExecutionContext,
|
|
320
377
|
) => void | Promise<void>;
|
|
321
378
|
declare type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
322
379
|
traces: TraceItem[],
|
|
323
380
|
env: Env,
|
|
324
|
-
ctx: ExecutionContext
|
|
381
|
+
ctx: ExecutionContext,
|
|
325
382
|
) => void | Promise<void>;
|
|
326
383
|
declare type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
327
384
|
controller: ScheduledController,
|
|
328
385
|
env: Env,
|
|
329
|
-
ctx: ExecutionContext
|
|
386
|
+
ctx: ExecutionContext,
|
|
330
387
|
) => void | Promise<void>;
|
|
331
388
|
declare type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
|
|
332
389
|
batch: MessageBatch<Message>,
|
|
333
390
|
env: Env,
|
|
334
|
-
ctx: ExecutionContext
|
|
391
|
+
ctx: ExecutionContext,
|
|
335
392
|
) => void | Promise<void>;
|
|
336
393
|
declare type ExportedHandlerTestHandler<Env = unknown> = (
|
|
337
394
|
controller: TestController,
|
|
338
395
|
env: Env,
|
|
339
|
-
ctx: ExecutionContext
|
|
396
|
+
ctx: ExecutionContext,
|
|
340
397
|
) => void | Promise<void>;
|
|
341
398
|
declare interface ExportedHandler<
|
|
342
399
|
Env = unknown,
|
|
343
400
|
QueueHandlerMessage = unknown,
|
|
344
|
-
CfHostMetadata = unknown
|
|
401
|
+
CfHostMetadata = unknown,
|
|
345
402
|
> {
|
|
346
403
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
347
404
|
tail?: ExportedHandlerTailHandler<Env>;
|
|
@@ -355,7 +412,9 @@ declare interface StructuredSerializeOptions {
|
|
|
355
412
|
transfer?: any[];
|
|
356
413
|
}
|
|
357
414
|
declare abstract class PromiseRejectionEvent extends Event {
|
|
415
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
|
|
358
416
|
readonly promise: Promise<any>;
|
|
417
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
|
|
359
418
|
readonly reason: any;
|
|
360
419
|
}
|
|
361
420
|
declare abstract class Navigator {
|
|
@@ -367,14 +426,20 @@ declare abstract class Navigator {
|
|
|
367
426
|
| (ArrayBuffer | ArrayBufferView)
|
|
368
427
|
| Blob
|
|
369
428
|
| URLSearchParams
|
|
370
|
-
| FormData
|
|
429
|
+
| FormData,
|
|
371
430
|
): boolean;
|
|
372
431
|
readonly userAgent: string;
|
|
373
432
|
readonly gpu: gpuGPU;
|
|
374
433
|
}
|
|
375
|
-
/**
|
|
434
|
+
/**
|
|
435
|
+
* Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API.
|
|
436
|
+
*
|
|
437
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
|
|
438
|
+
*/
|
|
376
439
|
declare interface Performance {
|
|
440
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
|
|
377
441
|
readonly timeOrigin: number;
|
|
442
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
|
|
378
443
|
now(): number;
|
|
379
444
|
}
|
|
380
445
|
declare interface AlarmInvocationInfo {
|
|
@@ -386,36 +451,42 @@ declare interface DurableObject {
|
|
|
386
451
|
alarm?(): void | Promise<void>;
|
|
387
452
|
webSocketMessage?(
|
|
388
453
|
ws: WebSocket,
|
|
389
|
-
message: string | ArrayBuffer
|
|
454
|
+
message: string | ArrayBuffer,
|
|
390
455
|
): void | Promise<void>;
|
|
391
456
|
webSocketClose?(
|
|
392
457
|
ws: WebSocket,
|
|
393
458
|
code: number,
|
|
394
459
|
reason: string,
|
|
395
|
-
wasClean: boolean
|
|
460
|
+
wasClean: boolean,
|
|
396
461
|
): void | Promise<void>;
|
|
397
462
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
398
463
|
}
|
|
399
|
-
declare
|
|
464
|
+
declare type DurableObjectStub<
|
|
465
|
+
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
466
|
+
> = Fetcher<
|
|
467
|
+
T,
|
|
468
|
+
"alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
|
|
469
|
+
> & {
|
|
400
470
|
readonly id: DurableObjectId;
|
|
401
471
|
readonly name?: string;
|
|
402
|
-
}
|
|
472
|
+
};
|
|
403
473
|
declare interface DurableObjectId {
|
|
404
474
|
toString(): string;
|
|
405
475
|
equals(other: DurableObjectId): boolean;
|
|
406
476
|
readonly name?: string;
|
|
407
477
|
}
|
|
408
|
-
declare interface DurableObjectNamespace
|
|
478
|
+
declare interface DurableObjectNamespace<
|
|
479
|
+
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
480
|
+
> {
|
|
409
481
|
newUniqueId(
|
|
410
|
-
options?: DurableObjectNamespaceNewUniqueIdOptions
|
|
482
|
+
options?: DurableObjectNamespaceNewUniqueIdOptions,
|
|
411
483
|
): DurableObjectId;
|
|
412
484
|
idFromName(name: string): DurableObjectId;
|
|
413
485
|
idFromString(id: string): DurableObjectId;
|
|
414
|
-
get(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
):
|
|
418
|
-
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
|
|
486
|
+
get(id: DurableObjectId): DurableObjectStub<T>;
|
|
487
|
+
jurisdiction(
|
|
488
|
+
jurisdiction: DurableObjectJurisdiction,
|
|
489
|
+
): DurableObjectNamespace<T>;
|
|
419
490
|
}
|
|
420
491
|
declare type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
421
492
|
declare interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
@@ -451,23 +522,23 @@ declare interface DurableObjectState {
|
|
|
451
522
|
declare interface DurableObjectTransaction {
|
|
452
523
|
get<T = unknown>(
|
|
453
524
|
key: string,
|
|
454
|
-
options?: DurableObjectGetOptions
|
|
525
|
+
options?: DurableObjectGetOptions,
|
|
455
526
|
): Promise<T | undefined>;
|
|
456
527
|
get<T = unknown>(
|
|
457
528
|
keys: string[],
|
|
458
|
-
options?: DurableObjectGetOptions
|
|
529
|
+
options?: DurableObjectGetOptions,
|
|
459
530
|
): Promise<Map<string, T>>;
|
|
460
531
|
list<T = unknown>(
|
|
461
|
-
options?: DurableObjectListOptions
|
|
532
|
+
options?: DurableObjectListOptions,
|
|
462
533
|
): Promise<Map<string, T>>;
|
|
463
534
|
put<T>(
|
|
464
535
|
key: string,
|
|
465
536
|
value: T,
|
|
466
|
-
options?: DurableObjectPutOptions
|
|
537
|
+
options?: DurableObjectPutOptions,
|
|
467
538
|
): Promise<void>;
|
|
468
539
|
put<T>(
|
|
469
540
|
entries: Record<string, T>,
|
|
470
|
-
options?: DurableObjectPutOptions
|
|
541
|
+
options?: DurableObjectPutOptions,
|
|
471
542
|
): Promise<void>;
|
|
472
543
|
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
|
|
473
544
|
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
|
|
@@ -475,41 +546,41 @@ declare interface DurableObjectTransaction {
|
|
|
475
546
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
476
547
|
setAlarm(
|
|
477
548
|
scheduledTime: number | Date,
|
|
478
|
-
options?: DurableObjectSetAlarmOptions
|
|
549
|
+
options?: DurableObjectSetAlarmOptions,
|
|
479
550
|
): Promise<void>;
|
|
480
551
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
481
552
|
}
|
|
482
553
|
declare interface DurableObjectStorage {
|
|
483
554
|
get<T = unknown>(
|
|
484
555
|
key: string,
|
|
485
|
-
options?: DurableObjectGetOptions
|
|
556
|
+
options?: DurableObjectGetOptions,
|
|
486
557
|
): Promise<T | undefined>;
|
|
487
558
|
get<T = unknown>(
|
|
488
559
|
keys: string[],
|
|
489
|
-
options?: DurableObjectGetOptions
|
|
560
|
+
options?: DurableObjectGetOptions,
|
|
490
561
|
): Promise<Map<string, T>>;
|
|
491
562
|
list<T = unknown>(
|
|
492
|
-
options?: DurableObjectListOptions
|
|
563
|
+
options?: DurableObjectListOptions,
|
|
493
564
|
): Promise<Map<string, T>>;
|
|
494
565
|
put<T>(
|
|
495
566
|
key: string,
|
|
496
567
|
value: T,
|
|
497
|
-
options?: DurableObjectPutOptions
|
|
568
|
+
options?: DurableObjectPutOptions,
|
|
498
569
|
): Promise<void>;
|
|
499
570
|
put<T>(
|
|
500
571
|
entries: Record<string, T>,
|
|
501
|
-
options?: DurableObjectPutOptions
|
|
572
|
+
options?: DurableObjectPutOptions,
|
|
502
573
|
): Promise<void>;
|
|
503
574
|
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
|
|
504
575
|
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
|
|
505
576
|
deleteAll(options?: DurableObjectPutOptions): Promise<void>;
|
|
506
577
|
transaction<T>(
|
|
507
|
-
closure: (txn: DurableObjectTransaction) => Promise<T
|
|
578
|
+
closure: (txn: DurableObjectTransaction) => Promise<T>,
|
|
508
579
|
): Promise<T>;
|
|
509
580
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
510
581
|
setAlarm(
|
|
511
582
|
scheduledTime: number | Date,
|
|
512
|
-
options?: DurableObjectSetAlarmOptions
|
|
583
|
+
options?: DurableObjectSetAlarmOptions,
|
|
513
584
|
): Promise<void>;
|
|
514
585
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
515
586
|
sync(): Promise<void>;
|
|
@@ -556,22 +627,107 @@ declare interface AnalyticsEngineDataPoint {
|
|
|
556
627
|
}
|
|
557
628
|
declare class Event {
|
|
558
629
|
constructor(type: string, init?: EventInit);
|
|
630
|
+
/**
|
|
631
|
+
* Returns the type of event, e.g. "click", "hashchange", or "submit".
|
|
632
|
+
*
|
|
633
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
|
634
|
+
*/
|
|
559
635
|
get type(): string;
|
|
636
|
+
/**
|
|
637
|
+
* Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
|
|
638
|
+
*
|
|
639
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
|
640
|
+
*/
|
|
560
641
|
get eventPhase(): number;
|
|
642
|
+
/**
|
|
643
|
+
* Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
|
|
644
|
+
*
|
|
645
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
|
646
|
+
*/
|
|
561
647
|
get composed(): boolean;
|
|
648
|
+
/**
|
|
649
|
+
* Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
|
|
650
|
+
*
|
|
651
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
|
|
652
|
+
*/
|
|
562
653
|
get bubbles(): boolean;
|
|
654
|
+
/**
|
|
655
|
+
* Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
|
|
656
|
+
*
|
|
657
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
|
|
658
|
+
*/
|
|
563
659
|
get cancelable(): boolean;
|
|
660
|
+
/**
|
|
661
|
+
* Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
|
|
662
|
+
*
|
|
663
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
|
|
664
|
+
*/
|
|
564
665
|
get defaultPrevented(): boolean;
|
|
666
|
+
/**
|
|
667
|
+
* @deprecated
|
|
668
|
+
*
|
|
669
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
|
|
670
|
+
*/
|
|
565
671
|
get returnValue(): boolean;
|
|
672
|
+
/**
|
|
673
|
+
* Returns the object whose event listener's callback is currently being invoked.
|
|
674
|
+
*
|
|
675
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
|
|
676
|
+
*/
|
|
566
677
|
get currentTarget(): EventTarget | undefined;
|
|
678
|
+
/**
|
|
679
|
+
* @deprecated
|
|
680
|
+
*
|
|
681
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
|
682
|
+
*/
|
|
567
683
|
get srcElement(): EventTarget | undefined;
|
|
684
|
+
/**
|
|
685
|
+
* Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
|
|
686
|
+
*
|
|
687
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
|
|
688
|
+
*/
|
|
568
689
|
get timeStamp(): number;
|
|
690
|
+
/**
|
|
691
|
+
* Returns true if event was dispatched by the user agent, and false otherwise.
|
|
692
|
+
*
|
|
693
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
|
694
|
+
*/
|
|
569
695
|
get isTrusted(): boolean;
|
|
696
|
+
/**
|
|
697
|
+
* @deprecated
|
|
698
|
+
*
|
|
699
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
|
700
|
+
*/
|
|
570
701
|
get cancelBubble(): boolean;
|
|
702
|
+
/**
|
|
703
|
+
* @deprecated
|
|
704
|
+
*
|
|
705
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
|
706
|
+
*/
|
|
571
707
|
set cancelBubble(value: boolean);
|
|
708
|
+
/**
|
|
709
|
+
* Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
|
|
710
|
+
*
|
|
711
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
|
712
|
+
*/
|
|
572
713
|
stopImmediatePropagation(): void;
|
|
714
|
+
/**
|
|
715
|
+
* If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
|
|
716
|
+
*
|
|
717
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
|
718
|
+
*/
|
|
573
719
|
preventDefault(): void;
|
|
720
|
+
/**
|
|
721
|
+
* When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
|
|
722
|
+
*
|
|
723
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
|
724
|
+
*/
|
|
574
725
|
stopPropagation(): void;
|
|
726
|
+
/**
|
|
727
|
+
* Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
|
|
728
|
+
*
|
|
729
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
|
730
|
+
*/
|
|
575
731
|
composedPath(): EventTarget[];
|
|
576
732
|
static readonly NONE: number;
|
|
577
733
|
static readonly CAPTURING_PHASE: number;
|
|
@@ -584,28 +740,55 @@ declare interface EventInit {
|
|
|
584
740
|
composed?: boolean;
|
|
585
741
|
}
|
|
586
742
|
declare type EventListener<EventType extends Event = Event> = (
|
|
587
|
-
event: EventType
|
|
743
|
+
event: EventType,
|
|
588
744
|
) => void;
|
|
589
745
|
declare interface EventListenerObject<EventType extends Event = Event> {
|
|
590
746
|
handleEvent(event: EventType): void;
|
|
591
747
|
}
|
|
592
748
|
declare type EventListenerOrEventListenerObject<
|
|
593
|
-
EventType extends Event = Event
|
|
749
|
+
EventType extends Event = Event,
|
|
594
750
|
> = EventListener<EventType> | EventListenerObject<EventType>;
|
|
595
751
|
declare class EventTarget<
|
|
596
|
-
EventMap extends Record<string, Event> = Record<string, Event
|
|
752
|
+
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
597
753
|
> {
|
|
598
754
|
constructor();
|
|
755
|
+
/**
|
|
756
|
+
* Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
|
757
|
+
*
|
|
758
|
+
* The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
|
759
|
+
*
|
|
760
|
+
* When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
|
761
|
+
*
|
|
762
|
+
* When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
|
763
|
+
*
|
|
764
|
+
* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
765
|
+
*
|
|
766
|
+
* If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
767
|
+
*
|
|
768
|
+
* The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
769
|
+
*
|
|
770
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
771
|
+
*/
|
|
599
772
|
addEventListener<Type extends keyof EventMap>(
|
|
600
773
|
type: Type,
|
|
601
774
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
602
|
-
options?: EventTargetAddEventListenerOptions | boolean
|
|
775
|
+
options?: EventTargetAddEventListenerOptions | boolean,
|
|
603
776
|
): void;
|
|
777
|
+
/**
|
|
778
|
+
* Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
779
|
+
*
|
|
780
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
781
|
+
*/
|
|
604
782
|
removeEventListener<Type extends keyof EventMap>(
|
|
605
783
|
type: Type,
|
|
606
784
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
607
|
-
options?: EventTargetEventListenerOptions | boolean
|
|
785
|
+
options?: EventTargetEventListenerOptions | boolean,
|
|
608
786
|
): void;
|
|
787
|
+
/**
|
|
788
|
+
* Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
|
|
789
|
+
*
|
|
790
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
791
|
+
*/
|
|
609
792
|
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
|
|
610
793
|
}
|
|
611
794
|
declare interface EventTargetEventListenerOptions {
|
|
@@ -622,15 +805,34 @@ declare interface EventTargetHandlerObject {
|
|
|
622
805
|
}
|
|
623
806
|
declare class AbortController {
|
|
624
807
|
constructor();
|
|
808
|
+
/**
|
|
809
|
+
* Returns the AbortSignal object associated with this object.
|
|
810
|
+
*
|
|
811
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
|
|
812
|
+
*/
|
|
625
813
|
get signal(): AbortSignal;
|
|
814
|
+
/**
|
|
815
|
+
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
816
|
+
*
|
|
817
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
|
818
|
+
*/
|
|
626
819
|
abort(reason?: any): void;
|
|
627
820
|
}
|
|
628
821
|
declare abstract class AbortSignal extends EventTarget {
|
|
822
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
629
823
|
static abort(reason?: any): AbortSignal;
|
|
824
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
630
825
|
static timeout(delay: number): AbortSignal;
|
|
631
826
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
827
|
+
/**
|
|
828
|
+
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
829
|
+
*
|
|
830
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
831
|
+
*/
|
|
632
832
|
get aborted(): boolean;
|
|
833
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
633
834
|
get reason(): any;
|
|
835
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
634
836
|
throwIfAborted(): void;
|
|
635
837
|
}
|
|
636
838
|
declare interface Scheduler {
|
|
@@ -640,10 +842,16 @@ declare interface SchedulerWaitOptions {
|
|
|
640
842
|
signal?: AbortSignal;
|
|
641
843
|
}
|
|
642
844
|
declare abstract class ExtendableEvent extends Event {
|
|
845
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
643
846
|
waitUntil(promise: Promise<any>): void;
|
|
644
847
|
}
|
|
645
848
|
declare class CustomEvent<T = any> extends Event {
|
|
646
849
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
850
|
+
/**
|
|
851
|
+
* Returns any custom data event was created with. Typically used for synthetic events.
|
|
852
|
+
*
|
|
853
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
|
|
854
|
+
*/
|
|
647
855
|
get detail(): T;
|
|
648
856
|
}
|
|
649
857
|
declare interface CustomEventCustomEventInit {
|
|
@@ -655,13 +863,19 @@ declare interface CustomEventCustomEventInit {
|
|
|
655
863
|
declare class Blob {
|
|
656
864
|
constructor(
|
|
657
865
|
bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
658
|
-
options?: BlobOptions
|
|
866
|
+
options?: BlobOptions,
|
|
659
867
|
);
|
|
868
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
660
869
|
get size(): number;
|
|
870
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
661
871
|
get type(): string;
|
|
872
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
662
873
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
874
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
663
875
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
876
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
664
877
|
text(): Promise<string>;
|
|
878
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
665
879
|
stream(): ReadableStream;
|
|
666
880
|
}
|
|
667
881
|
declare interface BlobOptions {
|
|
@@ -671,9 +885,11 @@ declare class File extends Blob {
|
|
|
671
885
|
constructor(
|
|
672
886
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
673
887
|
name: string,
|
|
674
|
-
options?: FileOptions
|
|
888
|
+
options?: FileOptions,
|
|
675
889
|
);
|
|
890
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
676
891
|
get name(): string;
|
|
892
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
677
893
|
get lastModified(): number;
|
|
678
894
|
}
|
|
679
895
|
declare interface FileOptions {
|
|
@@ -681,6 +897,7 @@ declare interface FileOptions {
|
|
|
681
897
|
lastModified?: number;
|
|
682
898
|
}
|
|
683
899
|
declare abstract class CacheStorage {
|
|
900
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
684
901
|
open(cacheName: string): Promise<Cache>;
|
|
685
902
|
readonly default: Cache;
|
|
686
903
|
}
|
|
@@ -688,7 +905,7 @@ declare abstract class Cache {
|
|
|
688
905
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
689
906
|
match(
|
|
690
907
|
request: RequestInfo,
|
|
691
|
-
options?: CacheQueryOptions
|
|
908
|
+
options?: CacheQueryOptions,
|
|
692
909
|
): Promise<Response | undefined>;
|
|
693
910
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
694
911
|
}
|
|
@@ -696,7 +913,13 @@ declare interface CacheQueryOptions {
|
|
|
696
913
|
ignoreMethod?: boolean;
|
|
697
914
|
}
|
|
698
915
|
declare abstract class Crypto {
|
|
916
|
+
/**
|
|
917
|
+
* Available only in secure contexts.
|
|
918
|
+
*
|
|
919
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
920
|
+
*/
|
|
699
921
|
get subtle(): SubtleCrypto;
|
|
922
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
700
923
|
getRandomValues<
|
|
701
924
|
T extends
|
|
702
925
|
| Int8Array
|
|
@@ -706,8 +929,13 @@ declare abstract class Crypto {
|
|
|
706
929
|
| Int32Array
|
|
707
930
|
| Uint32Array
|
|
708
931
|
| BigInt64Array
|
|
709
|
-
| BigUint64Array
|
|
932
|
+
| BigUint64Array,
|
|
710
933
|
>(buffer: T): T;
|
|
934
|
+
/**
|
|
935
|
+
* Available only in secure contexts.
|
|
936
|
+
*
|
|
937
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
938
|
+
*/
|
|
711
939
|
randomUUID(): string;
|
|
712
940
|
DigestStream: typeof DigestStream;
|
|
713
941
|
}
|
|
@@ -715,59 +943,63 @@ declare abstract class SubtleCrypto {
|
|
|
715
943
|
encrypt(
|
|
716
944
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
717
945
|
key: CryptoKey,
|
|
718
|
-
plainText: ArrayBuffer | ArrayBufferView
|
|
946
|
+
plainText: ArrayBuffer | ArrayBufferView,
|
|
719
947
|
): Promise<ArrayBuffer>;
|
|
720
948
|
decrypt(
|
|
721
949
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
722
950
|
key: CryptoKey,
|
|
723
|
-
cipherText: ArrayBuffer | ArrayBufferView
|
|
951
|
+
cipherText: ArrayBuffer | ArrayBufferView,
|
|
724
952
|
): Promise<ArrayBuffer>;
|
|
725
953
|
sign(
|
|
726
954
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
727
955
|
key: CryptoKey,
|
|
728
|
-
data: ArrayBuffer | ArrayBufferView
|
|
956
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
729
957
|
): Promise<ArrayBuffer>;
|
|
730
958
|
verify(
|
|
731
959
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
732
960
|
key: CryptoKey,
|
|
733
961
|
signature: ArrayBuffer | ArrayBufferView,
|
|
734
|
-
data: ArrayBuffer | ArrayBufferView
|
|
962
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
735
963
|
): Promise<boolean>;
|
|
736
964
|
digest(
|
|
737
965
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
738
|
-
data: ArrayBuffer | ArrayBufferView
|
|
966
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
739
967
|
): Promise<ArrayBuffer>;
|
|
968
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
740
969
|
generateKey(
|
|
741
970
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
742
971
|
extractable: boolean,
|
|
743
|
-
keyUsages: string[]
|
|
972
|
+
keyUsages: string[],
|
|
744
973
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
974
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
745
975
|
deriveKey(
|
|
746
976
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
747
977
|
baseKey: CryptoKey,
|
|
748
978
|
derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
749
979
|
extractable: boolean,
|
|
750
|
-
keyUsages: string[]
|
|
980
|
+
keyUsages: string[],
|
|
751
981
|
): Promise<CryptoKey>;
|
|
752
982
|
deriveBits(
|
|
753
983
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
754
984
|
baseKey: CryptoKey,
|
|
755
|
-
length: number | null
|
|
985
|
+
length: number | null,
|
|
756
986
|
): Promise<ArrayBuffer>;
|
|
987
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
757
988
|
importKey(
|
|
758
989
|
format: string,
|
|
759
990
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
760
991
|
algorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
761
992
|
extractable: boolean,
|
|
762
|
-
keyUsages: string[]
|
|
993
|
+
keyUsages: string[],
|
|
763
994
|
): Promise<CryptoKey>;
|
|
764
995
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
765
996
|
wrapKey(
|
|
766
997
|
format: string,
|
|
767
998
|
key: CryptoKey,
|
|
768
999
|
wrappingKey: CryptoKey,
|
|
769
|
-
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm
|
|
1000
|
+
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
770
1001
|
): Promise<ArrayBuffer>;
|
|
1002
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
771
1003
|
unwrapKey(
|
|
772
1004
|
format: string,
|
|
773
1005
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -775,16 +1007,19 @@ declare abstract class SubtleCrypto {
|
|
|
775
1007
|
unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
776
1008
|
unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
777
1009
|
extractable: boolean,
|
|
778
|
-
keyUsages: string[]
|
|
1010
|
+
keyUsages: string[],
|
|
779
1011
|
): Promise<CryptoKey>;
|
|
780
1012
|
timingSafeEqual(
|
|
781
1013
|
a: ArrayBuffer | ArrayBufferView,
|
|
782
|
-
b: ArrayBuffer | ArrayBufferView
|
|
1014
|
+
b: ArrayBuffer | ArrayBufferView,
|
|
783
1015
|
): boolean;
|
|
784
1016
|
}
|
|
785
1017
|
declare abstract class CryptoKey {
|
|
1018
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
786
1019
|
readonly type: string;
|
|
1020
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
787
1021
|
readonly extractable: boolean;
|
|
1022
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
788
1023
|
readonly algorithm:
|
|
789
1024
|
| CryptoKeyKeyAlgorithm
|
|
790
1025
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -792,6 +1027,7 @@ declare abstract class CryptoKey {
|
|
|
792
1027
|
| CryptoKeyRsaKeyAlgorithm
|
|
793
1028
|
| CryptoKeyEllipticKeyAlgorithm
|
|
794
1029
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1030
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
795
1031
|
readonly usages: string[];
|
|
796
1032
|
}
|
|
797
1033
|
declare interface CryptoKeyPair {
|
|
@@ -900,9 +1136,24 @@ declare class DigestStream extends WritableStream<
|
|
|
900
1136
|
}
|
|
901
1137
|
declare class TextDecoder {
|
|
902
1138
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1139
|
+
/**
|
|
1140
|
+
* Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
|
|
1141
|
+
*
|
|
1142
|
+
* ```
|
|
1143
|
+
* var string = "", decoder = new TextDecoder(encoding), buffer;
|
|
1144
|
+
* while(buffer = next_chunk()) {
|
|
1145
|
+
* string += decoder.decode(buffer, {stream:true});
|
|
1146
|
+
* }
|
|
1147
|
+
* string += decoder.decode(); // end-of-queue
|
|
1148
|
+
* ```
|
|
1149
|
+
*
|
|
1150
|
+
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
|
|
1151
|
+
*
|
|
1152
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
|
|
1153
|
+
*/
|
|
903
1154
|
decode(
|
|
904
1155
|
input?: ArrayBuffer | ArrayBufferView,
|
|
905
|
-
options?: TextDecoderDecodeOptions
|
|
1156
|
+
options?: TextDecoderDecodeOptions,
|
|
906
1157
|
): string;
|
|
907
1158
|
get encoding(): string;
|
|
908
1159
|
get fatal(): boolean;
|
|
@@ -910,10 +1161,20 @@ declare class TextDecoder {
|
|
|
910
1161
|
}
|
|
911
1162
|
declare class TextEncoder {
|
|
912
1163
|
constructor();
|
|
1164
|
+
/**
|
|
1165
|
+
* Returns the result of running UTF-8's encoder.
|
|
1166
|
+
*
|
|
1167
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
|
1168
|
+
*/
|
|
913
1169
|
encode(input?: string): Uint8Array;
|
|
1170
|
+
/**
|
|
1171
|
+
* Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
|
|
1172
|
+
*
|
|
1173
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
|
1174
|
+
*/
|
|
914
1175
|
encodeInto(
|
|
915
1176
|
input: string,
|
|
916
|
-
buffer: ArrayBuffer | ArrayBufferView
|
|
1177
|
+
buffer: ArrayBuffer | ArrayBufferView,
|
|
917
1178
|
): TextEncoderEncodeIntoResult;
|
|
918
1179
|
get encoding(): string;
|
|
919
1180
|
}
|
|
@@ -938,17 +1199,20 @@ declare class FormData {
|
|
|
938
1199
|
has(name: string): boolean;
|
|
939
1200
|
set(name: string, value: string): void;
|
|
940
1201
|
set(name: string, value: Blob, filename?: string): void;
|
|
1202
|
+
/** Returns an array of key, value pairs for every entry in the list. */
|
|
941
1203
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1204
|
+
/** Returns a list of keys in the list. */
|
|
942
1205
|
keys(): IterableIterator<string>;
|
|
1206
|
+
/** Returns a list of values in the list. */
|
|
943
1207
|
values(): IterableIterator<File | string>;
|
|
944
1208
|
forEach<This = unknown>(
|
|
945
1209
|
callback: (
|
|
946
1210
|
this: This,
|
|
947
1211
|
value: File | string,
|
|
948
1212
|
key: string,
|
|
949
|
-
parent: FormData
|
|
1213
|
+
parent: FormData,
|
|
950
1214
|
) => void,
|
|
951
|
-
thisArg?: This
|
|
1215
|
+
thisArg?: This,
|
|
952
1216
|
): void;
|
|
953
1217
|
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
|
|
954
1218
|
}
|
|
@@ -959,7 +1223,7 @@ declare class HTMLRewriter {
|
|
|
959
1223
|
constructor();
|
|
960
1224
|
on(
|
|
961
1225
|
selector: string,
|
|
962
|
-
handlers: HTMLRewriterElementContentHandlers
|
|
1226
|
+
handlers: HTMLRewriterElementContentHandlers,
|
|
963
1227
|
): HTMLRewriter;
|
|
964
1228
|
onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
|
|
965
1229
|
transform(response: Response): Response;
|
|
@@ -1026,7 +1290,9 @@ declare interface DocumentEnd {
|
|
|
1026
1290
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
1027
1291
|
}
|
|
1028
1292
|
declare abstract class FetchEvent extends ExtendableEvent {
|
|
1293
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
1029
1294
|
readonly request: Request;
|
|
1295
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
1030
1296
|
respondWith(promise: Response | Promise<Response>): void;
|
|
1031
1297
|
passThroughOnException(): void;
|
|
1032
1298
|
}
|
|
@@ -1044,10 +1310,13 @@ declare class Headers {
|
|
|
1044
1310
|
delete(name: string): void;
|
|
1045
1311
|
forEach<This = unknown>(
|
|
1046
1312
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
1047
|
-
thisArg?: This
|
|
1313
|
+
thisArg?: This,
|
|
1048
1314
|
): void;
|
|
1315
|
+
/** Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
1049
1316
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1317
|
+
/** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
1050
1318
|
keys(): IterableIterator<string>;
|
|
1319
|
+
/** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
1051
1320
|
values(): IterableIterator<string>;
|
|
1052
1321
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1053
1322
|
}
|
|
@@ -1070,14 +1339,23 @@ declare abstract class Body {
|
|
|
1070
1339
|
}
|
|
1071
1340
|
declare class Response extends Body {
|
|
1072
1341
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1342
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1073
1343
|
static redirect(url: string, status?: number): Response;
|
|
1344
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1074
1345
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1346
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1075
1347
|
clone(): Response;
|
|
1348
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1076
1349
|
get status(): number;
|
|
1350
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1077
1351
|
get statusText(): string;
|
|
1352
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1078
1353
|
get headers(): Headers;
|
|
1354
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1079
1355
|
get ok(): boolean;
|
|
1356
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1080
1357
|
get redirected(): boolean;
|
|
1358
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1081
1359
|
get url(): string;
|
|
1082
1360
|
get webSocket(): WebSocket | null;
|
|
1083
1361
|
get cf(): any | undefined;
|
|
@@ -1092,22 +1370,58 @@ declare interface ResponseInit {
|
|
|
1092
1370
|
}
|
|
1093
1371
|
declare type RequestInfo<
|
|
1094
1372
|
CfHostMetadata = unknown,
|
|
1095
|
-
Cf = CfProperties<CfHostMetadata
|
|
1373
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1096
1374
|
> = Request<CfHostMetadata, Cf> | string | URL;
|
|
1097
1375
|
declare class Request<
|
|
1098
1376
|
CfHostMetadata = unknown,
|
|
1099
|
-
Cf = CfProperties<CfHostMetadata
|
|
1377
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1100
1378
|
> extends Body {
|
|
1101
1379
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1380
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1102
1381
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1382
|
+
/**
|
|
1383
|
+
* Returns request's HTTP method, which is "GET" by default.
|
|
1384
|
+
*
|
|
1385
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1386
|
+
*/
|
|
1103
1387
|
get method(): string;
|
|
1388
|
+
/**
|
|
1389
|
+
* Returns the URL of request as a string.
|
|
1390
|
+
*
|
|
1391
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1392
|
+
*/
|
|
1104
1393
|
get url(): string;
|
|
1394
|
+
/**
|
|
1395
|
+
* Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
|
|
1396
|
+
*
|
|
1397
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1398
|
+
*/
|
|
1105
1399
|
get headers(): Headers;
|
|
1400
|
+
/**
|
|
1401
|
+
* Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
|
|
1402
|
+
*
|
|
1403
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1404
|
+
*/
|
|
1106
1405
|
get redirect(): string;
|
|
1107
1406
|
get fetcher(): Fetcher | null;
|
|
1407
|
+
/**
|
|
1408
|
+
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1409
|
+
*
|
|
1410
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1411
|
+
*/
|
|
1108
1412
|
get signal(): AbortSignal;
|
|
1109
1413
|
get cf(): Cf | undefined;
|
|
1414
|
+
/**
|
|
1415
|
+
* Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
|
|
1416
|
+
*
|
|
1417
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1418
|
+
*/
|
|
1110
1419
|
get integrity(): string;
|
|
1420
|
+
/**
|
|
1421
|
+
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1422
|
+
*
|
|
1423
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1424
|
+
*/
|
|
1111
1425
|
get keepalive(): boolean;
|
|
1112
1426
|
}
|
|
1113
1427
|
declare interface RequestInit<Cf = CfProperties> {
|
|
@@ -1126,10 +1440,18 @@ declare interface RequestInit<Cf = CfProperties> {
|
|
|
1126
1440
|
/** An AbortSignal to set request's signal. */
|
|
1127
1441
|
signal?: AbortSignal | null;
|
|
1128
1442
|
}
|
|
1129
|
-
declare
|
|
1443
|
+
declare type Service<
|
|
1444
|
+
T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
|
|
1445
|
+
> = Fetcher<T>;
|
|
1446
|
+
declare type Fetcher<
|
|
1447
|
+
T extends Rpc.EntrypointBranded | undefined = undefined,
|
|
1448
|
+
Reserved extends string = never,
|
|
1449
|
+
> = (T extends Rpc.EntrypointBranded
|
|
1450
|
+
? Rpc.Provider<T, Reserved | "fetch" | "connect">
|
|
1451
|
+
: unknown) & {
|
|
1130
1452
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1131
1453
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1132
|
-
}
|
|
1454
|
+
};
|
|
1133
1455
|
declare interface FetcherPutOptions {
|
|
1134
1456
|
expiration?: number;
|
|
1135
1457
|
expirationTtl?: number;
|
|
@@ -1154,74 +1476,74 @@ declare type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
|
1154
1476
|
declare interface KVNamespace<Key extends string = string> {
|
|
1155
1477
|
get(
|
|
1156
1478
|
key: Key,
|
|
1157
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1479
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1158
1480
|
): Promise<string | null>;
|
|
1159
1481
|
get(key: Key, type: "text"): Promise<string | null>;
|
|
1160
1482
|
get<ExpectedValue = unknown>(
|
|
1161
1483
|
key: Key,
|
|
1162
|
-
type: "json"
|
|
1484
|
+
type: "json",
|
|
1163
1485
|
): Promise<ExpectedValue | null>;
|
|
1164
1486
|
get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
|
|
1165
1487
|
get(key: Key, type: "stream"): Promise<ReadableStream | null>;
|
|
1166
1488
|
get(
|
|
1167
1489
|
key: Key,
|
|
1168
|
-
options?: KVNamespaceGetOptions<"text"
|
|
1490
|
+
options?: KVNamespaceGetOptions<"text">,
|
|
1169
1491
|
): Promise<string | null>;
|
|
1170
1492
|
get<ExpectedValue = unknown>(
|
|
1171
1493
|
key: Key,
|
|
1172
|
-
options?: KVNamespaceGetOptions<"json"
|
|
1494
|
+
options?: KVNamespaceGetOptions<"json">,
|
|
1173
1495
|
): Promise<ExpectedValue | null>;
|
|
1174
1496
|
get(
|
|
1175
1497
|
key: Key,
|
|
1176
|
-
options?: KVNamespaceGetOptions<"arrayBuffer"
|
|
1498
|
+
options?: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1177
1499
|
): Promise<ArrayBuffer | null>;
|
|
1178
1500
|
get(
|
|
1179
1501
|
key: Key,
|
|
1180
|
-
options?: KVNamespaceGetOptions<"stream"
|
|
1502
|
+
options?: KVNamespaceGetOptions<"stream">,
|
|
1181
1503
|
): Promise<ReadableStream | null>;
|
|
1182
1504
|
list<Metadata = unknown>(
|
|
1183
|
-
options?: KVNamespaceListOptions
|
|
1505
|
+
options?: KVNamespaceListOptions,
|
|
1184
1506
|
): Promise<KVNamespaceListResult<Metadata, Key>>;
|
|
1185
1507
|
put(
|
|
1186
1508
|
key: Key,
|
|
1187
1509
|
value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
|
|
1188
|
-
options?: KVNamespacePutOptions
|
|
1510
|
+
options?: KVNamespacePutOptions,
|
|
1189
1511
|
): Promise<void>;
|
|
1190
1512
|
getWithMetadata<Metadata = unknown>(
|
|
1191
1513
|
key: Key,
|
|
1192
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1514
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1193
1515
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1194
1516
|
getWithMetadata<Metadata = unknown>(
|
|
1195
1517
|
key: Key,
|
|
1196
|
-
type: "text"
|
|
1518
|
+
type: "text",
|
|
1197
1519
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1198
1520
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1199
1521
|
key: Key,
|
|
1200
|
-
type: "json"
|
|
1522
|
+
type: "json",
|
|
1201
1523
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1202
1524
|
getWithMetadata<Metadata = unknown>(
|
|
1203
1525
|
key: Key,
|
|
1204
|
-
type: "arrayBuffer"
|
|
1526
|
+
type: "arrayBuffer",
|
|
1205
1527
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1206
1528
|
getWithMetadata<Metadata = unknown>(
|
|
1207
1529
|
key: Key,
|
|
1208
|
-
type: "stream"
|
|
1530
|
+
type: "stream",
|
|
1209
1531
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1210
1532
|
getWithMetadata<Metadata = unknown>(
|
|
1211
1533
|
key: Key,
|
|
1212
|
-
options: KVNamespaceGetOptions<"text"
|
|
1534
|
+
options: KVNamespaceGetOptions<"text">,
|
|
1213
1535
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1214
1536
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1215
1537
|
key: Key,
|
|
1216
|
-
options: KVNamespaceGetOptions<"json"
|
|
1538
|
+
options: KVNamespaceGetOptions<"json">,
|
|
1217
1539
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1218
1540
|
getWithMetadata<Metadata = unknown>(
|
|
1219
1541
|
key: Key,
|
|
1220
|
-
options: KVNamespaceGetOptions<"arrayBuffer"
|
|
1542
|
+
options: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1221
1543
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1222
1544
|
getWithMetadata<Metadata = unknown>(
|
|
1223
1545
|
key: Key,
|
|
1224
|
-
options: KVNamespaceGetOptions<"stream"
|
|
1546
|
+
options: KVNamespaceGetOptions<"stream">,
|
|
1225
1547
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1226
1548
|
delete(key: Key): Promise<void>;
|
|
1227
1549
|
}
|
|
@@ -1249,7 +1571,7 @@ declare interface Queue<Body = unknown> {
|
|
|
1249
1571
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1250
1572
|
sendBatch(
|
|
1251
1573
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
1252
|
-
options?: QueueSendBatchOptions
|
|
1574
|
+
options?: QueueSendBatchOptions,
|
|
1253
1575
|
): Promise<void>;
|
|
1254
1576
|
}
|
|
1255
1577
|
declare interface QueueSendOptions {
|
|
@@ -1271,6 +1593,7 @@ declare interface Message<Body = unknown> {
|
|
|
1271
1593
|
readonly id: string;
|
|
1272
1594
|
readonly timestamp: Date;
|
|
1273
1595
|
readonly body: Body;
|
|
1596
|
+
readonly attempts: number;
|
|
1274
1597
|
retry(options?: QueueRetryOptions): void;
|
|
1275
1598
|
ack(): void;
|
|
1276
1599
|
}
|
|
@@ -1307,7 +1630,7 @@ declare abstract class R2Bucket {
|
|
|
1307
1630
|
key: string,
|
|
1308
1631
|
options: R2GetOptions & {
|
|
1309
1632
|
onlyIf: R2Conditional | Headers;
|
|
1310
|
-
}
|
|
1633
|
+
},
|
|
1311
1634
|
): Promise<R2ObjectBody | R2Object | null>;
|
|
1312
1635
|
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
|
|
1313
1636
|
put(
|
|
@@ -1321,7 +1644,7 @@ declare abstract class R2Bucket {
|
|
|
1321
1644
|
| Blob,
|
|
1322
1645
|
options?: R2PutOptions & {
|
|
1323
1646
|
onlyIf: R2Conditional | Headers;
|
|
1324
|
-
}
|
|
1647
|
+
},
|
|
1325
1648
|
): Promise<R2Object | null>;
|
|
1326
1649
|
put(
|
|
1327
1650
|
key: string,
|
|
@@ -1332,11 +1655,11 @@ declare abstract class R2Bucket {
|
|
|
1332
1655
|
| string
|
|
1333
1656
|
| null
|
|
1334
1657
|
| Blob,
|
|
1335
|
-
options?: R2PutOptions
|
|
1658
|
+
options?: R2PutOptions,
|
|
1336
1659
|
): Promise<R2Object>;
|
|
1337
1660
|
createMultipartUpload(
|
|
1338
1661
|
key: string,
|
|
1339
|
-
options?: R2MultipartOptions
|
|
1662
|
+
options?: R2MultipartOptions,
|
|
1340
1663
|
): Promise<R2MultipartUpload>;
|
|
1341
1664
|
resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
|
|
1342
1665
|
delete(keys: string | string[]): Promise<void>;
|
|
@@ -1347,7 +1670,7 @@ declare interface R2MultipartUpload {
|
|
|
1347
1670
|
readonly uploadId: string;
|
|
1348
1671
|
uploadPart(
|
|
1349
1672
|
partNumber: number,
|
|
1350
|
-
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob
|
|
1673
|
+
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
|
|
1351
1674
|
): Promise<R2UploadedPart>;
|
|
1352
1675
|
abort(): Promise<void>;
|
|
1353
1676
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
@@ -1468,7 +1791,7 @@ declare interface UnderlyingSink<W = any> {
|
|
|
1468
1791
|
start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
|
|
1469
1792
|
write?: (
|
|
1470
1793
|
chunk: W,
|
|
1471
|
-
controller: WritableStreamDefaultController
|
|
1794
|
+
controller: WritableStreamDefaultController,
|
|
1472
1795
|
) => void | Promise<void>;
|
|
1473
1796
|
abort?: (reason: any) => void | Promise<void>;
|
|
1474
1797
|
close?: () => void | Promise<void>;
|
|
@@ -1483,10 +1806,10 @@ declare interface UnderlyingByteSource {
|
|
|
1483
1806
|
declare interface UnderlyingSource<R = any> {
|
|
1484
1807
|
type?: "" | undefined;
|
|
1485
1808
|
start?: (
|
|
1486
|
-
controller: ReadableStreamDefaultController<R
|
|
1809
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1487
1810
|
) => void | Promise<void>;
|
|
1488
1811
|
pull?: (
|
|
1489
|
-
controller: ReadableStreamDefaultController<R
|
|
1812
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1490
1813
|
) => void | Promise<void>;
|
|
1491
1814
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1492
1815
|
expectedLength?: number | bigint;
|
|
@@ -1495,16 +1818,17 @@ declare interface Transformer<I = any, O = any> {
|
|
|
1495
1818
|
readableType?: string;
|
|
1496
1819
|
writableType?: string;
|
|
1497
1820
|
start?: (
|
|
1498
|
-
controller: TransformStreamDefaultController<O
|
|
1821
|
+
controller: TransformStreamDefaultController<O>,
|
|
1499
1822
|
) => void | Promise<void>;
|
|
1500
1823
|
transform?: (
|
|
1501
1824
|
chunk: I,
|
|
1502
|
-
controller: TransformStreamDefaultController<O
|
|
1825
|
+
controller: TransformStreamDefaultController<O>,
|
|
1503
1826
|
) => void | Promise<void>;
|
|
1504
1827
|
flush?: (
|
|
1505
|
-
controller: TransformStreamDefaultController<O
|
|
1828
|
+
controller: TransformStreamDefaultController<O>,
|
|
1506
1829
|
) => void | Promise<void>;
|
|
1507
|
-
|
|
1830
|
+
cancel?: (reason: any) => void | Promise<void>;
|
|
1831
|
+
expectedLength?: number;
|
|
1508
1832
|
}
|
|
1509
1833
|
declare interface StreamPipeOptions {
|
|
1510
1834
|
/**
|
|
@@ -1538,91 +1862,137 @@ declare type ReadableStreamReadResult<R = any> =
|
|
|
1538
1862
|
done: true;
|
|
1539
1863
|
value?: undefined;
|
|
1540
1864
|
};
|
|
1541
|
-
/**
|
|
1865
|
+
/**
|
|
1866
|
+
* 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.
|
|
1867
|
+
*
|
|
1868
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1869
|
+
*/
|
|
1542
1870
|
declare interface ReadableStream<R = any> {
|
|
1871
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1543
1872
|
get locked(): boolean;
|
|
1873
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1544
1874
|
cancel(reason?: any): Promise<void>;
|
|
1875
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1545
1876
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1877
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1546
1878
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1879
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1547
1880
|
pipeThrough<T>(
|
|
1548
1881
|
transform: ReadableWritablePair<T, R>,
|
|
1549
|
-
options?: StreamPipeOptions
|
|
1882
|
+
options?: StreamPipeOptions,
|
|
1550
1883
|
): ReadableStream<T>;
|
|
1884
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1551
1885
|
pipeTo(
|
|
1552
1886
|
destination: WritableStream<R>,
|
|
1553
|
-
options?: StreamPipeOptions
|
|
1887
|
+
options?: StreamPipeOptions,
|
|
1554
1888
|
): Promise<void>;
|
|
1889
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1555
1890
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1556
1891
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1557
1892
|
[Symbol.asyncIterator](
|
|
1558
|
-
options?: ReadableStreamValuesOptions
|
|
1893
|
+
options?: ReadableStreamValuesOptions,
|
|
1559
1894
|
): AsyncIterableIterator<R>;
|
|
1560
1895
|
}
|
|
1561
1896
|
declare const ReadableStream: {
|
|
1562
1897
|
prototype: ReadableStream;
|
|
1563
1898
|
new (
|
|
1564
1899
|
underlyingSource: UnderlyingByteSource,
|
|
1565
|
-
strategy?: QueuingStrategy<Uint8Array
|
|
1900
|
+
strategy?: QueuingStrategy<Uint8Array>,
|
|
1566
1901
|
): ReadableStream<Uint8Array>;
|
|
1567
1902
|
new <R = any>(
|
|
1568
1903
|
underlyingSource?: UnderlyingSource<R>,
|
|
1569
|
-
strategy?: QueuingStrategy<R
|
|
1904
|
+
strategy?: QueuingStrategy<R>,
|
|
1570
1905
|
): ReadableStream<R>;
|
|
1571
1906
|
};
|
|
1572
1907
|
declare class ReadableStreamDefaultReader<R = any> {
|
|
1573
1908
|
constructor(stream: ReadableStream);
|
|
1574
1909
|
get closed(): Promise<void>;
|
|
1575
1910
|
cancel(reason?: any): Promise<void>;
|
|
1911
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1576
1912
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1913
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1577
1914
|
releaseLock(): void;
|
|
1578
1915
|
}
|
|
1579
1916
|
declare class ReadableStreamBYOBReader {
|
|
1580
1917
|
constructor(stream: ReadableStream);
|
|
1581
1918
|
get closed(): Promise<void>;
|
|
1582
1919
|
cancel(reason?: any): Promise<void>;
|
|
1920
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1583
1921
|
read<T extends ArrayBufferView>(
|
|
1584
|
-
view: T
|
|
1922
|
+
view: T,
|
|
1585
1923
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1924
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1586
1925
|
releaseLock(): void;
|
|
1587
1926
|
readAtLeast<T extends ArrayBufferView>(
|
|
1588
1927
|
minElements: number,
|
|
1589
|
-
view: T
|
|
1928
|
+
view: T,
|
|
1590
1929
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1591
1930
|
}
|
|
1592
1931
|
declare interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1593
1932
|
min?: number;
|
|
1594
1933
|
}
|
|
1595
1934
|
declare interface ReadableStreamGetReaderOptions {
|
|
1935
|
+
/**
|
|
1936
|
+
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
|
1937
|
+
*
|
|
1938
|
+
* This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
|
|
1939
|
+
*/
|
|
1596
1940
|
mode: "byob";
|
|
1597
1941
|
}
|
|
1942
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
1598
1943
|
declare interface ReadableStreamBYOBRequest {
|
|
1944
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1599
1945
|
readonly view: Uint8Array | null;
|
|
1946
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1600
1947
|
respond(bytesWritten: number): void;
|
|
1948
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1601
1949
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1602
1950
|
readonly atLeast: number | null;
|
|
1603
1951
|
}
|
|
1952
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
1604
1953
|
declare interface ReadableStreamDefaultController<R = any> {
|
|
1954
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1605
1955
|
readonly desiredSize: number | null;
|
|
1956
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1606
1957
|
close(): void;
|
|
1958
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1607
1959
|
enqueue(chunk?: R): void;
|
|
1960
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1608
1961
|
error(reason: any): void;
|
|
1609
1962
|
}
|
|
1963
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
1610
1964
|
declare interface ReadableByteStreamController {
|
|
1965
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1611
1966
|
readonly byobRequest: ReadableStreamBYOBRequest | null;
|
|
1967
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1612
1968
|
readonly desiredSize: number | null;
|
|
1969
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1613
1970
|
close(): void;
|
|
1971
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1614
1972
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1973
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1615
1974
|
error(reason: any): void;
|
|
1616
1975
|
}
|
|
1617
|
-
/**
|
|
1976
|
+
/**
|
|
1977
|
+
* 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.
|
|
1978
|
+
*
|
|
1979
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
1980
|
+
*/
|
|
1618
1981
|
declare interface WritableStreamDefaultController {
|
|
1982
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1619
1983
|
readonly signal: AbortSignal;
|
|
1984
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1620
1985
|
error(reason?: any): void;
|
|
1621
1986
|
}
|
|
1987
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
1622
1988
|
declare interface TransformStreamDefaultController<O = any> {
|
|
1989
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1623
1990
|
get desiredSize(): number | null;
|
|
1991
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
1624
1992
|
enqueue(chunk?: O): void;
|
|
1993
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
1625
1994
|
error(reason: any): void;
|
|
1995
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
1626
1996
|
terminate(): void;
|
|
1627
1997
|
}
|
|
1628
1998
|
declare interface ReadableWritablePair<R = any, W = any> {
|
|
@@ -1637,36 +2007,49 @@ declare interface ReadableWritablePair<R = any, W = any> {
|
|
|
1637
2007
|
declare class WritableStream<W = any> {
|
|
1638
2008
|
constructor(
|
|
1639
2009
|
underlyingSink?: UnderlyingSink,
|
|
1640
|
-
queuingStrategy?: QueuingStrategy
|
|
2010
|
+
queuingStrategy?: QueuingStrategy,
|
|
1641
2011
|
);
|
|
2012
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
1642
2013
|
get locked(): boolean;
|
|
2014
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
1643
2015
|
abort(reason?: any): Promise<void>;
|
|
2016
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
1644
2017
|
close(): Promise<void>;
|
|
2018
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
1645
2019
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
1646
2020
|
}
|
|
1647
2021
|
declare class WritableStreamDefaultWriter<W = any> {
|
|
1648
2022
|
constructor(stream: WritableStream);
|
|
2023
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
1649
2024
|
get closed(): Promise<void>;
|
|
2025
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
1650
2026
|
get ready(): Promise<void>;
|
|
2027
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
1651
2028
|
get desiredSize(): number | null;
|
|
2029
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
1652
2030
|
abort(reason?: any): Promise<void>;
|
|
2031
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
1653
2032
|
close(): Promise<void>;
|
|
2033
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
1654
2034
|
write(chunk?: W): Promise<void>;
|
|
2035
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
1655
2036
|
releaseLock(): void;
|
|
1656
2037
|
}
|
|
1657
2038
|
declare class TransformStream<I = any, O = any> {
|
|
1658
2039
|
constructor(
|
|
1659
2040
|
transformer?: Transformer<I, O>,
|
|
1660
2041
|
writableStrategy?: QueuingStrategy<I>,
|
|
1661
|
-
readableStrategy?: QueuingStrategy<O
|
|
2042
|
+
readableStrategy?: QueuingStrategy<O>,
|
|
1662
2043
|
);
|
|
2044
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
1663
2045
|
get readable(): ReadableStream<O>;
|
|
2046
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
1664
2047
|
get writable(): WritableStream<I>;
|
|
1665
2048
|
}
|
|
1666
2049
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
1667
2050
|
constructor(
|
|
1668
2051
|
expectedLength: number | bigint,
|
|
1669
|
-
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
2052
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
1670
2053
|
);
|
|
1671
2054
|
}
|
|
1672
2055
|
declare class IdentityTransformStream extends TransformStream<
|
|
@@ -1709,12 +2092,16 @@ declare class ByteLengthQueuingStrategy
|
|
|
1709
2092
|
implements QueuingStrategy<ArrayBufferView>
|
|
1710
2093
|
{
|
|
1711
2094
|
constructor(init: QueuingStrategyInit);
|
|
2095
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
1712
2096
|
get highWaterMark(): number;
|
|
2097
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
1713
2098
|
get size(): (chunk?: any) => number;
|
|
1714
2099
|
}
|
|
1715
2100
|
declare class CountQueuingStrategy implements QueuingStrategy {
|
|
1716
2101
|
constructor(init: QueuingStrategyInit);
|
|
2102
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
1717
2103
|
get highWaterMark(): number;
|
|
2104
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
1718
2105
|
get size(): (chunk?: any) => number;
|
|
1719
2106
|
}
|
|
1720
2107
|
declare interface QueuingStrategyInit {
|
|
@@ -1738,6 +2125,7 @@ declare interface TraceItem {
|
|
|
1738
2125
|
readonly event:
|
|
1739
2126
|
| (
|
|
1740
2127
|
| TraceItemFetchEventInfo
|
|
2128
|
+
| TraceItemJsRpcEventInfo
|
|
1741
2129
|
| TraceItemScheduledEventInfo
|
|
1742
2130
|
| TraceItemAlarmEventInfo
|
|
1743
2131
|
| TraceItemQueueEventInfo
|
|
@@ -1752,6 +2140,7 @@ declare interface TraceItem {
|
|
|
1752
2140
|
readonly exceptions: TraceException[];
|
|
1753
2141
|
readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
|
|
1754
2142
|
readonly scriptName: string | null;
|
|
2143
|
+
readonly entrypoint?: string;
|
|
1755
2144
|
readonly scriptVersion?: ScriptVersion;
|
|
1756
2145
|
readonly dispatchNamespace?: string;
|
|
1757
2146
|
readonly scriptTags?: string[];
|
|
@@ -1794,6 +2183,9 @@ declare interface TraceItemFetchEventInfoRequest {
|
|
|
1794
2183
|
declare interface TraceItemFetchEventInfoResponse {
|
|
1795
2184
|
readonly status: number;
|
|
1796
2185
|
}
|
|
2186
|
+
declare interface TraceItemJsRpcEventInfo {
|
|
2187
|
+
readonly rpcMethod: string;
|
|
2188
|
+
}
|
|
1797
2189
|
declare interface TraceItemHibernatableWebSocketEventInfo {
|
|
1798
2190
|
readonly getWebSocketEvent:
|
|
1799
2191
|
| TraceItemHibernatableWebSocketEventInfoMessage
|
|
@@ -1820,6 +2212,7 @@ declare interface TraceException {
|
|
|
1820
2212
|
readonly timestamp: number;
|
|
1821
2213
|
readonly message: string;
|
|
1822
2214
|
readonly name: string;
|
|
2215
|
+
readonly stack?: string;
|
|
1823
2216
|
}
|
|
1824
2217
|
declare interface TraceDiagnosticChannelEvent {
|
|
1825
2218
|
readonly timestamp: number;
|
|
@@ -1835,29 +2228,52 @@ declare interface UnsafeTraceMetrics {
|
|
|
1835
2228
|
}
|
|
1836
2229
|
declare class URL {
|
|
1837
2230
|
constructor(url: string | URL, base?: string | URL);
|
|
2231
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
1838
2232
|
get href(): string;
|
|
2233
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
1839
2234
|
set href(value: string);
|
|
2235
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
1840
2236
|
get origin(): string;
|
|
2237
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
1841
2238
|
get protocol(): string;
|
|
2239
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
1842
2240
|
set protocol(value: string);
|
|
2241
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
1843
2242
|
get username(): string;
|
|
2243
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
1844
2244
|
set username(value: string);
|
|
2245
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
1845
2246
|
get password(): string;
|
|
2247
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
1846
2248
|
set password(value: string);
|
|
2249
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
1847
2250
|
get host(): string;
|
|
2251
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
1848
2252
|
set host(value: string);
|
|
2253
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
1849
2254
|
get hostname(): string;
|
|
2255
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
1850
2256
|
set hostname(value: string);
|
|
2257
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
1851
2258
|
get port(): string;
|
|
2259
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
1852
2260
|
set port(value: string);
|
|
2261
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
1853
2262
|
get pathname(): string;
|
|
2263
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
1854
2264
|
set pathname(value: string);
|
|
2265
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
1855
2266
|
get search(): string;
|
|
2267
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
1856
2268
|
set search(value: string);
|
|
2269
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
1857
2270
|
get searchParams(): URLSearchParams;
|
|
2271
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
1858
2272
|
get hash(): string;
|
|
2273
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
1859
2274
|
set hash(value: string);
|
|
1860
2275
|
toString(): string;
|
|
2276
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
1861
2277
|
toJSON(): string;
|
|
1862
2278
|
}
|
|
1863
2279
|
declare class URLSearchParams {
|
|
@@ -1866,7 +2282,7 @@ declare class URLSearchParams {
|
|
|
1866
2282
|
| URLSearchParams
|
|
1867
2283
|
| string
|
|
1868
2284
|
| Record<string, string>
|
|
1869
|
-
| [key: string, value: string][]
|
|
2285
|
+
| [key: string, value: string][],
|
|
1870
2286
|
);
|
|
1871
2287
|
get size(): number;
|
|
1872
2288
|
append(name: string, value: string): void;
|
|
@@ -1876,17 +2292,20 @@ declare class URLSearchParams {
|
|
|
1876
2292
|
has(name: string): boolean;
|
|
1877
2293
|
set(name: string, value: string): void;
|
|
1878
2294
|
sort(): void;
|
|
2295
|
+
/** Returns an array of key, value pairs for every entry in the search params. */
|
|
1879
2296
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2297
|
+
/** Returns a list of keys in the search params. */
|
|
1880
2298
|
keys(): IterableIterator<string>;
|
|
2299
|
+
/** Returns a list of values in the search params. */
|
|
1881
2300
|
values(): IterableIterator<string>;
|
|
1882
2301
|
forEach<This = unknown>(
|
|
1883
2302
|
callback: (
|
|
1884
2303
|
this: This,
|
|
1885
2304
|
value: string,
|
|
1886
2305
|
key: string,
|
|
1887
|
-
parent: URLSearchParams
|
|
2306
|
+
parent: URLSearchParams,
|
|
1888
2307
|
) => void,
|
|
1889
|
-
thisArg?: This
|
|
2308
|
+
thisArg?: This,
|
|
1890
2309
|
): void;
|
|
1891
2310
|
toString(): string;
|
|
1892
2311
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
@@ -1895,7 +2314,7 @@ declare class URLPattern {
|
|
|
1895
2314
|
constructor(
|
|
1896
2315
|
input?: string | URLPatternURLPatternInit,
|
|
1897
2316
|
baseURL?: string,
|
|
1898
|
-
patternOptions?: URLPatternURLPatternOptions
|
|
2317
|
+
patternOptions?: URLPatternURLPatternOptions,
|
|
1899
2318
|
);
|
|
1900
2319
|
get protocol(): string;
|
|
1901
2320
|
get username(): string;
|
|
@@ -1908,7 +2327,7 @@ declare class URLPattern {
|
|
|
1908
2327
|
test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean;
|
|
1909
2328
|
exec(
|
|
1910
2329
|
input?: string | URLPatternURLPatternInit,
|
|
1911
|
-
baseURL?: string
|
|
2330
|
+
baseURL?: string,
|
|
1912
2331
|
): URLPatternURLPatternResult | null;
|
|
1913
2332
|
}
|
|
1914
2333
|
declare interface URLPatternURLPatternInit {
|
|
@@ -1941,12 +2360,24 @@ declare interface URLPatternURLPatternOptions {
|
|
|
1941
2360
|
ignoreCase?: boolean;
|
|
1942
2361
|
}
|
|
1943
2362
|
declare class CloseEvent extends Event {
|
|
1944
|
-
constructor(type: string, initializer
|
|
1945
|
-
/**
|
|
2363
|
+
constructor(type: string, initializer?: CloseEventInit);
|
|
2364
|
+
/**
|
|
2365
|
+
* Returns the WebSocket connection close code provided by the server.
|
|
2366
|
+
*
|
|
2367
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
|
|
2368
|
+
*/
|
|
1946
2369
|
readonly code: number;
|
|
1947
|
-
/**
|
|
2370
|
+
/**
|
|
2371
|
+
* Returns the WebSocket connection close reason provided by the server.
|
|
2372
|
+
*
|
|
2373
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
|
|
2374
|
+
*/
|
|
1948
2375
|
readonly reason: string;
|
|
1949
|
-
/**
|
|
2376
|
+
/**
|
|
2377
|
+
* Returns true if the connection closed cleanly; false otherwise.
|
|
2378
|
+
*
|
|
2379
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
|
2380
|
+
*/
|
|
1950
2381
|
readonly wasClean: boolean;
|
|
1951
2382
|
}
|
|
1952
2383
|
declare interface CloseEventInit {
|
|
@@ -1961,12 +2392,21 @@ declare class MessageEvent extends Event {
|
|
|
1961
2392
|
declare interface MessageEventInit {
|
|
1962
2393
|
data: ArrayBuffer | string;
|
|
1963
2394
|
}
|
|
1964
|
-
/**
|
|
2395
|
+
/**
|
|
2396
|
+
* Events providing information related to errors in scripts or in files.
|
|
2397
|
+
*
|
|
2398
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2399
|
+
*/
|
|
1965
2400
|
declare interface ErrorEvent extends Event {
|
|
2401
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1966
2402
|
readonly filename: string;
|
|
2403
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1967
2404
|
readonly message: string;
|
|
2405
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1968
2406
|
readonly lineno: number;
|
|
2407
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1969
2408
|
readonly colno: number;
|
|
2409
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1970
2410
|
readonly error: any;
|
|
1971
2411
|
}
|
|
1972
2412
|
declare type WebSocketEventMap = {
|
|
@@ -1978,7 +2418,17 @@ declare type WebSocketEventMap = {
|
|
|
1978
2418
|
declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
1979
2419
|
constructor(url: string, protocols?: string[] | string);
|
|
1980
2420
|
accept(): void;
|
|
2421
|
+
/**
|
|
2422
|
+
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
2423
|
+
*
|
|
2424
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
2425
|
+
*/
|
|
1981
2426
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
2427
|
+
/**
|
|
2428
|
+
* Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
|
|
2429
|
+
*
|
|
2430
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
|
2431
|
+
*/
|
|
1982
2432
|
close(code?: number, reason?: string): void;
|
|
1983
2433
|
serializeAttachment(attachment: any): void;
|
|
1984
2434
|
deserializeAttachment(): any | null;
|
|
@@ -1990,9 +2440,29 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
1990
2440
|
static readonly CLOSING: number;
|
|
1991
2441
|
static readonly READY_STATE_CLOSED: number;
|
|
1992
2442
|
static readonly CLOSED: number;
|
|
2443
|
+
/**
|
|
2444
|
+
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2445
|
+
*
|
|
2446
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2447
|
+
*/
|
|
1993
2448
|
get readyState(): number;
|
|
2449
|
+
/**
|
|
2450
|
+
* Returns the URL that was used to establish the WebSocket connection.
|
|
2451
|
+
*
|
|
2452
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2453
|
+
*/
|
|
1994
2454
|
get url(): string | null;
|
|
2455
|
+
/**
|
|
2456
|
+
* Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
|
|
2457
|
+
*
|
|
2458
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2459
|
+
*/
|
|
1995
2460
|
get protocol(): string | null;
|
|
2461
|
+
/**
|
|
2462
|
+
* Returns the extensions selected by the server, if any.
|
|
2463
|
+
*
|
|
2464
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2465
|
+
*/
|
|
1996
2466
|
get extensions(): string | null;
|
|
1997
2467
|
}
|
|
1998
2468
|
declare const WebSocketPair: {
|
|
@@ -2026,7 +2496,7 @@ declare interface SocketInfo {
|
|
|
2026
2496
|
}
|
|
2027
2497
|
declare interface gpuGPU {
|
|
2028
2498
|
requestAdapter(
|
|
2029
|
-
param1?: gpuGPURequestAdapterOptions
|
|
2499
|
+
param1?: gpuGPURequestAdapterOptions,
|
|
2030
2500
|
): Promise<gpuGPUAdapter | null>;
|
|
2031
2501
|
}
|
|
2032
2502
|
declare abstract class gpuGPUAdapter {
|
|
@@ -2038,24 +2508,24 @@ declare abstract class gpuGPUAdapter {
|
|
|
2038
2508
|
declare interface gpuGPUDevice extends EventTarget {
|
|
2039
2509
|
createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
|
|
2040
2510
|
createBindGroupLayout(
|
|
2041
|
-
descriptor: gpuGPUBindGroupLayoutDescriptor
|
|
2511
|
+
descriptor: gpuGPUBindGroupLayoutDescriptor,
|
|
2042
2512
|
): gpuGPUBindGroupLayout;
|
|
2043
2513
|
createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
|
|
2044
2514
|
createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
|
|
2045
2515
|
createShaderModule(
|
|
2046
|
-
descriptor: gpuGPUShaderModuleDescriptor
|
|
2516
|
+
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2047
2517
|
): gpuGPUShaderModule;
|
|
2048
2518
|
createPipelineLayout(
|
|
2049
|
-
descriptor: gpuGPUPipelineLayoutDescriptor
|
|
2519
|
+
descriptor: gpuGPUPipelineLayoutDescriptor,
|
|
2050
2520
|
): gpuGPUPipelineLayout;
|
|
2051
2521
|
createComputePipeline(
|
|
2052
|
-
descriptor: gpuGPUComputePipelineDescriptor
|
|
2522
|
+
descriptor: gpuGPUComputePipelineDescriptor,
|
|
2053
2523
|
): gpuGPUComputePipeline;
|
|
2054
2524
|
createRenderPipeline(
|
|
2055
|
-
descriptor: gpuGPURenderPipelineDescriptor
|
|
2525
|
+
descriptor: gpuGPURenderPipelineDescriptor,
|
|
2056
2526
|
): gpuGPURenderPipeline;
|
|
2057
2527
|
createCommandEncoder(
|
|
2058
|
-
descriptor?: gpuGPUCommandEncoderDescriptor
|
|
2528
|
+
descriptor?: gpuGPUCommandEncoderDescriptor,
|
|
2059
2529
|
): gpuGPUCommandEncoder;
|
|
2060
2530
|
createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
|
|
2061
2531
|
destroy(): void;
|
|
@@ -2101,7 +2571,7 @@ declare interface gpuGPUBuffer {
|
|
|
2101
2571
|
mapAsync(
|
|
2102
2572
|
offset: number,
|
|
2103
2573
|
size?: number | bigint,
|
|
2104
|
-
param3?: number | bigint
|
|
2574
|
+
param3?: number | bigint,
|
|
2105
2575
|
): Promise<void>;
|
|
2106
2576
|
get size(): number | bigint;
|
|
2107
2577
|
get usage(): number;
|
|
@@ -2200,38 +2670,38 @@ declare interface gpuGPUProgrammableStage {
|
|
|
2200
2670
|
declare interface gpuGPUCommandEncoder {
|
|
2201
2671
|
get label(): string;
|
|
2202
2672
|
beginComputePass(
|
|
2203
|
-
descriptor?: gpuGPUComputePassDescriptor
|
|
2673
|
+
descriptor?: gpuGPUComputePassDescriptor,
|
|
2204
2674
|
): gpuGPUComputePassEncoder;
|
|
2205
2675
|
beginRenderPass(
|
|
2206
|
-
descriptor: gpuGPURenderPassDescriptor
|
|
2676
|
+
descriptor: gpuGPURenderPassDescriptor,
|
|
2207
2677
|
): gpuGPURenderPassEncoder;
|
|
2208
2678
|
copyBufferToBuffer(
|
|
2209
2679
|
source: gpuGPUBuffer,
|
|
2210
2680
|
sourceOffset: number | bigint,
|
|
2211
2681
|
destination: gpuGPUBuffer,
|
|
2212
2682
|
destinationOffset: number | bigint,
|
|
2213
|
-
size: number | bigint
|
|
2683
|
+
size: number | bigint,
|
|
2214
2684
|
): void;
|
|
2215
2685
|
finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
|
|
2216
2686
|
copyTextureToBuffer(
|
|
2217
2687
|
source: gpuGPUImageCopyTexture,
|
|
2218
2688
|
destination: gpuGPUImageCopyBuffer,
|
|
2219
|
-
copySize: Iterable<number> | gpuGPUExtent3DDict
|
|
2689
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2220
2690
|
): void;
|
|
2221
2691
|
copyBufferToTexture(
|
|
2222
2692
|
source: gpuGPUImageCopyBuffer,
|
|
2223
2693
|
destination: gpuGPUImageCopyTexture,
|
|
2224
|
-
copySize: Iterable<number> | gpuGPUExtent3DDict
|
|
2694
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2225
2695
|
): void;
|
|
2226
2696
|
copyTextureToTexture(
|
|
2227
2697
|
source: gpuGPUImageCopyTexture,
|
|
2228
2698
|
destination: gpuGPUImageCopyTexture,
|
|
2229
|
-
copySize: Iterable<number> | gpuGPUExtent3DDict
|
|
2699
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2230
2700
|
): void;
|
|
2231
2701
|
clearBuffer(
|
|
2232
2702
|
buffer: gpuGPUBuffer,
|
|
2233
2703
|
offset?: number | bigint,
|
|
2234
|
-
size?: number | bigint
|
|
2704
|
+
size?: number | bigint,
|
|
2235
2705
|
): void;
|
|
2236
2706
|
}
|
|
2237
2707
|
declare interface gpuGPUCommandEncoderDescriptor {
|
|
@@ -2242,12 +2712,12 @@ declare interface gpuGPUComputePassEncoder {
|
|
|
2242
2712
|
setBindGroup(
|
|
2243
2713
|
index: number,
|
|
2244
2714
|
bindGroup: gpuGPUBindGroup | null,
|
|
2245
|
-
dynamicOffsets?: Iterable<number
|
|
2715
|
+
dynamicOffsets?: Iterable<number>,
|
|
2246
2716
|
): void;
|
|
2247
2717
|
dispatchWorkgroups(
|
|
2248
2718
|
workgroupCountX: number,
|
|
2249
2719
|
workgroupCountY?: number,
|
|
2250
|
-
workgroupCountZ?: number
|
|
2720
|
+
workgroupCountZ?: number,
|
|
2251
2721
|
): void;
|
|
2252
2722
|
end(): void;
|
|
2253
2723
|
}
|
|
@@ -2275,7 +2745,7 @@ declare interface gpuGPUQueue {
|
|
|
2275
2745
|
bufferOffset: number | bigint,
|
|
2276
2746
|
data: ArrayBuffer | ArrayBufferView,
|
|
2277
2747
|
dataOffset?: number | bigint,
|
|
2278
|
-
size?: number | bigint
|
|
2748
|
+
size?: number | bigint,
|
|
2279
2749
|
): void;
|
|
2280
2750
|
}
|
|
2281
2751
|
declare abstract class gpuGPUMapMode {
|
|
@@ -2483,7 +2953,7 @@ declare interface gpuGPURenderPassEncoder {
|
|
|
2483
2953
|
vertexCount: number,
|
|
2484
2954
|
instanceCount?: number,
|
|
2485
2955
|
firstVertex?: number,
|
|
2486
|
-
firstInstance?: number
|
|
2956
|
+
firstInstance?: number,
|
|
2487
2957
|
): void;
|
|
2488
2958
|
end(): void;
|
|
2489
2959
|
}
|
|
@@ -2981,7 +3451,7 @@ declare interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
|
2981
3451
|
};
|
|
2982
3452
|
}
|
|
2983
3453
|
declare interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
|
|
2984
|
-
HostMetadata
|
|
3454
|
+
HostMetadata,
|
|
2985
3455
|
> {
|
|
2986
3456
|
/**
|
|
2987
3457
|
* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
|
|
@@ -3551,6 +4021,13 @@ declare abstract class D1PreparedStatement {
|
|
|
3551
4021
|
}): Promise<[string[], ...T[]]>;
|
|
3552
4022
|
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3553
4023
|
}
|
|
4024
|
+
// `Disposable` was added to TypeScript's standard lib types in version 5.2.
|
|
4025
|
+
// To support older TypeScript versions, define an empty `Disposable` interface.
|
|
4026
|
+
// Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
|
|
4027
|
+
// but this will ensure type checking on older versions still passes.
|
|
4028
|
+
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
4029
|
+
// ignored when `Disposable` is included in the standard lib.
|
|
4030
|
+
declare interface Disposable {}
|
|
3554
4031
|
/**
|
|
3555
4032
|
* An email message that can be sent from a Worker.
|
|
3556
4033
|
*/
|
|
@@ -3606,7 +4083,7 @@ declare abstract class EmailEvent extends ExtendableEvent {
|
|
|
3606
4083
|
declare type EmailExportedHandler<Env = unknown> = (
|
|
3607
4084
|
message: ForwardableEmailMessage,
|
|
3608
4085
|
env: Env,
|
|
3609
|
-
ctx: ExecutionContext
|
|
4086
|
+
ctx: ExecutionContext,
|
|
3610
4087
|
) => void | Promise<void>;
|
|
3611
4088
|
declare module "cloudflare:email" {
|
|
3612
4089
|
let _EmailMessage: {
|
|
@@ -3680,7 +4157,7 @@ declare type EventContext<Env, P extends string, Data> = {
|
|
|
3680
4157
|
declare type PagesFunction<
|
|
3681
4158
|
Env = unknown,
|
|
3682
4159
|
Params extends string = any,
|
|
3683
|
-
Data extends Record<string, unknown> = Record<string, unknown
|
|
4160
|
+
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
3684
4161
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3685
4162
|
declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3686
4163
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
@@ -3701,9 +4178,9 @@ declare type PagesPluginFunction<
|
|
|
3701
4178
|
Env = unknown,
|
|
3702
4179
|
Params extends string = any,
|
|
3703
4180
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
3704
|
-
PluginArgs = unknown
|
|
4181
|
+
PluginArgs = unknown,
|
|
3705
4182
|
> = (
|
|
3706
|
-
context: EventPluginContext<Env, Params, Data, PluginArgs
|
|
4183
|
+
context: EventPluginContext<Env, Params, Data, PluginArgs>,
|
|
3707
4184
|
) => Response | Promise<Response>;
|
|
3708
4185
|
declare module "assets:*" {
|
|
3709
4186
|
export const onRequest: PagesFunction;
|
|
@@ -3742,10 +4219,207 @@ declare interface JsonWebKeyWithKid extends JsonWebKey {
|
|
|
3742
4219
|
// Key Identifier of the JWK
|
|
3743
4220
|
readonly kid: string;
|
|
3744
4221
|
}
|
|
4222
|
+
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4223
|
+
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4224
|
+
// strips all `module` blocks.
|
|
4225
|
+
declare namespace Rpc {
|
|
4226
|
+
// Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
|
|
4227
|
+
// TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
|
|
4228
|
+
// For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
|
|
4229
|
+
// accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
|
|
4230
|
+
export const __RPC_STUB_BRAND: unique symbol;
|
|
4231
|
+
export const __RPC_TARGET_BRAND: unique symbol;
|
|
4232
|
+
export const __WORKER_ENTRYPOINT_BRAND: unique symbol;
|
|
4233
|
+
export const __DURABLE_OBJECT_BRAND: unique symbol;
|
|
4234
|
+
export interface RpcTargetBranded {
|
|
4235
|
+
[__RPC_TARGET_BRAND]: never;
|
|
4236
|
+
}
|
|
4237
|
+
export interface WorkerEntrypointBranded {
|
|
4238
|
+
[__WORKER_ENTRYPOINT_BRAND]: never;
|
|
4239
|
+
}
|
|
4240
|
+
export interface DurableObjectBranded {
|
|
4241
|
+
[__DURABLE_OBJECT_BRAND]: never;
|
|
4242
|
+
}
|
|
4243
|
+
export type EntrypointBranded =
|
|
4244
|
+
| WorkerEntrypointBranded
|
|
4245
|
+
| DurableObjectBranded;
|
|
4246
|
+
// Types that can be used through `Stub`s
|
|
4247
|
+
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
4248
|
+
// Types that can be passed over RPC
|
|
4249
|
+
type Serializable =
|
|
4250
|
+
// Structured cloneables
|
|
4251
|
+
| void
|
|
4252
|
+
| undefined
|
|
4253
|
+
| null
|
|
4254
|
+
| boolean
|
|
4255
|
+
| number
|
|
4256
|
+
| bigint
|
|
4257
|
+
| string
|
|
4258
|
+
| TypedArray
|
|
4259
|
+
| ArrayBuffer
|
|
4260
|
+
| DataView
|
|
4261
|
+
| Date
|
|
4262
|
+
| Error
|
|
4263
|
+
| RegExp
|
|
4264
|
+
// Structured cloneable composites
|
|
4265
|
+
| Map<Serializable, Serializable>
|
|
4266
|
+
| Set<Serializable>
|
|
4267
|
+
| ReadonlyArray<Serializable>
|
|
4268
|
+
| {
|
|
4269
|
+
[key: string | number]: Serializable;
|
|
4270
|
+
}
|
|
4271
|
+
// Special types
|
|
4272
|
+
| ReadableStream<Uint8Array>
|
|
4273
|
+
| WritableStream<Uint8Array>
|
|
4274
|
+
| Request
|
|
4275
|
+
| Response
|
|
4276
|
+
| Headers
|
|
4277
|
+
| Stub<Stubable>
|
|
4278
|
+
// Serialized as stubs, see `Stubify`
|
|
4279
|
+
| Stubable;
|
|
4280
|
+
// Base type for all RPC stubs, including common memory management methods.
|
|
4281
|
+
// `T` is used as a marker type for unwrapping `Stub`s later.
|
|
4282
|
+
interface StubBase<T extends Stubable> extends Disposable {
|
|
4283
|
+
[__RPC_STUB_BRAND]: T;
|
|
4284
|
+
dup(): this;
|
|
4285
|
+
}
|
|
4286
|
+
export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
|
|
4287
|
+
// Recursively rewrite all `Stubable` types with `Stub`s
|
|
4288
|
+
type Stubify<T> = T extends Stubable
|
|
4289
|
+
? Stub<T>
|
|
4290
|
+
: T extends Map<infer K, infer V>
|
|
4291
|
+
? Map<Stubify<K>, Stubify<V>>
|
|
4292
|
+
: T extends Set<infer V>
|
|
4293
|
+
? Set<Stubify<V>>
|
|
4294
|
+
: T extends Array<infer V>
|
|
4295
|
+
? Array<Stubify<V>>
|
|
4296
|
+
: T extends ReadonlyArray<infer V>
|
|
4297
|
+
? ReadonlyArray<Stubify<V>>
|
|
4298
|
+
: T extends {
|
|
4299
|
+
[key: string | number]: unknown;
|
|
4300
|
+
}
|
|
4301
|
+
? {
|
|
4302
|
+
[K in keyof T]: Stubify<T[K]>;
|
|
4303
|
+
}
|
|
4304
|
+
: T;
|
|
4305
|
+
// Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
|
|
4306
|
+
// Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
|
|
4307
|
+
// `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
|
|
4308
|
+
type Unstubify<T> =
|
|
4309
|
+
T extends StubBase<infer V>
|
|
4310
|
+
? V
|
|
4311
|
+
: T extends Map<infer K, infer V>
|
|
4312
|
+
? Map<Unstubify<K>, Unstubify<V>>
|
|
4313
|
+
: T extends Set<infer V>
|
|
4314
|
+
? Set<Unstubify<V>>
|
|
4315
|
+
: T extends Array<infer V>
|
|
4316
|
+
? Array<Unstubify<V>>
|
|
4317
|
+
: T extends ReadonlyArray<infer V>
|
|
4318
|
+
? ReadonlyArray<Unstubify<V>>
|
|
4319
|
+
: T extends {
|
|
4320
|
+
[key: string | number]: unknown;
|
|
4321
|
+
}
|
|
4322
|
+
? {
|
|
4323
|
+
[K in keyof T]: Unstubify<T[K]>;
|
|
4324
|
+
}
|
|
4325
|
+
: T;
|
|
4326
|
+
type UnstubifyAll<A extends any[]> = {
|
|
4327
|
+
[I in keyof A]: Unstubify<A[I]>;
|
|
4328
|
+
};
|
|
4329
|
+
// Utility type for adding `Provider`/`Disposable`s to `object` types only.
|
|
4330
|
+
// Note `unknown & T` is equivalent to `T`.
|
|
4331
|
+
type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
|
|
4332
|
+
type MaybeDisposable<T> = T extends object ? Disposable : unknown;
|
|
4333
|
+
// Type for method return or property on an RPC interface.
|
|
4334
|
+
// - Stubable types are replaced by stubs.
|
|
4335
|
+
// - Serializable types are passed by value, with stubable types replaced by stubs
|
|
4336
|
+
// and a top-level `Disposer`.
|
|
4337
|
+
// Everything else can't be passed over PRC.
|
|
4338
|
+
// Technically, we use custom thenables here, but they quack like `Promise`s.
|
|
4339
|
+
// Intersecting with `(Maybe)Provider` allows pipelining.
|
|
4340
|
+
type Result<R> = R extends Stubable
|
|
4341
|
+
? Promise<Stub<R>> & Provider<R>
|
|
4342
|
+
: R extends Serializable
|
|
4343
|
+
? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
|
|
4344
|
+
: never;
|
|
4345
|
+
// Type for method or property on an RPC interface.
|
|
4346
|
+
// For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
|
|
4347
|
+
// Unwrapping `Stub`s allows calling with `Stubable` arguments.
|
|
4348
|
+
// For properties, rewrite types to be `Result`s.
|
|
4349
|
+
// In each case, unwrap `Promise`s.
|
|
4350
|
+
type MethodOrProperty<V> = V extends (...args: infer P) => infer R
|
|
4351
|
+
? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
|
|
4352
|
+
: Result<Awaited<V>>;
|
|
4353
|
+
// Type for the callable part of an `Provider` if `T` is callable.
|
|
4354
|
+
// This is intersected with methods/properties.
|
|
4355
|
+
type MaybeCallableProvider<T> = T extends (...args: any[]) => any
|
|
4356
|
+
? MethodOrProperty<T>
|
|
4357
|
+
: unknown;
|
|
4358
|
+
// Base type for all other types providing RPC-like interfaces.
|
|
4359
|
+
// Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
|
|
4360
|
+
// `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
|
|
4361
|
+
export type Provider<
|
|
4362
|
+
T extends object,
|
|
4363
|
+
Reserved extends string = never,
|
|
4364
|
+
> = MaybeCallableProvider<T> & {
|
|
4365
|
+
[K in Exclude<
|
|
4366
|
+
keyof T,
|
|
4367
|
+
Reserved | symbol | keyof StubBase<never>
|
|
4368
|
+
>]: MethodOrProperty<T[K]>;
|
|
4369
|
+
};
|
|
4370
|
+
}
|
|
4371
|
+
declare module "cloudflare:workers" {
|
|
4372
|
+
export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T>;
|
|
4373
|
+
export const RpcStub: {
|
|
4374
|
+
new <T extends Rpc.Stubable>(value: T): Rpc.Stub<T>;
|
|
4375
|
+
};
|
|
4376
|
+
export abstract class RpcTarget implements Rpc.RpcTargetBranded {
|
|
4377
|
+
[Rpc.__RPC_TARGET_BRAND]: never;
|
|
4378
|
+
[Symbol.dispose]?(): void;
|
|
4379
|
+
}
|
|
4380
|
+
// `protected` fields don't appear in `keyof`s, so can't be accessed over RPC
|
|
4381
|
+
export abstract class WorkerEntrypoint<Env = unknown>
|
|
4382
|
+
implements Rpc.WorkerEntrypointBranded
|
|
4383
|
+
{
|
|
4384
|
+
[Rpc.__WORKER_ENTRYPOINT_BRAND]: never;
|
|
4385
|
+
protected ctx: ExecutionContext;
|
|
4386
|
+
protected env: Env;
|
|
4387
|
+
constructor(ctx: ExecutionContext, env: Env);
|
|
4388
|
+
[Symbol.dispose]?(): void;
|
|
4389
|
+
fetch?(request: Request): Response | Promise<Response>;
|
|
4390
|
+
tail?(events: TraceItem[]): void | Promise<void>;
|
|
4391
|
+
trace?(traces: TraceItem[]): void | Promise<void>;
|
|
4392
|
+
scheduled?(controller: ScheduledController): void | Promise<void>;
|
|
4393
|
+
queue?(batch: MessageBatch<unknown>): void | Promise<void>;
|
|
4394
|
+
test?(controller: TestController): void | Promise<void>;
|
|
4395
|
+
}
|
|
4396
|
+
export abstract class DurableObject<Env = unknown>
|
|
4397
|
+
implements Rpc.DurableObjectBranded
|
|
4398
|
+
{
|
|
4399
|
+
[Rpc.__DURABLE_OBJECT_BRAND]: never;
|
|
4400
|
+
protected ctx: DurableObjectState;
|
|
4401
|
+
protected env: Env;
|
|
4402
|
+
constructor(ctx: DurableObjectState, env: Env);
|
|
4403
|
+
[Symbol.dispose]?(): void;
|
|
4404
|
+
fetch?(request: Request): Response | Promise<Response>;
|
|
4405
|
+
alarm?(): void | Promise<void>;
|
|
4406
|
+
webSocketMessage?(
|
|
4407
|
+
ws: WebSocket,
|
|
4408
|
+
message: string | ArrayBuffer,
|
|
4409
|
+
): void | Promise<void>;
|
|
4410
|
+
webSocketClose?(
|
|
4411
|
+
ws: WebSocket,
|
|
4412
|
+
code: number,
|
|
4413
|
+
reason: string,
|
|
4414
|
+
wasClean: boolean,
|
|
4415
|
+
): void | Promise<void>;
|
|
4416
|
+
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
3745
4419
|
declare module "cloudflare:sockets" {
|
|
3746
4420
|
function _connect(
|
|
3747
4421
|
address: string | SocketAddress,
|
|
3748
|
-
options?: SocketOptions
|
|
4422
|
+
options?: SocketOptions,
|
|
3749
4423
|
): Socket;
|
|
3750
4424
|
export { _connect as connect };
|
|
3751
4425
|
}
|
|
@@ -3881,7 +4555,7 @@ declare abstract class VectorizeIndex {
|
|
|
3881
4555
|
*/
|
|
3882
4556
|
public query(
|
|
3883
4557
|
vector: VectorFloatArray | number[],
|
|
3884
|
-
options: VectorizeQueryOptions
|
|
4558
|
+
options: VectorizeQueryOptions,
|
|
3885
4559
|
): Promise<VectorizeMatches>;
|
|
3886
4560
|
/**
|
|
3887
4561
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
@@ -3908,6 +4582,16 @@ declare abstract class VectorizeIndex {
|
|
|
3908
4582
|
*/
|
|
3909
4583
|
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
3910
4584
|
}
|
|
4585
|
+
/**
|
|
4586
|
+
* The interface for "version_metadata" binding
|
|
4587
|
+
* providing metadata about the Worker Version using this binding.
|
|
4588
|
+
*/
|
|
4589
|
+
declare type WorkerVersionMetadata = {
|
|
4590
|
+
/** The ID of the Worker Version using this binding */
|
|
4591
|
+
id: string;
|
|
4592
|
+
/** The tag of the Worker Version using this binding */
|
|
4593
|
+
tag: string;
|
|
4594
|
+
};
|
|
3911
4595
|
declare interface DynamicDispatchLimits {
|
|
3912
4596
|
/**
|
|
3913
4597
|
* Limit CPU time in milliseconds.
|
|
@@ -3943,6 +4627,6 @@ declare interface DispatchNamespace {
|
|
|
3943
4627
|
args?: {
|
|
3944
4628
|
[key: string]: any;
|
|
3945
4629
|
},
|
|
3946
|
-
options?: DynamicDispatchOptions
|
|
4630
|
+
options?: DynamicDispatchOptions,
|
|
3947
4631
|
): Fetcher;
|
|
3948
4632
|
}
|