@cloudflare/workers-types 4.20240320.1 → 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 +819 -176
- package/2021-11-03/index.ts +771 -176
- package/2022-01-31/index.d.ts +834 -151
- package/2022-01-31/index.ts +786 -151
- package/2022-03-21/index.d.ts +836 -153
- package/2022-03-21/index.ts +788 -153
- package/2022-08-04/index.d.ts +836 -153
- package/2022-08-04/index.ts +788 -153
- package/2022-10-31/index.d.ts +837 -153
- package/2022-10-31/index.ts +789 -153
- package/2022-11-30/index.d.ts +829 -152
- package/2022-11-30/index.ts +781 -152
- package/2023-03-01/index.d.ts +829 -152
- package/2023-03-01/index.ts +781 -152
- package/2023-07-01/index.d.ts +829 -152
- package/2023-07-01/index.ts +781 -152
- package/README.md +0 -3
- package/experimental/index.d.ts +834 -157
- package/experimental/index.ts +786 -157
- package/index.d.ts +819 -176
- package/index.ts +771 -176
- package/oldest/index.d.ts +819 -176
- package/oldest/index.ts +771 -176
- package/package.json +1 -1
package/2021-11-03/index.ts
CHANGED
|
@@ -16,8 +16,15 @@ and limitations under the License.
|
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
17
|
export 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 @@ export type WorkerGlobalScopeEventMap = {
|
|
|
56
63
|
export 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
|
export 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
|
export declare const console: Console;
|
|
82
108
|
export type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
109
|
+
export 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
|
export declare namespace WebAssembly {
|
|
84
122
|
class CompileError extends Error {
|
|
85
123
|
constructor(message?: string);
|
|
@@ -154,7 +192,11 @@ export 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
|
export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
159
201
|
DOMException: typeof DOMException;
|
|
160
202
|
WorkerGlobalScope: typeof WorkerGlobalScope;
|
|
@@ -178,7 +220,7 @@ export 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;
|
|
@@ -245,53 +287,68 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
245
287
|
GPUColorWrite: typeof gpuGPUColorWrite;
|
|
246
288
|
}
|
|
247
289
|
export declare function addEventListener<
|
|
248
|
-
Type extends keyof WorkerGlobalScopeEventMap
|
|
290
|
+
Type extends keyof WorkerGlobalScopeEventMap,
|
|
249
291
|
>(
|
|
250
292
|
type: Type,
|
|
251
293
|
handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
|
|
252
|
-
options?: EventTargetAddEventListenerOptions | boolean
|
|
294
|
+
options?: EventTargetAddEventListenerOptions | boolean,
|
|
253
295
|
): void;
|
|
254
296
|
export 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
|
export 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
|
export declare function btoa(data: string): string;
|
|
313
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
|
266
314
|
export declare function atob(data: string): string;
|
|
315
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
267
316
|
export 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
|
export 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
|
export declare function clearTimeout(timeoutId: number | null): void;
|
|
328
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
277
329
|
export 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
|
export 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
|
export declare function clearInterval(timeoutId: number | null): void;
|
|
341
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
|
|
287
342
|
export declare function queueMicrotask(task: Function): void;
|
|
343
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
|
|
288
344
|
export 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
|
export declare function fetch(
|
|
293
350
|
input: RequestInfo,
|
|
294
|
-
init?: RequestInit<RequestInitCfProperties
|
|
351
|
+
init?: RequestInit<RequestInitCfProperties>,
|
|
295
352
|
): Promise<Response>;
|
|
296
353
|
export declare const self: ServiceWorkerGlobalScope;
|
|
297
354
|
export declare const crypto: Crypto;
|
|
@@ -306,41 +363,41 @@ export interface ExecutionContext {
|
|
|
306
363
|
}
|
|
307
364
|
export type ExportedHandlerFetchHandler<
|
|
308
365
|
Env = unknown,
|
|
309
|
-
CfHostMetadata = unknown
|
|
366
|
+
CfHostMetadata = unknown,
|
|
310
367
|
> = (
|
|
311
368
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
312
369
|
env: Env,
|
|
313
|
-
ctx: ExecutionContext
|
|
370
|
+
ctx: ExecutionContext,
|
|
314
371
|
) => Response | Promise<Response>;
|
|
315
372
|
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
316
373
|
events: TraceItem[],
|
|
317
374
|
env: Env,
|
|
318
|
-
ctx: ExecutionContext
|
|
375
|
+
ctx: ExecutionContext,
|
|
319
376
|
) => void | Promise<void>;
|
|
320
377
|
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
321
378
|
traces: TraceItem[],
|
|
322
379
|
env: Env,
|
|
323
|
-
ctx: ExecutionContext
|
|
380
|
+
ctx: ExecutionContext,
|
|
324
381
|
) => void | Promise<void>;
|
|
325
382
|
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
326
383
|
controller: ScheduledController,
|
|
327
384
|
env: Env,
|
|
328
|
-
ctx: ExecutionContext
|
|
385
|
+
ctx: ExecutionContext,
|
|
329
386
|
) => void | Promise<void>;
|
|
330
387
|
export type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
|
|
331
388
|
batch: MessageBatch<Message>,
|
|
332
389
|
env: Env,
|
|
333
|
-
ctx: ExecutionContext
|
|
390
|
+
ctx: ExecutionContext,
|
|
334
391
|
) => void | Promise<void>;
|
|
335
392
|
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
336
393
|
controller: TestController,
|
|
337
394
|
env: Env,
|
|
338
|
-
ctx: ExecutionContext
|
|
395
|
+
ctx: ExecutionContext,
|
|
339
396
|
) => void | Promise<void>;
|
|
340
397
|
export interface ExportedHandler<
|
|
341
398
|
Env = unknown,
|
|
342
399
|
QueueHandlerMessage = unknown,
|
|
343
|
-
CfHostMetadata = unknown
|
|
400
|
+
CfHostMetadata = unknown,
|
|
344
401
|
> {
|
|
345
402
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
346
403
|
tail?: ExportedHandlerTailHandler<Env>;
|
|
@@ -354,12 +411,20 @@ export interface StructuredSerializeOptions {
|
|
|
354
411
|
transfer?: any[];
|
|
355
412
|
}
|
|
356
413
|
export declare abstract class PromiseRejectionEvent extends Event {
|
|
414
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
|
|
357
415
|
readonly promise: Promise<any>;
|
|
416
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
|
|
358
417
|
readonly reason: any;
|
|
359
418
|
}
|
|
360
|
-
/**
|
|
419
|
+
/**
|
|
420
|
+
* 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.
|
|
421
|
+
*
|
|
422
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
|
|
423
|
+
*/
|
|
361
424
|
export interface Performance {
|
|
425
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
|
|
362
426
|
readonly timeOrigin: number;
|
|
427
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
|
|
363
428
|
now(): number;
|
|
364
429
|
}
|
|
365
430
|
export interface AlarmInvocationInfo {
|
|
@@ -371,36 +436,42 @@ export interface DurableObject {
|
|
|
371
436
|
alarm?(): void | Promise<void>;
|
|
372
437
|
webSocketMessage?(
|
|
373
438
|
ws: WebSocket,
|
|
374
|
-
message: string | ArrayBuffer
|
|
439
|
+
message: string | ArrayBuffer,
|
|
375
440
|
): void | Promise<void>;
|
|
376
441
|
webSocketClose?(
|
|
377
442
|
ws: WebSocket,
|
|
378
443
|
code: number,
|
|
379
444
|
reason: string,
|
|
380
|
-
wasClean: boolean
|
|
445
|
+
wasClean: boolean,
|
|
381
446
|
): void | Promise<void>;
|
|
382
447
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
383
448
|
}
|
|
384
|
-
export
|
|
449
|
+
export type DurableObjectStub<
|
|
450
|
+
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
451
|
+
> = Fetcher<
|
|
452
|
+
T,
|
|
453
|
+
"alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
|
|
454
|
+
> & {
|
|
385
455
|
readonly id: DurableObjectId;
|
|
386
456
|
readonly name?: string;
|
|
387
|
-
}
|
|
457
|
+
};
|
|
388
458
|
export interface DurableObjectId {
|
|
389
459
|
toString(): string;
|
|
390
460
|
equals(other: DurableObjectId): boolean;
|
|
391
461
|
readonly name?: string;
|
|
392
462
|
}
|
|
393
|
-
export interface DurableObjectNamespace
|
|
463
|
+
export interface DurableObjectNamespace<
|
|
464
|
+
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
465
|
+
> {
|
|
394
466
|
newUniqueId(
|
|
395
|
-
options?: DurableObjectNamespaceNewUniqueIdOptions
|
|
467
|
+
options?: DurableObjectNamespaceNewUniqueIdOptions,
|
|
396
468
|
): DurableObjectId;
|
|
397
469
|
idFromName(name: string): DurableObjectId;
|
|
398
470
|
idFromString(id: string): DurableObjectId;
|
|
399
|
-
get(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
):
|
|
403
|
-
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
|
|
471
|
+
get(id: DurableObjectId): DurableObjectStub<T>;
|
|
472
|
+
jurisdiction(
|
|
473
|
+
jurisdiction: DurableObjectJurisdiction,
|
|
474
|
+
): DurableObjectNamespace<T>;
|
|
404
475
|
}
|
|
405
476
|
export type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
406
477
|
export interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
@@ -436,23 +507,23 @@ export interface DurableObjectState {
|
|
|
436
507
|
export interface DurableObjectTransaction {
|
|
437
508
|
get<T = unknown>(
|
|
438
509
|
key: string,
|
|
439
|
-
options?: DurableObjectGetOptions
|
|
510
|
+
options?: DurableObjectGetOptions,
|
|
440
511
|
): Promise<T | undefined>;
|
|
441
512
|
get<T = unknown>(
|
|
442
513
|
keys: string[],
|
|
443
|
-
options?: DurableObjectGetOptions
|
|
514
|
+
options?: DurableObjectGetOptions,
|
|
444
515
|
): Promise<Map<string, T>>;
|
|
445
516
|
list<T = unknown>(
|
|
446
|
-
options?: DurableObjectListOptions
|
|
517
|
+
options?: DurableObjectListOptions,
|
|
447
518
|
): Promise<Map<string, T>>;
|
|
448
519
|
put<T>(
|
|
449
520
|
key: string,
|
|
450
521
|
value: T,
|
|
451
|
-
options?: DurableObjectPutOptions
|
|
522
|
+
options?: DurableObjectPutOptions,
|
|
452
523
|
): Promise<void>;
|
|
453
524
|
put<T>(
|
|
454
525
|
entries: Record<string, T>,
|
|
455
|
-
options?: DurableObjectPutOptions
|
|
526
|
+
options?: DurableObjectPutOptions,
|
|
456
527
|
): Promise<void>;
|
|
457
528
|
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
|
|
458
529
|
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
|
|
@@ -460,41 +531,41 @@ export interface DurableObjectTransaction {
|
|
|
460
531
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
461
532
|
setAlarm(
|
|
462
533
|
scheduledTime: number | Date,
|
|
463
|
-
options?: DurableObjectSetAlarmOptions
|
|
534
|
+
options?: DurableObjectSetAlarmOptions,
|
|
464
535
|
): Promise<void>;
|
|
465
536
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
466
537
|
}
|
|
467
538
|
export interface DurableObjectStorage {
|
|
468
539
|
get<T = unknown>(
|
|
469
540
|
key: string,
|
|
470
|
-
options?: DurableObjectGetOptions
|
|
541
|
+
options?: DurableObjectGetOptions,
|
|
471
542
|
): Promise<T | undefined>;
|
|
472
543
|
get<T = unknown>(
|
|
473
544
|
keys: string[],
|
|
474
|
-
options?: DurableObjectGetOptions
|
|
545
|
+
options?: DurableObjectGetOptions,
|
|
475
546
|
): Promise<Map<string, T>>;
|
|
476
547
|
list<T = unknown>(
|
|
477
|
-
options?: DurableObjectListOptions
|
|
548
|
+
options?: DurableObjectListOptions,
|
|
478
549
|
): Promise<Map<string, T>>;
|
|
479
550
|
put<T>(
|
|
480
551
|
key: string,
|
|
481
552
|
value: T,
|
|
482
|
-
options?: DurableObjectPutOptions
|
|
553
|
+
options?: DurableObjectPutOptions,
|
|
483
554
|
): Promise<void>;
|
|
484
555
|
put<T>(
|
|
485
556
|
entries: Record<string, T>,
|
|
486
|
-
options?: DurableObjectPutOptions
|
|
557
|
+
options?: DurableObjectPutOptions,
|
|
487
558
|
): Promise<void>;
|
|
488
559
|
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
|
|
489
560
|
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
|
|
490
561
|
deleteAll(options?: DurableObjectPutOptions): Promise<void>;
|
|
491
562
|
transaction<T>(
|
|
492
|
-
closure: (txn: DurableObjectTransaction) => Promise<T
|
|
563
|
+
closure: (txn: DurableObjectTransaction) => Promise<T>,
|
|
493
564
|
): Promise<T>;
|
|
494
565
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
495
566
|
setAlarm(
|
|
496
567
|
scheduledTime: number | Date,
|
|
497
|
-
options?: DurableObjectSetAlarmOptions
|
|
568
|
+
options?: DurableObjectSetAlarmOptions,
|
|
498
569
|
): Promise<void>;
|
|
499
570
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
500
571
|
sync(): Promise<void>;
|
|
@@ -541,32 +612,101 @@ export interface AnalyticsEngineDataPoint {
|
|
|
541
612
|
}
|
|
542
613
|
export declare class Event {
|
|
543
614
|
constructor(type: string, init?: EventInit);
|
|
544
|
-
/**
|
|
615
|
+
/**
|
|
616
|
+
* Returns the type of event, e.g. "click", "hashchange", or "submit".
|
|
617
|
+
*
|
|
618
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
|
619
|
+
*/
|
|
545
620
|
readonly type: string;
|
|
546
|
-
/**
|
|
621
|
+
/**
|
|
622
|
+
* Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
|
|
623
|
+
*
|
|
624
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
|
625
|
+
*/
|
|
547
626
|
readonly eventPhase: number;
|
|
548
|
-
/**
|
|
627
|
+
/**
|
|
628
|
+
* 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.
|
|
629
|
+
*
|
|
630
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
|
631
|
+
*/
|
|
549
632
|
readonly composed: boolean;
|
|
550
|
-
/**
|
|
633
|
+
/**
|
|
634
|
+
* 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.
|
|
635
|
+
*
|
|
636
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
|
|
637
|
+
*/
|
|
551
638
|
readonly bubbles: boolean;
|
|
552
|
-
/**
|
|
639
|
+
/**
|
|
640
|
+
* 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.
|
|
641
|
+
*
|
|
642
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
|
|
643
|
+
*/
|
|
553
644
|
readonly cancelable: boolean;
|
|
554
|
-
/**
|
|
645
|
+
/**
|
|
646
|
+
* Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
|
|
647
|
+
*
|
|
648
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
|
|
649
|
+
*/
|
|
555
650
|
readonly defaultPrevented: boolean;
|
|
556
|
-
/**
|
|
651
|
+
/**
|
|
652
|
+
* @deprecated
|
|
653
|
+
*
|
|
654
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
|
|
655
|
+
*/
|
|
557
656
|
readonly returnValue: boolean;
|
|
558
|
-
/**
|
|
657
|
+
/**
|
|
658
|
+
* Returns the object whose event listener's callback is currently being invoked.
|
|
659
|
+
*
|
|
660
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
|
|
661
|
+
*/
|
|
559
662
|
readonly currentTarget?: EventTarget;
|
|
560
|
-
/**
|
|
663
|
+
/**
|
|
664
|
+
* @deprecated
|
|
665
|
+
*
|
|
666
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
|
667
|
+
*/
|
|
561
668
|
readonly srcElement?: EventTarget;
|
|
562
|
-
/**
|
|
669
|
+
/**
|
|
670
|
+
* Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
|
|
671
|
+
*
|
|
672
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
|
|
673
|
+
*/
|
|
563
674
|
readonly timeStamp: number;
|
|
564
|
-
/**
|
|
675
|
+
/**
|
|
676
|
+
* Returns true if event was dispatched by the user agent, and false otherwise.
|
|
677
|
+
*
|
|
678
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
|
679
|
+
*/
|
|
565
680
|
readonly isTrusted: boolean;
|
|
681
|
+
/**
|
|
682
|
+
* @deprecated
|
|
683
|
+
*
|
|
684
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
|
685
|
+
*/
|
|
566
686
|
cancelBubble: boolean;
|
|
687
|
+
/**
|
|
688
|
+
* 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.
|
|
689
|
+
*
|
|
690
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
|
691
|
+
*/
|
|
567
692
|
stopImmediatePropagation(): void;
|
|
693
|
+
/**
|
|
694
|
+
* 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.
|
|
695
|
+
*
|
|
696
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
|
697
|
+
*/
|
|
568
698
|
preventDefault(): void;
|
|
699
|
+
/**
|
|
700
|
+
* When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
|
|
701
|
+
*
|
|
702
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
|
703
|
+
*/
|
|
569
704
|
stopPropagation(): void;
|
|
705
|
+
/**
|
|
706
|
+
* 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.
|
|
707
|
+
*
|
|
708
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
|
709
|
+
*/
|
|
570
710
|
composedPath(): EventTarget[];
|
|
571
711
|
static readonly NONE: number;
|
|
572
712
|
static readonly CAPTURING_PHASE: number;
|
|
@@ -579,28 +719,55 @@ export interface EventInit {
|
|
|
579
719
|
composed?: boolean;
|
|
580
720
|
}
|
|
581
721
|
export type EventListener<EventType extends Event = Event> = (
|
|
582
|
-
event: EventType
|
|
722
|
+
event: EventType,
|
|
583
723
|
) => void;
|
|
584
724
|
export interface EventListenerObject<EventType extends Event = Event> {
|
|
585
725
|
handleEvent(event: EventType): void;
|
|
586
726
|
}
|
|
587
727
|
export type EventListenerOrEventListenerObject<
|
|
588
|
-
EventType extends Event = Event
|
|
728
|
+
EventType extends Event = Event,
|
|
589
729
|
> = EventListener<EventType> | EventListenerObject<EventType>;
|
|
590
730
|
export declare class EventTarget<
|
|
591
|
-
EventMap extends Record<string, Event> = Record<string, Event
|
|
731
|
+
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
592
732
|
> {
|
|
593
733
|
constructor();
|
|
734
|
+
/**
|
|
735
|
+
* 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.
|
|
736
|
+
*
|
|
737
|
+
* 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.
|
|
738
|
+
*
|
|
739
|
+
* 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.
|
|
740
|
+
*
|
|
741
|
+
* 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.
|
|
742
|
+
*
|
|
743
|
+
* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
744
|
+
*
|
|
745
|
+
* If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
746
|
+
*
|
|
747
|
+
* The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
748
|
+
*
|
|
749
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
750
|
+
*/
|
|
594
751
|
addEventListener<Type extends keyof EventMap>(
|
|
595
752
|
type: Type,
|
|
596
753
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
597
|
-
options?: EventTargetAddEventListenerOptions | boolean
|
|
754
|
+
options?: EventTargetAddEventListenerOptions | boolean,
|
|
598
755
|
): void;
|
|
756
|
+
/**
|
|
757
|
+
* Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
758
|
+
*
|
|
759
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
760
|
+
*/
|
|
599
761
|
removeEventListener<Type extends keyof EventMap>(
|
|
600
762
|
type: Type,
|
|
601
763
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
602
|
-
options?: EventTargetEventListenerOptions | boolean
|
|
764
|
+
options?: EventTargetEventListenerOptions | boolean,
|
|
603
765
|
): void;
|
|
766
|
+
/**
|
|
767
|
+
* 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.
|
|
768
|
+
*
|
|
769
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
770
|
+
*/
|
|
604
771
|
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
|
|
605
772
|
}
|
|
606
773
|
export interface EventTargetEventListenerOptions {
|
|
@@ -617,17 +784,34 @@ export interface EventTargetHandlerObject {
|
|
|
617
784
|
}
|
|
618
785
|
export declare class AbortController {
|
|
619
786
|
constructor();
|
|
620
|
-
/**
|
|
787
|
+
/**
|
|
788
|
+
* Returns the AbortSignal object associated with this object.
|
|
789
|
+
*
|
|
790
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
|
|
791
|
+
*/
|
|
621
792
|
readonly signal: AbortSignal;
|
|
793
|
+
/**
|
|
794
|
+
* 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.
|
|
795
|
+
*
|
|
796
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
|
797
|
+
*/
|
|
622
798
|
abort(reason?: any): void;
|
|
623
799
|
}
|
|
624
800
|
export declare abstract class AbortSignal extends EventTarget {
|
|
801
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
625
802
|
static abort(reason?: any): AbortSignal;
|
|
803
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
626
804
|
static timeout(delay: number): AbortSignal;
|
|
627
805
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
628
|
-
/**
|
|
806
|
+
/**
|
|
807
|
+
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
808
|
+
*
|
|
809
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
810
|
+
*/
|
|
629
811
|
readonly aborted: boolean;
|
|
812
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
630
813
|
readonly reason: any;
|
|
814
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
631
815
|
throwIfAborted(): void;
|
|
632
816
|
}
|
|
633
817
|
export interface Scheduler {
|
|
@@ -637,10 +821,16 @@ export interface SchedulerWaitOptions {
|
|
|
637
821
|
signal?: AbortSignal;
|
|
638
822
|
}
|
|
639
823
|
export declare abstract class ExtendableEvent extends Event {
|
|
824
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
640
825
|
waitUntil(promise: Promise<any>): void;
|
|
641
826
|
}
|
|
642
827
|
export declare class CustomEvent<T = any> extends Event {
|
|
643
828
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
829
|
+
/**
|
|
830
|
+
* Returns any custom data event was created with. Typically used for synthetic events.
|
|
831
|
+
*
|
|
832
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
|
|
833
|
+
*/
|
|
644
834
|
get detail(): T;
|
|
645
835
|
}
|
|
646
836
|
export interface CustomEventCustomEventInit {
|
|
@@ -652,13 +842,19 @@ export interface CustomEventCustomEventInit {
|
|
|
652
842
|
export declare class Blob {
|
|
653
843
|
constructor(
|
|
654
844
|
bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
655
|
-
options?: BlobOptions
|
|
845
|
+
options?: BlobOptions,
|
|
656
846
|
);
|
|
847
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
657
848
|
readonly size: number;
|
|
849
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
658
850
|
readonly type: string;
|
|
851
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
659
852
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
853
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
660
854
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
855
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
661
856
|
text(): Promise<string>;
|
|
857
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
662
858
|
stream(): ReadableStream;
|
|
663
859
|
}
|
|
664
860
|
export interface BlobOptions {
|
|
@@ -668,9 +864,11 @@ export declare class File extends Blob {
|
|
|
668
864
|
constructor(
|
|
669
865
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
670
866
|
name: string,
|
|
671
|
-
options?: FileOptions
|
|
867
|
+
options?: FileOptions,
|
|
672
868
|
);
|
|
869
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
673
870
|
readonly name: string;
|
|
871
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
674
872
|
readonly lastModified: number;
|
|
675
873
|
}
|
|
676
874
|
export interface FileOptions {
|
|
@@ -678,6 +876,7 @@ export interface FileOptions {
|
|
|
678
876
|
lastModified?: number;
|
|
679
877
|
}
|
|
680
878
|
export declare abstract class CacheStorage {
|
|
879
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
681
880
|
open(cacheName: string): Promise<Cache>;
|
|
682
881
|
readonly default: Cache;
|
|
683
882
|
}
|
|
@@ -685,7 +884,7 @@ export declare abstract class Cache {
|
|
|
685
884
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
686
885
|
match(
|
|
687
886
|
request: RequestInfo,
|
|
688
|
-
options?: CacheQueryOptions
|
|
887
|
+
options?: CacheQueryOptions,
|
|
689
888
|
): Promise<Response | undefined>;
|
|
690
889
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
691
890
|
}
|
|
@@ -693,8 +892,13 @@ export interface CacheQueryOptions {
|
|
|
693
892
|
ignoreMethod?: boolean;
|
|
694
893
|
}
|
|
695
894
|
export declare abstract class Crypto {
|
|
696
|
-
/**
|
|
895
|
+
/**
|
|
896
|
+
* Available only in secure contexts.
|
|
897
|
+
*
|
|
898
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
899
|
+
*/
|
|
697
900
|
readonly subtle: SubtleCrypto;
|
|
901
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
698
902
|
getRandomValues<
|
|
699
903
|
T extends
|
|
700
904
|
| Int8Array
|
|
@@ -704,8 +908,13 @@ export declare abstract class Crypto {
|
|
|
704
908
|
| Int32Array
|
|
705
909
|
| Uint32Array
|
|
706
910
|
| BigInt64Array
|
|
707
|
-
| BigUint64Array
|
|
911
|
+
| BigUint64Array,
|
|
708
912
|
>(buffer: T): T;
|
|
913
|
+
/**
|
|
914
|
+
* Available only in secure contexts.
|
|
915
|
+
*
|
|
916
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
917
|
+
*/
|
|
709
918
|
randomUUID(): string;
|
|
710
919
|
DigestStream: typeof DigestStream;
|
|
711
920
|
}
|
|
@@ -713,59 +922,63 @@ export declare abstract class SubtleCrypto {
|
|
|
713
922
|
encrypt(
|
|
714
923
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
715
924
|
key: CryptoKey,
|
|
716
|
-
plainText: ArrayBuffer | ArrayBufferView
|
|
925
|
+
plainText: ArrayBuffer | ArrayBufferView,
|
|
717
926
|
): Promise<ArrayBuffer>;
|
|
718
927
|
decrypt(
|
|
719
928
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
720
929
|
key: CryptoKey,
|
|
721
|
-
cipherText: ArrayBuffer | ArrayBufferView
|
|
930
|
+
cipherText: ArrayBuffer | ArrayBufferView,
|
|
722
931
|
): Promise<ArrayBuffer>;
|
|
723
932
|
sign(
|
|
724
933
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
725
934
|
key: CryptoKey,
|
|
726
|
-
data: ArrayBuffer | ArrayBufferView
|
|
935
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
727
936
|
): Promise<ArrayBuffer>;
|
|
728
937
|
verify(
|
|
729
938
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
730
939
|
key: CryptoKey,
|
|
731
940
|
signature: ArrayBuffer | ArrayBufferView,
|
|
732
|
-
data: ArrayBuffer | ArrayBufferView
|
|
941
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
733
942
|
): Promise<boolean>;
|
|
734
943
|
digest(
|
|
735
944
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
736
|
-
data: ArrayBuffer | ArrayBufferView
|
|
945
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
737
946
|
): Promise<ArrayBuffer>;
|
|
947
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
738
948
|
generateKey(
|
|
739
949
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
740
950
|
extractable: boolean,
|
|
741
|
-
keyUsages: string[]
|
|
951
|
+
keyUsages: string[],
|
|
742
952
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
953
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
743
954
|
deriveKey(
|
|
744
955
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
745
956
|
baseKey: CryptoKey,
|
|
746
957
|
derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
747
958
|
extractable: boolean,
|
|
748
|
-
keyUsages: string[]
|
|
959
|
+
keyUsages: string[],
|
|
749
960
|
): Promise<CryptoKey>;
|
|
750
961
|
deriveBits(
|
|
751
962
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
752
963
|
baseKey: CryptoKey,
|
|
753
|
-
length: number | null
|
|
964
|
+
length: number | null,
|
|
754
965
|
): Promise<ArrayBuffer>;
|
|
966
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
755
967
|
importKey(
|
|
756
968
|
format: string,
|
|
757
969
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
758
970
|
algorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
759
971
|
extractable: boolean,
|
|
760
|
-
keyUsages: string[]
|
|
972
|
+
keyUsages: string[],
|
|
761
973
|
): Promise<CryptoKey>;
|
|
762
974
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
763
975
|
wrapKey(
|
|
764
976
|
format: string,
|
|
765
977
|
key: CryptoKey,
|
|
766
978
|
wrappingKey: CryptoKey,
|
|
767
|
-
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm
|
|
979
|
+
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
768
980
|
): Promise<ArrayBuffer>;
|
|
981
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
769
982
|
unwrapKey(
|
|
770
983
|
format: string,
|
|
771
984
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -773,16 +986,19 @@ export declare abstract class SubtleCrypto {
|
|
|
773
986
|
unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
774
987
|
unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
775
988
|
extractable: boolean,
|
|
776
|
-
keyUsages: string[]
|
|
989
|
+
keyUsages: string[],
|
|
777
990
|
): Promise<CryptoKey>;
|
|
778
991
|
timingSafeEqual(
|
|
779
992
|
a: ArrayBuffer | ArrayBufferView,
|
|
780
|
-
b: ArrayBuffer | ArrayBufferView
|
|
993
|
+
b: ArrayBuffer | ArrayBufferView,
|
|
781
994
|
): boolean;
|
|
782
995
|
}
|
|
783
996
|
export declare abstract class CryptoKey {
|
|
997
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
784
998
|
readonly type: string;
|
|
999
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
785
1000
|
readonly extractable: boolean;
|
|
1001
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
786
1002
|
readonly algorithm:
|
|
787
1003
|
| CryptoKeyKeyAlgorithm
|
|
788
1004
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -790,6 +1006,7 @@ export declare abstract class CryptoKey {
|
|
|
790
1006
|
| CryptoKeyRsaKeyAlgorithm
|
|
791
1007
|
| CryptoKeyEllipticKeyAlgorithm
|
|
792
1008
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1009
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
793
1010
|
readonly usages: string[];
|
|
794
1011
|
}
|
|
795
1012
|
export interface CryptoKeyPair {
|
|
@@ -898,9 +1115,24 @@ export declare class DigestStream extends WritableStream<
|
|
|
898
1115
|
}
|
|
899
1116
|
export declare class TextDecoder {
|
|
900
1117
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1118
|
+
/**
|
|
1119
|
+
* 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.
|
|
1120
|
+
*
|
|
1121
|
+
* ```
|
|
1122
|
+
* var string = "", decoder = new TextDecoder(encoding), buffer;
|
|
1123
|
+
* while(buffer = next_chunk()) {
|
|
1124
|
+
* string += decoder.decode(buffer, {stream:true});
|
|
1125
|
+
* }
|
|
1126
|
+
* string += decoder.decode(); // end-of-queue
|
|
1127
|
+
* ```
|
|
1128
|
+
*
|
|
1129
|
+
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
|
|
1130
|
+
*
|
|
1131
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
|
|
1132
|
+
*/
|
|
901
1133
|
decode(
|
|
902
1134
|
input?: ArrayBuffer | ArrayBufferView,
|
|
903
|
-
options?: TextDecoderDecodeOptions
|
|
1135
|
+
options?: TextDecoderDecodeOptions,
|
|
904
1136
|
): string;
|
|
905
1137
|
readonly encoding: string;
|
|
906
1138
|
readonly fatal: boolean;
|
|
@@ -908,10 +1140,20 @@ export declare class TextDecoder {
|
|
|
908
1140
|
}
|
|
909
1141
|
export declare class TextEncoder {
|
|
910
1142
|
constructor();
|
|
1143
|
+
/**
|
|
1144
|
+
* Returns the result of running UTF-8's encoder.
|
|
1145
|
+
*
|
|
1146
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
|
1147
|
+
*/
|
|
911
1148
|
encode(input?: string): Uint8Array;
|
|
1149
|
+
/**
|
|
1150
|
+
* 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.
|
|
1151
|
+
*
|
|
1152
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
|
1153
|
+
*/
|
|
912
1154
|
encodeInto(
|
|
913
1155
|
input: string,
|
|
914
|
-
buffer: ArrayBuffer | ArrayBufferView
|
|
1156
|
+
buffer: ArrayBuffer | ArrayBufferView,
|
|
915
1157
|
): TextEncoderEncodeIntoResult;
|
|
916
1158
|
readonly encoding: string;
|
|
917
1159
|
}
|
|
@@ -936,17 +1178,20 @@ export declare class FormData {
|
|
|
936
1178
|
has(name: string): boolean;
|
|
937
1179
|
set(name: string, value: string): void;
|
|
938
1180
|
set(name: string, value: Blob, filename?: string): void;
|
|
1181
|
+
/** Returns an array of key, value pairs for every entry in the list. */
|
|
939
1182
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1183
|
+
/** Returns a list of keys in the list. */
|
|
940
1184
|
keys(): IterableIterator<string>;
|
|
1185
|
+
/** Returns a list of values in the list. */
|
|
941
1186
|
values(): IterableIterator<File | string>;
|
|
942
1187
|
forEach<This = unknown>(
|
|
943
1188
|
callback: (
|
|
944
1189
|
this: This,
|
|
945
1190
|
value: File | string,
|
|
946
1191
|
key: string,
|
|
947
|
-
parent: FormData
|
|
1192
|
+
parent: FormData,
|
|
948
1193
|
) => void,
|
|
949
|
-
thisArg?: This
|
|
1194
|
+
thisArg?: This,
|
|
950
1195
|
): void;
|
|
951
1196
|
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
|
|
952
1197
|
}
|
|
@@ -957,7 +1202,7 @@ export declare class HTMLRewriter {
|
|
|
957
1202
|
constructor();
|
|
958
1203
|
on(
|
|
959
1204
|
selector: string,
|
|
960
|
-
handlers: HTMLRewriterElementContentHandlers
|
|
1205
|
+
handlers: HTMLRewriterElementContentHandlers,
|
|
961
1206
|
): HTMLRewriter;
|
|
962
1207
|
onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
|
|
963
1208
|
transform(response: Response): Response;
|
|
@@ -1024,7 +1269,9 @@ export interface DocumentEnd {
|
|
|
1024
1269
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
1025
1270
|
}
|
|
1026
1271
|
export declare abstract class FetchEvent extends ExtendableEvent {
|
|
1272
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
1027
1273
|
readonly request: Request;
|
|
1274
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
1028
1275
|
respondWith(promise: Response | Promise<Response>): void;
|
|
1029
1276
|
passThroughOnException(): void;
|
|
1030
1277
|
}
|
|
@@ -1042,10 +1289,13 @@ export declare class Headers {
|
|
|
1042
1289
|
delete(name: string): void;
|
|
1043
1290
|
forEach<This = unknown>(
|
|
1044
1291
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
1045
|
-
thisArg?: This
|
|
1292
|
+
thisArg?: This,
|
|
1046
1293
|
): void;
|
|
1294
|
+
/** Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
1047
1295
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1296
|
+
/** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
1048
1297
|
keys(): IterableIterator<string>;
|
|
1298
|
+
/** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
1049
1299
|
values(): IterableIterator<string>;
|
|
1050
1300
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1051
1301
|
}
|
|
@@ -1068,14 +1318,23 @@ export declare abstract class Body {
|
|
|
1068
1318
|
}
|
|
1069
1319
|
export declare class Response extends Body {
|
|
1070
1320
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1321
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1071
1322
|
static redirect(url: string, status?: number): Response;
|
|
1323
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1072
1324
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1325
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1073
1326
|
clone(): Response;
|
|
1327
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1074
1328
|
readonly status: number;
|
|
1329
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1075
1330
|
readonly statusText: string;
|
|
1331
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1076
1332
|
readonly headers: Headers;
|
|
1333
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1077
1334
|
readonly ok: boolean;
|
|
1335
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1078
1336
|
readonly redirected: boolean;
|
|
1337
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1079
1338
|
readonly url: string;
|
|
1080
1339
|
readonly webSocket: WebSocket | null;
|
|
1081
1340
|
readonly cf?: any;
|
|
@@ -1090,29 +1349,58 @@ export interface ResponseInit {
|
|
|
1090
1349
|
}
|
|
1091
1350
|
export type RequestInfo<
|
|
1092
1351
|
CfHostMetadata = unknown,
|
|
1093
|
-
Cf = CfProperties<CfHostMetadata
|
|
1352
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1094
1353
|
> = Request<CfHostMetadata, Cf> | string | URL;
|
|
1095
1354
|
export declare class Request<
|
|
1096
1355
|
CfHostMetadata = unknown,
|
|
1097
|
-
Cf = CfProperties<CfHostMetadata
|
|
1356
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1098
1357
|
> extends Body {
|
|
1099
1358
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1359
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1100
1360
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1101
|
-
/**
|
|
1361
|
+
/**
|
|
1362
|
+
* Returns request's HTTP method, which is "GET" by default.
|
|
1363
|
+
*
|
|
1364
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1365
|
+
*/
|
|
1102
1366
|
readonly method: string;
|
|
1103
|
-
/**
|
|
1367
|
+
/**
|
|
1368
|
+
* Returns the URL of request as a string.
|
|
1369
|
+
*
|
|
1370
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1371
|
+
*/
|
|
1104
1372
|
readonly url: string;
|
|
1105
|
-
/**
|
|
1373
|
+
/**
|
|
1374
|
+
* 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.
|
|
1375
|
+
*
|
|
1376
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1377
|
+
*/
|
|
1106
1378
|
readonly headers: Headers;
|
|
1107
|
-
/**
|
|
1379
|
+
/**
|
|
1380
|
+
* 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.
|
|
1381
|
+
*
|
|
1382
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1383
|
+
*/
|
|
1108
1384
|
readonly redirect: string;
|
|
1109
1385
|
readonly fetcher: Fetcher | null;
|
|
1110
|
-
/**
|
|
1386
|
+
/**
|
|
1387
|
+
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1388
|
+
*
|
|
1389
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1390
|
+
*/
|
|
1111
1391
|
readonly signal: AbortSignal;
|
|
1112
1392
|
readonly cf?: Cf;
|
|
1113
|
-
/**
|
|
1393
|
+
/**
|
|
1394
|
+
* 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]
|
|
1395
|
+
*
|
|
1396
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1397
|
+
*/
|
|
1114
1398
|
readonly integrity: string;
|
|
1115
|
-
/**
|
|
1399
|
+
/**
|
|
1400
|
+
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1401
|
+
*
|
|
1402
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1403
|
+
*/
|
|
1116
1404
|
readonly keepalive: boolean;
|
|
1117
1405
|
}
|
|
1118
1406
|
export interface RequestInit<Cf = CfProperties> {
|
|
@@ -1131,10 +1419,18 @@ export interface RequestInit<Cf = CfProperties> {
|
|
|
1131
1419
|
/** An AbortSignal to set request's signal. */
|
|
1132
1420
|
signal?: AbortSignal | null;
|
|
1133
1421
|
}
|
|
1134
|
-
export
|
|
1422
|
+
export type Service<
|
|
1423
|
+
T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
|
|
1424
|
+
> = Fetcher<T>;
|
|
1425
|
+
export type Fetcher<
|
|
1426
|
+
T extends Rpc.EntrypointBranded | undefined = undefined,
|
|
1427
|
+
Reserved extends string = never,
|
|
1428
|
+
> = (T extends Rpc.EntrypointBranded
|
|
1429
|
+
? Rpc.Provider<T, Reserved | "fetch" | "connect">
|
|
1430
|
+
: unknown) & {
|
|
1135
1431
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1136
1432
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1137
|
-
}
|
|
1433
|
+
};
|
|
1138
1434
|
export interface FetcherPutOptions {
|
|
1139
1435
|
expiration?: number;
|
|
1140
1436
|
expirationTtl?: number;
|
|
@@ -1159,74 +1455,74 @@ export type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
|
1159
1455
|
export interface KVNamespace<Key extends string = string> {
|
|
1160
1456
|
get(
|
|
1161
1457
|
key: Key,
|
|
1162
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1458
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1163
1459
|
): Promise<string | null>;
|
|
1164
1460
|
get(key: Key, type: "text"): Promise<string | null>;
|
|
1165
1461
|
get<ExpectedValue = unknown>(
|
|
1166
1462
|
key: Key,
|
|
1167
|
-
type: "json"
|
|
1463
|
+
type: "json",
|
|
1168
1464
|
): Promise<ExpectedValue | null>;
|
|
1169
1465
|
get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
|
|
1170
1466
|
get(key: Key, type: "stream"): Promise<ReadableStream | null>;
|
|
1171
1467
|
get(
|
|
1172
1468
|
key: Key,
|
|
1173
|
-
options?: KVNamespaceGetOptions<"text"
|
|
1469
|
+
options?: KVNamespaceGetOptions<"text">,
|
|
1174
1470
|
): Promise<string | null>;
|
|
1175
1471
|
get<ExpectedValue = unknown>(
|
|
1176
1472
|
key: Key,
|
|
1177
|
-
options?: KVNamespaceGetOptions<"json"
|
|
1473
|
+
options?: KVNamespaceGetOptions<"json">,
|
|
1178
1474
|
): Promise<ExpectedValue | null>;
|
|
1179
1475
|
get(
|
|
1180
1476
|
key: Key,
|
|
1181
|
-
options?: KVNamespaceGetOptions<"arrayBuffer"
|
|
1477
|
+
options?: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1182
1478
|
): Promise<ArrayBuffer | null>;
|
|
1183
1479
|
get(
|
|
1184
1480
|
key: Key,
|
|
1185
|
-
options?: KVNamespaceGetOptions<"stream"
|
|
1481
|
+
options?: KVNamespaceGetOptions<"stream">,
|
|
1186
1482
|
): Promise<ReadableStream | null>;
|
|
1187
1483
|
list<Metadata = unknown>(
|
|
1188
|
-
options?: KVNamespaceListOptions
|
|
1484
|
+
options?: KVNamespaceListOptions,
|
|
1189
1485
|
): Promise<KVNamespaceListResult<Metadata, Key>>;
|
|
1190
1486
|
put(
|
|
1191
1487
|
key: Key,
|
|
1192
1488
|
value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
|
|
1193
|
-
options?: KVNamespacePutOptions
|
|
1489
|
+
options?: KVNamespacePutOptions,
|
|
1194
1490
|
): Promise<void>;
|
|
1195
1491
|
getWithMetadata<Metadata = unknown>(
|
|
1196
1492
|
key: Key,
|
|
1197
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1493
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1198
1494
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1199
1495
|
getWithMetadata<Metadata = unknown>(
|
|
1200
1496
|
key: Key,
|
|
1201
|
-
type: "text"
|
|
1497
|
+
type: "text",
|
|
1202
1498
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1203
1499
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1204
1500
|
key: Key,
|
|
1205
|
-
type: "json"
|
|
1501
|
+
type: "json",
|
|
1206
1502
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1207
1503
|
getWithMetadata<Metadata = unknown>(
|
|
1208
1504
|
key: Key,
|
|
1209
|
-
type: "arrayBuffer"
|
|
1505
|
+
type: "arrayBuffer",
|
|
1210
1506
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1211
1507
|
getWithMetadata<Metadata = unknown>(
|
|
1212
1508
|
key: Key,
|
|
1213
|
-
type: "stream"
|
|
1509
|
+
type: "stream",
|
|
1214
1510
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1215
1511
|
getWithMetadata<Metadata = unknown>(
|
|
1216
1512
|
key: Key,
|
|
1217
|
-
options: KVNamespaceGetOptions<"text"
|
|
1513
|
+
options: KVNamespaceGetOptions<"text">,
|
|
1218
1514
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1219
1515
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1220
1516
|
key: Key,
|
|
1221
|
-
options: KVNamespaceGetOptions<"json"
|
|
1517
|
+
options: KVNamespaceGetOptions<"json">,
|
|
1222
1518
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1223
1519
|
getWithMetadata<Metadata = unknown>(
|
|
1224
1520
|
key: Key,
|
|
1225
|
-
options: KVNamespaceGetOptions<"arrayBuffer"
|
|
1521
|
+
options: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1226
1522
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1227
1523
|
getWithMetadata<Metadata = unknown>(
|
|
1228
1524
|
key: Key,
|
|
1229
|
-
options: KVNamespaceGetOptions<"stream"
|
|
1525
|
+
options: KVNamespaceGetOptions<"stream">,
|
|
1230
1526
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1231
1527
|
delete(key: Key): Promise<void>;
|
|
1232
1528
|
}
|
|
@@ -1254,7 +1550,7 @@ export interface Queue<Body = unknown> {
|
|
|
1254
1550
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1255
1551
|
sendBatch(
|
|
1256
1552
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
1257
|
-
options?: QueueSendBatchOptions
|
|
1553
|
+
options?: QueueSendBatchOptions,
|
|
1258
1554
|
): Promise<void>;
|
|
1259
1555
|
}
|
|
1260
1556
|
export interface QueueSendOptions {
|
|
@@ -1276,6 +1572,7 @@ export interface Message<Body = unknown> {
|
|
|
1276
1572
|
readonly id: string;
|
|
1277
1573
|
readonly timestamp: Date;
|
|
1278
1574
|
readonly body: Body;
|
|
1575
|
+
readonly attempts: number;
|
|
1279
1576
|
retry(options?: QueueRetryOptions): void;
|
|
1280
1577
|
ack(): void;
|
|
1281
1578
|
}
|
|
@@ -1311,7 +1608,7 @@ export declare abstract class R2Bucket {
|
|
|
1311
1608
|
key: string,
|
|
1312
1609
|
options: R2GetOptions & {
|
|
1313
1610
|
onlyIf: R2Conditional | Headers;
|
|
1314
|
-
}
|
|
1611
|
+
},
|
|
1315
1612
|
): Promise<R2ObjectBody | R2Object | null>;
|
|
1316
1613
|
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
|
|
1317
1614
|
put(
|
|
@@ -1325,7 +1622,7 @@ export declare abstract class R2Bucket {
|
|
|
1325
1622
|
| Blob,
|
|
1326
1623
|
options?: R2PutOptions & {
|
|
1327
1624
|
onlyIf: R2Conditional | Headers;
|
|
1328
|
-
}
|
|
1625
|
+
},
|
|
1329
1626
|
): Promise<R2Object | null>;
|
|
1330
1627
|
put(
|
|
1331
1628
|
key: string,
|
|
@@ -1336,11 +1633,11 @@ export declare abstract class R2Bucket {
|
|
|
1336
1633
|
| string
|
|
1337
1634
|
| null
|
|
1338
1635
|
| Blob,
|
|
1339
|
-
options?: R2PutOptions
|
|
1636
|
+
options?: R2PutOptions,
|
|
1340
1637
|
): Promise<R2Object>;
|
|
1341
1638
|
createMultipartUpload(
|
|
1342
1639
|
key: string,
|
|
1343
|
-
options?: R2MultipartOptions
|
|
1640
|
+
options?: R2MultipartOptions,
|
|
1344
1641
|
): Promise<R2MultipartUpload>;
|
|
1345
1642
|
resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
|
|
1346
1643
|
delete(keys: string | string[]): Promise<void>;
|
|
@@ -1351,7 +1648,7 @@ export interface R2MultipartUpload {
|
|
|
1351
1648
|
readonly uploadId: string;
|
|
1352
1649
|
uploadPart(
|
|
1353
1650
|
partNumber: number,
|
|
1354
|
-
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob
|
|
1651
|
+
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
|
|
1355
1652
|
): Promise<R2UploadedPart>;
|
|
1356
1653
|
abort(): Promise<void>;
|
|
1357
1654
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
@@ -1472,7 +1769,7 @@ export interface UnderlyingSink<W = any> {
|
|
|
1472
1769
|
start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
|
|
1473
1770
|
write?: (
|
|
1474
1771
|
chunk: W,
|
|
1475
|
-
controller: WritableStreamDefaultController
|
|
1772
|
+
controller: WritableStreamDefaultController,
|
|
1476
1773
|
) => void | Promise<void>;
|
|
1477
1774
|
abort?: (reason: any) => void | Promise<void>;
|
|
1478
1775
|
close?: () => void | Promise<void>;
|
|
@@ -1487,10 +1784,10 @@ export interface UnderlyingByteSource {
|
|
|
1487
1784
|
export interface UnderlyingSource<R = any> {
|
|
1488
1785
|
type?: "" | undefined;
|
|
1489
1786
|
start?: (
|
|
1490
|
-
controller: ReadableStreamDefaultController<R
|
|
1787
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1491
1788
|
) => void | Promise<void>;
|
|
1492
1789
|
pull?: (
|
|
1493
|
-
controller: ReadableStreamDefaultController<R
|
|
1790
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1494
1791
|
) => void | Promise<void>;
|
|
1495
1792
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1496
1793
|
expectedLength?: number | bigint;
|
|
@@ -1499,14 +1796,14 @@ export interface Transformer<I = any, O = any> {
|
|
|
1499
1796
|
readableType?: string;
|
|
1500
1797
|
writableType?: string;
|
|
1501
1798
|
start?: (
|
|
1502
|
-
controller: TransformStreamDefaultController<O
|
|
1799
|
+
controller: TransformStreamDefaultController<O>,
|
|
1503
1800
|
) => void | Promise<void>;
|
|
1504
1801
|
transform?: (
|
|
1505
1802
|
chunk: I,
|
|
1506
|
-
controller: TransformStreamDefaultController<O
|
|
1803
|
+
controller: TransformStreamDefaultController<O>,
|
|
1507
1804
|
) => void | Promise<void>;
|
|
1508
1805
|
flush?: (
|
|
1509
|
-
controller: TransformStreamDefaultController<O
|
|
1806
|
+
controller: TransformStreamDefaultController<O>,
|
|
1510
1807
|
) => void | Promise<void>;
|
|
1511
1808
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1512
1809
|
expectedLength?: number;
|
|
@@ -1543,91 +1840,137 @@ export type ReadableStreamReadResult<R = any> =
|
|
|
1543
1840
|
done: true;
|
|
1544
1841
|
value?: undefined;
|
|
1545
1842
|
};
|
|
1546
|
-
/**
|
|
1843
|
+
/**
|
|
1844
|
+
* 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.
|
|
1845
|
+
*
|
|
1846
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1847
|
+
*/
|
|
1547
1848
|
export interface ReadableStream<R = any> {
|
|
1849
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1548
1850
|
readonly locked: boolean;
|
|
1851
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1549
1852
|
cancel(reason?: any): Promise<void>;
|
|
1853
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1550
1854
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1855
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1551
1856
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1857
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1552
1858
|
pipeThrough<T>(
|
|
1553
1859
|
transform: ReadableWritablePair<T, R>,
|
|
1554
|
-
options?: StreamPipeOptions
|
|
1860
|
+
options?: StreamPipeOptions,
|
|
1555
1861
|
): ReadableStream<T>;
|
|
1862
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1556
1863
|
pipeTo(
|
|
1557
1864
|
destination: WritableStream<R>,
|
|
1558
|
-
options?: StreamPipeOptions
|
|
1865
|
+
options?: StreamPipeOptions,
|
|
1559
1866
|
): Promise<void>;
|
|
1867
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1560
1868
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1561
1869
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1562
1870
|
[Symbol.asyncIterator](
|
|
1563
|
-
options?: ReadableStreamValuesOptions
|
|
1871
|
+
options?: ReadableStreamValuesOptions,
|
|
1564
1872
|
): AsyncIterableIterator<R>;
|
|
1565
1873
|
}
|
|
1566
1874
|
export declare const ReadableStream: {
|
|
1567
1875
|
prototype: ReadableStream;
|
|
1568
1876
|
new (
|
|
1569
1877
|
underlyingSource: UnderlyingByteSource,
|
|
1570
|
-
strategy?: QueuingStrategy<Uint8Array
|
|
1878
|
+
strategy?: QueuingStrategy<Uint8Array>,
|
|
1571
1879
|
): ReadableStream<Uint8Array>;
|
|
1572
1880
|
new <R = any>(
|
|
1573
1881
|
underlyingSource?: UnderlyingSource<R>,
|
|
1574
|
-
strategy?: QueuingStrategy<R
|
|
1882
|
+
strategy?: QueuingStrategy<R>,
|
|
1575
1883
|
): ReadableStream<R>;
|
|
1576
1884
|
};
|
|
1577
1885
|
export declare class ReadableStreamDefaultReader<R = any> {
|
|
1578
1886
|
constructor(stream: ReadableStream);
|
|
1579
1887
|
readonly closed: Promise<void>;
|
|
1580
1888
|
cancel(reason?: any): Promise<void>;
|
|
1889
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1581
1890
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1891
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1582
1892
|
releaseLock(): void;
|
|
1583
1893
|
}
|
|
1584
1894
|
export declare class ReadableStreamBYOBReader {
|
|
1585
1895
|
constructor(stream: ReadableStream);
|
|
1586
1896
|
readonly closed: Promise<void>;
|
|
1587
1897
|
cancel(reason?: any): Promise<void>;
|
|
1898
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1588
1899
|
read<T extends ArrayBufferView>(
|
|
1589
|
-
view: T
|
|
1900
|
+
view: T,
|
|
1590
1901
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1902
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1591
1903
|
releaseLock(): void;
|
|
1592
1904
|
readAtLeast<T extends ArrayBufferView>(
|
|
1593
1905
|
minElements: number,
|
|
1594
|
-
view: T
|
|
1906
|
+
view: T,
|
|
1595
1907
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1596
1908
|
}
|
|
1597
1909
|
export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1598
1910
|
min?: number;
|
|
1599
1911
|
}
|
|
1600
1912
|
export interface ReadableStreamGetReaderOptions {
|
|
1913
|
+
/**
|
|
1914
|
+
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
|
1915
|
+
*
|
|
1916
|
+
* 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.
|
|
1917
|
+
*/
|
|
1601
1918
|
mode: "byob";
|
|
1602
1919
|
}
|
|
1920
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
1603
1921
|
export interface ReadableStreamBYOBRequest {
|
|
1922
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1604
1923
|
readonly view: Uint8Array | null;
|
|
1924
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1605
1925
|
respond(bytesWritten: number): void;
|
|
1926
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1606
1927
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1607
1928
|
readonly atLeast: number | null;
|
|
1608
1929
|
}
|
|
1930
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
1609
1931
|
export interface ReadableStreamDefaultController<R = any> {
|
|
1932
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1610
1933
|
readonly desiredSize: number | null;
|
|
1934
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1611
1935
|
close(): void;
|
|
1936
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1612
1937
|
enqueue(chunk?: R): void;
|
|
1938
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1613
1939
|
error(reason: any): void;
|
|
1614
1940
|
}
|
|
1941
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
1615
1942
|
export interface ReadableByteStreamController {
|
|
1943
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1616
1944
|
readonly byobRequest: ReadableStreamBYOBRequest | null;
|
|
1945
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1617
1946
|
readonly desiredSize: number | null;
|
|
1947
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1618
1948
|
close(): void;
|
|
1949
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1619
1950
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1951
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1620
1952
|
error(reason: any): void;
|
|
1621
1953
|
}
|
|
1622
|
-
/**
|
|
1954
|
+
/**
|
|
1955
|
+
* 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.
|
|
1956
|
+
*
|
|
1957
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
1958
|
+
*/
|
|
1623
1959
|
export interface WritableStreamDefaultController {
|
|
1960
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1624
1961
|
readonly signal: AbortSignal;
|
|
1962
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1625
1963
|
error(reason?: any): void;
|
|
1626
1964
|
}
|
|
1965
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
1627
1966
|
export interface TransformStreamDefaultController<O = any> {
|
|
1967
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1628
1968
|
get desiredSize(): number | null;
|
|
1969
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
1629
1970
|
enqueue(chunk?: O): void;
|
|
1971
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
1630
1972
|
error(reason: any): void;
|
|
1973
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
1631
1974
|
terminate(): void;
|
|
1632
1975
|
}
|
|
1633
1976
|
export interface ReadableWritablePair<R = any, W = any> {
|
|
@@ -1642,36 +1985,49 @@ export interface ReadableWritablePair<R = any, W = any> {
|
|
|
1642
1985
|
export declare class WritableStream<W = any> {
|
|
1643
1986
|
constructor(
|
|
1644
1987
|
underlyingSink?: UnderlyingSink,
|
|
1645
|
-
queuingStrategy?: QueuingStrategy
|
|
1988
|
+
queuingStrategy?: QueuingStrategy,
|
|
1646
1989
|
);
|
|
1990
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
1647
1991
|
readonly locked: boolean;
|
|
1992
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
1648
1993
|
abort(reason?: any): Promise<void>;
|
|
1994
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
1649
1995
|
close(): Promise<void>;
|
|
1996
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
1650
1997
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
1651
1998
|
}
|
|
1652
1999
|
export declare class WritableStreamDefaultWriter<W = any> {
|
|
1653
2000
|
constructor(stream: WritableStream);
|
|
2001
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
1654
2002
|
readonly closed: Promise<void>;
|
|
2003
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
1655
2004
|
readonly ready: Promise<void>;
|
|
2005
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
1656
2006
|
readonly desiredSize: number | null;
|
|
2007
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
1657
2008
|
abort(reason?: any): Promise<void>;
|
|
2009
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
1658
2010
|
close(): Promise<void>;
|
|
2011
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
1659
2012
|
write(chunk?: W): Promise<void>;
|
|
2013
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
1660
2014
|
releaseLock(): void;
|
|
1661
2015
|
}
|
|
1662
2016
|
export declare class TransformStream<I = any, O = any> {
|
|
1663
2017
|
constructor(
|
|
1664
2018
|
transformer?: Transformer<I, O>,
|
|
1665
2019
|
writableStrategy?: QueuingStrategy<I>,
|
|
1666
|
-
readableStrategy?: QueuingStrategy<O
|
|
2020
|
+
readableStrategy?: QueuingStrategy<O>,
|
|
1667
2021
|
);
|
|
2022
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
1668
2023
|
readonly readable: ReadableStream<O>;
|
|
2024
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
1669
2025
|
readonly writable: WritableStream<I>;
|
|
1670
2026
|
}
|
|
1671
2027
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
1672
2028
|
constructor(
|
|
1673
2029
|
expectedLength: number | bigint,
|
|
1674
|
-
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
2030
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
1675
2031
|
);
|
|
1676
2032
|
}
|
|
1677
2033
|
export declare class IdentityTransformStream extends TransformStream<
|
|
@@ -1717,12 +2073,16 @@ export declare class ByteLengthQueuingStrategy
|
|
|
1717
2073
|
implements QueuingStrategy<ArrayBufferView>
|
|
1718
2074
|
{
|
|
1719
2075
|
constructor(init: QueuingStrategyInit);
|
|
2076
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
1720
2077
|
get highWaterMark(): number;
|
|
2078
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
1721
2079
|
get size(): (chunk?: any) => number;
|
|
1722
2080
|
}
|
|
1723
2081
|
export declare class CountQueuingStrategy implements QueuingStrategy {
|
|
1724
2082
|
constructor(init: QueuingStrategyInit);
|
|
2083
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
1725
2084
|
get highWaterMark(): number;
|
|
2085
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
1726
2086
|
get size(): (chunk?: any) => number;
|
|
1727
2087
|
}
|
|
1728
2088
|
export interface QueuingStrategyInit {
|
|
@@ -1746,6 +2106,7 @@ export interface TraceItem {
|
|
|
1746
2106
|
readonly event:
|
|
1747
2107
|
| (
|
|
1748
2108
|
| TraceItemFetchEventInfo
|
|
2109
|
+
| TraceItemJsRpcEventInfo
|
|
1749
2110
|
| TraceItemScheduledEventInfo
|
|
1750
2111
|
| TraceItemAlarmEventInfo
|
|
1751
2112
|
| TraceItemQueueEventInfo
|
|
@@ -1760,6 +2121,7 @@ export interface TraceItem {
|
|
|
1760
2121
|
readonly exceptions: TraceException[];
|
|
1761
2122
|
readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
|
|
1762
2123
|
readonly scriptName: string | null;
|
|
2124
|
+
readonly entrypoint?: string;
|
|
1763
2125
|
readonly scriptVersion?: ScriptVersion;
|
|
1764
2126
|
readonly dispatchNamespace?: string;
|
|
1765
2127
|
readonly scriptTags?: string[];
|
|
@@ -1802,6 +2164,9 @@ export interface TraceItemFetchEventInfoRequest {
|
|
|
1802
2164
|
export interface TraceItemFetchEventInfoResponse {
|
|
1803
2165
|
readonly status: number;
|
|
1804
2166
|
}
|
|
2167
|
+
export interface TraceItemJsRpcEventInfo {
|
|
2168
|
+
readonly rpcMethod: string;
|
|
2169
|
+
}
|
|
1805
2170
|
export interface TraceItemHibernatableWebSocketEventInfo {
|
|
1806
2171
|
readonly getWebSocketEvent:
|
|
1807
2172
|
| TraceItemHibernatableWebSocketEventInfoMessage
|
|
@@ -1828,6 +2193,7 @@ export interface TraceException {
|
|
|
1828
2193
|
readonly timestamp: number;
|
|
1829
2194
|
readonly message: string;
|
|
1830
2195
|
readonly name: string;
|
|
2196
|
+
readonly stack?: string;
|
|
1831
2197
|
}
|
|
1832
2198
|
export interface TraceDiagnosticChannelEvent {
|
|
1833
2199
|
readonly timestamp: number;
|
|
@@ -1843,19 +2209,32 @@ export interface UnsafeTraceMetrics {
|
|
|
1843
2209
|
}
|
|
1844
2210
|
export declare class URL {
|
|
1845
2211
|
constructor(url: string | URL, base?: string | URL);
|
|
2212
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
1846
2213
|
href: string;
|
|
2214
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
1847
2215
|
readonly origin: string;
|
|
2216
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
1848
2217
|
protocol: string;
|
|
2218
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
1849
2219
|
username: string;
|
|
2220
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
1850
2221
|
password: string;
|
|
2222
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
1851
2223
|
host: string;
|
|
2224
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
1852
2225
|
hostname: string;
|
|
2226
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
1853
2227
|
port: string;
|
|
2228
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
1854
2229
|
pathname: string;
|
|
2230
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
1855
2231
|
search: string;
|
|
2232
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
1856
2233
|
readonly searchParams: URLSearchParams;
|
|
2234
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
1857
2235
|
hash: string;
|
|
1858
2236
|
toString(): string;
|
|
2237
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
1859
2238
|
toJSON(): string;
|
|
1860
2239
|
}
|
|
1861
2240
|
export declare class URLSearchParams {
|
|
@@ -1864,7 +2243,7 @@ export declare class URLSearchParams {
|
|
|
1864
2243
|
| URLSearchParams
|
|
1865
2244
|
| string
|
|
1866
2245
|
| Record<string, string>
|
|
1867
|
-
| [key: string, value: string][]
|
|
2246
|
+
| [key: string, value: string][],
|
|
1868
2247
|
);
|
|
1869
2248
|
get size(): number;
|
|
1870
2249
|
append(name: string, value: string): void;
|
|
@@ -1874,17 +2253,20 @@ export declare class URLSearchParams {
|
|
|
1874
2253
|
has(name: string): boolean;
|
|
1875
2254
|
set(name: string, value: string): void;
|
|
1876
2255
|
sort(): void;
|
|
2256
|
+
/** Returns an array of key, value pairs for every entry in the search params. */
|
|
1877
2257
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2258
|
+
/** Returns a list of keys in the search params. */
|
|
1878
2259
|
keys(): IterableIterator<string>;
|
|
2260
|
+
/** Returns a list of values in the search params. */
|
|
1879
2261
|
values(): IterableIterator<string>;
|
|
1880
2262
|
forEach<This = unknown>(
|
|
1881
2263
|
callback: (
|
|
1882
2264
|
this: This,
|
|
1883
2265
|
value: string,
|
|
1884
2266
|
key: string,
|
|
1885
|
-
parent: URLSearchParams
|
|
2267
|
+
parent: URLSearchParams,
|
|
1886
2268
|
) => void,
|
|
1887
|
-
thisArg?: This
|
|
2269
|
+
thisArg?: This,
|
|
1888
2270
|
): void;
|
|
1889
2271
|
toString(): string;
|
|
1890
2272
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
@@ -1893,7 +2275,7 @@ export declare class URLPattern {
|
|
|
1893
2275
|
constructor(
|
|
1894
2276
|
input?: string | URLPatternURLPatternInit,
|
|
1895
2277
|
baseURL?: string,
|
|
1896
|
-
patternOptions?: URLPatternURLPatternOptions
|
|
2278
|
+
patternOptions?: URLPatternURLPatternOptions,
|
|
1897
2279
|
);
|
|
1898
2280
|
get protocol(): string;
|
|
1899
2281
|
get username(): string;
|
|
@@ -1906,7 +2288,7 @@ export declare class URLPattern {
|
|
|
1906
2288
|
test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean;
|
|
1907
2289
|
exec(
|
|
1908
2290
|
input?: string | URLPatternURLPatternInit,
|
|
1909
|
-
baseURL?: string
|
|
2291
|
+
baseURL?: string,
|
|
1910
2292
|
): URLPatternURLPatternResult | null;
|
|
1911
2293
|
}
|
|
1912
2294
|
export interface URLPatternURLPatternInit {
|
|
@@ -1940,11 +2322,23 @@ export interface URLPatternURLPatternOptions {
|
|
|
1940
2322
|
}
|
|
1941
2323
|
export declare class CloseEvent extends Event {
|
|
1942
2324
|
constructor(type: string, initializer?: CloseEventInit);
|
|
1943
|
-
/**
|
|
2325
|
+
/**
|
|
2326
|
+
* Returns the WebSocket connection close code provided by the server.
|
|
2327
|
+
*
|
|
2328
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
|
|
2329
|
+
*/
|
|
1944
2330
|
readonly code: number;
|
|
1945
|
-
/**
|
|
2331
|
+
/**
|
|
2332
|
+
* Returns the WebSocket connection close reason provided by the server.
|
|
2333
|
+
*
|
|
2334
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
|
|
2335
|
+
*/
|
|
1946
2336
|
readonly reason: string;
|
|
1947
|
-
/**
|
|
2337
|
+
/**
|
|
2338
|
+
* Returns true if the connection closed cleanly; false otherwise.
|
|
2339
|
+
*
|
|
2340
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
|
2341
|
+
*/
|
|
1948
2342
|
readonly wasClean: boolean;
|
|
1949
2343
|
}
|
|
1950
2344
|
export interface CloseEventInit {
|
|
@@ -1959,12 +2353,21 @@ export declare class MessageEvent extends Event {
|
|
|
1959
2353
|
export interface MessageEventInit {
|
|
1960
2354
|
data: ArrayBuffer | string;
|
|
1961
2355
|
}
|
|
1962
|
-
/**
|
|
2356
|
+
/**
|
|
2357
|
+
* Events providing information related to errors in scripts or in files.
|
|
2358
|
+
*
|
|
2359
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2360
|
+
*/
|
|
1963
2361
|
export interface ErrorEvent extends Event {
|
|
2362
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1964
2363
|
readonly filename: string;
|
|
2364
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1965
2365
|
readonly message: string;
|
|
2366
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1966
2367
|
readonly lineno: number;
|
|
2368
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1967
2369
|
readonly colno: number;
|
|
2370
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1968
2371
|
readonly error: any;
|
|
1969
2372
|
}
|
|
1970
2373
|
export type WebSocketEventMap = {
|
|
@@ -1976,7 +2379,17 @@ export type WebSocketEventMap = {
|
|
|
1976
2379
|
export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
1977
2380
|
constructor(url: string, protocols?: string[] | string);
|
|
1978
2381
|
accept(): void;
|
|
2382
|
+
/**
|
|
2383
|
+
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
2384
|
+
*
|
|
2385
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
2386
|
+
*/
|
|
1979
2387
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
2388
|
+
/**
|
|
2389
|
+
* Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
|
|
2390
|
+
*
|
|
2391
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
|
2392
|
+
*/
|
|
1980
2393
|
close(code?: number, reason?: string): void;
|
|
1981
2394
|
serializeAttachment(attachment: any): void;
|
|
1982
2395
|
deserializeAttachment(): any | null;
|
|
@@ -1988,13 +2401,29 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
1988
2401
|
static readonly CLOSING: number;
|
|
1989
2402
|
static readonly READY_STATE_CLOSED: number;
|
|
1990
2403
|
static readonly CLOSED: number;
|
|
1991
|
-
/**
|
|
2404
|
+
/**
|
|
2405
|
+
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2406
|
+
*
|
|
2407
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2408
|
+
*/
|
|
1992
2409
|
readonly readyState: number;
|
|
1993
|
-
/**
|
|
2410
|
+
/**
|
|
2411
|
+
* Returns the URL that was used to establish the WebSocket connection.
|
|
2412
|
+
*
|
|
2413
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2414
|
+
*/
|
|
1994
2415
|
readonly url: string | null;
|
|
1995
|
-
/**
|
|
2416
|
+
/**
|
|
2417
|
+
* 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.
|
|
2418
|
+
*
|
|
2419
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2420
|
+
*/
|
|
1996
2421
|
readonly protocol: string | null;
|
|
1997
|
-
/**
|
|
2422
|
+
/**
|
|
2423
|
+
* Returns the extensions selected by the server, if any.
|
|
2424
|
+
*
|
|
2425
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2426
|
+
*/
|
|
1998
2427
|
readonly extensions: string | null;
|
|
1999
2428
|
}
|
|
2000
2429
|
export declare const WebSocketPair: {
|
|
@@ -2035,24 +2464,24 @@ export declare abstract class gpuGPUAdapter {
|
|
|
2035
2464
|
export interface gpuGPUDevice extends EventTarget {
|
|
2036
2465
|
createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
|
|
2037
2466
|
createBindGroupLayout(
|
|
2038
|
-
descriptor: gpuGPUBindGroupLayoutDescriptor
|
|
2467
|
+
descriptor: gpuGPUBindGroupLayoutDescriptor,
|
|
2039
2468
|
): gpuGPUBindGroupLayout;
|
|
2040
2469
|
createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
|
|
2041
2470
|
createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
|
|
2042
2471
|
createShaderModule(
|
|
2043
|
-
descriptor: gpuGPUShaderModuleDescriptor
|
|
2472
|
+
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2044
2473
|
): gpuGPUShaderModule;
|
|
2045
2474
|
createPipelineLayout(
|
|
2046
|
-
descriptor: gpuGPUPipelineLayoutDescriptor
|
|
2475
|
+
descriptor: gpuGPUPipelineLayoutDescriptor,
|
|
2047
2476
|
): gpuGPUPipelineLayout;
|
|
2048
2477
|
createComputePipeline(
|
|
2049
|
-
descriptor: gpuGPUComputePipelineDescriptor
|
|
2478
|
+
descriptor: gpuGPUComputePipelineDescriptor,
|
|
2050
2479
|
): gpuGPUComputePipeline;
|
|
2051
2480
|
createRenderPipeline(
|
|
2052
|
-
descriptor: gpuGPURenderPipelineDescriptor
|
|
2481
|
+
descriptor: gpuGPURenderPipelineDescriptor,
|
|
2053
2482
|
): gpuGPURenderPipeline;
|
|
2054
2483
|
createCommandEncoder(
|
|
2055
|
-
descriptor?: gpuGPUCommandEncoderDescriptor
|
|
2484
|
+
descriptor?: gpuGPUCommandEncoderDescriptor,
|
|
2056
2485
|
): gpuGPUCommandEncoder;
|
|
2057
2486
|
createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
|
|
2058
2487
|
destroy(): void;
|
|
@@ -2098,7 +2527,7 @@ export interface gpuGPUBuffer {
|
|
|
2098
2527
|
mapAsync(
|
|
2099
2528
|
offset: number,
|
|
2100
2529
|
size?: number | bigint,
|
|
2101
|
-
param3?: number | bigint
|
|
2530
|
+
param3?: number | bigint,
|
|
2102
2531
|
): Promise<void>;
|
|
2103
2532
|
get size(): number | bigint;
|
|
2104
2533
|
get usage(): number;
|
|
@@ -2197,38 +2626,38 @@ export interface gpuGPUProgrammableStage {
|
|
|
2197
2626
|
export interface gpuGPUCommandEncoder {
|
|
2198
2627
|
get label(): string;
|
|
2199
2628
|
beginComputePass(
|
|
2200
|
-
descriptor?: gpuGPUComputePassDescriptor
|
|
2629
|
+
descriptor?: gpuGPUComputePassDescriptor,
|
|
2201
2630
|
): gpuGPUComputePassEncoder;
|
|
2202
2631
|
beginRenderPass(
|
|
2203
|
-
descriptor: gpuGPURenderPassDescriptor
|
|
2632
|
+
descriptor: gpuGPURenderPassDescriptor,
|
|
2204
2633
|
): gpuGPURenderPassEncoder;
|
|
2205
2634
|
copyBufferToBuffer(
|
|
2206
2635
|
source: gpuGPUBuffer,
|
|
2207
2636
|
sourceOffset: number | bigint,
|
|
2208
2637
|
destination: gpuGPUBuffer,
|
|
2209
2638
|
destinationOffset: number | bigint,
|
|
2210
|
-
size: number | bigint
|
|
2639
|
+
size: number | bigint,
|
|
2211
2640
|
): void;
|
|
2212
2641
|
finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
|
|
2213
2642
|
copyTextureToBuffer(
|
|
2214
2643
|
source: gpuGPUImageCopyTexture,
|
|
2215
2644
|
destination: gpuGPUImageCopyBuffer,
|
|
2216
|
-
copySize: Iterable<number> | gpuGPUExtent3DDict
|
|
2645
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2217
2646
|
): void;
|
|
2218
2647
|
copyBufferToTexture(
|
|
2219
2648
|
source: gpuGPUImageCopyBuffer,
|
|
2220
2649
|
destination: gpuGPUImageCopyTexture,
|
|
2221
|
-
copySize: Iterable<number> | gpuGPUExtent3DDict
|
|
2650
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2222
2651
|
): void;
|
|
2223
2652
|
copyTextureToTexture(
|
|
2224
2653
|
source: gpuGPUImageCopyTexture,
|
|
2225
2654
|
destination: gpuGPUImageCopyTexture,
|
|
2226
|
-
copySize: Iterable<number> | gpuGPUExtent3DDict
|
|
2655
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2227
2656
|
): void;
|
|
2228
2657
|
clearBuffer(
|
|
2229
2658
|
buffer: gpuGPUBuffer,
|
|
2230
2659
|
offset?: number | bigint,
|
|
2231
|
-
size?: number | bigint
|
|
2660
|
+
size?: number | bigint,
|
|
2232
2661
|
): void;
|
|
2233
2662
|
}
|
|
2234
2663
|
export interface gpuGPUCommandEncoderDescriptor {
|
|
@@ -2239,12 +2668,12 @@ export interface gpuGPUComputePassEncoder {
|
|
|
2239
2668
|
setBindGroup(
|
|
2240
2669
|
index: number,
|
|
2241
2670
|
bindGroup: gpuGPUBindGroup | null,
|
|
2242
|
-
dynamicOffsets?: Iterable<number
|
|
2671
|
+
dynamicOffsets?: Iterable<number>,
|
|
2243
2672
|
): void;
|
|
2244
2673
|
dispatchWorkgroups(
|
|
2245
2674
|
workgroupCountX: number,
|
|
2246
2675
|
workgroupCountY?: number,
|
|
2247
|
-
workgroupCountZ?: number
|
|
2676
|
+
workgroupCountZ?: number,
|
|
2248
2677
|
): void;
|
|
2249
2678
|
end(): void;
|
|
2250
2679
|
}
|
|
@@ -2272,7 +2701,7 @@ export interface gpuGPUQueue {
|
|
|
2272
2701
|
bufferOffset: number | bigint,
|
|
2273
2702
|
data: ArrayBuffer | ArrayBufferView,
|
|
2274
2703
|
dataOffset?: number | bigint,
|
|
2275
|
-
size?: number | bigint
|
|
2704
|
+
size?: number | bigint,
|
|
2276
2705
|
): void;
|
|
2277
2706
|
}
|
|
2278
2707
|
export declare abstract class gpuGPUMapMode {
|
|
@@ -2476,7 +2905,7 @@ export interface gpuGPURenderPassEncoder {
|
|
|
2476
2905
|
vertexCount: number,
|
|
2477
2906
|
instanceCount?: number,
|
|
2478
2907
|
firstVertex?: number,
|
|
2479
|
-
firstInstance?: number
|
|
2908
|
+
firstInstance?: number,
|
|
2480
2909
|
): void;
|
|
2481
2910
|
end(): void;
|
|
2482
2911
|
}
|
|
@@ -2974,7 +3403,7 @@ export interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
|
2974
3403
|
};
|
|
2975
3404
|
}
|
|
2976
3405
|
export interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
|
|
2977
|
-
HostMetadata
|
|
3406
|
+
HostMetadata,
|
|
2978
3407
|
> {
|
|
2979
3408
|
/**
|
|
2980
3409
|
* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
|
|
@@ -3544,6 +3973,13 @@ export declare abstract class D1PreparedStatement {
|
|
|
3544
3973
|
}): Promise<[string[], ...T[]]>;
|
|
3545
3974
|
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3546
3975
|
}
|
|
3976
|
+
// `Disposable` was added to TypeScript's standard lib types in version 5.2.
|
|
3977
|
+
// To support older TypeScript versions, define an empty `Disposable` interface.
|
|
3978
|
+
// Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
|
|
3979
|
+
// but this will ensure type checking on older versions still passes.
|
|
3980
|
+
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
3981
|
+
// ignored when `Disposable` is included in the standard lib.
|
|
3982
|
+
export interface Disposable {}
|
|
3547
3983
|
/**
|
|
3548
3984
|
* An email message that can be sent from a Worker.
|
|
3549
3985
|
*/
|
|
@@ -3599,7 +4035,7 @@ export declare abstract class EmailEvent extends ExtendableEvent {
|
|
|
3599
4035
|
export type EmailExportedHandler<Env = unknown> = (
|
|
3600
4036
|
message: ForwardableEmailMessage,
|
|
3601
4037
|
env: Env,
|
|
3602
|
-
ctx: ExecutionContext
|
|
4038
|
+
ctx: ExecutionContext,
|
|
3603
4039
|
) => void | Promise<void>;
|
|
3604
4040
|
export interface Hyperdrive {
|
|
3605
4041
|
/**
|
|
@@ -3666,7 +4102,7 @@ export type EventContext<Env, P extends string, Data> = {
|
|
|
3666
4102
|
export type PagesFunction<
|
|
3667
4103
|
Env = unknown,
|
|
3668
4104
|
Params extends string = any,
|
|
3669
|
-
Data extends Record<string, unknown> = Record<string, unknown
|
|
4105
|
+
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
3670
4106
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3671
4107
|
export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3672
4108
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
@@ -3687,9 +4123,9 @@ export type PagesPluginFunction<
|
|
|
3687
4123
|
Env = unknown,
|
|
3688
4124
|
Params extends string = any,
|
|
3689
4125
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
3690
|
-
PluginArgs = unknown
|
|
4126
|
+
PluginArgs = unknown,
|
|
3691
4127
|
> = (
|
|
3692
|
-
context: EventPluginContext<Env, Params, Data, PluginArgs
|
|
4128
|
+
context: EventPluginContext<Env, Params, Data, PluginArgs>,
|
|
3693
4129
|
) => Response | Promise<Response>;
|
|
3694
4130
|
// PubSubMessage represents an incoming PubSub message.
|
|
3695
4131
|
// The message includes metadata about the broker, the client, and the payload
|
|
@@ -3725,6 +4161,155 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
|
|
|
3725
4161
|
// Key Identifier of the JWK
|
|
3726
4162
|
readonly kid: string;
|
|
3727
4163
|
}
|
|
4164
|
+
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4165
|
+
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4166
|
+
// strips all `module` blocks.
|
|
4167
|
+
export declare namespace Rpc {
|
|
4168
|
+
// Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
|
|
4169
|
+
// TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
|
|
4170
|
+
// For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
|
|
4171
|
+
// accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
|
|
4172
|
+
export const __RPC_STUB_BRAND: unique symbol;
|
|
4173
|
+
export const __RPC_TARGET_BRAND: unique symbol;
|
|
4174
|
+
export const __WORKER_ENTRYPOINT_BRAND: unique symbol;
|
|
4175
|
+
export const __DURABLE_OBJECT_BRAND: unique symbol;
|
|
4176
|
+
export interface RpcTargetBranded {
|
|
4177
|
+
[__RPC_TARGET_BRAND]: never;
|
|
4178
|
+
}
|
|
4179
|
+
export interface WorkerEntrypointBranded {
|
|
4180
|
+
[__WORKER_ENTRYPOINT_BRAND]: never;
|
|
4181
|
+
}
|
|
4182
|
+
export interface DurableObjectBranded {
|
|
4183
|
+
[__DURABLE_OBJECT_BRAND]: never;
|
|
4184
|
+
}
|
|
4185
|
+
export type EntrypointBranded =
|
|
4186
|
+
| WorkerEntrypointBranded
|
|
4187
|
+
| DurableObjectBranded;
|
|
4188
|
+
// Types that can be used through `Stub`s
|
|
4189
|
+
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
4190
|
+
// Types that can be passed over RPC
|
|
4191
|
+
type Serializable =
|
|
4192
|
+
// Structured cloneables
|
|
4193
|
+
| void
|
|
4194
|
+
| undefined
|
|
4195
|
+
| null
|
|
4196
|
+
| boolean
|
|
4197
|
+
| number
|
|
4198
|
+
| bigint
|
|
4199
|
+
| string
|
|
4200
|
+
| TypedArray
|
|
4201
|
+
| ArrayBuffer
|
|
4202
|
+
| DataView
|
|
4203
|
+
| Date
|
|
4204
|
+
| Error
|
|
4205
|
+
| RegExp
|
|
4206
|
+
// Structured cloneable composites
|
|
4207
|
+
| Map<Serializable, Serializable>
|
|
4208
|
+
| Set<Serializable>
|
|
4209
|
+
| ReadonlyArray<Serializable>
|
|
4210
|
+
| {
|
|
4211
|
+
[key: string | number]: Serializable;
|
|
4212
|
+
}
|
|
4213
|
+
// Special types
|
|
4214
|
+
| ReadableStream<Uint8Array>
|
|
4215
|
+
| WritableStream<Uint8Array>
|
|
4216
|
+
| Request
|
|
4217
|
+
| Response
|
|
4218
|
+
| Headers
|
|
4219
|
+
| Stub<Stubable>
|
|
4220
|
+
// Serialized as stubs, see `Stubify`
|
|
4221
|
+
| Stubable;
|
|
4222
|
+
// Base type for all RPC stubs, including common memory management methods.
|
|
4223
|
+
// `T` is used as a marker type for unwrapping `Stub`s later.
|
|
4224
|
+
interface StubBase<T extends Stubable> extends Disposable {
|
|
4225
|
+
[__RPC_STUB_BRAND]: T;
|
|
4226
|
+
dup(): this;
|
|
4227
|
+
}
|
|
4228
|
+
export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
|
|
4229
|
+
// Recursively rewrite all `Stubable` types with `Stub`s
|
|
4230
|
+
type Stubify<T> = T extends Stubable
|
|
4231
|
+
? Stub<T>
|
|
4232
|
+
: T extends Map<infer K, infer V>
|
|
4233
|
+
? Map<Stubify<K>, Stubify<V>>
|
|
4234
|
+
: T extends Set<infer V>
|
|
4235
|
+
? Set<Stubify<V>>
|
|
4236
|
+
: T extends Array<infer V>
|
|
4237
|
+
? Array<Stubify<V>>
|
|
4238
|
+
: T extends ReadonlyArray<infer V>
|
|
4239
|
+
? ReadonlyArray<Stubify<V>>
|
|
4240
|
+
: T extends {
|
|
4241
|
+
[key: string | number]: unknown;
|
|
4242
|
+
}
|
|
4243
|
+
? {
|
|
4244
|
+
[K in keyof T]: Stubify<T[K]>;
|
|
4245
|
+
}
|
|
4246
|
+
: T;
|
|
4247
|
+
// Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
|
|
4248
|
+
// Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
|
|
4249
|
+
// `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
|
|
4250
|
+
type Unstubify<T> =
|
|
4251
|
+
T extends StubBase<infer V>
|
|
4252
|
+
? V
|
|
4253
|
+
: T extends Map<infer K, infer V>
|
|
4254
|
+
? Map<Unstubify<K>, Unstubify<V>>
|
|
4255
|
+
: T extends Set<infer V>
|
|
4256
|
+
? Set<Unstubify<V>>
|
|
4257
|
+
: T extends Array<infer V>
|
|
4258
|
+
? Array<Unstubify<V>>
|
|
4259
|
+
: T extends ReadonlyArray<infer V>
|
|
4260
|
+
? ReadonlyArray<Unstubify<V>>
|
|
4261
|
+
: T extends {
|
|
4262
|
+
[key: string | number]: unknown;
|
|
4263
|
+
}
|
|
4264
|
+
? {
|
|
4265
|
+
[K in keyof T]: Unstubify<T[K]>;
|
|
4266
|
+
}
|
|
4267
|
+
: T;
|
|
4268
|
+
type UnstubifyAll<A extends any[]> = {
|
|
4269
|
+
[I in keyof A]: Unstubify<A[I]>;
|
|
4270
|
+
};
|
|
4271
|
+
// Utility type for adding `Provider`/`Disposable`s to `object` types only.
|
|
4272
|
+
// Note `unknown & T` is equivalent to `T`.
|
|
4273
|
+
type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
|
|
4274
|
+
type MaybeDisposable<T> = T extends object ? Disposable : unknown;
|
|
4275
|
+
// Type for method return or property on an RPC interface.
|
|
4276
|
+
// - Stubable types are replaced by stubs.
|
|
4277
|
+
// - Serializable types are passed by value, with stubable types replaced by stubs
|
|
4278
|
+
// and a top-level `Disposer`.
|
|
4279
|
+
// Everything else can't be passed over PRC.
|
|
4280
|
+
// Technically, we use custom thenables here, but they quack like `Promise`s.
|
|
4281
|
+
// Intersecting with `(Maybe)Provider` allows pipelining.
|
|
4282
|
+
type Result<R> = R extends Stubable
|
|
4283
|
+
? Promise<Stub<R>> & Provider<R>
|
|
4284
|
+
: R extends Serializable
|
|
4285
|
+
? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
|
|
4286
|
+
: never;
|
|
4287
|
+
// Type for method or property on an RPC interface.
|
|
4288
|
+
// For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
|
|
4289
|
+
// Unwrapping `Stub`s allows calling with `Stubable` arguments.
|
|
4290
|
+
// For properties, rewrite types to be `Result`s.
|
|
4291
|
+
// In each case, unwrap `Promise`s.
|
|
4292
|
+
type MethodOrProperty<V> = V extends (...args: infer P) => infer R
|
|
4293
|
+
? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
|
|
4294
|
+
: Result<Awaited<V>>;
|
|
4295
|
+
// Type for the callable part of an `Provider` if `T` is callable.
|
|
4296
|
+
// This is intersected with methods/properties.
|
|
4297
|
+
type MaybeCallableProvider<T> = T extends (...args: any[]) => any
|
|
4298
|
+
? MethodOrProperty<T>
|
|
4299
|
+
: unknown;
|
|
4300
|
+
// Base type for all other types providing RPC-like interfaces.
|
|
4301
|
+
// Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
|
|
4302
|
+
// `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
|
|
4303
|
+
export type Provider<
|
|
4304
|
+
T extends object,
|
|
4305
|
+
Reserved extends string = never,
|
|
4306
|
+
> = MaybeCallableProvider<T> & {
|
|
4307
|
+
[K in Exclude<
|
|
4308
|
+
keyof T,
|
|
4309
|
+
Reserved | symbol | keyof StubBase<never>
|
|
4310
|
+
>]: MethodOrProperty<T[K]>;
|
|
4311
|
+
};
|
|
4312
|
+
}
|
|
3728
4313
|
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
3729
4314
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
3730
4315
|
// https://opensource.org/licenses/Apache-2.0
|
|
@@ -3853,7 +4438,7 @@ export declare abstract class VectorizeIndex {
|
|
|
3853
4438
|
*/
|
|
3854
4439
|
public query(
|
|
3855
4440
|
vector: VectorFloatArray | number[],
|
|
3856
|
-
options: VectorizeQueryOptions
|
|
4441
|
+
options: VectorizeQueryOptions,
|
|
3857
4442
|
): Promise<VectorizeMatches>;
|
|
3858
4443
|
/**
|
|
3859
4444
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
@@ -3880,6 +4465,16 @@ export declare abstract class VectorizeIndex {
|
|
|
3880
4465
|
*/
|
|
3881
4466
|
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
3882
4467
|
}
|
|
4468
|
+
/**
|
|
4469
|
+
* The interface for "version_metadata" binding
|
|
4470
|
+
* providing metadata about the Worker Version using this binding.
|
|
4471
|
+
*/
|
|
4472
|
+
export type WorkerVersionMetadata = {
|
|
4473
|
+
/** The ID of the Worker Version using this binding */
|
|
4474
|
+
id: string;
|
|
4475
|
+
/** The tag of the Worker Version using this binding */
|
|
4476
|
+
tag: string;
|
|
4477
|
+
};
|
|
3883
4478
|
export interface DynamicDispatchLimits {
|
|
3884
4479
|
/**
|
|
3885
4480
|
* Limit CPU time in milliseconds.
|
|
@@ -3915,6 +4510,6 @@ export interface DispatchNamespace {
|
|
|
3915
4510
|
args?: {
|
|
3916
4511
|
[key: string]: any;
|
|
3917
4512
|
},
|
|
3918
|
-
options?: DynamicDispatchOptions
|
|
4513
|
+
options?: DynamicDispatchOptions,
|
|
3919
4514
|
): Fetcher;
|
|
3920
4515
|
}
|