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