@cloudflare/workers-types 0.20230518.0 → 0.20240405.1
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 +1708 -191
- package/2021-11-03/index.ts +1659 -191
- package/2022-01-31/index.d.ts +1723 -166
- package/2022-01-31/index.ts +1674 -166
- package/2022-03-21/index.d.ts +1743 -166
- package/2022-03-21/index.ts +1694 -166
- package/2022-08-04/index.d.ts +1743 -166
- package/2022-08-04/index.ts +1694 -166
- package/2022-10-31/index.d.ts +1747 -168
- package/2022-10-31/index.ts +1698 -168
- package/2022-11-30/index.d.ts +1739 -167
- package/2022-11-30/index.ts +1690 -167
- package/2023-03-01/index.d.ts +4640 -0
- package/2023-03-01/index.ts +4579 -0
- package/2023-07-01/index.d.ts +4640 -0
- package/2023-07-01/index.ts +4579 -0
- package/README.md +9 -4
- package/experimental/index.d.ts +1787 -182
- package/experimental/index.ts +1738 -182
- package/index.d.ts +1708 -191
- package/index.ts +1659 -191
- package/oldest/index.d.ts +1708 -191
- package/oldest/index.ts +1659 -191
- package/package.json +1 -1
package/2022-11-30/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;
|
|
@@ -188,6 +230,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
188
230
|
readonly origin: string;
|
|
189
231
|
Event: typeof Event;
|
|
190
232
|
ExtendableEvent: typeof ExtendableEvent;
|
|
233
|
+
CustomEvent: typeof CustomEvent;
|
|
191
234
|
PromiseRejectionEvent: typeof PromiseRejectionEvent;
|
|
192
235
|
FetchEvent: typeof FetchEvent;
|
|
193
236
|
TailEvent: typeof TailEvent;
|
|
@@ -217,6 +260,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
217
260
|
Response: typeof Response;
|
|
218
261
|
WebSocket: typeof WebSocket;
|
|
219
262
|
WebSocketPair: typeof WebSocketPair;
|
|
263
|
+
WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
|
|
220
264
|
AbortController: typeof AbortController;
|
|
221
265
|
AbortSignal: typeof AbortSignal;
|
|
222
266
|
TextDecoder: typeof TextDecoder;
|
|
@@ -237,55 +281,80 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
237
281
|
FixedLengthStream: typeof FixedLengthStream;
|
|
238
282
|
IdentityTransformStream: typeof IdentityTransformStream;
|
|
239
283
|
HTMLRewriter: typeof HTMLRewriter;
|
|
284
|
+
GPUAdapter: typeof gpuGPUAdapter;
|
|
285
|
+
GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
|
|
286
|
+
GPUValidationError: typeof gpuGPUValidationError;
|
|
287
|
+
GPUInternalError: typeof gpuGPUInternalError;
|
|
288
|
+
GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
|
|
289
|
+
GPUBufferUsage: typeof gpuGPUBufferUsage;
|
|
290
|
+
GPUShaderStage: typeof gpuGPUShaderStage;
|
|
291
|
+
GPUMapMode: typeof gpuGPUMapMode;
|
|
292
|
+
GPUTextureUsage: typeof gpuGPUTextureUsage;
|
|
293
|
+
GPUColorWrite: typeof gpuGPUColorWrite;
|
|
240
294
|
}
|
|
241
295
|
export declare function addEventListener<
|
|
242
|
-
Type extends keyof WorkerGlobalScopeEventMap
|
|
296
|
+
Type extends keyof WorkerGlobalScopeEventMap,
|
|
243
297
|
>(
|
|
244
298
|
type: Type,
|
|
245
299
|
handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
|
|
246
|
-
options?: EventTargetAddEventListenerOptions | boolean
|
|
300
|
+
options?: EventTargetAddEventListenerOptions | boolean,
|
|
247
301
|
): void;
|
|
248
302
|
export declare function removeEventListener<
|
|
249
|
-
Type extends keyof WorkerGlobalScopeEventMap
|
|
303
|
+
Type extends keyof WorkerGlobalScopeEventMap,
|
|
250
304
|
>(
|
|
251
305
|
type: Type,
|
|
252
306
|
handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
|
|
253
|
-
options?: EventTargetEventListenerOptions | boolean
|
|
307
|
+
options?: EventTargetEventListenerOptions | boolean,
|
|
254
308
|
): void;
|
|
255
|
-
/**
|
|
309
|
+
/**
|
|
310
|
+
* 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.
|
|
311
|
+
*
|
|
312
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
313
|
+
*/
|
|
256
314
|
export declare function dispatchEvent(
|
|
257
|
-
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]
|
|
315
|
+
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
|
|
258
316
|
): boolean;
|
|
317
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
|
259
318
|
export declare function btoa(data: string): string;
|
|
319
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
|
260
320
|
export declare function atob(data: string): string;
|
|
321
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
261
322
|
export declare function setTimeout(
|
|
262
323
|
callback: (...args: any[]) => void,
|
|
263
|
-
msDelay?: number
|
|
324
|
+
msDelay?: number,
|
|
264
325
|
): number;
|
|
326
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
265
327
|
export declare function setTimeout<Args extends any[]>(
|
|
266
328
|
callback: (...args: Args) => void,
|
|
267
329
|
msDelay?: number,
|
|
268
330
|
...args: Args
|
|
269
331
|
): number;
|
|
332
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
|
|
270
333
|
export declare function clearTimeout(timeoutId: number | null): void;
|
|
334
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
271
335
|
export declare function setInterval(
|
|
272
336
|
callback: (...args: any[]) => void,
|
|
273
|
-
msDelay?: number
|
|
337
|
+
msDelay?: number,
|
|
274
338
|
): number;
|
|
339
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
275
340
|
export declare function setInterval<Args extends any[]>(
|
|
276
341
|
callback: (...args: Args) => void,
|
|
277
342
|
msDelay?: number,
|
|
278
343
|
...args: Args
|
|
279
344
|
): number;
|
|
345
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
|
280
346
|
export declare function clearInterval(timeoutId: number | null): void;
|
|
347
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
|
|
281
348
|
export declare function queueMicrotask(task: Function): void;
|
|
349
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
|
|
282
350
|
export declare function structuredClone<T>(
|
|
283
351
|
value: T,
|
|
284
|
-
options?: StructuredSerializeOptions
|
|
352
|
+
options?: StructuredSerializeOptions,
|
|
285
353
|
): T;
|
|
354
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
|
|
286
355
|
export declare function fetch(
|
|
287
356
|
input: RequestInfo,
|
|
288
|
-
init?: RequestInit<RequestInitCfProperties
|
|
357
|
+
init?: RequestInit<RequestInitCfProperties>,
|
|
289
358
|
): Promise<Response>;
|
|
290
359
|
export declare const self: ServiceWorkerGlobalScope;
|
|
291
360
|
export declare const crypto: Crypto;
|
|
@@ -301,88 +370,132 @@ export interface ExecutionContext {
|
|
|
301
370
|
}
|
|
302
371
|
export type ExportedHandlerFetchHandler<
|
|
303
372
|
Env = unknown,
|
|
304
|
-
CfHostMetadata = unknown
|
|
373
|
+
CfHostMetadata = unknown,
|
|
305
374
|
> = (
|
|
306
375
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
307
376
|
env: Env,
|
|
308
|
-
ctx: ExecutionContext
|
|
377
|
+
ctx: ExecutionContext,
|
|
309
378
|
) => Response | Promise<Response>;
|
|
310
379
|
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
311
380
|
events: TraceItem[],
|
|
312
381
|
env: Env,
|
|
313
|
-
ctx: ExecutionContext
|
|
382
|
+
ctx: ExecutionContext,
|
|
314
383
|
) => void | Promise<void>;
|
|
315
384
|
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
316
385
|
traces: TraceItem[],
|
|
317
386
|
env: Env,
|
|
318
|
-
ctx: ExecutionContext
|
|
387
|
+
ctx: ExecutionContext,
|
|
319
388
|
) => void | Promise<void>;
|
|
320
389
|
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
321
390
|
controller: ScheduledController,
|
|
322
391
|
env: Env,
|
|
323
|
-
ctx: ExecutionContext
|
|
392
|
+
ctx: ExecutionContext,
|
|
324
393
|
) => void | Promise<void>;
|
|
325
394
|
export type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
|
|
326
395
|
batch: MessageBatch<Message>,
|
|
327
396
|
env: Env,
|
|
328
|
-
ctx: ExecutionContext
|
|
397
|
+
ctx: ExecutionContext,
|
|
329
398
|
) => void | Promise<void>;
|
|
330
399
|
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
331
400
|
controller: TestController,
|
|
332
401
|
env: Env,
|
|
333
|
-
ctx: ExecutionContext
|
|
402
|
+
ctx: ExecutionContext,
|
|
334
403
|
) => void | Promise<void>;
|
|
335
404
|
export interface ExportedHandler<
|
|
336
405
|
Env = unknown,
|
|
337
|
-
|
|
338
|
-
CfHostMetadata = unknown
|
|
406
|
+
QueueHandlerMessage = unknown,
|
|
407
|
+
CfHostMetadata = unknown,
|
|
339
408
|
> {
|
|
340
409
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
341
410
|
tail?: ExportedHandlerTailHandler<Env>;
|
|
342
411
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
343
412
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
344
413
|
test?: ExportedHandlerTestHandler<Env>;
|
|
345
|
-
|
|
414
|
+
email?: EmailExportedHandler<Env>;
|
|
415
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
346
416
|
}
|
|
347
417
|
export interface StructuredSerializeOptions {
|
|
348
418
|
transfer?: any[];
|
|
349
419
|
}
|
|
350
420
|
export declare abstract class PromiseRejectionEvent extends Event {
|
|
421
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
|
|
351
422
|
readonly promise: Promise<any>;
|
|
423
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
|
|
352
424
|
readonly reason: any;
|
|
353
425
|
}
|
|
354
426
|
export declare abstract class Navigator {
|
|
427
|
+
sendBeacon(
|
|
428
|
+
url: string,
|
|
429
|
+
body?:
|
|
430
|
+
| ReadableStream
|
|
431
|
+
| string
|
|
432
|
+
| (ArrayBuffer | ArrayBufferView)
|
|
433
|
+
| Blob
|
|
434
|
+
| URLSearchParams
|
|
435
|
+
| FormData,
|
|
436
|
+
): boolean;
|
|
355
437
|
readonly userAgent: string;
|
|
438
|
+
readonly gpu: gpuGPU;
|
|
356
439
|
}
|
|
357
|
-
/**
|
|
440
|
+
/**
|
|
441
|
+
* 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.
|
|
442
|
+
*
|
|
443
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
|
|
444
|
+
*/
|
|
358
445
|
export interface Performance {
|
|
446
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
|
|
359
447
|
readonly timeOrigin: number;
|
|
448
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
|
|
360
449
|
now(): number;
|
|
361
450
|
}
|
|
451
|
+
export interface AlarmInvocationInfo {
|
|
452
|
+
readonly isRetry: boolean;
|
|
453
|
+
readonly retryCount: number;
|
|
454
|
+
}
|
|
362
455
|
export interface DurableObject {
|
|
363
456
|
fetch(request: Request): Response | Promise<Response>;
|
|
364
457
|
alarm?(): void | Promise<void>;
|
|
365
|
-
|
|
366
|
-
|
|
458
|
+
webSocketMessage?(
|
|
459
|
+
ws: WebSocket,
|
|
460
|
+
message: string | ArrayBuffer,
|
|
461
|
+
): void | Promise<void>;
|
|
462
|
+
webSocketClose?(
|
|
463
|
+
ws: WebSocket,
|
|
464
|
+
code: number,
|
|
465
|
+
reason: string,
|
|
466
|
+
wasClean: boolean,
|
|
467
|
+
): void | Promise<void>;
|
|
468
|
+
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
469
|
+
}
|
|
470
|
+
export type DurableObjectStub<
|
|
471
|
+
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
472
|
+
> = Fetcher<
|
|
473
|
+
T,
|
|
474
|
+
"alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
|
|
475
|
+
> & {
|
|
367
476
|
readonly id: DurableObjectId;
|
|
368
477
|
readonly name?: string;
|
|
369
|
-
}
|
|
478
|
+
};
|
|
370
479
|
export interface DurableObjectId {
|
|
371
480
|
toString(): string;
|
|
372
481
|
equals(other: DurableObjectId): boolean;
|
|
373
482
|
readonly name?: string;
|
|
374
483
|
}
|
|
375
|
-
export interface DurableObjectNamespace
|
|
484
|
+
export interface DurableObjectNamespace<
|
|
485
|
+
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
486
|
+
> {
|
|
376
487
|
newUniqueId(
|
|
377
|
-
options?: DurableObjectNamespaceNewUniqueIdOptions
|
|
488
|
+
options?: DurableObjectNamespaceNewUniqueIdOptions,
|
|
378
489
|
): DurableObjectId;
|
|
379
490
|
idFromName(name: string): DurableObjectId;
|
|
380
491
|
idFromString(id: string): DurableObjectId;
|
|
381
492
|
get(
|
|
382
493
|
id: DurableObjectId,
|
|
383
|
-
options?: DurableObjectNamespaceGetDurableObjectOptions
|
|
384
|
-
): DurableObjectStub
|
|
385
|
-
jurisdiction(
|
|
494
|
+
options?: DurableObjectNamespaceGetDurableObjectOptions,
|
|
495
|
+
): DurableObjectStub<T>;
|
|
496
|
+
jurisdiction(
|
|
497
|
+
jurisdiction: DurableObjectJurisdiction,
|
|
498
|
+
): DurableObjectNamespace<T>;
|
|
386
499
|
}
|
|
387
500
|
export type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
388
501
|
export interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
@@ -408,27 +521,33 @@ export interface DurableObjectState {
|
|
|
408
521
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
409
522
|
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
410
523
|
getWebSockets(tag?: string): WebSocket[];
|
|
524
|
+
setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
|
|
525
|
+
getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
|
|
526
|
+
getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
|
|
527
|
+
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
|
528
|
+
getHibernatableWebSocketEventTimeout(): number | null;
|
|
529
|
+
getTags(ws: WebSocket): string[];
|
|
411
530
|
}
|
|
412
531
|
export interface DurableObjectTransaction {
|
|
413
532
|
get<T = unknown>(
|
|
414
533
|
key: string,
|
|
415
|
-
options?: DurableObjectGetOptions
|
|
534
|
+
options?: DurableObjectGetOptions,
|
|
416
535
|
): Promise<T | undefined>;
|
|
417
536
|
get<T = unknown>(
|
|
418
537
|
keys: string[],
|
|
419
|
-
options?: DurableObjectGetOptions
|
|
538
|
+
options?: DurableObjectGetOptions,
|
|
420
539
|
): Promise<Map<string, T>>;
|
|
421
540
|
list<T = unknown>(
|
|
422
|
-
options?: DurableObjectListOptions
|
|
541
|
+
options?: DurableObjectListOptions,
|
|
423
542
|
): Promise<Map<string, T>>;
|
|
424
543
|
put<T>(
|
|
425
544
|
key: string,
|
|
426
545
|
value: T,
|
|
427
|
-
options?: DurableObjectPutOptions
|
|
546
|
+
options?: DurableObjectPutOptions,
|
|
428
547
|
): Promise<void>;
|
|
429
548
|
put<T>(
|
|
430
549
|
entries: Record<string, T>,
|
|
431
|
-
options?: DurableObjectPutOptions
|
|
550
|
+
options?: DurableObjectPutOptions,
|
|
432
551
|
): Promise<void>;
|
|
433
552
|
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
|
|
434
553
|
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
|
|
@@ -436,41 +555,41 @@ export interface DurableObjectTransaction {
|
|
|
436
555
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
437
556
|
setAlarm(
|
|
438
557
|
scheduledTime: number | Date,
|
|
439
|
-
options?: DurableObjectSetAlarmOptions
|
|
558
|
+
options?: DurableObjectSetAlarmOptions,
|
|
440
559
|
): Promise<void>;
|
|
441
560
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
442
561
|
}
|
|
443
562
|
export interface DurableObjectStorage {
|
|
444
563
|
get<T = unknown>(
|
|
445
564
|
key: string,
|
|
446
|
-
options?: DurableObjectGetOptions
|
|
565
|
+
options?: DurableObjectGetOptions,
|
|
447
566
|
): Promise<T | undefined>;
|
|
448
567
|
get<T = unknown>(
|
|
449
568
|
keys: string[],
|
|
450
|
-
options?: DurableObjectGetOptions
|
|
569
|
+
options?: DurableObjectGetOptions,
|
|
451
570
|
): Promise<Map<string, T>>;
|
|
452
571
|
list<T = unknown>(
|
|
453
|
-
options?: DurableObjectListOptions
|
|
572
|
+
options?: DurableObjectListOptions,
|
|
454
573
|
): Promise<Map<string, T>>;
|
|
455
574
|
put<T>(
|
|
456
575
|
key: string,
|
|
457
576
|
value: T,
|
|
458
|
-
options?: DurableObjectPutOptions
|
|
577
|
+
options?: DurableObjectPutOptions,
|
|
459
578
|
): Promise<void>;
|
|
460
579
|
put<T>(
|
|
461
580
|
entries: Record<string, T>,
|
|
462
|
-
options?: DurableObjectPutOptions
|
|
581
|
+
options?: DurableObjectPutOptions,
|
|
463
582
|
): Promise<void>;
|
|
464
583
|
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
|
|
465
584
|
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
|
|
466
585
|
deleteAll(options?: DurableObjectPutOptions): Promise<void>;
|
|
467
586
|
transaction<T>(
|
|
468
|
-
closure: (txn: DurableObjectTransaction) => Promise<T
|
|
587
|
+
closure: (txn: DurableObjectTransaction) => Promise<T>,
|
|
469
588
|
): Promise<T>;
|
|
470
589
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
471
590
|
setAlarm(
|
|
472
591
|
scheduledTime: number | Date,
|
|
473
|
-
options?: DurableObjectSetAlarmOptions
|
|
592
|
+
options?: DurableObjectSetAlarmOptions,
|
|
474
593
|
): Promise<void>;
|
|
475
594
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
476
595
|
sync(): Promise<void>;
|
|
@@ -502,6 +621,11 @@ export interface DurableObjectSetAlarmOptions {
|
|
|
502
621
|
allowConcurrency?: boolean;
|
|
503
622
|
allowUnconfirmed?: boolean;
|
|
504
623
|
}
|
|
624
|
+
export declare class WebSocketRequestResponsePair {
|
|
625
|
+
constructor(request: string, response: string);
|
|
626
|
+
get request(): string;
|
|
627
|
+
get response(): string;
|
|
628
|
+
}
|
|
505
629
|
export interface AnalyticsEngineDataset {
|
|
506
630
|
writeDataPoint(event?: AnalyticsEngineDataPoint): void;
|
|
507
631
|
}
|
|
@@ -512,22 +636,107 @@ export interface AnalyticsEngineDataPoint {
|
|
|
512
636
|
}
|
|
513
637
|
export declare class Event {
|
|
514
638
|
constructor(type: string, init?: EventInit);
|
|
639
|
+
/**
|
|
640
|
+
* Returns the type of event, e.g. "click", "hashchange", or "submit".
|
|
641
|
+
*
|
|
642
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
|
|
643
|
+
*/
|
|
515
644
|
get type(): string;
|
|
645
|
+
/**
|
|
646
|
+
* Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
|
|
647
|
+
*
|
|
648
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
|
|
649
|
+
*/
|
|
516
650
|
get eventPhase(): number;
|
|
651
|
+
/**
|
|
652
|
+
* 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.
|
|
653
|
+
*
|
|
654
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
|
|
655
|
+
*/
|
|
517
656
|
get composed(): boolean;
|
|
657
|
+
/**
|
|
658
|
+
* 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.
|
|
659
|
+
*
|
|
660
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
|
|
661
|
+
*/
|
|
518
662
|
get bubbles(): boolean;
|
|
663
|
+
/**
|
|
664
|
+
* 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.
|
|
665
|
+
*
|
|
666
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
|
|
667
|
+
*/
|
|
519
668
|
get cancelable(): boolean;
|
|
669
|
+
/**
|
|
670
|
+
* Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
|
|
671
|
+
*
|
|
672
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
|
|
673
|
+
*/
|
|
520
674
|
get defaultPrevented(): boolean;
|
|
675
|
+
/**
|
|
676
|
+
* @deprecated
|
|
677
|
+
*
|
|
678
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
|
|
679
|
+
*/
|
|
521
680
|
get returnValue(): boolean;
|
|
681
|
+
/**
|
|
682
|
+
* Returns the object whose event listener's callback is currently being invoked.
|
|
683
|
+
*
|
|
684
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
|
|
685
|
+
*/
|
|
522
686
|
get currentTarget(): EventTarget | undefined;
|
|
687
|
+
/**
|
|
688
|
+
* @deprecated
|
|
689
|
+
*
|
|
690
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
|
691
|
+
*/
|
|
523
692
|
get srcElement(): EventTarget | undefined;
|
|
693
|
+
/**
|
|
694
|
+
* Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
|
|
695
|
+
*
|
|
696
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
|
|
697
|
+
*/
|
|
524
698
|
get timeStamp(): number;
|
|
699
|
+
/**
|
|
700
|
+
* Returns true if event was dispatched by the user agent, and false otherwise.
|
|
701
|
+
*
|
|
702
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
|
|
703
|
+
*/
|
|
525
704
|
get isTrusted(): boolean;
|
|
705
|
+
/**
|
|
706
|
+
* @deprecated
|
|
707
|
+
*
|
|
708
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
|
709
|
+
*/
|
|
526
710
|
get cancelBubble(): boolean;
|
|
711
|
+
/**
|
|
712
|
+
* @deprecated
|
|
713
|
+
*
|
|
714
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
|
715
|
+
*/
|
|
527
716
|
set cancelBubble(value: boolean);
|
|
717
|
+
/**
|
|
718
|
+
* 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.
|
|
719
|
+
*
|
|
720
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
|
721
|
+
*/
|
|
528
722
|
stopImmediatePropagation(): void;
|
|
723
|
+
/**
|
|
724
|
+
* 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.
|
|
725
|
+
*
|
|
726
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
|
727
|
+
*/
|
|
529
728
|
preventDefault(): void;
|
|
729
|
+
/**
|
|
730
|
+
* When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
|
|
731
|
+
*
|
|
732
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
|
733
|
+
*/
|
|
530
734
|
stopPropagation(): void;
|
|
735
|
+
/**
|
|
736
|
+
* 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.
|
|
737
|
+
*
|
|
738
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
|
739
|
+
*/
|
|
531
740
|
composedPath(): EventTarget[];
|
|
532
741
|
static readonly NONE: number;
|
|
533
742
|
static readonly CAPTURING_PHASE: number;
|
|
@@ -540,28 +749,55 @@ export interface EventInit {
|
|
|
540
749
|
composed?: boolean;
|
|
541
750
|
}
|
|
542
751
|
export type EventListener<EventType extends Event = Event> = (
|
|
543
|
-
event: EventType
|
|
752
|
+
event: EventType,
|
|
544
753
|
) => void;
|
|
545
754
|
export interface EventListenerObject<EventType extends Event = Event> {
|
|
546
755
|
handleEvent(event: EventType): void;
|
|
547
756
|
}
|
|
548
757
|
export type EventListenerOrEventListenerObject<
|
|
549
|
-
EventType extends Event = Event
|
|
758
|
+
EventType extends Event = Event,
|
|
550
759
|
> = EventListener<EventType> | EventListenerObject<EventType>;
|
|
551
760
|
export declare class EventTarget<
|
|
552
|
-
EventMap extends Record<string, Event> = Record<string, Event
|
|
761
|
+
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
553
762
|
> {
|
|
554
763
|
constructor();
|
|
764
|
+
/**
|
|
765
|
+
* 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.
|
|
766
|
+
*
|
|
767
|
+
* 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.
|
|
768
|
+
*
|
|
769
|
+
* 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.
|
|
770
|
+
*
|
|
771
|
+
* 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.
|
|
772
|
+
*
|
|
773
|
+
* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
774
|
+
*
|
|
775
|
+
* If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
776
|
+
*
|
|
777
|
+
* The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
778
|
+
*
|
|
779
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
780
|
+
*/
|
|
555
781
|
addEventListener<Type extends keyof EventMap>(
|
|
556
782
|
type: Type,
|
|
557
783
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
558
|
-
options?: EventTargetAddEventListenerOptions | boolean
|
|
784
|
+
options?: EventTargetAddEventListenerOptions | boolean,
|
|
559
785
|
): void;
|
|
786
|
+
/**
|
|
787
|
+
* Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
788
|
+
*
|
|
789
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
790
|
+
*/
|
|
560
791
|
removeEventListener<Type extends keyof EventMap>(
|
|
561
792
|
type: Type,
|
|
562
793
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
563
|
-
options?: EventTargetEventListenerOptions | boolean
|
|
794
|
+
options?: EventTargetEventListenerOptions | boolean,
|
|
564
795
|
): void;
|
|
796
|
+
/**
|
|
797
|
+
* 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.
|
|
798
|
+
*
|
|
799
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
800
|
+
*/
|
|
565
801
|
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
|
|
566
802
|
}
|
|
567
803
|
export interface EventTargetEventListenerOptions {
|
|
@@ -578,15 +814,38 @@ export interface EventTargetHandlerObject {
|
|
|
578
814
|
}
|
|
579
815
|
export declare class AbortController {
|
|
580
816
|
constructor();
|
|
817
|
+
/**
|
|
818
|
+
* Returns the AbortSignal object associated with this object.
|
|
819
|
+
*
|
|
820
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
|
|
821
|
+
*/
|
|
581
822
|
get signal(): AbortSignal;
|
|
823
|
+
/**
|
|
824
|
+
* 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.
|
|
825
|
+
*
|
|
826
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
|
827
|
+
*/
|
|
582
828
|
abort(reason?: any): void;
|
|
583
829
|
}
|
|
584
830
|
export declare abstract class AbortSignal extends EventTarget {
|
|
831
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
585
832
|
static abort(reason?: any): AbortSignal;
|
|
833
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
586
834
|
static timeout(delay: number): AbortSignal;
|
|
587
835
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
836
|
+
/**
|
|
837
|
+
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
838
|
+
*
|
|
839
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
840
|
+
*/
|
|
588
841
|
get aborted(): boolean;
|
|
842
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
589
843
|
get reason(): any;
|
|
844
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
845
|
+
get onabort(): any | null;
|
|
846
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
847
|
+
set onabort(value: any | null);
|
|
848
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
590
849
|
throwIfAborted(): void;
|
|
591
850
|
}
|
|
592
851
|
export interface Scheduler {
|
|
@@ -596,18 +855,40 @@ export interface SchedulerWaitOptions {
|
|
|
596
855
|
signal?: AbortSignal;
|
|
597
856
|
}
|
|
598
857
|
export declare abstract class ExtendableEvent extends Event {
|
|
858
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
599
859
|
waitUntil(promise: Promise<any>): void;
|
|
600
860
|
}
|
|
861
|
+
export declare class CustomEvent<T = any> extends Event {
|
|
862
|
+
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
863
|
+
/**
|
|
864
|
+
* Returns any custom data event was created with. Typically used for synthetic events.
|
|
865
|
+
*
|
|
866
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
|
|
867
|
+
*/
|
|
868
|
+
get detail(): T;
|
|
869
|
+
}
|
|
870
|
+
export interface CustomEventCustomEventInit {
|
|
871
|
+
bubbles?: boolean;
|
|
872
|
+
cancelable?: boolean;
|
|
873
|
+
composed?: boolean;
|
|
874
|
+
detail?: any;
|
|
875
|
+
}
|
|
601
876
|
export declare class Blob {
|
|
602
877
|
constructor(
|
|
603
878
|
bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
604
|
-
options?: BlobOptions
|
|
879
|
+
options?: BlobOptions,
|
|
605
880
|
);
|
|
881
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
606
882
|
get size(): number;
|
|
883
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
607
884
|
get type(): string;
|
|
885
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
608
886
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
887
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
609
888
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
889
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
610
890
|
text(): Promise<string>;
|
|
891
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
611
892
|
stream(): ReadableStream;
|
|
612
893
|
}
|
|
613
894
|
export interface BlobOptions {
|
|
@@ -617,9 +898,11 @@ export declare class File extends Blob {
|
|
|
617
898
|
constructor(
|
|
618
899
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
619
900
|
name: string,
|
|
620
|
-
options?: FileOptions
|
|
901
|
+
options?: FileOptions,
|
|
621
902
|
);
|
|
903
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
622
904
|
get name(): string;
|
|
905
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
623
906
|
get lastModified(): number;
|
|
624
907
|
}
|
|
625
908
|
export interface FileOptions {
|
|
@@ -627,6 +910,7 @@ export interface FileOptions {
|
|
|
627
910
|
lastModified?: number;
|
|
628
911
|
}
|
|
629
912
|
export declare abstract class CacheStorage {
|
|
913
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
630
914
|
open(cacheName: string): Promise<Cache>;
|
|
631
915
|
readonly default: Cache;
|
|
632
916
|
}
|
|
@@ -634,7 +918,7 @@ export declare abstract class Cache {
|
|
|
634
918
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
635
919
|
match(
|
|
636
920
|
request: RequestInfo,
|
|
637
|
-
options?: CacheQueryOptions
|
|
921
|
+
options?: CacheQueryOptions,
|
|
638
922
|
): Promise<Response | undefined>;
|
|
639
923
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
640
924
|
}
|
|
@@ -642,7 +926,13 @@ export interface CacheQueryOptions {
|
|
|
642
926
|
ignoreMethod?: boolean;
|
|
643
927
|
}
|
|
644
928
|
export declare abstract class Crypto {
|
|
929
|
+
/**
|
|
930
|
+
* Available only in secure contexts.
|
|
931
|
+
*
|
|
932
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
933
|
+
*/
|
|
645
934
|
get subtle(): SubtleCrypto;
|
|
935
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
646
936
|
getRandomValues<
|
|
647
937
|
T extends
|
|
648
938
|
| Int8Array
|
|
@@ -652,8 +942,13 @@ export declare abstract class Crypto {
|
|
|
652
942
|
| Int32Array
|
|
653
943
|
| Uint32Array
|
|
654
944
|
| BigInt64Array
|
|
655
|
-
| BigUint64Array
|
|
945
|
+
| BigUint64Array,
|
|
656
946
|
>(buffer: T): T;
|
|
947
|
+
/**
|
|
948
|
+
* Available only in secure contexts.
|
|
949
|
+
*
|
|
950
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
951
|
+
*/
|
|
657
952
|
randomUUID(): string;
|
|
658
953
|
DigestStream: typeof DigestStream;
|
|
659
954
|
}
|
|
@@ -661,59 +956,63 @@ export declare abstract class SubtleCrypto {
|
|
|
661
956
|
encrypt(
|
|
662
957
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
663
958
|
key: CryptoKey,
|
|
664
|
-
plainText: ArrayBuffer | ArrayBufferView
|
|
959
|
+
plainText: ArrayBuffer | ArrayBufferView,
|
|
665
960
|
): Promise<ArrayBuffer>;
|
|
666
961
|
decrypt(
|
|
667
962
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
668
963
|
key: CryptoKey,
|
|
669
|
-
cipherText: ArrayBuffer | ArrayBufferView
|
|
964
|
+
cipherText: ArrayBuffer | ArrayBufferView,
|
|
670
965
|
): Promise<ArrayBuffer>;
|
|
671
966
|
sign(
|
|
672
967
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
673
968
|
key: CryptoKey,
|
|
674
|
-
data: ArrayBuffer | ArrayBufferView
|
|
969
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
675
970
|
): Promise<ArrayBuffer>;
|
|
676
971
|
verify(
|
|
677
972
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
678
973
|
key: CryptoKey,
|
|
679
974
|
signature: ArrayBuffer | ArrayBufferView,
|
|
680
|
-
data: ArrayBuffer | ArrayBufferView
|
|
975
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
681
976
|
): Promise<boolean>;
|
|
682
977
|
digest(
|
|
683
978
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
684
|
-
data: ArrayBuffer | ArrayBufferView
|
|
979
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
685
980
|
): Promise<ArrayBuffer>;
|
|
981
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
686
982
|
generateKey(
|
|
687
983
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
688
984
|
extractable: boolean,
|
|
689
|
-
keyUsages: string[]
|
|
985
|
+
keyUsages: string[],
|
|
690
986
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
987
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
691
988
|
deriveKey(
|
|
692
989
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
693
990
|
baseKey: CryptoKey,
|
|
694
991
|
derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
695
992
|
extractable: boolean,
|
|
696
|
-
keyUsages: string[]
|
|
993
|
+
keyUsages: string[],
|
|
697
994
|
): Promise<CryptoKey>;
|
|
698
995
|
deriveBits(
|
|
699
996
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
700
997
|
baseKey: CryptoKey,
|
|
701
|
-
length: number | null
|
|
998
|
+
length: number | null,
|
|
702
999
|
): Promise<ArrayBuffer>;
|
|
1000
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
703
1001
|
importKey(
|
|
704
1002
|
format: string,
|
|
705
1003
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
706
1004
|
algorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
707
1005
|
extractable: boolean,
|
|
708
|
-
keyUsages: string[]
|
|
1006
|
+
keyUsages: string[],
|
|
709
1007
|
): Promise<CryptoKey>;
|
|
710
1008
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
711
1009
|
wrapKey(
|
|
712
1010
|
format: string,
|
|
713
1011
|
key: CryptoKey,
|
|
714
1012
|
wrappingKey: CryptoKey,
|
|
715
|
-
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm
|
|
1013
|
+
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
716
1014
|
): Promise<ArrayBuffer>;
|
|
1015
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
717
1016
|
unwrapKey(
|
|
718
1017
|
format: string,
|
|
719
1018
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -721,16 +1020,19 @@ export declare abstract class SubtleCrypto {
|
|
|
721
1020
|
unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
722
1021
|
unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
723
1022
|
extractable: boolean,
|
|
724
|
-
keyUsages: string[]
|
|
1023
|
+
keyUsages: string[],
|
|
725
1024
|
): Promise<CryptoKey>;
|
|
726
1025
|
timingSafeEqual(
|
|
727
1026
|
a: ArrayBuffer | ArrayBufferView,
|
|
728
|
-
b: ArrayBuffer | ArrayBufferView
|
|
1027
|
+
b: ArrayBuffer | ArrayBufferView,
|
|
729
1028
|
): boolean;
|
|
730
1029
|
}
|
|
731
1030
|
export declare abstract class CryptoKey {
|
|
1031
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
732
1032
|
readonly type: string;
|
|
1033
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
733
1034
|
readonly extractable: boolean;
|
|
1035
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
734
1036
|
readonly algorithm:
|
|
735
1037
|
| CryptoKeyKeyAlgorithm
|
|
736
1038
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -738,6 +1040,7 @@ export declare abstract class CryptoKey {
|
|
|
738
1040
|
| CryptoKeyRsaKeyAlgorithm
|
|
739
1041
|
| CryptoKeyEllipticKeyAlgorithm
|
|
740
1042
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1043
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
741
1044
|
readonly usages: string[];
|
|
742
1045
|
}
|
|
743
1046
|
export interface CryptoKeyPair {
|
|
@@ -825,7 +1128,7 @@ export interface CryptoKeyHmacKeyAlgorithm {
|
|
|
825
1128
|
export interface CryptoKeyRsaKeyAlgorithm {
|
|
826
1129
|
name: string;
|
|
827
1130
|
modulusLength: number;
|
|
828
|
-
publicExponent: ArrayBuffer;
|
|
1131
|
+
publicExponent: ArrayBuffer | (ArrayBuffer | ArrayBufferView);
|
|
829
1132
|
hash?: CryptoKeyKeyAlgorithm;
|
|
830
1133
|
}
|
|
831
1134
|
export interface CryptoKeyEllipticKeyAlgorithm {
|
|
@@ -846,9 +1149,24 @@ export declare class DigestStream extends WritableStream<
|
|
|
846
1149
|
}
|
|
847
1150
|
export declare class TextDecoder {
|
|
848
1151
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1152
|
+
/**
|
|
1153
|
+
* 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.
|
|
1154
|
+
*
|
|
1155
|
+
* ```
|
|
1156
|
+
* var string = "", decoder = new TextDecoder(encoding), buffer;
|
|
1157
|
+
* while(buffer = next_chunk()) {
|
|
1158
|
+
* string += decoder.decode(buffer, {stream:true});
|
|
1159
|
+
* }
|
|
1160
|
+
* string += decoder.decode(); // end-of-queue
|
|
1161
|
+
* ```
|
|
1162
|
+
*
|
|
1163
|
+
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
|
|
1164
|
+
*
|
|
1165
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
|
|
1166
|
+
*/
|
|
849
1167
|
decode(
|
|
850
1168
|
input?: ArrayBuffer | ArrayBufferView,
|
|
851
|
-
options?: TextDecoderDecodeOptions
|
|
1169
|
+
options?: TextDecoderDecodeOptions,
|
|
852
1170
|
): string;
|
|
853
1171
|
get encoding(): string;
|
|
854
1172
|
get fatal(): boolean;
|
|
@@ -856,8 +1174,21 @@ export declare class TextDecoder {
|
|
|
856
1174
|
}
|
|
857
1175
|
export declare class TextEncoder {
|
|
858
1176
|
constructor();
|
|
1177
|
+
/**
|
|
1178
|
+
* Returns the result of running UTF-8's encoder.
|
|
1179
|
+
*
|
|
1180
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
|
1181
|
+
*/
|
|
859
1182
|
encode(input?: string): Uint8Array;
|
|
860
|
-
|
|
1183
|
+
/**
|
|
1184
|
+
* 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.
|
|
1185
|
+
*
|
|
1186
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
|
1187
|
+
*/
|
|
1188
|
+
encodeInto(
|
|
1189
|
+
input: string,
|
|
1190
|
+
buffer: ArrayBuffer | ArrayBufferView,
|
|
1191
|
+
): TextEncoderEncodeIntoResult;
|
|
861
1192
|
get encoding(): string;
|
|
862
1193
|
}
|
|
863
1194
|
export interface TextDecoderConstructorOptions {
|
|
@@ -881,17 +1212,20 @@ export declare class FormData {
|
|
|
881
1212
|
has(name: string): boolean;
|
|
882
1213
|
set(name: string, value: string): void;
|
|
883
1214
|
set(name: string, value: Blob, filename?: string): void;
|
|
1215
|
+
/** Returns an array of key, value pairs for every entry in the list. */
|
|
884
1216
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1217
|
+
/** Returns a list of keys in the list. */
|
|
885
1218
|
keys(): IterableIterator<string>;
|
|
1219
|
+
/** Returns a list of values in the list. */
|
|
886
1220
|
values(): IterableIterator<File | string>;
|
|
887
1221
|
forEach<This = unknown>(
|
|
888
1222
|
callback: (
|
|
889
1223
|
this: This,
|
|
890
1224
|
value: File | string,
|
|
891
1225
|
key: string,
|
|
892
|
-
parent: FormData
|
|
1226
|
+
parent: FormData,
|
|
893
1227
|
) => void,
|
|
894
|
-
thisArg?: This
|
|
1228
|
+
thisArg?: This,
|
|
895
1229
|
): void;
|
|
896
1230
|
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
|
|
897
1231
|
}
|
|
@@ -902,7 +1236,7 @@ export declare class HTMLRewriter {
|
|
|
902
1236
|
constructor();
|
|
903
1237
|
on(
|
|
904
1238
|
selector: string,
|
|
905
|
-
handlers: HTMLRewriterElementContentHandlers
|
|
1239
|
+
handlers: HTMLRewriterElementContentHandlers,
|
|
906
1240
|
): HTMLRewriter;
|
|
907
1241
|
onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
|
|
908
1242
|
transform(response: Response): Response;
|
|
@@ -969,7 +1303,9 @@ export interface DocumentEnd {
|
|
|
969
1303
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
970
1304
|
}
|
|
971
1305
|
export declare abstract class FetchEvent extends ExtendableEvent {
|
|
1306
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
972
1307
|
readonly request: Request;
|
|
1308
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
973
1309
|
respondWith(promise: Response | Promise<Response>): void;
|
|
974
1310
|
passThroughOnException(): void;
|
|
975
1311
|
}
|
|
@@ -987,10 +1323,13 @@ export declare class Headers {
|
|
|
987
1323
|
delete(name: string): void;
|
|
988
1324
|
forEach<This = unknown>(
|
|
989
1325
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
990
|
-
thisArg?: This
|
|
1326
|
+
thisArg?: This,
|
|
991
1327
|
): void;
|
|
1328
|
+
/** Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
992
1329
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1330
|
+
/** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
993
1331
|
keys(): IterableIterator<string>;
|
|
1332
|
+
/** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
994
1333
|
values(): IterableIterator<string>;
|
|
995
1334
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
996
1335
|
}
|
|
@@ -1013,14 +1352,23 @@ export declare abstract class Body {
|
|
|
1013
1352
|
}
|
|
1014
1353
|
export declare class Response extends Body {
|
|
1015
1354
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1355
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1016
1356
|
static redirect(url: string, status?: number): Response;
|
|
1357
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1017
1358
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1359
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1018
1360
|
clone(): Response;
|
|
1361
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1019
1362
|
get status(): number;
|
|
1363
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1020
1364
|
get statusText(): string;
|
|
1365
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1021
1366
|
get headers(): Headers;
|
|
1367
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1022
1368
|
get ok(): boolean;
|
|
1369
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1023
1370
|
get redirected(): boolean;
|
|
1371
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1024
1372
|
get url(): string;
|
|
1025
1373
|
get webSocket(): WebSocket | null;
|
|
1026
1374
|
get cf(): any | undefined;
|
|
@@ -1035,22 +1383,58 @@ export interface ResponseInit {
|
|
|
1035
1383
|
}
|
|
1036
1384
|
export type RequestInfo<
|
|
1037
1385
|
CfHostMetadata = unknown,
|
|
1038
|
-
Cf = CfProperties<CfHostMetadata
|
|
1386
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1039
1387
|
> = Request<CfHostMetadata, Cf> | string | URL;
|
|
1040
1388
|
export declare class Request<
|
|
1041
1389
|
CfHostMetadata = unknown,
|
|
1042
|
-
Cf = CfProperties<CfHostMetadata
|
|
1390
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1043
1391
|
> extends Body {
|
|
1044
1392
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1393
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1045
1394
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Returns request's HTTP method, which is "GET" by default.
|
|
1397
|
+
*
|
|
1398
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1399
|
+
*/
|
|
1046
1400
|
get method(): string;
|
|
1401
|
+
/**
|
|
1402
|
+
* Returns the URL of request as a string.
|
|
1403
|
+
*
|
|
1404
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1405
|
+
*/
|
|
1047
1406
|
get url(): string;
|
|
1407
|
+
/**
|
|
1408
|
+
* 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.
|
|
1409
|
+
*
|
|
1410
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1411
|
+
*/
|
|
1048
1412
|
get headers(): Headers;
|
|
1413
|
+
/**
|
|
1414
|
+
* 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.
|
|
1415
|
+
*
|
|
1416
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1417
|
+
*/
|
|
1049
1418
|
get redirect(): string;
|
|
1050
1419
|
get fetcher(): Fetcher | null;
|
|
1420
|
+
/**
|
|
1421
|
+
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1422
|
+
*
|
|
1423
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1424
|
+
*/
|
|
1051
1425
|
get signal(): AbortSignal;
|
|
1052
1426
|
get cf(): Cf | undefined;
|
|
1427
|
+
/**
|
|
1428
|
+
* 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]
|
|
1429
|
+
*
|
|
1430
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1431
|
+
*/
|
|
1053
1432
|
get integrity(): string;
|
|
1433
|
+
/**
|
|
1434
|
+
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1435
|
+
*
|
|
1436
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1437
|
+
*/
|
|
1054
1438
|
get keepalive(): boolean;
|
|
1055
1439
|
}
|
|
1056
1440
|
export interface RequestInit<Cf = CfProperties> {
|
|
@@ -1069,10 +1453,18 @@ export interface RequestInit<Cf = CfProperties> {
|
|
|
1069
1453
|
/** An AbortSignal to set request's signal. */
|
|
1070
1454
|
signal?: AbortSignal | null;
|
|
1071
1455
|
}
|
|
1072
|
-
export
|
|
1456
|
+
export type Service<
|
|
1457
|
+
T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
|
|
1458
|
+
> = Fetcher<T>;
|
|
1459
|
+
export type Fetcher<
|
|
1460
|
+
T extends Rpc.EntrypointBranded | undefined = undefined,
|
|
1461
|
+
Reserved extends string = never,
|
|
1462
|
+
> = (T extends Rpc.EntrypointBranded
|
|
1463
|
+
? Rpc.Provider<T, Reserved | "fetch" | "connect">
|
|
1464
|
+
: unknown) & {
|
|
1073
1465
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1074
1466
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1075
|
-
}
|
|
1467
|
+
};
|
|
1076
1468
|
export interface FetcherPutOptions {
|
|
1077
1469
|
expiration?: number;
|
|
1078
1470
|
expirationTtl?: number;
|
|
@@ -1087,82 +1479,84 @@ export type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
|
1087
1479
|
list_complete: false;
|
|
1088
1480
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
1089
1481
|
cursor: string;
|
|
1482
|
+
cacheStatus: string | null;
|
|
1090
1483
|
}
|
|
1091
1484
|
| {
|
|
1092
1485
|
list_complete: true;
|
|
1093
1486
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
1487
|
+
cacheStatus: string | null;
|
|
1094
1488
|
};
|
|
1095
1489
|
export interface KVNamespace<Key extends string = string> {
|
|
1096
1490
|
get(
|
|
1097
1491
|
key: Key,
|
|
1098
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1492
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1099
1493
|
): Promise<string | null>;
|
|
1100
1494
|
get(key: Key, type: "text"): Promise<string | null>;
|
|
1101
1495
|
get<ExpectedValue = unknown>(
|
|
1102
1496
|
key: Key,
|
|
1103
|
-
type: "json"
|
|
1497
|
+
type: "json",
|
|
1104
1498
|
): Promise<ExpectedValue | null>;
|
|
1105
1499
|
get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
|
|
1106
1500
|
get(key: Key, type: "stream"): Promise<ReadableStream | null>;
|
|
1107
1501
|
get(
|
|
1108
1502
|
key: Key,
|
|
1109
|
-
options?: KVNamespaceGetOptions<"text"
|
|
1503
|
+
options?: KVNamespaceGetOptions<"text">,
|
|
1110
1504
|
): Promise<string | null>;
|
|
1111
1505
|
get<ExpectedValue = unknown>(
|
|
1112
1506
|
key: Key,
|
|
1113
|
-
options?: KVNamespaceGetOptions<"json"
|
|
1507
|
+
options?: KVNamespaceGetOptions<"json">,
|
|
1114
1508
|
): Promise<ExpectedValue | null>;
|
|
1115
1509
|
get(
|
|
1116
1510
|
key: Key,
|
|
1117
|
-
options?: KVNamespaceGetOptions<"arrayBuffer"
|
|
1511
|
+
options?: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1118
1512
|
): Promise<ArrayBuffer | null>;
|
|
1119
1513
|
get(
|
|
1120
1514
|
key: Key,
|
|
1121
|
-
options?: KVNamespaceGetOptions<"stream"
|
|
1515
|
+
options?: KVNamespaceGetOptions<"stream">,
|
|
1122
1516
|
): Promise<ReadableStream | null>;
|
|
1123
1517
|
list<Metadata = unknown>(
|
|
1124
|
-
options?: KVNamespaceListOptions
|
|
1518
|
+
options?: KVNamespaceListOptions,
|
|
1125
1519
|
): Promise<KVNamespaceListResult<Metadata, Key>>;
|
|
1126
1520
|
put(
|
|
1127
1521
|
key: Key,
|
|
1128
1522
|
value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
|
|
1129
|
-
options?: KVNamespacePutOptions
|
|
1523
|
+
options?: KVNamespacePutOptions,
|
|
1130
1524
|
): Promise<void>;
|
|
1131
1525
|
getWithMetadata<Metadata = unknown>(
|
|
1132
1526
|
key: Key,
|
|
1133
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1527
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1134
1528
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1135
1529
|
getWithMetadata<Metadata = unknown>(
|
|
1136
1530
|
key: Key,
|
|
1137
|
-
type: "text"
|
|
1531
|
+
type: "text",
|
|
1138
1532
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1139
1533
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1140
1534
|
key: Key,
|
|
1141
|
-
type: "json"
|
|
1535
|
+
type: "json",
|
|
1142
1536
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1143
1537
|
getWithMetadata<Metadata = unknown>(
|
|
1144
1538
|
key: Key,
|
|
1145
|
-
type: "arrayBuffer"
|
|
1539
|
+
type: "arrayBuffer",
|
|
1146
1540
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1147
1541
|
getWithMetadata<Metadata = unknown>(
|
|
1148
1542
|
key: Key,
|
|
1149
|
-
type: "stream"
|
|
1543
|
+
type: "stream",
|
|
1150
1544
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1151
1545
|
getWithMetadata<Metadata = unknown>(
|
|
1152
1546
|
key: Key,
|
|
1153
|
-
options: KVNamespaceGetOptions<"text"
|
|
1547
|
+
options: KVNamespaceGetOptions<"text">,
|
|
1154
1548
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1155
1549
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1156
1550
|
key: Key,
|
|
1157
|
-
options: KVNamespaceGetOptions<"json"
|
|
1551
|
+
options: KVNamespaceGetOptions<"json">,
|
|
1158
1552
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1159
1553
|
getWithMetadata<Metadata = unknown>(
|
|
1160
1554
|
key: Key,
|
|
1161
|
-
options: KVNamespaceGetOptions<"arrayBuffer"
|
|
1555
|
+
options: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1162
1556
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1163
1557
|
getWithMetadata<Metadata = unknown>(
|
|
1164
1558
|
key: Key,
|
|
1165
|
-
options: KVNamespaceGetOptions<"stream"
|
|
1559
|
+
options: KVNamespaceGetOptions<"stream">,
|
|
1166
1560
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1167
1561
|
delete(key: Key): Promise<void>;
|
|
1168
1562
|
}
|
|
@@ -1183,32 +1577,49 @@ export interface KVNamespacePutOptions {
|
|
|
1183
1577
|
export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
1184
1578
|
value: Value | null;
|
|
1185
1579
|
metadata: Metadata | null;
|
|
1580
|
+
cacheStatus: string | null;
|
|
1581
|
+
}
|
|
1582
|
+
export type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1583
|
+
export interface Queue<Body = unknown> {
|
|
1584
|
+
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1585
|
+
sendBatch(
|
|
1586
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1587
|
+
options?: QueueSendBatchOptions,
|
|
1588
|
+
): Promise<void>;
|
|
1186
1589
|
}
|
|
1187
|
-
export interface
|
|
1188
|
-
|
|
1189
|
-
|
|
1590
|
+
export interface QueueSendOptions {
|
|
1591
|
+
contentType?: QueueContentType;
|
|
1592
|
+
delaySeconds?: number;
|
|
1593
|
+
}
|
|
1594
|
+
export interface QueueSendBatchOptions {
|
|
1595
|
+
delaySeconds?: number;
|
|
1190
1596
|
}
|
|
1191
|
-
export interface QueueSendOptions {}
|
|
1192
1597
|
export interface MessageSendRequest<Body = unknown> {
|
|
1193
1598
|
body: Body;
|
|
1599
|
+
contentType?: QueueContentType;
|
|
1600
|
+
delaySeconds?: number;
|
|
1601
|
+
}
|
|
1602
|
+
export interface QueueRetryOptions {
|
|
1603
|
+
delaySeconds?: number;
|
|
1194
1604
|
}
|
|
1195
1605
|
export interface Message<Body = unknown> {
|
|
1196
1606
|
readonly id: string;
|
|
1197
1607
|
readonly timestamp: Date;
|
|
1198
1608
|
readonly body: Body;
|
|
1199
|
-
|
|
1609
|
+
readonly attempts: number;
|
|
1610
|
+
retry(options?: QueueRetryOptions): void;
|
|
1200
1611
|
ack(): void;
|
|
1201
1612
|
}
|
|
1202
1613
|
export interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1203
1614
|
readonly messages: readonly Message<Body>[];
|
|
1204
1615
|
readonly queue: string;
|
|
1205
|
-
retryAll(): void;
|
|
1616
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1206
1617
|
ackAll(): void;
|
|
1207
1618
|
}
|
|
1208
1619
|
export interface MessageBatch<Body = unknown> {
|
|
1209
1620
|
readonly messages: readonly Message<Body>[];
|
|
1210
1621
|
readonly queue: string;
|
|
1211
|
-
retryAll(): void;
|
|
1622
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1212
1623
|
ackAll(): void;
|
|
1213
1624
|
}
|
|
1214
1625
|
export interface R2Error extends Error {
|
|
@@ -1232,7 +1643,7 @@ export declare abstract class R2Bucket {
|
|
|
1232
1643
|
key: string,
|
|
1233
1644
|
options: R2GetOptions & {
|
|
1234
1645
|
onlyIf: R2Conditional | Headers;
|
|
1235
|
-
}
|
|
1646
|
+
},
|
|
1236
1647
|
): Promise<R2ObjectBody | R2Object | null>;
|
|
1237
1648
|
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
|
|
1238
1649
|
put(
|
|
@@ -1244,8 +1655,10 @@ export declare abstract class R2Bucket {
|
|
|
1244
1655
|
| string
|
|
1245
1656
|
| null
|
|
1246
1657
|
| Blob,
|
|
1247
|
-
options?: R2PutOptions
|
|
1248
|
-
|
|
1658
|
+
options?: R2PutOptions & {
|
|
1659
|
+
onlyIf: R2Conditional | Headers;
|
|
1660
|
+
},
|
|
1661
|
+
): Promise<R2Object | null>;
|
|
1249
1662
|
put(
|
|
1250
1663
|
key: string,
|
|
1251
1664
|
value:
|
|
@@ -1255,13 +1668,11 @@ export declare abstract class R2Bucket {
|
|
|
1255
1668
|
| string
|
|
1256
1669
|
| null
|
|
1257
1670
|
| Blob,
|
|
1258
|
-
options?: R2PutOptions
|
|
1259
|
-
|
|
1260
|
-
}
|
|
1261
|
-
): Promise<R2Object | null>;
|
|
1671
|
+
options?: R2PutOptions,
|
|
1672
|
+
): Promise<R2Object>;
|
|
1262
1673
|
createMultipartUpload(
|
|
1263
1674
|
key: string,
|
|
1264
|
-
options?: R2MultipartOptions
|
|
1675
|
+
options?: R2MultipartOptions,
|
|
1265
1676
|
): Promise<R2MultipartUpload>;
|
|
1266
1677
|
resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
|
|
1267
1678
|
delete(keys: string | string[]): Promise<void>;
|
|
@@ -1272,7 +1683,7 @@ export interface R2MultipartUpload {
|
|
|
1272
1683
|
readonly uploadId: string;
|
|
1273
1684
|
uploadPart(
|
|
1274
1685
|
partNumber: number,
|
|
1275
|
-
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob
|
|
1686
|
+
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
|
|
1276
1687
|
): Promise<R2UploadedPart>;
|
|
1277
1688
|
abort(): Promise<void>;
|
|
1278
1689
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
@@ -1292,6 +1703,7 @@ export declare abstract class R2Object {
|
|
|
1292
1703
|
readonly httpMetadata?: R2HTTPMetadata;
|
|
1293
1704
|
readonly customMetadata?: Record<string, string>;
|
|
1294
1705
|
readonly range?: R2Range;
|
|
1706
|
+
readonly storageClass: string;
|
|
1295
1707
|
writeHttpMetadata(headers: Headers): void;
|
|
1296
1708
|
}
|
|
1297
1709
|
export interface R2ObjectBody extends R2Object {
|
|
@@ -1334,10 +1746,12 @@ export interface R2PutOptions {
|
|
|
1334
1746
|
sha256?: ArrayBuffer | string;
|
|
1335
1747
|
sha384?: ArrayBuffer | string;
|
|
1336
1748
|
sha512?: ArrayBuffer | string;
|
|
1749
|
+
storageClass?: string;
|
|
1337
1750
|
}
|
|
1338
1751
|
export interface R2MultipartOptions {
|
|
1339
1752
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1340
1753
|
customMetadata?: Record<string, string>;
|
|
1754
|
+
storageClass?: string;
|
|
1341
1755
|
}
|
|
1342
1756
|
export interface R2Checksums {
|
|
1343
1757
|
readonly md5?: ArrayBuffer;
|
|
@@ -1393,7 +1807,7 @@ export interface UnderlyingSink<W = any> {
|
|
|
1393
1807
|
start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
|
|
1394
1808
|
write?: (
|
|
1395
1809
|
chunk: W,
|
|
1396
|
-
controller: WritableStreamDefaultController
|
|
1810
|
+
controller: WritableStreamDefaultController,
|
|
1397
1811
|
) => void | Promise<void>;
|
|
1398
1812
|
abort?: (reason: any) => void | Promise<void>;
|
|
1399
1813
|
close?: () => void | Promise<void>;
|
|
@@ -1408,26 +1822,29 @@ export interface UnderlyingByteSource {
|
|
|
1408
1822
|
export interface UnderlyingSource<R = any> {
|
|
1409
1823
|
type?: "" | undefined;
|
|
1410
1824
|
start?: (
|
|
1411
|
-
controller: ReadableStreamDefaultController<R
|
|
1825
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1412
1826
|
) => void | Promise<void>;
|
|
1413
1827
|
pull?: (
|
|
1414
|
-
controller: ReadableStreamDefaultController<R
|
|
1828
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1415
1829
|
) => void | Promise<void>;
|
|
1416
1830
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1831
|
+
expectedLength?: number | bigint;
|
|
1417
1832
|
}
|
|
1418
1833
|
export interface Transformer<I = any, O = any> {
|
|
1419
1834
|
readableType?: string;
|
|
1420
1835
|
writableType?: string;
|
|
1421
1836
|
start?: (
|
|
1422
|
-
controller: TransformStreamDefaultController<O
|
|
1837
|
+
controller: TransformStreamDefaultController<O>,
|
|
1423
1838
|
) => void | Promise<void>;
|
|
1424
1839
|
transform?: (
|
|
1425
1840
|
chunk: I,
|
|
1426
|
-
controller: TransformStreamDefaultController<O
|
|
1841
|
+
controller: TransformStreamDefaultController<O>,
|
|
1427
1842
|
) => void | Promise<void>;
|
|
1428
1843
|
flush?: (
|
|
1429
|
-
controller: TransformStreamDefaultController<O
|
|
1844
|
+
controller: TransformStreamDefaultController<O>,
|
|
1430
1845
|
) => void | Promise<void>;
|
|
1846
|
+
cancel?: (reason: any) => void | Promise<void>;
|
|
1847
|
+
expectedLength?: number;
|
|
1431
1848
|
}
|
|
1432
1849
|
export interface StreamPipeOptions {
|
|
1433
1850
|
/**
|
|
@@ -1461,87 +1878,129 @@ export type ReadableStreamReadResult<R = any> =
|
|
|
1461
1878
|
done: true;
|
|
1462
1879
|
value?: undefined;
|
|
1463
1880
|
};
|
|
1464
|
-
/**
|
|
1881
|
+
/**
|
|
1882
|
+
* 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.
|
|
1883
|
+
*
|
|
1884
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1885
|
+
*/
|
|
1465
1886
|
export interface ReadableStream<R = any> {
|
|
1887
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1466
1888
|
get locked(): boolean;
|
|
1889
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1467
1890
|
cancel(reason?: any): Promise<void>;
|
|
1891
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1468
1892
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1893
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1469
1894
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1895
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1470
1896
|
pipeThrough<T>(
|
|
1471
1897
|
transform: ReadableWritablePair<T, R>,
|
|
1472
|
-
options?: StreamPipeOptions
|
|
1898
|
+
options?: StreamPipeOptions,
|
|
1473
1899
|
): ReadableStream<T>;
|
|
1900
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1474
1901
|
pipeTo(
|
|
1475
1902
|
destination: WritableStream<R>,
|
|
1476
|
-
options?: StreamPipeOptions
|
|
1903
|
+
options?: StreamPipeOptions,
|
|
1477
1904
|
): Promise<void>;
|
|
1905
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1478
1906
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1479
1907
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1480
1908
|
[Symbol.asyncIterator](
|
|
1481
|
-
options?: ReadableStreamValuesOptions
|
|
1909
|
+
options?: ReadableStreamValuesOptions,
|
|
1482
1910
|
): AsyncIterableIterator<R>;
|
|
1483
1911
|
}
|
|
1484
1912
|
export declare const ReadableStream: {
|
|
1485
1913
|
prototype: ReadableStream;
|
|
1486
1914
|
new (
|
|
1487
1915
|
underlyingSource: UnderlyingByteSource,
|
|
1488
|
-
strategy?: QueuingStrategy<Uint8Array
|
|
1916
|
+
strategy?: QueuingStrategy<Uint8Array>,
|
|
1489
1917
|
): ReadableStream<Uint8Array>;
|
|
1490
1918
|
new <R = any>(
|
|
1491
1919
|
underlyingSource?: UnderlyingSource<R>,
|
|
1492
|
-
strategy?: QueuingStrategy<R
|
|
1920
|
+
strategy?: QueuingStrategy<R>,
|
|
1493
1921
|
): ReadableStream<R>;
|
|
1494
1922
|
};
|
|
1495
1923
|
export declare class ReadableStreamDefaultReader<R = any> {
|
|
1496
1924
|
constructor(stream: ReadableStream);
|
|
1497
1925
|
get closed(): Promise<void>;
|
|
1498
1926
|
cancel(reason?: any): Promise<void>;
|
|
1927
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1499
1928
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1929
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1500
1930
|
releaseLock(): void;
|
|
1501
1931
|
}
|
|
1502
1932
|
export declare class ReadableStreamBYOBReader {
|
|
1503
1933
|
constructor(stream: ReadableStream);
|
|
1504
1934
|
get closed(): Promise<void>;
|
|
1505
1935
|
cancel(reason?: any): Promise<void>;
|
|
1936
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1506
1937
|
read<T extends ArrayBufferView>(
|
|
1507
|
-
view: T
|
|
1938
|
+
view: T,
|
|
1508
1939
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1940
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1509
1941
|
releaseLock(): void;
|
|
1510
1942
|
readAtLeast<T extends ArrayBufferView>(
|
|
1511
1943
|
minElements: number,
|
|
1512
|
-
view: T
|
|
1944
|
+
view: T,
|
|
1513
1945
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1514
1946
|
}
|
|
1947
|
+
export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1948
|
+
min?: number;
|
|
1949
|
+
}
|
|
1515
1950
|
export interface ReadableStreamGetReaderOptions {
|
|
1951
|
+
/**
|
|
1952
|
+
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
|
1953
|
+
*
|
|
1954
|
+
* 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.
|
|
1955
|
+
*/
|
|
1516
1956
|
mode: "byob";
|
|
1517
1957
|
}
|
|
1518
1958
|
export declare abstract class ReadableStreamBYOBRequest {
|
|
1519
|
-
|
|
1959
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1960
|
+
get view(): Uint8Array | null;
|
|
1961
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1520
1962
|
respond(bytesWritten: number): void;
|
|
1963
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1521
1964
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1522
|
-
|
|
1965
|
+
get atLeast(): number | null;
|
|
1523
1966
|
}
|
|
1524
1967
|
export declare abstract class ReadableStreamDefaultController<R = any> {
|
|
1525
|
-
|
|
1968
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1969
|
+
get desiredSize(): number | null;
|
|
1970
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1526
1971
|
close(): void;
|
|
1972
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1527
1973
|
enqueue(chunk?: R): void;
|
|
1974
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1528
1975
|
error(reason: any): void;
|
|
1529
1976
|
}
|
|
1530
1977
|
export declare abstract class ReadableByteStreamController {
|
|
1531
|
-
|
|
1532
|
-
|
|
1978
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1979
|
+
get byobRequest(): ReadableStreamBYOBRequest | null;
|
|
1980
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1981
|
+
get desiredSize(): number | null;
|
|
1982
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1533
1983
|
close(): void;
|
|
1984
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1534
1985
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1986
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1535
1987
|
error(reason: any): void;
|
|
1536
1988
|
}
|
|
1537
1989
|
export declare abstract class WritableStreamDefaultController {
|
|
1538
|
-
|
|
1990
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1991
|
+
get signal(): AbortSignal;
|
|
1992
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1539
1993
|
error(reason?: any): void;
|
|
1540
1994
|
}
|
|
1995
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
1541
1996
|
export interface TransformStreamDefaultController<O = any> {
|
|
1997
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1542
1998
|
get desiredSize(): number | null;
|
|
1999
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
1543
2000
|
enqueue(chunk?: O): void;
|
|
2001
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
1544
2002
|
error(reason: any): void;
|
|
2003
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
1545
2004
|
terminate(): void;
|
|
1546
2005
|
}
|
|
1547
2006
|
export interface ReadableWritablePair<R = any, W = any> {
|
|
@@ -1556,36 +2015,49 @@ export interface ReadableWritablePair<R = any, W = any> {
|
|
|
1556
2015
|
export declare class WritableStream<W = any> {
|
|
1557
2016
|
constructor(
|
|
1558
2017
|
underlyingSink?: UnderlyingSink,
|
|
1559
|
-
queuingStrategy?: QueuingStrategy
|
|
2018
|
+
queuingStrategy?: QueuingStrategy,
|
|
1560
2019
|
);
|
|
2020
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
1561
2021
|
get locked(): boolean;
|
|
2022
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
1562
2023
|
abort(reason?: any): Promise<void>;
|
|
2024
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
1563
2025
|
close(): Promise<void>;
|
|
2026
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
1564
2027
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
1565
2028
|
}
|
|
1566
2029
|
export declare class WritableStreamDefaultWriter<W = any> {
|
|
1567
2030
|
constructor(stream: WritableStream);
|
|
2031
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
1568
2032
|
get closed(): Promise<void>;
|
|
2033
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
1569
2034
|
get ready(): Promise<void>;
|
|
2035
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
1570
2036
|
get desiredSize(): number | null;
|
|
2037
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
1571
2038
|
abort(reason?: any): Promise<void>;
|
|
2039
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
1572
2040
|
close(): Promise<void>;
|
|
2041
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
1573
2042
|
write(chunk?: W): Promise<void>;
|
|
2043
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
1574
2044
|
releaseLock(): void;
|
|
1575
2045
|
}
|
|
1576
2046
|
export declare class TransformStream<I = any, O = any> {
|
|
1577
2047
|
constructor(
|
|
1578
2048
|
transformer?: Transformer<I, O>,
|
|
1579
2049
|
writableStrategy?: QueuingStrategy<I>,
|
|
1580
|
-
readableStrategy?: QueuingStrategy<O
|
|
2050
|
+
readableStrategy?: QueuingStrategy<O>,
|
|
1581
2051
|
);
|
|
2052
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
1582
2053
|
get readable(): ReadableStream<O>;
|
|
2054
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
1583
2055
|
get writable(): WritableStream<I>;
|
|
1584
2056
|
}
|
|
1585
2057
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
1586
2058
|
constructor(
|
|
1587
2059
|
expectedLength: number | bigint,
|
|
1588
|
-
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
2060
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
1589
2061
|
);
|
|
1590
2062
|
}
|
|
1591
2063
|
export declare class IdentityTransformStream extends TransformStream<
|
|
@@ -1617,26 +2089,35 @@ export declare class TextEncoderStream extends TransformStream<
|
|
|
1617
2089
|
Uint8Array
|
|
1618
2090
|
> {
|
|
1619
2091
|
constructor();
|
|
2092
|
+
get encoding(): string;
|
|
1620
2093
|
}
|
|
1621
2094
|
export declare class TextDecoderStream extends TransformStream<
|
|
1622
2095
|
ArrayBuffer | ArrayBufferView,
|
|
1623
2096
|
string
|
|
1624
2097
|
> {
|
|
1625
2098
|
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
2099
|
+
get encoding(): string;
|
|
2100
|
+
get fatal(): boolean;
|
|
2101
|
+
get ignoreBOM(): boolean;
|
|
1626
2102
|
}
|
|
1627
2103
|
export interface TextDecoderStreamTextDecoderStreamInit {
|
|
1628
2104
|
fatal?: boolean;
|
|
2105
|
+
ignoreBOM?: boolean;
|
|
1629
2106
|
}
|
|
1630
2107
|
export declare class ByteLengthQueuingStrategy
|
|
1631
2108
|
implements QueuingStrategy<ArrayBufferView>
|
|
1632
2109
|
{
|
|
1633
2110
|
constructor(init: QueuingStrategyInit);
|
|
2111
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
1634
2112
|
get highWaterMark(): number;
|
|
2113
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
1635
2114
|
get size(): (chunk?: any) => number;
|
|
1636
2115
|
}
|
|
1637
2116
|
export declare class CountQueuingStrategy implements QueuingStrategy {
|
|
1638
2117
|
constructor(init: QueuingStrategyInit);
|
|
2118
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
1639
2119
|
get highWaterMark(): number;
|
|
2120
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
1640
2121
|
get size(): (chunk?: any) => number;
|
|
1641
2122
|
}
|
|
1642
2123
|
export interface QueuingStrategyInit {
|
|
@@ -1647,6 +2128,11 @@ export interface QueuingStrategyInit {
|
|
|
1647
2128
|
*/
|
|
1648
2129
|
highWaterMark: number;
|
|
1649
2130
|
}
|
|
2131
|
+
export interface ScriptVersion {
|
|
2132
|
+
id?: string;
|
|
2133
|
+
tag?: string;
|
|
2134
|
+
message?: string;
|
|
2135
|
+
}
|
|
1650
2136
|
export declare abstract class TailEvent extends ExtendableEvent {
|
|
1651
2137
|
readonly events: TraceItem[];
|
|
1652
2138
|
readonly traces: TraceItem[];
|
|
@@ -1655,17 +2141,23 @@ export interface TraceItem {
|
|
|
1655
2141
|
readonly event:
|
|
1656
2142
|
| (
|
|
1657
2143
|
| TraceItemFetchEventInfo
|
|
2144
|
+
| TraceItemJsRpcEventInfo
|
|
1658
2145
|
| TraceItemScheduledEventInfo
|
|
1659
2146
|
| TraceItemAlarmEventInfo
|
|
1660
2147
|
| TraceItemQueueEventInfo
|
|
1661
2148
|
| TraceItemEmailEventInfo
|
|
2149
|
+
| TraceItemTailEventInfo
|
|
1662
2150
|
| TraceItemCustomEventInfo
|
|
2151
|
+
| TraceItemHibernatableWebSocketEventInfo
|
|
1663
2152
|
)
|
|
1664
2153
|
| null;
|
|
1665
2154
|
readonly eventTimestamp: number | null;
|
|
1666
2155
|
readonly logs: TraceLog[];
|
|
1667
2156
|
readonly exceptions: TraceException[];
|
|
2157
|
+
readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
|
|
1668
2158
|
readonly scriptName: string | null;
|
|
2159
|
+
readonly entrypoint?: string;
|
|
2160
|
+
readonly scriptVersion?: ScriptVersion;
|
|
1669
2161
|
readonly dispatchNamespace?: string;
|
|
1670
2162
|
readonly scriptTags?: string[];
|
|
1671
2163
|
readonly outcome: string;
|
|
@@ -1687,6 +2179,12 @@ export interface TraceItemEmailEventInfo {
|
|
|
1687
2179
|
readonly rcptTo: string;
|
|
1688
2180
|
readonly rawSize: number;
|
|
1689
2181
|
}
|
|
2182
|
+
export interface TraceItemTailEventInfo {
|
|
2183
|
+
readonly consumedEvents: TraceItemTailEventInfoTailItem[];
|
|
2184
|
+
}
|
|
2185
|
+
export interface TraceItemTailEventInfoTailItem {
|
|
2186
|
+
readonly scriptName: string | null;
|
|
2187
|
+
}
|
|
1690
2188
|
export interface TraceItemFetchEventInfo {
|
|
1691
2189
|
readonly response?: TraceItemFetchEventInfoResponse;
|
|
1692
2190
|
readonly request: TraceItemFetchEventInfoRequest;
|
|
@@ -1701,6 +2199,26 @@ export interface TraceItemFetchEventInfoRequest {
|
|
|
1701
2199
|
export interface TraceItemFetchEventInfoResponse {
|
|
1702
2200
|
readonly status: number;
|
|
1703
2201
|
}
|
|
2202
|
+
export interface TraceItemJsRpcEventInfo {
|
|
2203
|
+
readonly rpcMethod: string;
|
|
2204
|
+
}
|
|
2205
|
+
export interface TraceItemHibernatableWebSocketEventInfo {
|
|
2206
|
+
readonly getWebSocketEvent:
|
|
2207
|
+
| TraceItemHibernatableWebSocketEventInfoMessage
|
|
2208
|
+
| TraceItemHibernatableWebSocketEventInfoClose
|
|
2209
|
+
| TraceItemHibernatableWebSocketEventInfoError;
|
|
2210
|
+
}
|
|
2211
|
+
export interface TraceItemHibernatableWebSocketEventInfoMessage {
|
|
2212
|
+
readonly webSocketEventType: string;
|
|
2213
|
+
}
|
|
2214
|
+
export interface TraceItemHibernatableWebSocketEventInfoClose {
|
|
2215
|
+
readonly webSocketEventType: string;
|
|
2216
|
+
readonly code: number;
|
|
2217
|
+
readonly wasClean: boolean;
|
|
2218
|
+
}
|
|
2219
|
+
export interface TraceItemHibernatableWebSocketEventInfoError {
|
|
2220
|
+
readonly webSocketEventType: string;
|
|
2221
|
+
}
|
|
1704
2222
|
export interface TraceLog {
|
|
1705
2223
|
readonly timestamp: number;
|
|
1706
2224
|
readonly level: string;
|
|
@@ -1710,6 +2228,12 @@ export interface TraceException {
|
|
|
1710
2228
|
readonly timestamp: number;
|
|
1711
2229
|
readonly message: string;
|
|
1712
2230
|
readonly name: string;
|
|
2231
|
+
readonly stack?: string;
|
|
2232
|
+
}
|
|
2233
|
+
export interface TraceDiagnosticChannelEvent {
|
|
2234
|
+
readonly timestamp: number;
|
|
2235
|
+
readonly channel: string;
|
|
2236
|
+
readonly message: any;
|
|
1713
2237
|
}
|
|
1714
2238
|
export interface TraceMetrics {
|
|
1715
2239
|
readonly cpuTime: number;
|
|
@@ -1720,61 +2244,93 @@ export interface UnsafeTraceMetrics {
|
|
|
1720
2244
|
}
|
|
1721
2245
|
export declare class URL {
|
|
1722
2246
|
constructor(url: string | URL, base?: string | URL);
|
|
2247
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
1723
2248
|
get origin(): string;
|
|
2249
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
1724
2250
|
get href(): string;
|
|
2251
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
1725
2252
|
set href(value: string);
|
|
2253
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
1726
2254
|
get protocol(): string;
|
|
2255
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
1727
2256
|
set protocol(value: string);
|
|
2257
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
1728
2258
|
get username(): string;
|
|
2259
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
1729
2260
|
set username(value: string);
|
|
2261
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
1730
2262
|
get password(): string;
|
|
2263
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
1731
2264
|
set password(value: string);
|
|
2265
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
1732
2266
|
get host(): string;
|
|
2267
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
1733
2268
|
set host(value: string);
|
|
2269
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
1734
2270
|
get hostname(): string;
|
|
2271
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
1735
2272
|
set hostname(value: string);
|
|
2273
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
1736
2274
|
get port(): string;
|
|
2275
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
1737
2276
|
set port(value: string);
|
|
2277
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
1738
2278
|
get pathname(): string;
|
|
2279
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
1739
2280
|
set pathname(value: string);
|
|
2281
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
1740
2282
|
get search(): string;
|
|
2283
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
1741
2284
|
set search(value: string);
|
|
2285
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
1742
2286
|
get hash(): string;
|
|
2287
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
1743
2288
|
set hash(value: string);
|
|
2289
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
1744
2290
|
get searchParams(): URLSearchParams;
|
|
2291
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
1745
2292
|
toJSON(): string;
|
|
1746
2293
|
toString(): string;
|
|
2294
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
1747
2295
|
static canParse(url: string, base?: string): boolean;
|
|
2296
|
+
static parse(url: string, base?: string): URL | null;
|
|
1748
2297
|
}
|
|
1749
2298
|
export declare class URLSearchParams {
|
|
1750
2299
|
constructor(
|
|
1751
|
-
init?: Iterable<Iterable<string>> | Record<string, string> | string
|
|
2300
|
+
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
1752
2301
|
);
|
|
1753
2302
|
get size(): number;
|
|
1754
2303
|
append(name: string, value: string): void;
|
|
1755
|
-
delete(name: string
|
|
2304
|
+
delete(name: string): void;
|
|
1756
2305
|
get(name: string): string | null;
|
|
1757
2306
|
getAll(name: string): string[];
|
|
1758
|
-
has(name: string
|
|
2307
|
+
has(name: string): boolean;
|
|
1759
2308
|
set(name: string, value: string): void;
|
|
1760
2309
|
sort(): void;
|
|
2310
|
+
/** Returns an array of key, value pairs for every entry in the search params. */
|
|
1761
2311
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2312
|
+
/** Returns a list of keys in the search params. */
|
|
1762
2313
|
keys(): IterableIterator<string>;
|
|
2314
|
+
/** Returns a list of values in the search params. */
|
|
1763
2315
|
values(): IterableIterator<string>;
|
|
1764
2316
|
forEach<This = unknown>(
|
|
1765
2317
|
callback: (
|
|
1766
2318
|
this: This,
|
|
1767
2319
|
value: string,
|
|
1768
2320
|
key: string,
|
|
1769
|
-
parent: URLSearchParams
|
|
2321
|
+
parent: URLSearchParams,
|
|
1770
2322
|
) => void,
|
|
1771
|
-
thisArg?: This
|
|
2323
|
+
thisArg?: This,
|
|
1772
2324
|
): void;
|
|
1773
2325
|
toString(): string;
|
|
1774
2326
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1775
2327
|
}
|
|
1776
2328
|
export declare class URLPattern {
|
|
1777
|
-
constructor(
|
|
2329
|
+
constructor(
|
|
2330
|
+
input?: string | URLPatternURLPatternInit,
|
|
2331
|
+
baseURL?: string,
|
|
2332
|
+
patternOptions?: URLPatternURLPatternOptions,
|
|
2333
|
+
);
|
|
1778
2334
|
get protocol(): string;
|
|
1779
2335
|
get username(): string;
|
|
1780
2336
|
get password(): string;
|
|
@@ -1786,7 +2342,7 @@ export declare class URLPattern {
|
|
|
1786
2342
|
test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean;
|
|
1787
2343
|
exec(
|
|
1788
2344
|
input?: string | URLPatternURLPatternInit,
|
|
1789
|
-
baseURL?: string
|
|
2345
|
+
baseURL?: string,
|
|
1790
2346
|
): URLPatternURLPatternResult | null;
|
|
1791
2347
|
}
|
|
1792
2348
|
export interface URLPatternURLPatternInit {
|
|
@@ -1815,13 +2371,28 @@ export interface URLPatternURLPatternResult {
|
|
|
1815
2371
|
search: URLPatternURLPatternComponentResult;
|
|
1816
2372
|
hash: URLPatternURLPatternComponentResult;
|
|
1817
2373
|
}
|
|
2374
|
+
export interface URLPatternURLPatternOptions {
|
|
2375
|
+
ignoreCase?: boolean;
|
|
2376
|
+
}
|
|
1818
2377
|
export declare class CloseEvent extends Event {
|
|
1819
|
-
constructor(type: string, initializer
|
|
1820
|
-
/**
|
|
2378
|
+
constructor(type: string, initializer?: CloseEventInit);
|
|
2379
|
+
/**
|
|
2380
|
+
* Returns the WebSocket connection close code provided by the server.
|
|
2381
|
+
*
|
|
2382
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
|
|
2383
|
+
*/
|
|
1821
2384
|
readonly code: number;
|
|
1822
|
-
/**
|
|
2385
|
+
/**
|
|
2386
|
+
* Returns the WebSocket connection close reason provided by the server.
|
|
2387
|
+
*
|
|
2388
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
|
|
2389
|
+
*/
|
|
1823
2390
|
readonly reason: string;
|
|
1824
|
-
/**
|
|
2391
|
+
/**
|
|
2392
|
+
* Returns true if the connection closed cleanly; false otherwise.
|
|
2393
|
+
*
|
|
2394
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
|
2395
|
+
*/
|
|
1825
2396
|
readonly wasClean: boolean;
|
|
1826
2397
|
}
|
|
1827
2398
|
export interface CloseEventInit {
|
|
@@ -1836,12 +2407,21 @@ export declare class MessageEvent extends Event {
|
|
|
1836
2407
|
export interface MessageEventInit {
|
|
1837
2408
|
data: ArrayBuffer | string;
|
|
1838
2409
|
}
|
|
1839
|
-
/**
|
|
2410
|
+
/**
|
|
2411
|
+
* Events providing information related to errors in scripts or in files.
|
|
2412
|
+
*
|
|
2413
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2414
|
+
*/
|
|
1840
2415
|
export interface ErrorEvent extends Event {
|
|
2416
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1841
2417
|
readonly filename: string;
|
|
2418
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1842
2419
|
readonly message: string;
|
|
2420
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1843
2421
|
readonly lineno: number;
|
|
2422
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1844
2423
|
readonly colno: number;
|
|
2424
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1845
2425
|
readonly error: any;
|
|
1846
2426
|
}
|
|
1847
2427
|
export type WebSocketEventMap = {
|
|
@@ -1853,17 +2433,51 @@ export type WebSocketEventMap = {
|
|
|
1853
2433
|
export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
1854
2434
|
constructor(url: string, protocols?: string[] | string);
|
|
1855
2435
|
accept(): void;
|
|
2436
|
+
/**
|
|
2437
|
+
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
2438
|
+
*
|
|
2439
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
2440
|
+
*/
|
|
1856
2441
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
2442
|
+
/**
|
|
2443
|
+
* Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
|
|
2444
|
+
*
|
|
2445
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
|
2446
|
+
*/
|
|
1857
2447
|
close(code?: number, reason?: string): void;
|
|
1858
2448
|
serializeAttachment(attachment: any): void;
|
|
1859
2449
|
deserializeAttachment(): any | null;
|
|
1860
2450
|
static readonly READY_STATE_CONNECTING: number;
|
|
2451
|
+
static readonly CONNECTING: number;
|
|
1861
2452
|
static readonly READY_STATE_OPEN: number;
|
|
2453
|
+
static readonly OPEN: number;
|
|
1862
2454
|
static readonly READY_STATE_CLOSING: number;
|
|
2455
|
+
static readonly CLOSING: number;
|
|
1863
2456
|
static readonly READY_STATE_CLOSED: number;
|
|
2457
|
+
static readonly CLOSED: number;
|
|
2458
|
+
/**
|
|
2459
|
+
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2460
|
+
*
|
|
2461
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2462
|
+
*/
|
|
1864
2463
|
get readyState(): number;
|
|
2464
|
+
/**
|
|
2465
|
+
* Returns the URL that was used to establish the WebSocket connection.
|
|
2466
|
+
*
|
|
2467
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2468
|
+
*/
|
|
1865
2469
|
get url(): string | null;
|
|
2470
|
+
/**
|
|
2471
|
+
* 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.
|
|
2472
|
+
*
|
|
2473
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2474
|
+
*/
|
|
1866
2475
|
get protocol(): string | null;
|
|
2476
|
+
/**
|
|
2477
|
+
* Returns the extensions selected by the server, if any.
|
|
2478
|
+
*
|
|
2479
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2480
|
+
*/
|
|
1867
2481
|
get extensions(): string | null;
|
|
1868
2482
|
}
|
|
1869
2483
|
export declare const WebSocketPair: {
|
|
@@ -1876,6 +2490,7 @@ export interface Socket {
|
|
|
1876
2490
|
get readable(): ReadableStream;
|
|
1877
2491
|
get writable(): WritableStream;
|
|
1878
2492
|
get closed(): Promise<void>;
|
|
2493
|
+
get opened(): Promise<SocketInfo>;
|
|
1879
2494
|
close(): Promise<void>;
|
|
1880
2495
|
startTls(options?: TlsOptions): Socket;
|
|
1881
2496
|
}
|
|
@@ -1890,6 +2505,528 @@ export interface SocketAddress {
|
|
|
1890
2505
|
export interface TlsOptions {
|
|
1891
2506
|
expectedServerHostname?: string;
|
|
1892
2507
|
}
|
|
2508
|
+
export interface SocketInfo {
|
|
2509
|
+
remoteAddress?: string;
|
|
2510
|
+
localAddress?: string;
|
|
2511
|
+
}
|
|
2512
|
+
export interface gpuGPU {
|
|
2513
|
+
requestAdapter(
|
|
2514
|
+
param1?: gpuGPURequestAdapterOptions,
|
|
2515
|
+
): Promise<gpuGPUAdapter | null>;
|
|
2516
|
+
}
|
|
2517
|
+
export declare abstract class gpuGPUAdapter {
|
|
2518
|
+
requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
|
|
2519
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
|
|
2520
|
+
get features(): gpuGPUSupportedFeatures;
|
|
2521
|
+
get limits(): gpuGPUSupportedLimits;
|
|
2522
|
+
}
|
|
2523
|
+
export interface gpuGPUDevice extends EventTarget {
|
|
2524
|
+
createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
|
|
2525
|
+
createBindGroupLayout(
|
|
2526
|
+
descriptor: gpuGPUBindGroupLayoutDescriptor,
|
|
2527
|
+
): gpuGPUBindGroupLayout;
|
|
2528
|
+
createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
|
|
2529
|
+
createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
|
|
2530
|
+
createShaderModule(
|
|
2531
|
+
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2532
|
+
): gpuGPUShaderModule;
|
|
2533
|
+
createPipelineLayout(
|
|
2534
|
+
descriptor: gpuGPUPipelineLayoutDescriptor,
|
|
2535
|
+
): gpuGPUPipelineLayout;
|
|
2536
|
+
createComputePipeline(
|
|
2537
|
+
descriptor: gpuGPUComputePipelineDescriptor,
|
|
2538
|
+
): gpuGPUComputePipeline;
|
|
2539
|
+
createRenderPipeline(
|
|
2540
|
+
descriptor: gpuGPURenderPipelineDescriptor,
|
|
2541
|
+
): gpuGPURenderPipeline;
|
|
2542
|
+
createCommandEncoder(
|
|
2543
|
+
descriptor?: gpuGPUCommandEncoderDescriptor,
|
|
2544
|
+
): gpuGPUCommandEncoder;
|
|
2545
|
+
createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
|
|
2546
|
+
destroy(): void;
|
|
2547
|
+
createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
|
|
2548
|
+
pushErrorScope(filter: string): void;
|
|
2549
|
+
popErrorScope(): Promise<gpuGPUError | null>;
|
|
2550
|
+
get queue(): gpuGPUQueue;
|
|
2551
|
+
get lost(): Promise<gpuGPUDeviceLostInfo>;
|
|
2552
|
+
get features(): gpuGPUSupportedFeatures;
|
|
2553
|
+
get limits(): gpuGPUSupportedLimits;
|
|
2554
|
+
}
|
|
2555
|
+
export interface gpuGPUDeviceDescriptor {
|
|
2556
|
+
label?: string;
|
|
2557
|
+
requiredFeatures?: string[];
|
|
2558
|
+
requiredLimits?: Record<string, number | bigint>;
|
|
2559
|
+
defaultQueue?: gpuGPUQueueDescriptor;
|
|
2560
|
+
}
|
|
2561
|
+
export interface gpuGPUBufferDescriptor {
|
|
2562
|
+
label: string;
|
|
2563
|
+
size: number | bigint;
|
|
2564
|
+
usage: number;
|
|
2565
|
+
mappedAtCreation: boolean;
|
|
2566
|
+
}
|
|
2567
|
+
export interface gpuGPUQueueDescriptor {
|
|
2568
|
+
label?: string;
|
|
2569
|
+
}
|
|
2570
|
+
export declare abstract class gpuGPUBufferUsage {
|
|
2571
|
+
static readonly MAP_READ: number;
|
|
2572
|
+
static readonly MAP_WRITE: number;
|
|
2573
|
+
static readonly COPY_SRC: number;
|
|
2574
|
+
static readonly COPY_DST: number;
|
|
2575
|
+
static readonly INDEX: number;
|
|
2576
|
+
static readonly VERTEX: number;
|
|
2577
|
+
static readonly UNIFORM: number;
|
|
2578
|
+
static readonly STORAGE: number;
|
|
2579
|
+
static readonly INDIRECT: number;
|
|
2580
|
+
static readonly QUERY_RESOLVE: number;
|
|
2581
|
+
}
|
|
2582
|
+
export interface gpuGPUBuffer {
|
|
2583
|
+
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2584
|
+
unmap(): void;
|
|
2585
|
+
destroy(): void;
|
|
2586
|
+
mapAsync(
|
|
2587
|
+
offset: number,
|
|
2588
|
+
size?: number | bigint,
|
|
2589
|
+
param3?: number | bigint,
|
|
2590
|
+
): Promise<void>;
|
|
2591
|
+
get size(): number | bigint;
|
|
2592
|
+
get usage(): number;
|
|
2593
|
+
get mapState(): string;
|
|
2594
|
+
}
|
|
2595
|
+
export declare abstract class gpuGPUShaderStage {
|
|
2596
|
+
static readonly VERTEX: number;
|
|
2597
|
+
static readonly FRAGMENT: number;
|
|
2598
|
+
static readonly COMPUTE: number;
|
|
2599
|
+
}
|
|
2600
|
+
export interface gpuGPUBindGroupLayoutDescriptor {
|
|
2601
|
+
label?: string;
|
|
2602
|
+
entries: gpuGPUBindGroupLayoutEntry[];
|
|
2603
|
+
}
|
|
2604
|
+
export interface gpuGPUBindGroupLayoutEntry {
|
|
2605
|
+
binding: number;
|
|
2606
|
+
visibility: number;
|
|
2607
|
+
buffer?: gpuGPUBufferBindingLayout;
|
|
2608
|
+
sampler?: gpuGPUSamplerBindingLayout;
|
|
2609
|
+
texture?: gpuGPUTextureBindingLayout;
|
|
2610
|
+
storageTexture?: gpuGPUStorageTextureBindingLayout;
|
|
2611
|
+
}
|
|
2612
|
+
export interface gpuGPUStorageTextureBindingLayout {
|
|
2613
|
+
access?: string;
|
|
2614
|
+
format: string;
|
|
2615
|
+
viewDimension?: string;
|
|
2616
|
+
}
|
|
2617
|
+
export interface gpuGPUTextureBindingLayout {
|
|
2618
|
+
sampleType?: string;
|
|
2619
|
+
viewDimension?: string;
|
|
2620
|
+
multisampled?: boolean;
|
|
2621
|
+
}
|
|
2622
|
+
export interface gpuGPUSamplerBindingLayout {
|
|
2623
|
+
type?: string;
|
|
2624
|
+
}
|
|
2625
|
+
export interface gpuGPUBufferBindingLayout {
|
|
2626
|
+
type?: string;
|
|
2627
|
+
hasDynamicOffset?: boolean;
|
|
2628
|
+
minBindingSize?: number | bigint;
|
|
2629
|
+
}
|
|
2630
|
+
export interface gpuGPUBindGroupLayout {}
|
|
2631
|
+
export interface gpuGPUBindGroup {}
|
|
2632
|
+
export interface gpuGPUBindGroupDescriptor {
|
|
2633
|
+
label?: string;
|
|
2634
|
+
layout: gpuGPUBindGroupLayout;
|
|
2635
|
+
entries: gpuGPUBindGroupEntry[];
|
|
2636
|
+
}
|
|
2637
|
+
export interface gpuGPUBindGroupEntry {
|
|
2638
|
+
binding: number;
|
|
2639
|
+
resource: gpuGPUBufferBinding | gpuGPUSampler;
|
|
2640
|
+
}
|
|
2641
|
+
export interface gpuGPUBufferBinding {
|
|
2642
|
+
buffer: gpuGPUBuffer;
|
|
2643
|
+
offset?: number | bigint;
|
|
2644
|
+
size?: number | bigint;
|
|
2645
|
+
}
|
|
2646
|
+
export interface gpuGPUSampler {}
|
|
2647
|
+
export interface gpuGPUSamplerDescriptor {
|
|
2648
|
+
label?: string;
|
|
2649
|
+
addressModeU?: string;
|
|
2650
|
+
addressModeV?: string;
|
|
2651
|
+
addressModeW?: string;
|
|
2652
|
+
magFilter?: string;
|
|
2653
|
+
minFilter?: string;
|
|
2654
|
+
mipmapFilter?: string;
|
|
2655
|
+
lodMinClamp?: number;
|
|
2656
|
+
lodMaxClamp?: number;
|
|
2657
|
+
compare: string;
|
|
2658
|
+
maxAnisotropy?: number;
|
|
2659
|
+
}
|
|
2660
|
+
export interface gpuGPUShaderModule {
|
|
2661
|
+
getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
|
|
2662
|
+
}
|
|
2663
|
+
export interface gpuGPUShaderModuleDescriptor {
|
|
2664
|
+
label?: string;
|
|
2665
|
+
code: string;
|
|
2666
|
+
}
|
|
2667
|
+
export interface gpuGPUPipelineLayout {}
|
|
2668
|
+
export interface gpuGPUPipelineLayoutDescriptor {
|
|
2669
|
+
label?: string;
|
|
2670
|
+
bindGroupLayouts: gpuGPUBindGroupLayout[];
|
|
2671
|
+
}
|
|
2672
|
+
export interface gpuGPUComputePipeline {
|
|
2673
|
+
getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
|
|
2674
|
+
}
|
|
2675
|
+
export interface gpuGPUComputePipelineDescriptor {
|
|
2676
|
+
label?: string;
|
|
2677
|
+
compute: gpuGPUProgrammableStage;
|
|
2678
|
+
layout: string | gpuGPUPipelineLayout;
|
|
2679
|
+
}
|
|
2680
|
+
export interface gpuGPUProgrammableStage {
|
|
2681
|
+
module: gpuGPUShaderModule;
|
|
2682
|
+
entryPoint: string;
|
|
2683
|
+
constants?: Record<string, number>;
|
|
2684
|
+
}
|
|
2685
|
+
export interface gpuGPUCommandEncoder {
|
|
2686
|
+
get label(): string;
|
|
2687
|
+
beginComputePass(
|
|
2688
|
+
descriptor?: gpuGPUComputePassDescriptor,
|
|
2689
|
+
): gpuGPUComputePassEncoder;
|
|
2690
|
+
beginRenderPass(
|
|
2691
|
+
descriptor: gpuGPURenderPassDescriptor,
|
|
2692
|
+
): gpuGPURenderPassEncoder;
|
|
2693
|
+
copyBufferToBuffer(
|
|
2694
|
+
source: gpuGPUBuffer,
|
|
2695
|
+
sourceOffset: number | bigint,
|
|
2696
|
+
destination: gpuGPUBuffer,
|
|
2697
|
+
destinationOffset: number | bigint,
|
|
2698
|
+
size: number | bigint,
|
|
2699
|
+
): void;
|
|
2700
|
+
finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
|
|
2701
|
+
copyTextureToBuffer(
|
|
2702
|
+
source: gpuGPUImageCopyTexture,
|
|
2703
|
+
destination: gpuGPUImageCopyBuffer,
|
|
2704
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2705
|
+
): void;
|
|
2706
|
+
copyBufferToTexture(
|
|
2707
|
+
source: gpuGPUImageCopyBuffer,
|
|
2708
|
+
destination: gpuGPUImageCopyTexture,
|
|
2709
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2710
|
+
): void;
|
|
2711
|
+
copyTextureToTexture(
|
|
2712
|
+
source: gpuGPUImageCopyTexture,
|
|
2713
|
+
destination: gpuGPUImageCopyTexture,
|
|
2714
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2715
|
+
): void;
|
|
2716
|
+
clearBuffer(
|
|
2717
|
+
buffer: gpuGPUBuffer,
|
|
2718
|
+
offset?: number | bigint,
|
|
2719
|
+
size?: number | bigint,
|
|
2720
|
+
): void;
|
|
2721
|
+
}
|
|
2722
|
+
export interface gpuGPUCommandEncoderDescriptor {
|
|
2723
|
+
label?: string;
|
|
2724
|
+
}
|
|
2725
|
+
export interface gpuGPUComputePassEncoder {
|
|
2726
|
+
setPipeline(pipeline: gpuGPUComputePipeline): void;
|
|
2727
|
+
setBindGroup(
|
|
2728
|
+
index: number,
|
|
2729
|
+
bindGroup: gpuGPUBindGroup | null,
|
|
2730
|
+
dynamicOffsets?: Iterable<number>,
|
|
2731
|
+
): void;
|
|
2732
|
+
dispatchWorkgroups(
|
|
2733
|
+
workgroupCountX: number,
|
|
2734
|
+
workgroupCountY?: number,
|
|
2735
|
+
workgroupCountZ?: number,
|
|
2736
|
+
): void;
|
|
2737
|
+
end(): void;
|
|
2738
|
+
}
|
|
2739
|
+
export interface gpuGPUComputePassDescriptor {
|
|
2740
|
+
label?: string;
|
|
2741
|
+
timestampWrites?: gpuGPUComputePassTimestampWrites;
|
|
2742
|
+
}
|
|
2743
|
+
export interface gpuGPUQuerySet {}
|
|
2744
|
+
export interface gpuGPUQuerySetDescriptor {
|
|
2745
|
+
label?: string;
|
|
2746
|
+
}
|
|
2747
|
+
export interface gpuGPUComputePassTimestampWrites {
|
|
2748
|
+
querySet: gpuGPUQuerySet;
|
|
2749
|
+
beginningOfPassWriteIndex?: number;
|
|
2750
|
+
endOfPassWriteIndex?: number;
|
|
2751
|
+
}
|
|
2752
|
+
export interface gpuGPUCommandBufferDescriptor {
|
|
2753
|
+
label?: string;
|
|
2754
|
+
}
|
|
2755
|
+
export interface gpuGPUCommandBuffer {}
|
|
2756
|
+
export interface gpuGPUQueue {
|
|
2757
|
+
submit(commandBuffers: gpuGPUCommandBuffer[]): void;
|
|
2758
|
+
writeBuffer(
|
|
2759
|
+
buffer: gpuGPUBuffer,
|
|
2760
|
+
bufferOffset: number | bigint,
|
|
2761
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
2762
|
+
dataOffset?: number | bigint,
|
|
2763
|
+
size?: number | bigint,
|
|
2764
|
+
): void;
|
|
2765
|
+
}
|
|
2766
|
+
export declare abstract class gpuGPUMapMode {
|
|
2767
|
+
static readonly READ: number;
|
|
2768
|
+
static readonly WRITE: number;
|
|
2769
|
+
}
|
|
2770
|
+
export interface gpuGPURequestAdapterOptions {
|
|
2771
|
+
powerPreference: string;
|
|
2772
|
+
forceFallbackAdapter?: boolean;
|
|
2773
|
+
}
|
|
2774
|
+
export interface gpuGPUAdapterInfo {
|
|
2775
|
+
get vendor(): string;
|
|
2776
|
+
get architecture(): string;
|
|
2777
|
+
get device(): string;
|
|
2778
|
+
get description(): string;
|
|
2779
|
+
}
|
|
2780
|
+
export interface gpuGPUSupportedFeatures {
|
|
2781
|
+
has(name: string): boolean;
|
|
2782
|
+
keys(): string[];
|
|
2783
|
+
}
|
|
2784
|
+
export interface gpuGPUSupportedLimits {
|
|
2785
|
+
get maxTextureDimension1D(): number;
|
|
2786
|
+
get maxTextureDimension2D(): number;
|
|
2787
|
+
get maxTextureDimension3D(): number;
|
|
2788
|
+
get maxTextureArrayLayers(): number;
|
|
2789
|
+
get maxBindGroups(): number;
|
|
2790
|
+
get maxBindingsPerBindGroup(): number;
|
|
2791
|
+
get maxDynamicUniformBuffersPerPipelineLayout(): number;
|
|
2792
|
+
get maxDynamicStorageBuffersPerPipelineLayout(): number;
|
|
2793
|
+
get maxSampledTexturesPerShaderStage(): number;
|
|
2794
|
+
get maxSamplersPerShaderStage(): number;
|
|
2795
|
+
get maxStorageBuffersPerShaderStage(): number;
|
|
2796
|
+
get maxStorageTexturesPerShaderStage(): number;
|
|
2797
|
+
get maxUniformBuffersPerShaderStage(): number;
|
|
2798
|
+
get maxUniformBufferBindingSize(): number | bigint;
|
|
2799
|
+
get maxStorageBufferBindingSize(): number | bigint;
|
|
2800
|
+
get minUniformBufferOffsetAlignment(): number;
|
|
2801
|
+
get minStorageBufferOffsetAlignment(): number;
|
|
2802
|
+
get maxVertexBuffers(): number;
|
|
2803
|
+
get maxBufferSize(): number | bigint;
|
|
2804
|
+
get maxVertexAttributes(): number;
|
|
2805
|
+
get maxVertexBufferArrayStride(): number;
|
|
2806
|
+
get maxInterStageShaderComponents(): number;
|
|
2807
|
+
get maxInterStageShaderVariables(): number;
|
|
2808
|
+
get maxColorAttachments(): number;
|
|
2809
|
+
get maxColorAttachmentBytesPerSample(): number;
|
|
2810
|
+
get maxComputeWorkgroupStorageSize(): number;
|
|
2811
|
+
get maxComputeInvocationsPerWorkgroup(): number;
|
|
2812
|
+
get maxComputeWorkgroupSizeX(): number;
|
|
2813
|
+
get maxComputeWorkgroupSizeY(): number;
|
|
2814
|
+
get maxComputeWorkgroupSizeZ(): number;
|
|
2815
|
+
get maxComputeWorkgroupsPerDimension(): number;
|
|
2816
|
+
}
|
|
2817
|
+
export declare abstract class gpuGPUError {
|
|
2818
|
+
get message(): string;
|
|
2819
|
+
}
|
|
2820
|
+
export declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
|
|
2821
|
+
export declare abstract class gpuGPUInternalError extends gpuGPUError {}
|
|
2822
|
+
export declare abstract class gpuGPUValidationError extends gpuGPUError {}
|
|
2823
|
+
export declare abstract class gpuGPUDeviceLostInfo {
|
|
2824
|
+
get message(): string;
|
|
2825
|
+
get reason(): string;
|
|
2826
|
+
}
|
|
2827
|
+
export interface gpuGPUCompilationMessage {
|
|
2828
|
+
get message(): string;
|
|
2829
|
+
get type(): string;
|
|
2830
|
+
get lineNum(): number;
|
|
2831
|
+
get linePos(): number;
|
|
2832
|
+
get offset(): number;
|
|
2833
|
+
get length(): number;
|
|
2834
|
+
}
|
|
2835
|
+
export interface gpuGPUCompilationInfo {
|
|
2836
|
+
get messages(): gpuGPUCompilationMessage[];
|
|
2837
|
+
}
|
|
2838
|
+
export declare abstract class gpuGPUTextureUsage {
|
|
2839
|
+
static readonly COPY_SRC: number;
|
|
2840
|
+
static readonly COPY_DST: number;
|
|
2841
|
+
static readonly TEXTURE_BINDING: number;
|
|
2842
|
+
static readonly STORAGE_BINDING: number;
|
|
2843
|
+
static readonly RENDER_ATTACHMENT: number;
|
|
2844
|
+
}
|
|
2845
|
+
export interface gpuGPUTextureDescriptor {
|
|
2846
|
+
label: string;
|
|
2847
|
+
size: number[] | gpuGPUExtent3DDict;
|
|
2848
|
+
mipLevelCount?: number;
|
|
2849
|
+
sampleCount?: number;
|
|
2850
|
+
dimension?: string;
|
|
2851
|
+
format: string;
|
|
2852
|
+
usage: number;
|
|
2853
|
+
viewFormats?: string[];
|
|
2854
|
+
}
|
|
2855
|
+
export interface gpuGPUExtent3DDict {
|
|
2856
|
+
width: number;
|
|
2857
|
+
height?: number;
|
|
2858
|
+
depthOrArrayLayers?: number;
|
|
2859
|
+
}
|
|
2860
|
+
export interface gpuGPUTexture {
|
|
2861
|
+
createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
|
|
2862
|
+
destroy(): void;
|
|
2863
|
+
get width(): number;
|
|
2864
|
+
get height(): number;
|
|
2865
|
+
get depthOrArrayLayers(): number;
|
|
2866
|
+
get mipLevelCount(): number;
|
|
2867
|
+
get dimension(): string;
|
|
2868
|
+
get format(): string;
|
|
2869
|
+
get usage(): number;
|
|
2870
|
+
}
|
|
2871
|
+
export interface gpuGPUTextureView {}
|
|
2872
|
+
export interface gpuGPUTextureViewDescriptor {
|
|
2873
|
+
label: string;
|
|
2874
|
+
format: string;
|
|
2875
|
+
dimension: string;
|
|
2876
|
+
aspect?: string;
|
|
2877
|
+
baseMipLevel?: number;
|
|
2878
|
+
mipLevelCount: number;
|
|
2879
|
+
baseArrayLayer?: number;
|
|
2880
|
+
arrayLayerCount: number;
|
|
2881
|
+
}
|
|
2882
|
+
export declare abstract class gpuGPUColorWrite {
|
|
2883
|
+
static readonly RED: number;
|
|
2884
|
+
static readonly GREEN: number;
|
|
2885
|
+
static readonly BLUE: number;
|
|
2886
|
+
static readonly ALPHA: number;
|
|
2887
|
+
static readonly ALL: number;
|
|
2888
|
+
}
|
|
2889
|
+
export interface gpuGPURenderPipeline {}
|
|
2890
|
+
export interface gpuGPURenderPipelineDescriptor {
|
|
2891
|
+
label?: string;
|
|
2892
|
+
layout: string | gpuGPUPipelineLayout;
|
|
2893
|
+
vertex: gpuGPUVertexState;
|
|
2894
|
+
primitive?: gpuGPUPrimitiveState;
|
|
2895
|
+
depthStencil?: gpuGPUDepthStencilState;
|
|
2896
|
+
multisample?: gpuGPUMultisampleState;
|
|
2897
|
+
fragment?: gpuGPUFragmentState;
|
|
2898
|
+
}
|
|
2899
|
+
export interface gpuGPUVertexState {
|
|
2900
|
+
module: gpuGPUShaderModule;
|
|
2901
|
+
entryPoint: string;
|
|
2902
|
+
constants?: Record<string, number>;
|
|
2903
|
+
buffers?: gpuGPUVertexBufferLayout[];
|
|
2904
|
+
}
|
|
2905
|
+
export interface gpuGPUVertexBufferLayout {
|
|
2906
|
+
arrayStride: number | bigint;
|
|
2907
|
+
stepMode?: string;
|
|
2908
|
+
attributes: gpuGPUVertexAttribute[];
|
|
2909
|
+
}
|
|
2910
|
+
export interface gpuGPUVertexAttribute {
|
|
2911
|
+
format: string;
|
|
2912
|
+
offset: number | bigint;
|
|
2913
|
+
shaderLocation: number;
|
|
2914
|
+
}
|
|
2915
|
+
export interface gpuGPUPrimitiveState {
|
|
2916
|
+
topology?: string;
|
|
2917
|
+
stripIndexFormat?: string;
|
|
2918
|
+
frontFace?: string;
|
|
2919
|
+
cullMode?: string;
|
|
2920
|
+
unclippedDepth?: boolean;
|
|
2921
|
+
}
|
|
2922
|
+
export interface gpuGPUStencilFaceState {
|
|
2923
|
+
compare?: string;
|
|
2924
|
+
failOp?: string;
|
|
2925
|
+
depthFailOp?: string;
|
|
2926
|
+
passOp?: string;
|
|
2927
|
+
}
|
|
2928
|
+
export interface gpuGPUDepthStencilState {
|
|
2929
|
+
format: string;
|
|
2930
|
+
depthWriteEnabled: boolean;
|
|
2931
|
+
depthCompare: string;
|
|
2932
|
+
stencilFront?: gpuGPUStencilFaceState;
|
|
2933
|
+
stencilBack?: gpuGPUStencilFaceState;
|
|
2934
|
+
stencilReadMask?: number;
|
|
2935
|
+
stencilWriteMask?: number;
|
|
2936
|
+
depthBias?: number;
|
|
2937
|
+
depthBiasSlopeScale?: number;
|
|
2938
|
+
depthBiasClamp?: number;
|
|
2939
|
+
}
|
|
2940
|
+
export interface gpuGPUMultisampleState {
|
|
2941
|
+
count?: number;
|
|
2942
|
+
mask?: number;
|
|
2943
|
+
alphaToCoverageEnabled?: boolean;
|
|
2944
|
+
}
|
|
2945
|
+
export interface gpuGPUFragmentState {
|
|
2946
|
+
module: gpuGPUShaderModule;
|
|
2947
|
+
entryPoint: string;
|
|
2948
|
+
constants?: Record<string, number>;
|
|
2949
|
+
targets: gpuGPUColorTargetState[];
|
|
2950
|
+
}
|
|
2951
|
+
export interface gpuGPUColorTargetState {
|
|
2952
|
+
format: string;
|
|
2953
|
+
blend: gpuGPUBlendState;
|
|
2954
|
+
writeMask?: number;
|
|
2955
|
+
}
|
|
2956
|
+
export interface gpuGPUBlendState {
|
|
2957
|
+
color: gpuGPUBlendComponent;
|
|
2958
|
+
alpha: gpuGPUBlendComponent;
|
|
2959
|
+
}
|
|
2960
|
+
export interface gpuGPUBlendComponent {
|
|
2961
|
+
operation?: string;
|
|
2962
|
+
srcFactor?: string;
|
|
2963
|
+
dstFactor?: string;
|
|
2964
|
+
}
|
|
2965
|
+
export interface gpuGPURenderPassEncoder {
|
|
2966
|
+
setPipeline(pipeline: gpuGPURenderPipeline): void;
|
|
2967
|
+
draw(
|
|
2968
|
+
vertexCount: number,
|
|
2969
|
+
instanceCount?: number,
|
|
2970
|
+
firstVertex?: number,
|
|
2971
|
+
firstInstance?: number,
|
|
2972
|
+
): void;
|
|
2973
|
+
end(): void;
|
|
2974
|
+
}
|
|
2975
|
+
export interface gpuGPURenderPassDescriptor {
|
|
2976
|
+
label?: string;
|
|
2977
|
+
colorAttachments: gpuGPURenderPassColorAttachment[];
|
|
2978
|
+
depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
|
|
2979
|
+
occlusionQuerySet?: gpuGPUQuerySet;
|
|
2980
|
+
timestampWrites?: gpuGPURenderPassTimestampWrites;
|
|
2981
|
+
maxDrawCount?: number | bigint;
|
|
2982
|
+
}
|
|
2983
|
+
export interface gpuGPURenderPassColorAttachment {
|
|
2984
|
+
view: gpuGPUTextureView;
|
|
2985
|
+
depthSlice?: number;
|
|
2986
|
+
resolveTarget?: gpuGPUTextureView;
|
|
2987
|
+
clearValue?: number[] | gpuGPUColorDict;
|
|
2988
|
+
loadOp: string;
|
|
2989
|
+
storeOp: string;
|
|
2990
|
+
}
|
|
2991
|
+
export interface gpuGPUColorDict {
|
|
2992
|
+
r: number;
|
|
2993
|
+
g: number;
|
|
2994
|
+
b: number;
|
|
2995
|
+
a: number;
|
|
2996
|
+
}
|
|
2997
|
+
export interface gpuGPURenderPassDepthStencilAttachment {
|
|
2998
|
+
view: gpuGPUTextureView;
|
|
2999
|
+
depthClearValue?: number;
|
|
3000
|
+
depthLoadOp?: string;
|
|
3001
|
+
depthStoreOp?: string;
|
|
3002
|
+
depthReadOnly?: boolean;
|
|
3003
|
+
stencilClearValue?: number;
|
|
3004
|
+
stencilLoadOp?: string;
|
|
3005
|
+
stencilStoreOp?: string;
|
|
3006
|
+
stencilReadOnly?: boolean;
|
|
3007
|
+
}
|
|
3008
|
+
export interface gpuGPURenderPassTimestampWrites {
|
|
3009
|
+
querySet: gpuGPUQuerySet;
|
|
3010
|
+
beginningOfPassWriteIndex?: number;
|
|
3011
|
+
endOfPassWriteIndex?: number;
|
|
3012
|
+
}
|
|
3013
|
+
export interface gpuGPUImageCopyTexture {
|
|
3014
|
+
texture: gpuGPUTexture;
|
|
3015
|
+
mipLevel?: number;
|
|
3016
|
+
origin?: number[] | gpuGPUOrigin3DDict;
|
|
3017
|
+
aspect?: string;
|
|
3018
|
+
}
|
|
3019
|
+
export interface gpuGPUImageCopyBuffer {
|
|
3020
|
+
buffer: gpuGPUBuffer;
|
|
3021
|
+
offset?: number | bigint;
|
|
3022
|
+
bytesPerRow?: number;
|
|
3023
|
+
rowsPerImage?: number;
|
|
3024
|
+
}
|
|
3025
|
+
export interface gpuGPUOrigin3DDict {
|
|
3026
|
+
x?: number;
|
|
3027
|
+
y?: number;
|
|
3028
|
+
z?: number;
|
|
3029
|
+
}
|
|
1893
3030
|
export interface BasicImageTransformations {
|
|
1894
3031
|
/**
|
|
1895
3032
|
* Maximum width in image pixels. The value must be an integer.
|
|
@@ -2329,7 +3466,7 @@ export interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
|
2329
3466
|
};
|
|
2330
3467
|
}
|
|
2331
3468
|
export interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
|
|
2332
|
-
HostMetadata
|
|
3469
|
+
HostMetadata,
|
|
2333
3470
|
> {
|
|
2334
3471
|
/**
|
|
2335
3472
|
* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
|
|
@@ -2861,25 +3998,51 @@ export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
|
|
|
2861
3998
|
export type CfProperties<HostMetadata = unknown> =
|
|
2862
3999
|
| IncomingRequestCfProperties<HostMetadata>
|
|
2863
4000
|
| RequestInitCfProperties;
|
|
2864
|
-
export interface
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
4001
|
+
export interface D1Meta {
|
|
4002
|
+
duration: number;
|
|
4003
|
+
size_after: number;
|
|
4004
|
+
rows_read: number;
|
|
4005
|
+
rows_written: number;
|
|
4006
|
+
last_row_id: number;
|
|
4007
|
+
changed_db: boolean;
|
|
4008
|
+
changes: number;
|
|
4009
|
+
}
|
|
4010
|
+
export interface D1Response {
|
|
4011
|
+
success: true;
|
|
4012
|
+
meta: D1Meta & Record<string, unknown>;
|
|
4013
|
+
error?: never;
|
|
4014
|
+
}
|
|
4015
|
+
export type D1Result<T = unknown> = D1Response & {
|
|
4016
|
+
results: T[];
|
|
4017
|
+
};
|
|
4018
|
+
export interface D1ExecResult {
|
|
4019
|
+
count: number;
|
|
4020
|
+
duration: number;
|
|
2869
4021
|
}
|
|
2870
4022
|
export declare abstract class D1Database {
|
|
2871
4023
|
prepare(query: string): D1PreparedStatement;
|
|
2872
4024
|
dump(): Promise<ArrayBuffer>;
|
|
2873
4025
|
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
|
|
2874
|
-
exec
|
|
4026
|
+
exec(query: string): Promise<D1ExecResult>;
|
|
2875
4027
|
}
|
|
2876
4028
|
export declare abstract class D1PreparedStatement {
|
|
2877
|
-
bind(...values:
|
|
2878
|
-
first<T = unknown>(colName
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
4029
|
+
bind(...values: unknown[]): D1PreparedStatement;
|
|
4030
|
+
first<T = unknown>(colName: string): Promise<T | null>;
|
|
4031
|
+
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
4032
|
+
run(): Promise<D1Response>;
|
|
4033
|
+
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4034
|
+
raw<T = unknown[]>(options: {
|
|
4035
|
+
columnNames: true;
|
|
4036
|
+
}): Promise<[string[], ...T[]]>;
|
|
4037
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
4038
|
+
}
|
|
4039
|
+
// `Disposable` was added to TypeScript's standard lib types in version 5.2.
|
|
4040
|
+
// To support older TypeScript versions, define an empty `Disposable` interface.
|
|
4041
|
+
// Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
|
|
4042
|
+
// but this will ensure type checking on older versions still passes.
|
|
4043
|
+
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
4044
|
+
// ignored when `Disposable` is included in the standard lib.
|
|
4045
|
+
export interface Disposable {}
|
|
2883
4046
|
/**
|
|
2884
4047
|
* An email message that can be sent from a Worker.
|
|
2885
4048
|
*/
|
|
@@ -2900,7 +4063,7 @@ export interface ForwardableEmailMessage extends EmailMessage {
|
|
|
2900
4063
|
/**
|
|
2901
4064
|
* Stream of the email message content.
|
|
2902
4065
|
*/
|
|
2903
|
-
readonly raw: ReadableStream
|
|
4066
|
+
readonly raw: ReadableStream<Uint8Array>;
|
|
2904
4067
|
/**
|
|
2905
4068
|
* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
|
|
2906
4069
|
*/
|
|
@@ -2935,11 +4098,58 @@ export declare abstract class EmailEvent extends ExtendableEvent {
|
|
|
2935
4098
|
export type EmailExportedHandler<Env = unknown> = (
|
|
2936
4099
|
message: ForwardableEmailMessage,
|
|
2937
4100
|
env: Env,
|
|
2938
|
-
ctx: ExecutionContext
|
|
4101
|
+
ctx: ExecutionContext,
|
|
2939
4102
|
) => void | Promise<void>;
|
|
4103
|
+
export interface Hyperdrive {
|
|
4104
|
+
/**
|
|
4105
|
+
* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
|
|
4106
|
+
*
|
|
4107
|
+
* Calling this method returns an idential socket to if you call
|
|
4108
|
+
* `connect("host:port")` using the `host` and `port` fields from this object.
|
|
4109
|
+
* Pick whichever approach works better with your preferred DB client library.
|
|
4110
|
+
*
|
|
4111
|
+
* Note that this socket is not yet authenticated -- it's expected that your
|
|
4112
|
+
* code (or preferably, the client library of your choice) will authenticate
|
|
4113
|
+
* using the information in this class's readonly fields.
|
|
4114
|
+
*/
|
|
4115
|
+
connect(): Socket;
|
|
4116
|
+
/**
|
|
4117
|
+
* A valid DB connection string that can be passed straight into the typical
|
|
4118
|
+
* client library/driver/ORM. This will typically be the easiest way to use
|
|
4119
|
+
* Hyperdrive.
|
|
4120
|
+
*/
|
|
4121
|
+
readonly connectionString: string;
|
|
4122
|
+
/*
|
|
4123
|
+
* A randomly generated hostname that is only valid within the context of the
|
|
4124
|
+
* currently running Worker which, when passed into `connect()` function from
|
|
4125
|
+
* the "cloudflare:sockets" module, will connect to the Hyperdrive instance
|
|
4126
|
+
* for your database.
|
|
4127
|
+
*/
|
|
4128
|
+
readonly host: string;
|
|
4129
|
+
/*
|
|
4130
|
+
* The port that must be paired the the host field when connecting.
|
|
4131
|
+
*/
|
|
4132
|
+
readonly port: number;
|
|
4133
|
+
/*
|
|
4134
|
+
* The username to use when authenticating to your database via Hyperdrive.
|
|
4135
|
+
* Unlike the host and password, this will be the same every time
|
|
4136
|
+
*/
|
|
4137
|
+
readonly user: string;
|
|
4138
|
+
/*
|
|
4139
|
+
* The randomly generated password to use when authenticating to your
|
|
4140
|
+
* database via Hyperdrive. Like the host field, this password is only valid
|
|
4141
|
+
* within the context of the currently running Worker instance from which
|
|
4142
|
+
* it's read.
|
|
4143
|
+
*/
|
|
4144
|
+
readonly password: string;
|
|
4145
|
+
/*
|
|
4146
|
+
* The name of the database to connect to.
|
|
4147
|
+
*/
|
|
4148
|
+
readonly database: string;
|
|
4149
|
+
}
|
|
2940
4150
|
export type Params<P extends string = any> = Record<P, string | string[]>;
|
|
2941
4151
|
export type EventContext<Env, P extends string, Data> = {
|
|
2942
|
-
request: Request
|
|
4152
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
2943
4153
|
functionPath: string;
|
|
2944
4154
|
waitUntil: (promise: Promise<any>) => void;
|
|
2945
4155
|
passThroughOnException: () => void;
|
|
@@ -2955,10 +4165,10 @@ export type EventContext<Env, P extends string, Data> = {
|
|
|
2955
4165
|
export type PagesFunction<
|
|
2956
4166
|
Env = unknown,
|
|
2957
4167
|
Params extends string = any,
|
|
2958
|
-
Data extends Record<string, unknown> = Record<string, unknown
|
|
4168
|
+
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
2959
4169
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
2960
4170
|
export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
2961
|
-
request: Request
|
|
4171
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
2962
4172
|
functionPath: string;
|
|
2963
4173
|
waitUntil: (promise: Promise<any>) => void;
|
|
2964
4174
|
passThroughOnException: () => void;
|
|
@@ -2976,14 +4186,14 @@ export type PagesPluginFunction<
|
|
|
2976
4186
|
Env = unknown,
|
|
2977
4187
|
Params extends string = any,
|
|
2978
4188
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
2979
|
-
PluginArgs = unknown
|
|
4189
|
+
PluginArgs = unknown,
|
|
2980
4190
|
> = (
|
|
2981
|
-
context: EventPluginContext<Env, Params, Data, PluginArgs
|
|
4191
|
+
context: EventPluginContext<Env, Params, Data, PluginArgs>,
|
|
2982
4192
|
) => Response | Promise<Response>;
|
|
2983
|
-
// https://developers.cloudflare.com/pub-sub/
|
|
2984
4193
|
// PubSubMessage represents an incoming PubSub message.
|
|
2985
4194
|
// The message includes metadata about the broker, the client, and the payload
|
|
2986
4195
|
// itself.
|
|
4196
|
+
// https://developers.cloudflare.com/pub-sub/
|
|
2987
4197
|
export interface PubSubMessage {
|
|
2988
4198
|
// Message ID
|
|
2989
4199
|
readonly mid: number;
|
|
@@ -3014,7 +4224,320 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
|
|
|
3014
4224
|
// Key Identifier of the JWK
|
|
3015
4225
|
readonly kid: string;
|
|
3016
4226
|
}
|
|
3017
|
-
//
|
|
4227
|
+
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4228
|
+
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4229
|
+
// strips all `module` blocks.
|
|
4230
|
+
export declare namespace Rpc {
|
|
4231
|
+
// Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
|
|
4232
|
+
// TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
|
|
4233
|
+
// For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
|
|
4234
|
+
// accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
|
|
4235
|
+
export const __RPC_STUB_BRAND: "__RPC_STUB_BRAND";
|
|
4236
|
+
export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
|
|
4237
|
+
export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
|
|
4238
|
+
export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
|
|
4239
|
+
export interface RpcTargetBranded {
|
|
4240
|
+
[__RPC_TARGET_BRAND]: never;
|
|
4241
|
+
}
|
|
4242
|
+
export interface WorkerEntrypointBranded {
|
|
4243
|
+
[__WORKER_ENTRYPOINT_BRAND]: never;
|
|
4244
|
+
}
|
|
4245
|
+
export interface DurableObjectBranded {
|
|
4246
|
+
[__DURABLE_OBJECT_BRAND]: never;
|
|
4247
|
+
}
|
|
4248
|
+
export type EntrypointBranded =
|
|
4249
|
+
| WorkerEntrypointBranded
|
|
4250
|
+
| DurableObjectBranded;
|
|
4251
|
+
// Types that can be used through `Stub`s
|
|
4252
|
+
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
4253
|
+
// Types that can be passed over RPC
|
|
4254
|
+
type Serializable =
|
|
4255
|
+
// Structured cloneables
|
|
4256
|
+
| void
|
|
4257
|
+
| undefined
|
|
4258
|
+
| null
|
|
4259
|
+
| boolean
|
|
4260
|
+
| number
|
|
4261
|
+
| bigint
|
|
4262
|
+
| string
|
|
4263
|
+
| TypedArray
|
|
4264
|
+
| ArrayBuffer
|
|
4265
|
+
| DataView
|
|
4266
|
+
| Date
|
|
4267
|
+
| Error
|
|
4268
|
+
| RegExp
|
|
4269
|
+
// Structured cloneable composites
|
|
4270
|
+
| Map<Serializable, Serializable>
|
|
4271
|
+
| Set<Serializable>
|
|
4272
|
+
| ReadonlyArray<Serializable>
|
|
4273
|
+
| {
|
|
4274
|
+
[key: string | number]: Serializable;
|
|
4275
|
+
}
|
|
4276
|
+
// Special types
|
|
4277
|
+
| ReadableStream<Uint8Array>
|
|
4278
|
+
| WritableStream<Uint8Array>
|
|
4279
|
+
| Request
|
|
4280
|
+
| Response
|
|
4281
|
+
| Headers
|
|
4282
|
+
| Stub<Stubable>
|
|
4283
|
+
// Serialized as stubs, see `Stubify`
|
|
4284
|
+
| Stubable;
|
|
4285
|
+
// Base type for all RPC stubs, including common memory management methods.
|
|
4286
|
+
// `T` is used as a marker type for unwrapping `Stub`s later.
|
|
4287
|
+
interface StubBase<T extends Stubable> extends Disposable {
|
|
4288
|
+
[__RPC_STUB_BRAND]: T;
|
|
4289
|
+
dup(): this;
|
|
4290
|
+
}
|
|
4291
|
+
export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
|
|
4292
|
+
// Recursively rewrite all `Stubable` types with `Stub`s
|
|
4293
|
+
type Stubify<T> = T extends Stubable
|
|
4294
|
+
? Stub<T>
|
|
4295
|
+
: T extends Map<infer K, infer V>
|
|
4296
|
+
? Map<Stubify<K>, Stubify<V>>
|
|
4297
|
+
: T extends Set<infer V>
|
|
4298
|
+
? Set<Stubify<V>>
|
|
4299
|
+
: T extends Array<infer V>
|
|
4300
|
+
? Array<Stubify<V>>
|
|
4301
|
+
: T extends ReadonlyArray<infer V>
|
|
4302
|
+
? ReadonlyArray<Stubify<V>>
|
|
4303
|
+
: T extends {
|
|
4304
|
+
[key: string | number]: unknown;
|
|
4305
|
+
}
|
|
4306
|
+
? {
|
|
4307
|
+
[K in keyof T]: Stubify<T[K]>;
|
|
4308
|
+
}
|
|
4309
|
+
: T;
|
|
4310
|
+
// Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
|
|
4311
|
+
// Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
|
|
4312
|
+
// `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
|
|
4313
|
+
type Unstubify<T> =
|
|
4314
|
+
T extends StubBase<infer V>
|
|
4315
|
+
? V
|
|
4316
|
+
: T extends Map<infer K, infer V>
|
|
4317
|
+
? Map<Unstubify<K>, Unstubify<V>>
|
|
4318
|
+
: T extends Set<infer V>
|
|
4319
|
+
? Set<Unstubify<V>>
|
|
4320
|
+
: T extends Array<infer V>
|
|
4321
|
+
? Array<Unstubify<V>>
|
|
4322
|
+
: T extends ReadonlyArray<infer V>
|
|
4323
|
+
? ReadonlyArray<Unstubify<V>>
|
|
4324
|
+
: T extends {
|
|
4325
|
+
[key: string | number]: unknown;
|
|
4326
|
+
}
|
|
4327
|
+
? {
|
|
4328
|
+
[K in keyof T]: Unstubify<T[K]>;
|
|
4329
|
+
}
|
|
4330
|
+
: T;
|
|
4331
|
+
type UnstubifyAll<A extends any[]> = {
|
|
4332
|
+
[I in keyof A]: Unstubify<A[I]>;
|
|
4333
|
+
};
|
|
4334
|
+
// Utility type for adding `Provider`/`Disposable`s to `object` types only.
|
|
4335
|
+
// Note `unknown & T` is equivalent to `T`.
|
|
4336
|
+
type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
|
|
4337
|
+
type MaybeDisposable<T> = T extends object ? Disposable : unknown;
|
|
4338
|
+
// Type for method return or property on an RPC interface.
|
|
4339
|
+
// - Stubable types are replaced by stubs.
|
|
4340
|
+
// - Serializable types are passed by value, with stubable types replaced by stubs
|
|
4341
|
+
// and a top-level `Disposer`.
|
|
4342
|
+
// Everything else can't be passed over PRC.
|
|
4343
|
+
// Technically, we use custom thenables here, but they quack like `Promise`s.
|
|
4344
|
+
// Intersecting with `(Maybe)Provider` allows pipelining.
|
|
4345
|
+
type Result<R> = R extends Stubable
|
|
4346
|
+
? Promise<Stub<R>> & Provider<R>
|
|
4347
|
+
: R extends Serializable
|
|
4348
|
+
? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
|
|
4349
|
+
: never;
|
|
4350
|
+
// Type for method or property on an RPC interface.
|
|
4351
|
+
// For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
|
|
4352
|
+
// Unwrapping `Stub`s allows calling with `Stubable` arguments.
|
|
4353
|
+
// For properties, rewrite types to be `Result`s.
|
|
4354
|
+
// In each case, unwrap `Promise`s.
|
|
4355
|
+
type MethodOrProperty<V> = V extends (...args: infer P) => infer R
|
|
4356
|
+
? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
|
|
4357
|
+
: Result<Awaited<V>>;
|
|
4358
|
+
// Type for the callable part of an `Provider` if `T` is callable.
|
|
4359
|
+
// This is intersected with methods/properties.
|
|
4360
|
+
type MaybeCallableProvider<T> = T extends (...args: any[]) => any
|
|
4361
|
+
? MethodOrProperty<T>
|
|
4362
|
+
: unknown;
|
|
4363
|
+
// Base type for all other types providing RPC-like interfaces.
|
|
4364
|
+
// Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
|
|
4365
|
+
// `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
|
|
4366
|
+
export type Provider<
|
|
4367
|
+
T extends object,
|
|
4368
|
+
Reserved extends string = never,
|
|
4369
|
+
> = MaybeCallableProvider<T> & {
|
|
4370
|
+
[K in Exclude<
|
|
4371
|
+
keyof T,
|
|
4372
|
+
Reserved | symbol | keyof StubBase<never>
|
|
4373
|
+
>]: MethodOrProperty<T[K]>;
|
|
4374
|
+
};
|
|
4375
|
+
}
|
|
4376
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
4377
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4378
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4379
|
+
/**
|
|
4380
|
+
* Data types supported for holding vector metadata.
|
|
4381
|
+
*/
|
|
4382
|
+
export type VectorizeVectorMetadataValue = string | number | boolean | string[];
|
|
4383
|
+
/**
|
|
4384
|
+
* Additional information to associate with a vector.
|
|
4385
|
+
*/
|
|
4386
|
+
export type VectorizeVectorMetadata =
|
|
4387
|
+
| VectorizeVectorMetadataValue
|
|
4388
|
+
| Record<string, VectorizeVectorMetadataValue>;
|
|
4389
|
+
export type VectorFloatArray = Float32Array | Float64Array;
|
|
4390
|
+
export interface VectorizeError {
|
|
4391
|
+
code?: number;
|
|
4392
|
+
error: string;
|
|
4393
|
+
}
|
|
4394
|
+
/**
|
|
4395
|
+
* Comparison logic/operation to use for metadata filtering.
|
|
4396
|
+
*
|
|
4397
|
+
* This list is expected to grow as support for more operations are released.
|
|
4398
|
+
*/
|
|
4399
|
+
export type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
|
|
4400
|
+
/**
|
|
4401
|
+
* Filter criteria for vector metadata used to limit the retrieved query result set.
|
|
4402
|
+
*/
|
|
4403
|
+
export type VectorizeVectorMetadataFilter = {
|
|
4404
|
+
[field: string]:
|
|
4405
|
+
| Exclude<VectorizeVectorMetadataValue, string[]>
|
|
4406
|
+
| null
|
|
4407
|
+
| {
|
|
4408
|
+
[Op in VectorizeVectorMetadataFilterOp]?: Exclude<
|
|
4409
|
+
VectorizeVectorMetadataValue,
|
|
4410
|
+
string[]
|
|
4411
|
+
> | null;
|
|
4412
|
+
};
|
|
4413
|
+
};
|
|
4414
|
+
/**
|
|
4415
|
+
* Supported distance metrics for an index.
|
|
4416
|
+
* Distance metrics determine how other "similar" vectors are determined.
|
|
4417
|
+
*/
|
|
4418
|
+
export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
4419
|
+
export interface VectorizeQueryOptions {
|
|
4420
|
+
topK?: number;
|
|
4421
|
+
namespace?: string;
|
|
4422
|
+
returnValues?: boolean;
|
|
4423
|
+
returnMetadata?: boolean;
|
|
4424
|
+
filter?: VectorizeVectorMetadataFilter;
|
|
4425
|
+
}
|
|
4426
|
+
/**
|
|
4427
|
+
* Information about the configuration of an index.
|
|
4428
|
+
*/
|
|
4429
|
+
export type VectorizeIndexConfig =
|
|
4430
|
+
| {
|
|
4431
|
+
dimensions: number;
|
|
4432
|
+
metric: VectorizeDistanceMetric;
|
|
4433
|
+
}
|
|
4434
|
+
| {
|
|
4435
|
+
preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
|
|
4436
|
+
};
|
|
4437
|
+
/**
|
|
4438
|
+
* Metadata about an existing index.
|
|
4439
|
+
*/
|
|
4440
|
+
export interface VectorizeIndexDetails {
|
|
4441
|
+
/** The unique ID of the index */
|
|
4442
|
+
readonly id: string;
|
|
4443
|
+
/** The name of the index. */
|
|
4444
|
+
name: string;
|
|
4445
|
+
/** (optional) A human readable description for the index. */
|
|
4446
|
+
description?: string;
|
|
4447
|
+
/** The index configuration, including the dimension size and distance metric. */
|
|
4448
|
+
config: VectorizeIndexConfig;
|
|
4449
|
+
/** The number of records containing vectors within the index. */
|
|
4450
|
+
vectorsCount: number;
|
|
4451
|
+
}
|
|
4452
|
+
/**
|
|
4453
|
+
* Represents a single vector value set along with its associated metadata.
|
|
4454
|
+
*/
|
|
4455
|
+
export interface VectorizeVector {
|
|
4456
|
+
/** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */
|
|
4457
|
+
id: string;
|
|
4458
|
+
/** The vector values */
|
|
4459
|
+
values: VectorFloatArray | number[];
|
|
4460
|
+
/** The namespace this vector belongs to. */
|
|
4461
|
+
namespace?: string;
|
|
4462
|
+
/** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
|
|
4463
|
+
metadata?: Record<string, VectorizeVectorMetadata>;
|
|
4464
|
+
}
|
|
4465
|
+
/**
|
|
4466
|
+
* Represents a matched vector for a query along with its score and (if specified) the matching vector information.
|
|
4467
|
+
*/
|
|
4468
|
+
export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
4469
|
+
Omit<VectorizeVector, "values"> & {
|
|
4470
|
+
/** The score or rank for similarity, when returned as a result */
|
|
4471
|
+
score: number;
|
|
4472
|
+
};
|
|
4473
|
+
/**
|
|
4474
|
+
* A set of vector {@link VectorizeMatch} for a particular query.
|
|
4475
|
+
*/
|
|
4476
|
+
export interface VectorizeMatches {
|
|
4477
|
+
matches: VectorizeMatch[];
|
|
4478
|
+
count: number;
|
|
4479
|
+
}
|
|
4480
|
+
/**
|
|
4481
|
+
* Results of an operation that performed a mutation on a set of vectors.
|
|
4482
|
+
* Here, `ids` is a list of vectors that were successfully processed.
|
|
4483
|
+
*/
|
|
4484
|
+
export interface VectorizeVectorMutation {
|
|
4485
|
+
/* List of ids of vectors that were successfully processed. */
|
|
4486
|
+
ids: string[];
|
|
4487
|
+
/* Total count of the number of processed vectors. */
|
|
4488
|
+
count: number;
|
|
4489
|
+
}
|
|
4490
|
+
export declare abstract class VectorizeIndex {
|
|
4491
|
+
/**
|
|
4492
|
+
* Get information about the currently bound index.
|
|
4493
|
+
* @returns A promise that resolves with information about the current index.
|
|
4494
|
+
*/
|
|
4495
|
+
public describe(): Promise<VectorizeIndexDetails>;
|
|
4496
|
+
/**
|
|
4497
|
+
* Use the provided vector to perform a similarity search across the index.
|
|
4498
|
+
* @param vector Input vector that will be used to drive the similarity search.
|
|
4499
|
+
* @param options Configuration options to massage the returned data.
|
|
4500
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
4501
|
+
*/
|
|
4502
|
+
public query(
|
|
4503
|
+
vector: VectorFloatArray | number[],
|
|
4504
|
+
options: VectorizeQueryOptions,
|
|
4505
|
+
): Promise<VectorizeMatches>;
|
|
4506
|
+
/**
|
|
4507
|
+
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
4508
|
+
* @param vectors List of vectors that will be inserted.
|
|
4509
|
+
* @returns A promise that resolves with the ids & count of records that were successfully processed.
|
|
4510
|
+
*/
|
|
4511
|
+
public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
|
|
4512
|
+
/**
|
|
4513
|
+
* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
|
|
4514
|
+
* @param vectors List of vectors that will be upserted.
|
|
4515
|
+
* @returns A promise that resolves with the ids & count of records that were successfully processed.
|
|
4516
|
+
*/
|
|
4517
|
+
public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
|
|
4518
|
+
/**
|
|
4519
|
+
* Delete a list of vectors with a matching id.
|
|
4520
|
+
* @param ids List of vector ids that should be deleted.
|
|
4521
|
+
* @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted).
|
|
4522
|
+
*/
|
|
4523
|
+
public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>;
|
|
4524
|
+
/**
|
|
4525
|
+
* Get a list of vectors with a matching id.
|
|
4526
|
+
* @param ids List of vector ids that should be returned.
|
|
4527
|
+
* @returns A promise that resolves with the raw unscored vectors matching the id set.
|
|
4528
|
+
*/
|
|
4529
|
+
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
4530
|
+
}
|
|
4531
|
+
/**
|
|
4532
|
+
* The interface for "version_metadata" binding
|
|
4533
|
+
* providing metadata about the Worker Version using this binding.
|
|
4534
|
+
*/
|
|
4535
|
+
export type WorkerVersionMetadata = {
|
|
4536
|
+
/** The ID of the Worker Version using this binding */
|
|
4537
|
+
id: string;
|
|
4538
|
+
/** The tag of the Worker Version using this binding */
|
|
4539
|
+
tag: string;
|
|
4540
|
+
};
|
|
3018
4541
|
export interface DynamicDispatchLimits {
|
|
3019
4542
|
/**
|
|
3020
4543
|
* Limit CPU time in milliseconds.
|
|
@@ -3050,6 +4573,6 @@ export interface DispatchNamespace {
|
|
|
3050
4573
|
args?: {
|
|
3051
4574
|
[key: string]: any;
|
|
3052
4575
|
},
|
|
3053
|
-
options?: DynamicDispatchOptions
|
|
4576
|
+
options?: DynamicDispatchOptions,
|
|
3054
4577
|
): Fetcher;
|
|
3055
4578
|
}
|