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