@cloudflare/workers-types 0.20230518.0 → 0.20240405.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2021-11-03/index.d.ts +1708 -191
- package/2021-11-03/index.ts +1659 -191
- package/2022-01-31/index.d.ts +1723 -166
- package/2022-01-31/index.ts +1674 -166
- package/2022-03-21/index.d.ts +1743 -166
- package/2022-03-21/index.ts +1694 -166
- package/2022-08-04/index.d.ts +1743 -166
- package/2022-08-04/index.ts +1694 -166
- package/2022-10-31/index.d.ts +1747 -168
- package/2022-10-31/index.ts +1698 -168
- package/2022-11-30/index.d.ts +1739 -167
- package/2022-11-30/index.ts +1690 -167
- package/2023-03-01/index.d.ts +4640 -0
- package/2023-03-01/index.ts +4579 -0
- package/2023-07-01/index.d.ts +4640 -0
- package/2023-07-01/index.ts +4579 -0
- package/README.md +9 -4
- package/experimental/index.d.ts +1787 -182
- package/experimental/index.ts +1738 -182
- package/index.d.ts +1708 -191
- package/index.ts +1659 -191
- package/oldest/index.d.ts +1708 -191
- package/oldest/index.ts +1659 -191
- package/package.json +1 -1
package/2022-01-31/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,22 +615,107 @@ export interface AnalyticsEngineDataPoint {
|
|
|
502
615
|
}
|
|
503
616
|
export declare class Event {
|
|
504
617
|
constructor(type: string, init?: EventInit);
|
|
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
|
+
*/
|
|
505
623
|
get type(): string;
|
|
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
|
+
*/
|
|
506
629
|
get eventPhase(): number;
|
|
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
|
+
*/
|
|
507
635
|
get composed(): boolean;
|
|
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
|
+
*/
|
|
508
641
|
get bubbles(): boolean;
|
|
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
|
+
*/
|
|
509
647
|
get cancelable(): boolean;
|
|
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
|
+
*/
|
|
510
653
|
get defaultPrevented(): boolean;
|
|
654
|
+
/**
|
|
655
|
+
* @deprecated
|
|
656
|
+
*
|
|
657
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
|
|
658
|
+
*/
|
|
511
659
|
get returnValue(): boolean;
|
|
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
|
+
*/
|
|
512
665
|
get currentTarget(): EventTarget | undefined;
|
|
666
|
+
/**
|
|
667
|
+
* @deprecated
|
|
668
|
+
*
|
|
669
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
|
|
670
|
+
*/
|
|
513
671
|
get srcElement(): EventTarget | undefined;
|
|
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
|
+
*/
|
|
514
677
|
get timeStamp(): number;
|
|
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
|
+
*/
|
|
515
683
|
get isTrusted(): boolean;
|
|
684
|
+
/**
|
|
685
|
+
* @deprecated
|
|
686
|
+
*
|
|
687
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
|
688
|
+
*/
|
|
516
689
|
get cancelBubble(): boolean;
|
|
690
|
+
/**
|
|
691
|
+
* @deprecated
|
|
692
|
+
*
|
|
693
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
|
|
694
|
+
*/
|
|
517
695
|
set cancelBubble(value: boolean);
|
|
696
|
+
/**
|
|
697
|
+
* 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.
|
|
698
|
+
*
|
|
699
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
|
|
700
|
+
*/
|
|
518
701
|
stopImmediatePropagation(): void;
|
|
702
|
+
/**
|
|
703
|
+
* 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.
|
|
704
|
+
*
|
|
705
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
|
|
706
|
+
*/
|
|
519
707
|
preventDefault(): void;
|
|
708
|
+
/**
|
|
709
|
+
* When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
|
|
710
|
+
*
|
|
711
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
|
|
712
|
+
*/
|
|
520
713
|
stopPropagation(): void;
|
|
714
|
+
/**
|
|
715
|
+
* 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.
|
|
716
|
+
*
|
|
717
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
|
|
718
|
+
*/
|
|
521
719
|
composedPath(): EventTarget[];
|
|
522
720
|
static readonly NONE: number;
|
|
523
721
|
static readonly CAPTURING_PHASE: number;
|
|
@@ -530,28 +728,55 @@ export interface EventInit {
|
|
|
530
728
|
composed?: boolean;
|
|
531
729
|
}
|
|
532
730
|
export type EventListener<EventType extends Event = Event> = (
|
|
533
|
-
event: EventType
|
|
731
|
+
event: EventType,
|
|
534
732
|
) => void;
|
|
535
733
|
export interface EventListenerObject<EventType extends Event = Event> {
|
|
536
734
|
handleEvent(event: EventType): void;
|
|
537
735
|
}
|
|
538
736
|
export type EventListenerOrEventListenerObject<
|
|
539
|
-
EventType extends Event = Event
|
|
737
|
+
EventType extends Event = Event,
|
|
540
738
|
> = EventListener<EventType> | EventListenerObject<EventType>;
|
|
541
739
|
export declare class EventTarget<
|
|
542
|
-
EventMap extends Record<string, Event> = Record<string, Event
|
|
740
|
+
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
543
741
|
> {
|
|
544
742
|
constructor();
|
|
743
|
+
/**
|
|
744
|
+
* 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.
|
|
745
|
+
*
|
|
746
|
+
* 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.
|
|
747
|
+
*
|
|
748
|
+
* 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.
|
|
749
|
+
*
|
|
750
|
+
* 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.
|
|
751
|
+
*
|
|
752
|
+
* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
753
|
+
*
|
|
754
|
+
* If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
755
|
+
*
|
|
756
|
+
* The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
757
|
+
*
|
|
758
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
759
|
+
*/
|
|
545
760
|
addEventListener<Type extends keyof EventMap>(
|
|
546
761
|
type: Type,
|
|
547
762
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
548
|
-
options?: EventTargetAddEventListenerOptions | boolean
|
|
763
|
+
options?: EventTargetAddEventListenerOptions | boolean,
|
|
549
764
|
): void;
|
|
765
|
+
/**
|
|
766
|
+
* Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
767
|
+
*
|
|
768
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
769
|
+
*/
|
|
550
770
|
removeEventListener<Type extends keyof EventMap>(
|
|
551
771
|
type: Type,
|
|
552
772
|
handler: EventListenerOrEventListenerObject<EventMap[Type]>,
|
|
553
|
-
options?: EventTargetEventListenerOptions | boolean
|
|
773
|
+
options?: EventTargetEventListenerOptions | boolean,
|
|
554
774
|
): void;
|
|
775
|
+
/**
|
|
776
|
+
* 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.
|
|
777
|
+
*
|
|
778
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
779
|
+
*/
|
|
555
780
|
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
|
|
556
781
|
}
|
|
557
782
|
export interface EventTargetEventListenerOptions {
|
|
@@ -568,15 +793,38 @@ export interface EventTargetHandlerObject {
|
|
|
568
793
|
}
|
|
569
794
|
export declare class AbortController {
|
|
570
795
|
constructor();
|
|
796
|
+
/**
|
|
797
|
+
* Returns the AbortSignal object associated with this object.
|
|
798
|
+
*
|
|
799
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
|
|
800
|
+
*/
|
|
571
801
|
get signal(): AbortSignal;
|
|
802
|
+
/**
|
|
803
|
+
* 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.
|
|
804
|
+
*
|
|
805
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
|
|
806
|
+
*/
|
|
572
807
|
abort(reason?: any): void;
|
|
573
808
|
}
|
|
574
809
|
export declare abstract class AbortSignal extends EventTarget {
|
|
810
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
575
811
|
static abort(reason?: any): AbortSignal;
|
|
812
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
576
813
|
static timeout(delay: number): AbortSignal;
|
|
577
814
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
815
|
+
/**
|
|
816
|
+
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
817
|
+
*
|
|
818
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
819
|
+
*/
|
|
578
820
|
get aborted(): boolean;
|
|
821
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
579
822
|
get reason(): any;
|
|
823
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
824
|
+
get onabort(): any | null;
|
|
825
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
826
|
+
set onabort(value: any | null);
|
|
827
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
580
828
|
throwIfAborted(): void;
|
|
581
829
|
}
|
|
582
830
|
export interface Scheduler {
|
|
@@ -586,18 +834,40 @@ export interface SchedulerWaitOptions {
|
|
|
586
834
|
signal?: AbortSignal;
|
|
587
835
|
}
|
|
588
836
|
export declare abstract class ExtendableEvent extends Event {
|
|
837
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
589
838
|
waitUntil(promise: Promise<any>): void;
|
|
590
839
|
}
|
|
840
|
+
export declare class CustomEvent<T = any> extends Event {
|
|
841
|
+
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
842
|
+
/**
|
|
843
|
+
* Returns any custom data event was created with. Typically used for synthetic events.
|
|
844
|
+
*
|
|
845
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
|
|
846
|
+
*/
|
|
847
|
+
get detail(): T;
|
|
848
|
+
}
|
|
849
|
+
export interface CustomEventCustomEventInit {
|
|
850
|
+
bubbles?: boolean;
|
|
851
|
+
cancelable?: boolean;
|
|
852
|
+
composed?: boolean;
|
|
853
|
+
detail?: any;
|
|
854
|
+
}
|
|
591
855
|
export declare class Blob {
|
|
592
856
|
constructor(
|
|
593
857
|
bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
594
|
-
options?: BlobOptions
|
|
858
|
+
options?: BlobOptions,
|
|
595
859
|
);
|
|
860
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
596
861
|
get size(): number;
|
|
862
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
597
863
|
get type(): string;
|
|
864
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
598
865
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
866
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
599
867
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
868
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
600
869
|
text(): Promise<string>;
|
|
870
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
601
871
|
stream(): ReadableStream;
|
|
602
872
|
}
|
|
603
873
|
export interface BlobOptions {
|
|
@@ -607,9 +877,11 @@ export declare class File extends Blob {
|
|
|
607
877
|
constructor(
|
|
608
878
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
609
879
|
name: string,
|
|
610
|
-
options?: FileOptions
|
|
880
|
+
options?: FileOptions,
|
|
611
881
|
);
|
|
882
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
612
883
|
get name(): string;
|
|
884
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
613
885
|
get lastModified(): number;
|
|
614
886
|
}
|
|
615
887
|
export interface FileOptions {
|
|
@@ -617,6 +889,7 @@ export interface FileOptions {
|
|
|
617
889
|
lastModified?: number;
|
|
618
890
|
}
|
|
619
891
|
export declare abstract class CacheStorage {
|
|
892
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
620
893
|
open(cacheName: string): Promise<Cache>;
|
|
621
894
|
readonly default: Cache;
|
|
622
895
|
}
|
|
@@ -624,7 +897,7 @@ export declare abstract class Cache {
|
|
|
624
897
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
625
898
|
match(
|
|
626
899
|
request: RequestInfo,
|
|
627
|
-
options?: CacheQueryOptions
|
|
900
|
+
options?: CacheQueryOptions,
|
|
628
901
|
): Promise<Response | undefined>;
|
|
629
902
|
put(request: RequestInfo, response: Response): Promise<void>;
|
|
630
903
|
}
|
|
@@ -632,7 +905,13 @@ export interface CacheQueryOptions {
|
|
|
632
905
|
ignoreMethod?: boolean;
|
|
633
906
|
}
|
|
634
907
|
export declare abstract class Crypto {
|
|
908
|
+
/**
|
|
909
|
+
* Available only in secure contexts.
|
|
910
|
+
*
|
|
911
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
912
|
+
*/
|
|
635
913
|
get subtle(): SubtleCrypto;
|
|
914
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
636
915
|
getRandomValues<
|
|
637
916
|
T extends
|
|
638
917
|
| Int8Array
|
|
@@ -642,8 +921,13 @@ export declare abstract class Crypto {
|
|
|
642
921
|
| Int32Array
|
|
643
922
|
| Uint32Array
|
|
644
923
|
| BigInt64Array
|
|
645
|
-
| BigUint64Array
|
|
924
|
+
| BigUint64Array,
|
|
646
925
|
>(buffer: T): T;
|
|
926
|
+
/**
|
|
927
|
+
* Available only in secure contexts.
|
|
928
|
+
*
|
|
929
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
930
|
+
*/
|
|
647
931
|
randomUUID(): string;
|
|
648
932
|
DigestStream: typeof DigestStream;
|
|
649
933
|
}
|
|
@@ -651,59 +935,63 @@ export declare abstract class SubtleCrypto {
|
|
|
651
935
|
encrypt(
|
|
652
936
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
653
937
|
key: CryptoKey,
|
|
654
|
-
plainText: ArrayBuffer | ArrayBufferView
|
|
938
|
+
plainText: ArrayBuffer | ArrayBufferView,
|
|
655
939
|
): Promise<ArrayBuffer>;
|
|
656
940
|
decrypt(
|
|
657
941
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
658
942
|
key: CryptoKey,
|
|
659
|
-
cipherText: ArrayBuffer | ArrayBufferView
|
|
943
|
+
cipherText: ArrayBuffer | ArrayBufferView,
|
|
660
944
|
): Promise<ArrayBuffer>;
|
|
661
945
|
sign(
|
|
662
946
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
663
947
|
key: CryptoKey,
|
|
664
|
-
data: ArrayBuffer | ArrayBufferView
|
|
948
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
665
949
|
): Promise<ArrayBuffer>;
|
|
666
950
|
verify(
|
|
667
951
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
668
952
|
key: CryptoKey,
|
|
669
953
|
signature: ArrayBuffer | ArrayBufferView,
|
|
670
|
-
data: ArrayBuffer | ArrayBufferView
|
|
954
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
671
955
|
): Promise<boolean>;
|
|
672
956
|
digest(
|
|
673
957
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
674
|
-
data: ArrayBuffer | ArrayBufferView
|
|
958
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
675
959
|
): Promise<ArrayBuffer>;
|
|
960
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
676
961
|
generateKey(
|
|
677
962
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
678
963
|
extractable: boolean,
|
|
679
|
-
keyUsages: string[]
|
|
964
|
+
keyUsages: string[],
|
|
680
965
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
966
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
681
967
|
deriveKey(
|
|
682
968
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
683
969
|
baseKey: CryptoKey,
|
|
684
970
|
derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
685
971
|
extractable: boolean,
|
|
686
|
-
keyUsages: string[]
|
|
972
|
+
keyUsages: string[],
|
|
687
973
|
): Promise<CryptoKey>;
|
|
688
974
|
deriveBits(
|
|
689
975
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
690
976
|
baseKey: CryptoKey,
|
|
691
|
-
length: number | null
|
|
977
|
+
length: number | null,
|
|
692
978
|
): Promise<ArrayBuffer>;
|
|
979
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
693
980
|
importKey(
|
|
694
981
|
format: string,
|
|
695
982
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
696
983
|
algorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
697
984
|
extractable: boolean,
|
|
698
|
-
keyUsages: string[]
|
|
985
|
+
keyUsages: string[],
|
|
699
986
|
): Promise<CryptoKey>;
|
|
700
987
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
701
988
|
wrapKey(
|
|
702
989
|
format: string,
|
|
703
990
|
key: CryptoKey,
|
|
704
991
|
wrappingKey: CryptoKey,
|
|
705
|
-
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm
|
|
992
|
+
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
706
993
|
): Promise<ArrayBuffer>;
|
|
994
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
707
995
|
unwrapKey(
|
|
708
996
|
format: string,
|
|
709
997
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -711,16 +999,19 @@ export declare abstract class SubtleCrypto {
|
|
|
711
999
|
unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
712
1000
|
unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
|
|
713
1001
|
extractable: boolean,
|
|
714
|
-
keyUsages: string[]
|
|
1002
|
+
keyUsages: string[],
|
|
715
1003
|
): Promise<CryptoKey>;
|
|
716
1004
|
timingSafeEqual(
|
|
717
1005
|
a: ArrayBuffer | ArrayBufferView,
|
|
718
|
-
b: ArrayBuffer | ArrayBufferView
|
|
1006
|
+
b: ArrayBuffer | ArrayBufferView,
|
|
719
1007
|
): boolean;
|
|
720
1008
|
}
|
|
721
1009
|
export declare abstract class CryptoKey {
|
|
1010
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
722
1011
|
readonly type: string;
|
|
1012
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
723
1013
|
readonly extractable: boolean;
|
|
1014
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
724
1015
|
readonly algorithm:
|
|
725
1016
|
| CryptoKeyKeyAlgorithm
|
|
726
1017
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -728,6 +1019,7 @@ export declare abstract class CryptoKey {
|
|
|
728
1019
|
| CryptoKeyRsaKeyAlgorithm
|
|
729
1020
|
| CryptoKeyEllipticKeyAlgorithm
|
|
730
1021
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1022
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
731
1023
|
readonly usages: string[];
|
|
732
1024
|
}
|
|
733
1025
|
export interface CryptoKeyPair {
|
|
@@ -815,7 +1107,7 @@ export interface CryptoKeyHmacKeyAlgorithm {
|
|
|
815
1107
|
export interface CryptoKeyRsaKeyAlgorithm {
|
|
816
1108
|
name: string;
|
|
817
1109
|
modulusLength: number;
|
|
818
|
-
publicExponent: ArrayBuffer;
|
|
1110
|
+
publicExponent: ArrayBuffer | (ArrayBuffer | ArrayBufferView);
|
|
819
1111
|
hash?: CryptoKeyKeyAlgorithm;
|
|
820
1112
|
}
|
|
821
1113
|
export interface CryptoKeyEllipticKeyAlgorithm {
|
|
@@ -836,9 +1128,24 @@ export declare class DigestStream extends WritableStream<
|
|
|
836
1128
|
}
|
|
837
1129
|
export declare class TextDecoder {
|
|
838
1130
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1131
|
+
/**
|
|
1132
|
+
* 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.
|
|
1133
|
+
*
|
|
1134
|
+
* ```
|
|
1135
|
+
* var string = "", decoder = new TextDecoder(encoding), buffer;
|
|
1136
|
+
* while(buffer = next_chunk()) {
|
|
1137
|
+
* string += decoder.decode(buffer, {stream:true});
|
|
1138
|
+
* }
|
|
1139
|
+
* string += decoder.decode(); // end-of-queue
|
|
1140
|
+
* ```
|
|
1141
|
+
*
|
|
1142
|
+
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
|
|
1143
|
+
*
|
|
1144
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
|
|
1145
|
+
*/
|
|
839
1146
|
decode(
|
|
840
1147
|
input?: ArrayBuffer | ArrayBufferView,
|
|
841
|
-
options?: TextDecoderDecodeOptions
|
|
1148
|
+
options?: TextDecoderDecodeOptions,
|
|
842
1149
|
): string;
|
|
843
1150
|
get encoding(): string;
|
|
844
1151
|
get fatal(): boolean;
|
|
@@ -846,8 +1153,21 @@ export declare class TextDecoder {
|
|
|
846
1153
|
}
|
|
847
1154
|
export declare class TextEncoder {
|
|
848
1155
|
constructor();
|
|
1156
|
+
/**
|
|
1157
|
+
* Returns the result of running UTF-8's encoder.
|
|
1158
|
+
*
|
|
1159
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
|
|
1160
|
+
*/
|
|
849
1161
|
encode(input?: string): Uint8Array;
|
|
850
|
-
|
|
1162
|
+
/**
|
|
1163
|
+
* 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.
|
|
1164
|
+
*
|
|
1165
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
|
|
1166
|
+
*/
|
|
1167
|
+
encodeInto(
|
|
1168
|
+
input: string,
|
|
1169
|
+
buffer: ArrayBuffer | ArrayBufferView,
|
|
1170
|
+
): TextEncoderEncodeIntoResult;
|
|
851
1171
|
get encoding(): string;
|
|
852
1172
|
}
|
|
853
1173
|
export interface TextDecoderConstructorOptions {
|
|
@@ -871,17 +1191,20 @@ export declare class FormData {
|
|
|
871
1191
|
has(name: string): boolean;
|
|
872
1192
|
set(name: string, value: string): void;
|
|
873
1193
|
set(name: string, value: Blob, filename?: string): void;
|
|
1194
|
+
/** Returns an array of key, value pairs for every entry in the list. */
|
|
874
1195
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1196
|
+
/** Returns a list of keys in the list. */
|
|
875
1197
|
keys(): IterableIterator<string>;
|
|
1198
|
+
/** Returns a list of values in the list. */
|
|
876
1199
|
values(): IterableIterator<File | string>;
|
|
877
1200
|
forEach<This = unknown>(
|
|
878
1201
|
callback: (
|
|
879
1202
|
this: This,
|
|
880
1203
|
value: File | string,
|
|
881
1204
|
key: string,
|
|
882
|
-
parent: FormData
|
|
1205
|
+
parent: FormData,
|
|
883
1206
|
) => void,
|
|
884
|
-
thisArg?: This
|
|
1207
|
+
thisArg?: This,
|
|
885
1208
|
): void;
|
|
886
1209
|
[Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
|
|
887
1210
|
}
|
|
@@ -892,7 +1215,7 @@ export declare class HTMLRewriter {
|
|
|
892
1215
|
constructor();
|
|
893
1216
|
on(
|
|
894
1217
|
selector: string,
|
|
895
|
-
handlers: HTMLRewriterElementContentHandlers
|
|
1218
|
+
handlers: HTMLRewriterElementContentHandlers,
|
|
896
1219
|
): HTMLRewriter;
|
|
897
1220
|
onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
|
|
898
1221
|
transform(response: Response): Response;
|
|
@@ -959,7 +1282,9 @@ export interface DocumentEnd {
|
|
|
959
1282
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
960
1283
|
}
|
|
961
1284
|
export declare abstract class FetchEvent extends ExtendableEvent {
|
|
1285
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
962
1286
|
readonly request: Request;
|
|
1287
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
963
1288
|
respondWith(promise: Response | Promise<Response>): void;
|
|
964
1289
|
passThroughOnException(): void;
|
|
965
1290
|
}
|
|
@@ -977,10 +1302,13 @@ export declare class Headers {
|
|
|
977
1302
|
delete(name: string): void;
|
|
978
1303
|
forEach<This = unknown>(
|
|
979
1304
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
980
|
-
thisArg?: This
|
|
1305
|
+
thisArg?: This,
|
|
981
1306
|
): void;
|
|
1307
|
+
/** Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
982
1308
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1309
|
+
/** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
983
1310
|
keys(): IterableIterator<string>;
|
|
1311
|
+
/** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
984
1312
|
values(): IterableIterator<string>;
|
|
985
1313
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
986
1314
|
}
|
|
@@ -1003,14 +1331,23 @@ export declare abstract class Body {
|
|
|
1003
1331
|
}
|
|
1004
1332
|
export declare class Response extends Body {
|
|
1005
1333
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
1334
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1006
1335
|
static redirect(url: string, status?: number): Response;
|
|
1336
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
1007
1337
|
static json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1338
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1008
1339
|
clone(): Response;
|
|
1340
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1009
1341
|
get status(): number;
|
|
1342
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1010
1343
|
get statusText(): string;
|
|
1344
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1011
1345
|
get headers(): Headers;
|
|
1346
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1012
1347
|
get ok(): boolean;
|
|
1348
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1013
1349
|
get redirected(): boolean;
|
|
1350
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1014
1351
|
get url(): string;
|
|
1015
1352
|
get webSocket(): WebSocket | null;
|
|
1016
1353
|
get cf(): any | undefined;
|
|
@@ -1025,22 +1362,58 @@ export interface ResponseInit {
|
|
|
1025
1362
|
}
|
|
1026
1363
|
export type RequestInfo<
|
|
1027
1364
|
CfHostMetadata = unknown,
|
|
1028
|
-
Cf = CfProperties<CfHostMetadata
|
|
1365
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1029
1366
|
> = Request<CfHostMetadata, Cf> | string | URL;
|
|
1030
1367
|
export declare class Request<
|
|
1031
1368
|
CfHostMetadata = unknown,
|
|
1032
|
-
Cf = CfProperties<CfHostMetadata
|
|
1369
|
+
Cf = CfProperties<CfHostMetadata>,
|
|
1033
1370
|
> extends Body {
|
|
1034
1371
|
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1372
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1035
1373
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Returns request's HTTP method, which is "GET" by default.
|
|
1376
|
+
*
|
|
1377
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1378
|
+
*/
|
|
1036
1379
|
get method(): string;
|
|
1380
|
+
/**
|
|
1381
|
+
* Returns the URL of request as a string.
|
|
1382
|
+
*
|
|
1383
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1384
|
+
*/
|
|
1037
1385
|
get url(): string;
|
|
1386
|
+
/**
|
|
1387
|
+
* 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.
|
|
1388
|
+
*
|
|
1389
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1390
|
+
*/
|
|
1038
1391
|
get headers(): Headers;
|
|
1392
|
+
/**
|
|
1393
|
+
* 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.
|
|
1394
|
+
*
|
|
1395
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1396
|
+
*/
|
|
1039
1397
|
get redirect(): string;
|
|
1040
1398
|
get fetcher(): Fetcher | null;
|
|
1399
|
+
/**
|
|
1400
|
+
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1401
|
+
*
|
|
1402
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1403
|
+
*/
|
|
1041
1404
|
get signal(): AbortSignal;
|
|
1042
1405
|
get cf(): Cf | undefined;
|
|
1406
|
+
/**
|
|
1407
|
+
* 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]
|
|
1408
|
+
*
|
|
1409
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1410
|
+
*/
|
|
1043
1411
|
get integrity(): string;
|
|
1412
|
+
/**
|
|
1413
|
+
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1414
|
+
*
|
|
1415
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1416
|
+
*/
|
|
1044
1417
|
get keepalive(): boolean;
|
|
1045
1418
|
}
|
|
1046
1419
|
export interface RequestInit<Cf = CfProperties> {
|
|
@@ -1059,10 +1432,18 @@ export interface RequestInit<Cf = CfProperties> {
|
|
|
1059
1432
|
/** An AbortSignal to set request's signal. */
|
|
1060
1433
|
signal?: AbortSignal | null;
|
|
1061
1434
|
}
|
|
1062
|
-
export
|
|
1435
|
+
export type Service<
|
|
1436
|
+
T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
|
|
1437
|
+
> = Fetcher<T>;
|
|
1438
|
+
export type Fetcher<
|
|
1439
|
+
T extends Rpc.EntrypointBranded | undefined = undefined,
|
|
1440
|
+
Reserved extends string = never,
|
|
1441
|
+
> = (T extends Rpc.EntrypointBranded
|
|
1442
|
+
? Rpc.Provider<T, Reserved | "fetch" | "connect">
|
|
1443
|
+
: unknown) & {
|
|
1063
1444
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1064
1445
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1065
|
-
}
|
|
1446
|
+
};
|
|
1066
1447
|
export interface FetcherPutOptions {
|
|
1067
1448
|
expiration?: number;
|
|
1068
1449
|
expirationTtl?: number;
|
|
@@ -1077,82 +1458,84 @@ export type KVNamespaceListResult<Metadata, Key extends string = string> =
|
|
|
1077
1458
|
list_complete: false;
|
|
1078
1459
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
1079
1460
|
cursor: string;
|
|
1461
|
+
cacheStatus: string | null;
|
|
1080
1462
|
}
|
|
1081
1463
|
| {
|
|
1082
1464
|
list_complete: true;
|
|
1083
1465
|
keys: KVNamespaceListKey<Metadata, Key>[];
|
|
1466
|
+
cacheStatus: string | null;
|
|
1084
1467
|
};
|
|
1085
1468
|
export interface KVNamespace<Key extends string = string> {
|
|
1086
1469
|
get(
|
|
1087
1470
|
key: Key,
|
|
1088
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1471
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1089
1472
|
): Promise<string | null>;
|
|
1090
1473
|
get(key: Key, type: "text"): Promise<string | null>;
|
|
1091
1474
|
get<ExpectedValue = unknown>(
|
|
1092
1475
|
key: Key,
|
|
1093
|
-
type: "json"
|
|
1476
|
+
type: "json",
|
|
1094
1477
|
): Promise<ExpectedValue | null>;
|
|
1095
1478
|
get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
|
|
1096
1479
|
get(key: Key, type: "stream"): Promise<ReadableStream | null>;
|
|
1097
1480
|
get(
|
|
1098
1481
|
key: Key,
|
|
1099
|
-
options?: KVNamespaceGetOptions<"text"
|
|
1482
|
+
options?: KVNamespaceGetOptions<"text">,
|
|
1100
1483
|
): Promise<string | null>;
|
|
1101
1484
|
get<ExpectedValue = unknown>(
|
|
1102
1485
|
key: Key,
|
|
1103
|
-
options?: KVNamespaceGetOptions<"json"
|
|
1486
|
+
options?: KVNamespaceGetOptions<"json">,
|
|
1104
1487
|
): Promise<ExpectedValue | null>;
|
|
1105
1488
|
get(
|
|
1106
1489
|
key: Key,
|
|
1107
|
-
options?: KVNamespaceGetOptions<"arrayBuffer"
|
|
1490
|
+
options?: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1108
1491
|
): Promise<ArrayBuffer | null>;
|
|
1109
1492
|
get(
|
|
1110
1493
|
key: Key,
|
|
1111
|
-
options?: KVNamespaceGetOptions<"stream"
|
|
1494
|
+
options?: KVNamespaceGetOptions<"stream">,
|
|
1112
1495
|
): Promise<ReadableStream | null>;
|
|
1113
1496
|
list<Metadata = unknown>(
|
|
1114
|
-
options?: KVNamespaceListOptions
|
|
1497
|
+
options?: KVNamespaceListOptions,
|
|
1115
1498
|
): Promise<KVNamespaceListResult<Metadata, Key>>;
|
|
1116
1499
|
put(
|
|
1117
1500
|
key: Key,
|
|
1118
1501
|
value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
|
|
1119
|
-
options?: KVNamespacePutOptions
|
|
1502
|
+
options?: KVNamespacePutOptions,
|
|
1120
1503
|
): Promise<void>;
|
|
1121
1504
|
getWithMetadata<Metadata = unknown>(
|
|
1122
1505
|
key: Key,
|
|
1123
|
-
options?: Partial<KVNamespaceGetOptions<undefined
|
|
1506
|
+
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
1124
1507
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1125
1508
|
getWithMetadata<Metadata = unknown>(
|
|
1126
1509
|
key: Key,
|
|
1127
|
-
type: "text"
|
|
1510
|
+
type: "text",
|
|
1128
1511
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1129
1512
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1130
1513
|
key: Key,
|
|
1131
|
-
type: "json"
|
|
1514
|
+
type: "json",
|
|
1132
1515
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1133
1516
|
getWithMetadata<Metadata = unknown>(
|
|
1134
1517
|
key: Key,
|
|
1135
|
-
type: "arrayBuffer"
|
|
1518
|
+
type: "arrayBuffer",
|
|
1136
1519
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1137
1520
|
getWithMetadata<Metadata = unknown>(
|
|
1138
1521
|
key: Key,
|
|
1139
|
-
type: "stream"
|
|
1522
|
+
type: "stream",
|
|
1140
1523
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1141
1524
|
getWithMetadata<Metadata = unknown>(
|
|
1142
1525
|
key: Key,
|
|
1143
|
-
options: KVNamespaceGetOptions<"text"
|
|
1526
|
+
options: KVNamespaceGetOptions<"text">,
|
|
1144
1527
|
): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
|
|
1145
1528
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
1146
1529
|
key: Key,
|
|
1147
|
-
options: KVNamespaceGetOptions<"json"
|
|
1530
|
+
options: KVNamespaceGetOptions<"json">,
|
|
1148
1531
|
): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
|
|
1149
1532
|
getWithMetadata<Metadata = unknown>(
|
|
1150
1533
|
key: Key,
|
|
1151
|
-
options: KVNamespaceGetOptions<"arrayBuffer"
|
|
1534
|
+
options: KVNamespaceGetOptions<"arrayBuffer">,
|
|
1152
1535
|
): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
|
|
1153
1536
|
getWithMetadata<Metadata = unknown>(
|
|
1154
1537
|
key: Key,
|
|
1155
|
-
options: KVNamespaceGetOptions<"stream"
|
|
1538
|
+
options: KVNamespaceGetOptions<"stream">,
|
|
1156
1539
|
): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
|
|
1157
1540
|
delete(key: Key): Promise<void>;
|
|
1158
1541
|
}
|
|
@@ -1173,32 +1556,49 @@ export interface KVNamespacePutOptions {
|
|
|
1173
1556
|
export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
1174
1557
|
value: Value | null;
|
|
1175
1558
|
metadata: Metadata | null;
|
|
1559
|
+
cacheStatus: string | null;
|
|
1560
|
+
}
|
|
1561
|
+
export type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1562
|
+
export interface Queue<Body = unknown> {
|
|
1563
|
+
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1564
|
+
sendBatch(
|
|
1565
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1566
|
+
options?: QueueSendBatchOptions,
|
|
1567
|
+
): Promise<void>;
|
|
1568
|
+
}
|
|
1569
|
+
export interface QueueSendOptions {
|
|
1570
|
+
contentType?: QueueContentType;
|
|
1571
|
+
delaySeconds?: number;
|
|
1176
1572
|
}
|
|
1177
|
-
export interface
|
|
1178
|
-
|
|
1179
|
-
sendBatch(messages: Iterable<MessageSendRequest<Body>>): Promise<void>;
|
|
1573
|
+
export interface QueueSendBatchOptions {
|
|
1574
|
+
delaySeconds?: number;
|
|
1180
1575
|
}
|
|
1181
|
-
export interface QueueSendOptions {}
|
|
1182
1576
|
export interface MessageSendRequest<Body = unknown> {
|
|
1183
1577
|
body: Body;
|
|
1578
|
+
contentType?: QueueContentType;
|
|
1579
|
+
delaySeconds?: number;
|
|
1580
|
+
}
|
|
1581
|
+
export interface QueueRetryOptions {
|
|
1582
|
+
delaySeconds?: number;
|
|
1184
1583
|
}
|
|
1185
1584
|
export interface Message<Body = unknown> {
|
|
1186
1585
|
readonly id: string;
|
|
1187
1586
|
readonly timestamp: Date;
|
|
1188
1587
|
readonly body: Body;
|
|
1189
|
-
|
|
1588
|
+
readonly attempts: number;
|
|
1589
|
+
retry(options?: QueueRetryOptions): void;
|
|
1190
1590
|
ack(): void;
|
|
1191
1591
|
}
|
|
1192
1592
|
export interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1193
1593
|
readonly messages: readonly Message<Body>[];
|
|
1194
1594
|
readonly queue: string;
|
|
1195
|
-
retryAll(): void;
|
|
1595
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1196
1596
|
ackAll(): void;
|
|
1197
1597
|
}
|
|
1198
1598
|
export interface MessageBatch<Body = unknown> {
|
|
1199
1599
|
readonly messages: readonly Message<Body>[];
|
|
1200
1600
|
readonly queue: string;
|
|
1201
|
-
retryAll(): void;
|
|
1601
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1202
1602
|
ackAll(): void;
|
|
1203
1603
|
}
|
|
1204
1604
|
export interface R2Error extends Error {
|
|
@@ -1221,7 +1621,7 @@ export declare abstract class R2Bucket {
|
|
|
1221
1621
|
key: string,
|
|
1222
1622
|
options: R2GetOptions & {
|
|
1223
1623
|
onlyIf: R2Conditional | Headers;
|
|
1224
|
-
}
|
|
1624
|
+
},
|
|
1225
1625
|
): Promise<R2ObjectBody | R2Object | null>;
|
|
1226
1626
|
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
|
|
1227
1627
|
put(
|
|
@@ -1233,8 +1633,10 @@ export declare abstract class R2Bucket {
|
|
|
1233
1633
|
| string
|
|
1234
1634
|
| null
|
|
1235
1635
|
| Blob,
|
|
1236
|
-
options?: R2PutOptions
|
|
1237
|
-
|
|
1636
|
+
options?: R2PutOptions & {
|
|
1637
|
+
onlyIf: R2Conditional | Headers;
|
|
1638
|
+
},
|
|
1639
|
+
): Promise<R2Object | null>;
|
|
1238
1640
|
put(
|
|
1239
1641
|
key: string,
|
|
1240
1642
|
value:
|
|
@@ -1244,13 +1646,11 @@ export declare abstract class R2Bucket {
|
|
|
1244
1646
|
| string
|
|
1245
1647
|
| null
|
|
1246
1648
|
| Blob,
|
|
1247
|
-
options?: R2PutOptions
|
|
1248
|
-
|
|
1249
|
-
}
|
|
1250
|
-
): Promise<R2Object | null>;
|
|
1649
|
+
options?: R2PutOptions,
|
|
1650
|
+
): Promise<R2Object>;
|
|
1251
1651
|
createMultipartUpload(
|
|
1252
1652
|
key: string,
|
|
1253
|
-
options?: R2MultipartOptions
|
|
1653
|
+
options?: R2MultipartOptions,
|
|
1254
1654
|
): Promise<R2MultipartUpload>;
|
|
1255
1655
|
resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
|
|
1256
1656
|
delete(keys: string | string[]): Promise<void>;
|
|
@@ -1261,7 +1661,7 @@ export interface R2MultipartUpload {
|
|
|
1261
1661
|
readonly uploadId: string;
|
|
1262
1662
|
uploadPart(
|
|
1263
1663
|
partNumber: number,
|
|
1264
|
-
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob
|
|
1664
|
+
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
|
|
1265
1665
|
): Promise<R2UploadedPart>;
|
|
1266
1666
|
abort(): Promise<void>;
|
|
1267
1667
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
@@ -1281,6 +1681,7 @@ export declare abstract class R2Object {
|
|
|
1281
1681
|
readonly httpMetadata?: R2HTTPMetadata;
|
|
1282
1682
|
readonly customMetadata?: Record<string, string>;
|
|
1283
1683
|
readonly range?: R2Range;
|
|
1684
|
+
readonly storageClass: string;
|
|
1284
1685
|
writeHttpMetadata(headers: Headers): void;
|
|
1285
1686
|
}
|
|
1286
1687
|
export interface R2ObjectBody extends R2Object {
|
|
@@ -1323,10 +1724,12 @@ export interface R2PutOptions {
|
|
|
1323
1724
|
sha256?: ArrayBuffer | string;
|
|
1324
1725
|
sha384?: ArrayBuffer | string;
|
|
1325
1726
|
sha512?: ArrayBuffer | string;
|
|
1727
|
+
storageClass?: string;
|
|
1326
1728
|
}
|
|
1327
1729
|
export interface R2MultipartOptions {
|
|
1328
1730
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1329
1731
|
customMetadata?: Record<string, string>;
|
|
1732
|
+
storageClass?: string;
|
|
1330
1733
|
}
|
|
1331
1734
|
export interface R2Checksums {
|
|
1332
1735
|
readonly md5?: ArrayBuffer;
|
|
@@ -1382,7 +1785,7 @@ export interface UnderlyingSink<W = any> {
|
|
|
1382
1785
|
start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
|
|
1383
1786
|
write?: (
|
|
1384
1787
|
chunk: W,
|
|
1385
|
-
controller: WritableStreamDefaultController
|
|
1788
|
+
controller: WritableStreamDefaultController,
|
|
1386
1789
|
) => void | Promise<void>;
|
|
1387
1790
|
abort?: (reason: any) => void | Promise<void>;
|
|
1388
1791
|
close?: () => void | Promise<void>;
|
|
@@ -1397,26 +1800,29 @@ export interface UnderlyingByteSource {
|
|
|
1397
1800
|
export interface UnderlyingSource<R = any> {
|
|
1398
1801
|
type?: "" | undefined;
|
|
1399
1802
|
start?: (
|
|
1400
|
-
controller: ReadableStreamDefaultController<R
|
|
1803
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1401
1804
|
) => void | Promise<void>;
|
|
1402
1805
|
pull?: (
|
|
1403
|
-
controller: ReadableStreamDefaultController<R
|
|
1806
|
+
controller: ReadableStreamDefaultController<R>,
|
|
1404
1807
|
) => void | Promise<void>;
|
|
1405
1808
|
cancel?: (reason: any) => void | Promise<void>;
|
|
1809
|
+
expectedLength?: number | bigint;
|
|
1406
1810
|
}
|
|
1407
1811
|
export interface Transformer<I = any, O = any> {
|
|
1408
1812
|
readableType?: string;
|
|
1409
1813
|
writableType?: string;
|
|
1410
1814
|
start?: (
|
|
1411
|
-
controller: TransformStreamDefaultController<O
|
|
1815
|
+
controller: TransformStreamDefaultController<O>,
|
|
1412
1816
|
) => void | Promise<void>;
|
|
1413
1817
|
transform?: (
|
|
1414
1818
|
chunk: I,
|
|
1415
|
-
controller: TransformStreamDefaultController<O
|
|
1819
|
+
controller: TransformStreamDefaultController<O>,
|
|
1416
1820
|
) => void | Promise<void>;
|
|
1417
1821
|
flush?: (
|
|
1418
|
-
controller: TransformStreamDefaultController<O
|
|
1822
|
+
controller: TransformStreamDefaultController<O>,
|
|
1419
1823
|
) => void | Promise<void>;
|
|
1824
|
+
cancel?: (reason: any) => void | Promise<void>;
|
|
1825
|
+
expectedLength?: number;
|
|
1420
1826
|
}
|
|
1421
1827
|
export interface StreamPipeOptions {
|
|
1422
1828
|
/**
|
|
@@ -1450,88 +1856,137 @@ export type ReadableStreamReadResult<R = any> =
|
|
|
1450
1856
|
done: true;
|
|
1451
1857
|
value?: undefined;
|
|
1452
1858
|
};
|
|
1453
|
-
/**
|
|
1859
|
+
/**
|
|
1860
|
+
* 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.
|
|
1861
|
+
*
|
|
1862
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1863
|
+
*/
|
|
1454
1864
|
export interface ReadableStream<R = any> {
|
|
1865
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1455
1866
|
get locked(): boolean;
|
|
1867
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1456
1868
|
cancel(reason?: any): Promise<void>;
|
|
1869
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1457
1870
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1871
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1458
1872
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1873
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1459
1874
|
pipeThrough<T>(
|
|
1460
1875
|
transform: ReadableWritablePair<T, R>,
|
|
1461
|
-
options?: StreamPipeOptions
|
|
1876
|
+
options?: StreamPipeOptions,
|
|
1462
1877
|
): ReadableStream<T>;
|
|
1878
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1463
1879
|
pipeTo(
|
|
1464
1880
|
destination: WritableStream<R>,
|
|
1465
|
-
options?: StreamPipeOptions
|
|
1881
|
+
options?: StreamPipeOptions,
|
|
1466
1882
|
): Promise<void>;
|
|
1883
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1467
1884
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1468
1885
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1469
1886
|
[Symbol.asyncIterator](
|
|
1470
|
-
options?: ReadableStreamValuesOptions
|
|
1887
|
+
options?: ReadableStreamValuesOptions,
|
|
1471
1888
|
): AsyncIterableIterator<R>;
|
|
1472
1889
|
}
|
|
1473
1890
|
export declare const ReadableStream: {
|
|
1474
1891
|
prototype: ReadableStream;
|
|
1475
1892
|
new (
|
|
1476
1893
|
underlyingSource: UnderlyingByteSource,
|
|
1477
|
-
strategy?: QueuingStrategy<Uint8Array
|
|
1894
|
+
strategy?: QueuingStrategy<Uint8Array>,
|
|
1478
1895
|
): ReadableStream<Uint8Array>;
|
|
1479
1896
|
new <R = any>(
|
|
1480
1897
|
underlyingSource?: UnderlyingSource<R>,
|
|
1481
|
-
strategy?: QueuingStrategy<R
|
|
1898
|
+
strategy?: QueuingStrategy<R>,
|
|
1482
1899
|
): ReadableStream<R>;
|
|
1483
1900
|
};
|
|
1484
1901
|
export declare class ReadableStreamDefaultReader<R = any> {
|
|
1485
1902
|
constructor(stream: ReadableStream);
|
|
1486
1903
|
get closed(): Promise<void>;
|
|
1487
1904
|
cancel(reason?: any): Promise<void>;
|
|
1905
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1488
1906
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1907
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1489
1908
|
releaseLock(): void;
|
|
1490
1909
|
}
|
|
1491
1910
|
export declare class ReadableStreamBYOBReader {
|
|
1492
1911
|
constructor(stream: ReadableStream);
|
|
1493
1912
|
get closed(): Promise<void>;
|
|
1494
1913
|
cancel(reason?: any): Promise<void>;
|
|
1914
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1495
1915
|
read<T extends ArrayBufferView>(
|
|
1496
|
-
view: T
|
|
1916
|
+
view: T,
|
|
1497
1917
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1918
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1498
1919
|
releaseLock(): void;
|
|
1499
1920
|
readAtLeast<T extends ArrayBufferView>(
|
|
1500
1921
|
minElements: number,
|
|
1501
|
-
view: T
|
|
1922
|
+
view: T,
|
|
1502
1923
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1503
1924
|
}
|
|
1925
|
+
export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1926
|
+
min?: number;
|
|
1927
|
+
}
|
|
1504
1928
|
export interface ReadableStreamGetReaderOptions {
|
|
1929
|
+
/**
|
|
1930
|
+
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
|
1931
|
+
*
|
|
1932
|
+
* 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.
|
|
1933
|
+
*/
|
|
1505
1934
|
mode: "byob";
|
|
1506
1935
|
}
|
|
1936
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
1507
1937
|
export interface ReadableStreamBYOBRequest {
|
|
1508
|
-
|
|
1938
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1939
|
+
get view(): Uint8Array | null;
|
|
1940
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1509
1941
|
respond(bytesWritten: number): void;
|
|
1942
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1510
1943
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1511
|
-
|
|
1944
|
+
get atLeast(): number | null;
|
|
1512
1945
|
}
|
|
1946
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
1513
1947
|
export interface ReadableStreamDefaultController<R = any> {
|
|
1514
|
-
|
|
1948
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1949
|
+
get desiredSize(): number | null;
|
|
1950
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1515
1951
|
close(): void;
|
|
1952
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1516
1953
|
enqueue(chunk?: R): void;
|
|
1954
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1517
1955
|
error(reason: any): void;
|
|
1518
1956
|
}
|
|
1957
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
1519
1958
|
export interface ReadableByteStreamController {
|
|
1520
|
-
|
|
1521
|
-
|
|
1959
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1960
|
+
get byobRequest(): ReadableStreamBYOBRequest | null;
|
|
1961
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1962
|
+
get desiredSize(): number | null;
|
|
1963
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1522
1964
|
close(): void;
|
|
1965
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1523
1966
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1967
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1524
1968
|
error(reason: any): void;
|
|
1525
1969
|
}
|
|
1526
|
-
/**
|
|
1970
|
+
/**
|
|
1971
|
+
* 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.
|
|
1972
|
+
*
|
|
1973
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
1974
|
+
*/
|
|
1527
1975
|
export interface WritableStreamDefaultController {
|
|
1528
|
-
|
|
1976
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1977
|
+
get signal(): AbortSignal;
|
|
1978
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1529
1979
|
error(reason?: any): void;
|
|
1530
1980
|
}
|
|
1981
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
1531
1982
|
export interface TransformStreamDefaultController<O = any> {
|
|
1983
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1532
1984
|
get desiredSize(): number | null;
|
|
1985
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
1533
1986
|
enqueue(chunk?: O): void;
|
|
1987
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
1534
1988
|
error(reason: any): void;
|
|
1989
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
1535
1990
|
terminate(): void;
|
|
1536
1991
|
}
|
|
1537
1992
|
export interface ReadableWritablePair<R = any, W = any> {
|
|
@@ -1546,36 +2001,49 @@ export interface ReadableWritablePair<R = any, W = any> {
|
|
|
1546
2001
|
export declare class WritableStream<W = any> {
|
|
1547
2002
|
constructor(
|
|
1548
2003
|
underlyingSink?: UnderlyingSink,
|
|
1549
|
-
queuingStrategy?: QueuingStrategy
|
|
2004
|
+
queuingStrategy?: QueuingStrategy,
|
|
1550
2005
|
);
|
|
2006
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
1551
2007
|
get locked(): boolean;
|
|
2008
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
1552
2009
|
abort(reason?: any): Promise<void>;
|
|
2010
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
1553
2011
|
close(): Promise<void>;
|
|
2012
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
1554
2013
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
1555
2014
|
}
|
|
1556
2015
|
export declare class WritableStreamDefaultWriter<W = any> {
|
|
1557
2016
|
constructor(stream: WritableStream);
|
|
2017
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
1558
2018
|
get closed(): Promise<void>;
|
|
2019
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
1559
2020
|
get ready(): Promise<void>;
|
|
2021
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
1560
2022
|
get desiredSize(): number | null;
|
|
2023
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
1561
2024
|
abort(reason?: any): Promise<void>;
|
|
2025
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
1562
2026
|
close(): Promise<void>;
|
|
2027
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
1563
2028
|
write(chunk?: W): Promise<void>;
|
|
2029
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
1564
2030
|
releaseLock(): void;
|
|
1565
2031
|
}
|
|
1566
2032
|
export declare class TransformStream<I = any, O = any> {
|
|
1567
2033
|
constructor(
|
|
1568
2034
|
transformer?: Transformer<I, O>,
|
|
1569
2035
|
writableStrategy?: QueuingStrategy<I>,
|
|
1570
|
-
readableStrategy?: QueuingStrategy<O
|
|
2036
|
+
readableStrategy?: QueuingStrategy<O>,
|
|
1571
2037
|
);
|
|
2038
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
1572
2039
|
get readable(): ReadableStream<O>;
|
|
2040
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
1573
2041
|
get writable(): WritableStream<I>;
|
|
1574
2042
|
}
|
|
1575
2043
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
1576
2044
|
constructor(
|
|
1577
2045
|
expectedLength: number | bigint,
|
|
1578
|
-
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
2046
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
1579
2047
|
);
|
|
1580
2048
|
}
|
|
1581
2049
|
export declare class IdentityTransformStream extends TransformStream<
|
|
@@ -1607,26 +2075,35 @@ export declare class TextEncoderStream extends TransformStream<
|
|
|
1607
2075
|
Uint8Array
|
|
1608
2076
|
> {
|
|
1609
2077
|
constructor();
|
|
2078
|
+
get encoding(): string;
|
|
1610
2079
|
}
|
|
1611
2080
|
export declare class TextDecoderStream extends TransformStream<
|
|
1612
2081
|
ArrayBuffer | ArrayBufferView,
|
|
1613
2082
|
string
|
|
1614
2083
|
> {
|
|
1615
2084
|
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
2085
|
+
get encoding(): string;
|
|
2086
|
+
get fatal(): boolean;
|
|
2087
|
+
get ignoreBOM(): boolean;
|
|
1616
2088
|
}
|
|
1617
2089
|
export interface TextDecoderStreamTextDecoderStreamInit {
|
|
1618
2090
|
fatal?: boolean;
|
|
2091
|
+
ignoreBOM?: boolean;
|
|
1619
2092
|
}
|
|
1620
2093
|
export declare class ByteLengthQueuingStrategy
|
|
1621
2094
|
implements QueuingStrategy<ArrayBufferView>
|
|
1622
2095
|
{
|
|
1623
2096
|
constructor(init: QueuingStrategyInit);
|
|
2097
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
1624
2098
|
get highWaterMark(): number;
|
|
2099
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
1625
2100
|
get size(): (chunk?: any) => number;
|
|
1626
2101
|
}
|
|
1627
2102
|
export declare class CountQueuingStrategy implements QueuingStrategy {
|
|
1628
2103
|
constructor(init: QueuingStrategyInit);
|
|
2104
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
1629
2105
|
get highWaterMark(): number;
|
|
2106
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
1630
2107
|
get size(): (chunk?: any) => number;
|
|
1631
2108
|
}
|
|
1632
2109
|
export interface QueuingStrategyInit {
|
|
@@ -1637,6 +2114,11 @@ export interface QueuingStrategyInit {
|
|
|
1637
2114
|
*/
|
|
1638
2115
|
highWaterMark: number;
|
|
1639
2116
|
}
|
|
2117
|
+
export interface ScriptVersion {
|
|
2118
|
+
id?: string;
|
|
2119
|
+
tag?: string;
|
|
2120
|
+
message?: string;
|
|
2121
|
+
}
|
|
1640
2122
|
export declare abstract class TailEvent extends ExtendableEvent {
|
|
1641
2123
|
readonly events: TraceItem[];
|
|
1642
2124
|
readonly traces: TraceItem[];
|
|
@@ -1645,17 +2127,23 @@ export interface TraceItem {
|
|
|
1645
2127
|
readonly event:
|
|
1646
2128
|
| (
|
|
1647
2129
|
| TraceItemFetchEventInfo
|
|
2130
|
+
| TraceItemJsRpcEventInfo
|
|
1648
2131
|
| TraceItemScheduledEventInfo
|
|
1649
2132
|
| TraceItemAlarmEventInfo
|
|
1650
2133
|
| TraceItemQueueEventInfo
|
|
1651
2134
|
| TraceItemEmailEventInfo
|
|
2135
|
+
| TraceItemTailEventInfo
|
|
1652
2136
|
| TraceItemCustomEventInfo
|
|
2137
|
+
| TraceItemHibernatableWebSocketEventInfo
|
|
1653
2138
|
)
|
|
1654
2139
|
| null;
|
|
1655
2140
|
readonly eventTimestamp: number | null;
|
|
1656
2141
|
readonly logs: TraceLog[];
|
|
1657
2142
|
readonly exceptions: TraceException[];
|
|
2143
|
+
readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
|
|
1658
2144
|
readonly scriptName: string | null;
|
|
2145
|
+
readonly entrypoint?: string;
|
|
2146
|
+
readonly scriptVersion?: ScriptVersion;
|
|
1659
2147
|
readonly dispatchNamespace?: string;
|
|
1660
2148
|
readonly scriptTags?: string[];
|
|
1661
2149
|
readonly outcome: string;
|
|
@@ -1677,6 +2165,12 @@ export interface TraceItemEmailEventInfo {
|
|
|
1677
2165
|
readonly rcptTo: string;
|
|
1678
2166
|
readonly rawSize: number;
|
|
1679
2167
|
}
|
|
2168
|
+
export interface TraceItemTailEventInfo {
|
|
2169
|
+
readonly consumedEvents: TraceItemTailEventInfoTailItem[];
|
|
2170
|
+
}
|
|
2171
|
+
export interface TraceItemTailEventInfoTailItem {
|
|
2172
|
+
readonly scriptName: string | null;
|
|
2173
|
+
}
|
|
1680
2174
|
export interface TraceItemFetchEventInfo {
|
|
1681
2175
|
readonly response?: TraceItemFetchEventInfoResponse;
|
|
1682
2176
|
readonly request: TraceItemFetchEventInfoRequest;
|
|
@@ -1691,6 +2185,26 @@ export interface TraceItemFetchEventInfoRequest {
|
|
|
1691
2185
|
export interface TraceItemFetchEventInfoResponse {
|
|
1692
2186
|
readonly status: number;
|
|
1693
2187
|
}
|
|
2188
|
+
export interface TraceItemJsRpcEventInfo {
|
|
2189
|
+
readonly rpcMethod: string;
|
|
2190
|
+
}
|
|
2191
|
+
export interface TraceItemHibernatableWebSocketEventInfo {
|
|
2192
|
+
readonly getWebSocketEvent:
|
|
2193
|
+
| TraceItemHibernatableWebSocketEventInfoMessage
|
|
2194
|
+
| TraceItemHibernatableWebSocketEventInfoClose
|
|
2195
|
+
| TraceItemHibernatableWebSocketEventInfoError;
|
|
2196
|
+
}
|
|
2197
|
+
export interface TraceItemHibernatableWebSocketEventInfoMessage {
|
|
2198
|
+
readonly webSocketEventType: string;
|
|
2199
|
+
}
|
|
2200
|
+
export interface TraceItemHibernatableWebSocketEventInfoClose {
|
|
2201
|
+
readonly webSocketEventType: string;
|
|
2202
|
+
readonly code: number;
|
|
2203
|
+
readonly wasClean: boolean;
|
|
2204
|
+
}
|
|
2205
|
+
export interface TraceItemHibernatableWebSocketEventInfoError {
|
|
2206
|
+
readonly webSocketEventType: string;
|
|
2207
|
+
}
|
|
1694
2208
|
export interface TraceLog {
|
|
1695
2209
|
readonly timestamp: number;
|
|
1696
2210
|
readonly level: string;
|
|
@@ -1700,6 +2214,12 @@ export interface TraceException {
|
|
|
1700
2214
|
readonly timestamp: number;
|
|
1701
2215
|
readonly message: string;
|
|
1702
2216
|
readonly name: string;
|
|
2217
|
+
readonly stack?: string;
|
|
2218
|
+
}
|
|
2219
|
+
export interface TraceDiagnosticChannelEvent {
|
|
2220
|
+
readonly timestamp: number;
|
|
2221
|
+
readonly channel: string;
|
|
2222
|
+
readonly message: any;
|
|
1703
2223
|
}
|
|
1704
2224
|
export interface TraceMetrics {
|
|
1705
2225
|
readonly cpuTime: number;
|
|
@@ -1710,29 +2230,52 @@ export interface UnsafeTraceMetrics {
|
|
|
1710
2230
|
}
|
|
1711
2231
|
export declare class URL {
|
|
1712
2232
|
constructor(url: string | URL, base?: string | URL);
|
|
2233
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
1713
2234
|
get href(): string;
|
|
2235
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
1714
2236
|
set href(value: string);
|
|
2237
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
1715
2238
|
get origin(): string;
|
|
2239
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
1716
2240
|
get protocol(): string;
|
|
2241
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
1717
2242
|
set protocol(value: string);
|
|
2243
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
1718
2244
|
get username(): string;
|
|
2245
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
1719
2246
|
set username(value: string);
|
|
2247
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
1720
2248
|
get password(): string;
|
|
2249
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
1721
2250
|
set password(value: string);
|
|
2251
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
1722
2252
|
get host(): string;
|
|
2253
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
1723
2254
|
set host(value: string);
|
|
2255
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
1724
2256
|
get hostname(): string;
|
|
2257
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
1725
2258
|
set hostname(value: string);
|
|
2259
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
1726
2260
|
get port(): string;
|
|
2261
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
1727
2262
|
set port(value: string);
|
|
2263
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
1728
2264
|
get pathname(): string;
|
|
2265
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
1729
2266
|
set pathname(value: string);
|
|
2267
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
1730
2268
|
get search(): string;
|
|
2269
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
1731
2270
|
set search(value: string);
|
|
2271
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
1732
2272
|
get searchParams(): URLSearchParams;
|
|
2273
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
1733
2274
|
get hash(): string;
|
|
2275
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
1734
2276
|
set hash(value: string);
|
|
1735
2277
|
toString(): string;
|
|
2278
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
1736
2279
|
toJSON(): string;
|
|
1737
2280
|
}
|
|
1738
2281
|
export declare class URLSearchParams {
|
|
@@ -1741,7 +2284,7 @@ export declare class URLSearchParams {
|
|
|
1741
2284
|
| URLSearchParams
|
|
1742
2285
|
| string
|
|
1743
2286
|
| Record<string, string>
|
|
1744
|
-
| [key: string, value: string][]
|
|
2287
|
+
| [key: string, value: string][],
|
|
1745
2288
|
);
|
|
1746
2289
|
get size(): number;
|
|
1747
2290
|
append(name: string, value: string): void;
|
|
@@ -1751,23 +2294,30 @@ export declare class URLSearchParams {
|
|
|
1751
2294
|
has(name: string): boolean;
|
|
1752
2295
|
set(name: string, value: string): void;
|
|
1753
2296
|
sort(): void;
|
|
2297
|
+
/** Returns an array of key, value pairs for every entry in the search params. */
|
|
1754
2298
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2299
|
+
/** Returns a list of keys in the search params. */
|
|
1755
2300
|
keys(): IterableIterator<string>;
|
|
2301
|
+
/** Returns a list of values in the search params. */
|
|
1756
2302
|
values(): IterableIterator<string>;
|
|
1757
2303
|
forEach<This = unknown>(
|
|
1758
2304
|
callback: (
|
|
1759
2305
|
this: This,
|
|
1760
2306
|
value: string,
|
|
1761
2307
|
key: string,
|
|
1762
|
-
parent: URLSearchParams
|
|
2308
|
+
parent: URLSearchParams,
|
|
1763
2309
|
) => void,
|
|
1764
|
-
thisArg?: This
|
|
2310
|
+
thisArg?: This,
|
|
1765
2311
|
): void;
|
|
1766
2312
|
toString(): string;
|
|
1767
2313
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1768
2314
|
}
|
|
1769
2315
|
export declare class URLPattern {
|
|
1770
|
-
constructor(
|
|
2316
|
+
constructor(
|
|
2317
|
+
input?: string | URLPatternURLPatternInit,
|
|
2318
|
+
baseURL?: string,
|
|
2319
|
+
patternOptions?: URLPatternURLPatternOptions,
|
|
2320
|
+
);
|
|
1771
2321
|
get protocol(): string;
|
|
1772
2322
|
get username(): string;
|
|
1773
2323
|
get password(): string;
|
|
@@ -1779,7 +2329,7 @@ export declare class URLPattern {
|
|
|
1779
2329
|
test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean;
|
|
1780
2330
|
exec(
|
|
1781
2331
|
input?: string | URLPatternURLPatternInit,
|
|
1782
|
-
baseURL?: string
|
|
2332
|
+
baseURL?: string,
|
|
1783
2333
|
): URLPatternURLPatternResult | null;
|
|
1784
2334
|
}
|
|
1785
2335
|
export interface URLPatternURLPatternInit {
|
|
@@ -1808,13 +2358,28 @@ export interface URLPatternURLPatternResult {
|
|
|
1808
2358
|
search: URLPatternURLPatternComponentResult;
|
|
1809
2359
|
hash: URLPatternURLPatternComponentResult;
|
|
1810
2360
|
}
|
|
2361
|
+
export interface URLPatternURLPatternOptions {
|
|
2362
|
+
ignoreCase?: boolean;
|
|
2363
|
+
}
|
|
1811
2364
|
export declare class CloseEvent extends Event {
|
|
1812
|
-
constructor(type: string, initializer
|
|
1813
|
-
/**
|
|
2365
|
+
constructor(type: string, initializer?: CloseEventInit);
|
|
2366
|
+
/**
|
|
2367
|
+
* Returns the WebSocket connection close code provided by the server.
|
|
2368
|
+
*
|
|
2369
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
|
|
2370
|
+
*/
|
|
1814
2371
|
readonly code: number;
|
|
1815
|
-
/**
|
|
2372
|
+
/**
|
|
2373
|
+
* Returns the WebSocket connection close reason provided by the server.
|
|
2374
|
+
*
|
|
2375
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
|
|
2376
|
+
*/
|
|
1816
2377
|
readonly reason: string;
|
|
1817
|
-
/**
|
|
2378
|
+
/**
|
|
2379
|
+
* Returns true if the connection closed cleanly; false otherwise.
|
|
2380
|
+
*
|
|
2381
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
|
|
2382
|
+
*/
|
|
1818
2383
|
readonly wasClean: boolean;
|
|
1819
2384
|
}
|
|
1820
2385
|
export interface CloseEventInit {
|
|
@@ -1829,12 +2394,21 @@ export declare class MessageEvent extends Event {
|
|
|
1829
2394
|
export interface MessageEventInit {
|
|
1830
2395
|
data: ArrayBuffer | string;
|
|
1831
2396
|
}
|
|
1832
|
-
/**
|
|
2397
|
+
/**
|
|
2398
|
+
* Events providing information related to errors in scripts or in files.
|
|
2399
|
+
*
|
|
2400
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2401
|
+
*/
|
|
1833
2402
|
export interface ErrorEvent extends Event {
|
|
2403
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1834
2404
|
readonly filename: string;
|
|
2405
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1835
2406
|
readonly message: string;
|
|
2407
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1836
2408
|
readonly lineno: number;
|
|
2409
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1837
2410
|
readonly colno: number;
|
|
2411
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1838
2412
|
readonly error: any;
|
|
1839
2413
|
}
|
|
1840
2414
|
export type WebSocketEventMap = {
|
|
@@ -1846,17 +2420,51 @@ export type WebSocketEventMap = {
|
|
|
1846
2420
|
export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
1847
2421
|
constructor(url: string, protocols?: string[] | string);
|
|
1848
2422
|
accept(): void;
|
|
2423
|
+
/**
|
|
2424
|
+
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
2425
|
+
*
|
|
2426
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
2427
|
+
*/
|
|
1849
2428
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
2429
|
+
/**
|
|
2430
|
+
* Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
|
|
2431
|
+
*
|
|
2432
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
|
2433
|
+
*/
|
|
1850
2434
|
close(code?: number, reason?: string): void;
|
|
1851
2435
|
serializeAttachment(attachment: any): void;
|
|
1852
2436
|
deserializeAttachment(): any | null;
|
|
1853
2437
|
static readonly READY_STATE_CONNECTING: number;
|
|
2438
|
+
static readonly CONNECTING: number;
|
|
1854
2439
|
static readonly READY_STATE_OPEN: number;
|
|
2440
|
+
static readonly OPEN: number;
|
|
1855
2441
|
static readonly READY_STATE_CLOSING: number;
|
|
2442
|
+
static readonly CLOSING: number;
|
|
1856
2443
|
static readonly READY_STATE_CLOSED: number;
|
|
2444
|
+
static readonly CLOSED: number;
|
|
2445
|
+
/**
|
|
2446
|
+
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2447
|
+
*
|
|
2448
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2449
|
+
*/
|
|
1857
2450
|
get readyState(): number;
|
|
2451
|
+
/**
|
|
2452
|
+
* Returns the URL that was used to establish the WebSocket connection.
|
|
2453
|
+
*
|
|
2454
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2455
|
+
*/
|
|
1858
2456
|
get url(): string | null;
|
|
2457
|
+
/**
|
|
2458
|
+
* 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.
|
|
2459
|
+
*
|
|
2460
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2461
|
+
*/
|
|
1859
2462
|
get protocol(): string | null;
|
|
2463
|
+
/**
|
|
2464
|
+
* Returns the extensions selected by the server, if any.
|
|
2465
|
+
*
|
|
2466
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2467
|
+
*/
|
|
1860
2468
|
get extensions(): string | null;
|
|
1861
2469
|
}
|
|
1862
2470
|
export declare const WebSocketPair: {
|
|
@@ -1869,6 +2477,7 @@ export interface Socket {
|
|
|
1869
2477
|
get readable(): ReadableStream;
|
|
1870
2478
|
get writable(): WritableStream;
|
|
1871
2479
|
get closed(): Promise<void>;
|
|
2480
|
+
get opened(): Promise<SocketInfo>;
|
|
1872
2481
|
close(): Promise<void>;
|
|
1873
2482
|
startTls(options?: TlsOptions): Socket;
|
|
1874
2483
|
}
|
|
@@ -1883,6 +2492,519 @@ export interface SocketAddress {
|
|
|
1883
2492
|
export interface TlsOptions {
|
|
1884
2493
|
expectedServerHostname?: string;
|
|
1885
2494
|
}
|
|
2495
|
+
export interface SocketInfo {
|
|
2496
|
+
remoteAddress?: string;
|
|
2497
|
+
localAddress?: string;
|
|
2498
|
+
}
|
|
2499
|
+
export declare abstract class gpuGPUAdapter {
|
|
2500
|
+
requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
|
|
2501
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
|
|
2502
|
+
get features(): gpuGPUSupportedFeatures;
|
|
2503
|
+
get limits(): gpuGPUSupportedLimits;
|
|
2504
|
+
}
|
|
2505
|
+
export interface gpuGPUDevice extends EventTarget {
|
|
2506
|
+
createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
|
|
2507
|
+
createBindGroupLayout(
|
|
2508
|
+
descriptor: gpuGPUBindGroupLayoutDescriptor,
|
|
2509
|
+
): gpuGPUBindGroupLayout;
|
|
2510
|
+
createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
|
|
2511
|
+
createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
|
|
2512
|
+
createShaderModule(
|
|
2513
|
+
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2514
|
+
): gpuGPUShaderModule;
|
|
2515
|
+
createPipelineLayout(
|
|
2516
|
+
descriptor: gpuGPUPipelineLayoutDescriptor,
|
|
2517
|
+
): gpuGPUPipelineLayout;
|
|
2518
|
+
createComputePipeline(
|
|
2519
|
+
descriptor: gpuGPUComputePipelineDescriptor,
|
|
2520
|
+
): gpuGPUComputePipeline;
|
|
2521
|
+
createRenderPipeline(
|
|
2522
|
+
descriptor: gpuGPURenderPipelineDescriptor,
|
|
2523
|
+
): gpuGPURenderPipeline;
|
|
2524
|
+
createCommandEncoder(
|
|
2525
|
+
descriptor?: gpuGPUCommandEncoderDescriptor,
|
|
2526
|
+
): gpuGPUCommandEncoder;
|
|
2527
|
+
createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
|
|
2528
|
+
destroy(): void;
|
|
2529
|
+
createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
|
|
2530
|
+
pushErrorScope(filter: string): void;
|
|
2531
|
+
popErrorScope(): Promise<gpuGPUError | null>;
|
|
2532
|
+
get queue(): gpuGPUQueue;
|
|
2533
|
+
get lost(): Promise<gpuGPUDeviceLostInfo>;
|
|
2534
|
+
get features(): gpuGPUSupportedFeatures;
|
|
2535
|
+
get limits(): gpuGPUSupportedLimits;
|
|
2536
|
+
}
|
|
2537
|
+
export interface gpuGPUDeviceDescriptor {
|
|
2538
|
+
label?: string;
|
|
2539
|
+
requiredFeatures?: string[];
|
|
2540
|
+
requiredLimits?: Record<string, number | bigint>;
|
|
2541
|
+
defaultQueue?: gpuGPUQueueDescriptor;
|
|
2542
|
+
}
|
|
2543
|
+
export interface gpuGPUBufferDescriptor {
|
|
2544
|
+
label: string;
|
|
2545
|
+
size: number | bigint;
|
|
2546
|
+
usage: number;
|
|
2547
|
+
mappedAtCreation: boolean;
|
|
2548
|
+
}
|
|
2549
|
+
export interface gpuGPUQueueDescriptor {
|
|
2550
|
+
label?: string;
|
|
2551
|
+
}
|
|
2552
|
+
export declare abstract class gpuGPUBufferUsage {
|
|
2553
|
+
static readonly MAP_READ: number;
|
|
2554
|
+
static readonly MAP_WRITE: number;
|
|
2555
|
+
static readonly COPY_SRC: number;
|
|
2556
|
+
static readonly COPY_DST: number;
|
|
2557
|
+
static readonly INDEX: number;
|
|
2558
|
+
static readonly VERTEX: number;
|
|
2559
|
+
static readonly UNIFORM: number;
|
|
2560
|
+
static readonly STORAGE: number;
|
|
2561
|
+
static readonly INDIRECT: number;
|
|
2562
|
+
static readonly QUERY_RESOLVE: number;
|
|
2563
|
+
}
|
|
2564
|
+
export interface gpuGPUBuffer {
|
|
2565
|
+
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2566
|
+
unmap(): void;
|
|
2567
|
+
destroy(): void;
|
|
2568
|
+
mapAsync(
|
|
2569
|
+
offset: number,
|
|
2570
|
+
size?: number | bigint,
|
|
2571
|
+
param3?: number | bigint,
|
|
2572
|
+
): Promise<void>;
|
|
2573
|
+
get size(): number | bigint;
|
|
2574
|
+
get usage(): number;
|
|
2575
|
+
get mapState(): string;
|
|
2576
|
+
}
|
|
2577
|
+
export declare abstract class gpuGPUShaderStage {
|
|
2578
|
+
static readonly VERTEX: number;
|
|
2579
|
+
static readonly FRAGMENT: number;
|
|
2580
|
+
static readonly COMPUTE: number;
|
|
2581
|
+
}
|
|
2582
|
+
export interface gpuGPUBindGroupLayoutDescriptor {
|
|
2583
|
+
label?: string;
|
|
2584
|
+
entries: gpuGPUBindGroupLayoutEntry[];
|
|
2585
|
+
}
|
|
2586
|
+
export interface gpuGPUBindGroupLayoutEntry {
|
|
2587
|
+
binding: number;
|
|
2588
|
+
visibility: number;
|
|
2589
|
+
buffer?: gpuGPUBufferBindingLayout;
|
|
2590
|
+
sampler?: gpuGPUSamplerBindingLayout;
|
|
2591
|
+
texture?: gpuGPUTextureBindingLayout;
|
|
2592
|
+
storageTexture?: gpuGPUStorageTextureBindingLayout;
|
|
2593
|
+
}
|
|
2594
|
+
export interface gpuGPUStorageTextureBindingLayout {
|
|
2595
|
+
access?: string;
|
|
2596
|
+
format: string;
|
|
2597
|
+
viewDimension?: string;
|
|
2598
|
+
}
|
|
2599
|
+
export interface gpuGPUTextureBindingLayout {
|
|
2600
|
+
sampleType?: string;
|
|
2601
|
+
viewDimension?: string;
|
|
2602
|
+
multisampled?: boolean;
|
|
2603
|
+
}
|
|
2604
|
+
export interface gpuGPUSamplerBindingLayout {
|
|
2605
|
+
type?: string;
|
|
2606
|
+
}
|
|
2607
|
+
export interface gpuGPUBufferBindingLayout {
|
|
2608
|
+
type?: string;
|
|
2609
|
+
hasDynamicOffset?: boolean;
|
|
2610
|
+
minBindingSize?: number | bigint;
|
|
2611
|
+
}
|
|
2612
|
+
export interface gpuGPUBindGroupLayout {}
|
|
2613
|
+
export interface gpuGPUBindGroup {}
|
|
2614
|
+
export interface gpuGPUBindGroupDescriptor {
|
|
2615
|
+
label?: string;
|
|
2616
|
+
layout: gpuGPUBindGroupLayout;
|
|
2617
|
+
entries: gpuGPUBindGroupEntry[];
|
|
2618
|
+
}
|
|
2619
|
+
export interface gpuGPUBindGroupEntry {
|
|
2620
|
+
binding: number;
|
|
2621
|
+
resource: gpuGPUBufferBinding | gpuGPUSampler;
|
|
2622
|
+
}
|
|
2623
|
+
export interface gpuGPUBufferBinding {
|
|
2624
|
+
buffer: gpuGPUBuffer;
|
|
2625
|
+
offset?: number | bigint;
|
|
2626
|
+
size?: number | bigint;
|
|
2627
|
+
}
|
|
2628
|
+
export interface gpuGPUSampler {}
|
|
2629
|
+
export interface gpuGPUSamplerDescriptor {
|
|
2630
|
+
label?: string;
|
|
2631
|
+
addressModeU?: string;
|
|
2632
|
+
addressModeV?: string;
|
|
2633
|
+
addressModeW?: string;
|
|
2634
|
+
magFilter?: string;
|
|
2635
|
+
minFilter?: string;
|
|
2636
|
+
mipmapFilter?: string;
|
|
2637
|
+
lodMinClamp?: number;
|
|
2638
|
+
lodMaxClamp?: number;
|
|
2639
|
+
compare: string;
|
|
2640
|
+
maxAnisotropy?: number;
|
|
2641
|
+
}
|
|
2642
|
+
export interface gpuGPUShaderModule {
|
|
2643
|
+
getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
|
|
2644
|
+
}
|
|
2645
|
+
export interface gpuGPUShaderModuleDescriptor {
|
|
2646
|
+
label?: string;
|
|
2647
|
+
code: string;
|
|
2648
|
+
}
|
|
2649
|
+
export interface gpuGPUPipelineLayout {}
|
|
2650
|
+
export interface gpuGPUPipelineLayoutDescriptor {
|
|
2651
|
+
label?: string;
|
|
2652
|
+
bindGroupLayouts: gpuGPUBindGroupLayout[];
|
|
2653
|
+
}
|
|
2654
|
+
export interface gpuGPUComputePipeline {
|
|
2655
|
+
getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
|
|
2656
|
+
}
|
|
2657
|
+
export interface gpuGPUComputePipelineDescriptor {
|
|
2658
|
+
label?: string;
|
|
2659
|
+
compute: gpuGPUProgrammableStage;
|
|
2660
|
+
layout: string | gpuGPUPipelineLayout;
|
|
2661
|
+
}
|
|
2662
|
+
export interface gpuGPUProgrammableStage {
|
|
2663
|
+
module: gpuGPUShaderModule;
|
|
2664
|
+
entryPoint: string;
|
|
2665
|
+
constants?: Record<string, number>;
|
|
2666
|
+
}
|
|
2667
|
+
export interface gpuGPUCommandEncoder {
|
|
2668
|
+
get label(): string;
|
|
2669
|
+
beginComputePass(
|
|
2670
|
+
descriptor?: gpuGPUComputePassDescriptor,
|
|
2671
|
+
): gpuGPUComputePassEncoder;
|
|
2672
|
+
beginRenderPass(
|
|
2673
|
+
descriptor: gpuGPURenderPassDescriptor,
|
|
2674
|
+
): gpuGPURenderPassEncoder;
|
|
2675
|
+
copyBufferToBuffer(
|
|
2676
|
+
source: gpuGPUBuffer,
|
|
2677
|
+
sourceOffset: number | bigint,
|
|
2678
|
+
destination: gpuGPUBuffer,
|
|
2679
|
+
destinationOffset: number | bigint,
|
|
2680
|
+
size: number | bigint,
|
|
2681
|
+
): void;
|
|
2682
|
+
finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
|
|
2683
|
+
copyTextureToBuffer(
|
|
2684
|
+
source: gpuGPUImageCopyTexture,
|
|
2685
|
+
destination: gpuGPUImageCopyBuffer,
|
|
2686
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2687
|
+
): void;
|
|
2688
|
+
copyBufferToTexture(
|
|
2689
|
+
source: gpuGPUImageCopyBuffer,
|
|
2690
|
+
destination: gpuGPUImageCopyTexture,
|
|
2691
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2692
|
+
): void;
|
|
2693
|
+
copyTextureToTexture(
|
|
2694
|
+
source: gpuGPUImageCopyTexture,
|
|
2695
|
+
destination: gpuGPUImageCopyTexture,
|
|
2696
|
+
copySize: Iterable<number> | gpuGPUExtent3DDict,
|
|
2697
|
+
): void;
|
|
2698
|
+
clearBuffer(
|
|
2699
|
+
buffer: gpuGPUBuffer,
|
|
2700
|
+
offset?: number | bigint,
|
|
2701
|
+
size?: number | bigint,
|
|
2702
|
+
): void;
|
|
2703
|
+
}
|
|
2704
|
+
export interface gpuGPUCommandEncoderDescriptor {
|
|
2705
|
+
label?: string;
|
|
2706
|
+
}
|
|
2707
|
+
export interface gpuGPUComputePassEncoder {
|
|
2708
|
+
setPipeline(pipeline: gpuGPUComputePipeline): void;
|
|
2709
|
+
setBindGroup(
|
|
2710
|
+
index: number,
|
|
2711
|
+
bindGroup: gpuGPUBindGroup | null,
|
|
2712
|
+
dynamicOffsets?: Iterable<number>,
|
|
2713
|
+
): void;
|
|
2714
|
+
dispatchWorkgroups(
|
|
2715
|
+
workgroupCountX: number,
|
|
2716
|
+
workgroupCountY?: number,
|
|
2717
|
+
workgroupCountZ?: number,
|
|
2718
|
+
): void;
|
|
2719
|
+
end(): void;
|
|
2720
|
+
}
|
|
2721
|
+
export interface gpuGPUComputePassDescriptor {
|
|
2722
|
+
label?: string;
|
|
2723
|
+
timestampWrites?: gpuGPUComputePassTimestampWrites;
|
|
2724
|
+
}
|
|
2725
|
+
export interface gpuGPUQuerySet {}
|
|
2726
|
+
export interface gpuGPUQuerySetDescriptor {
|
|
2727
|
+
label?: string;
|
|
2728
|
+
}
|
|
2729
|
+
export interface gpuGPUComputePassTimestampWrites {
|
|
2730
|
+
querySet: gpuGPUQuerySet;
|
|
2731
|
+
beginningOfPassWriteIndex?: number;
|
|
2732
|
+
endOfPassWriteIndex?: number;
|
|
2733
|
+
}
|
|
2734
|
+
export interface gpuGPUCommandBufferDescriptor {
|
|
2735
|
+
label?: string;
|
|
2736
|
+
}
|
|
2737
|
+
export interface gpuGPUCommandBuffer {}
|
|
2738
|
+
export interface gpuGPUQueue {
|
|
2739
|
+
submit(commandBuffers: gpuGPUCommandBuffer[]): void;
|
|
2740
|
+
writeBuffer(
|
|
2741
|
+
buffer: gpuGPUBuffer,
|
|
2742
|
+
bufferOffset: number | bigint,
|
|
2743
|
+
data: ArrayBuffer | ArrayBufferView,
|
|
2744
|
+
dataOffset?: number | bigint,
|
|
2745
|
+
size?: number | bigint,
|
|
2746
|
+
): void;
|
|
2747
|
+
}
|
|
2748
|
+
export declare abstract class gpuGPUMapMode {
|
|
2749
|
+
static readonly READ: number;
|
|
2750
|
+
static readonly WRITE: number;
|
|
2751
|
+
}
|
|
2752
|
+
export interface gpuGPUAdapterInfo {
|
|
2753
|
+
get vendor(): string;
|
|
2754
|
+
get architecture(): string;
|
|
2755
|
+
get device(): string;
|
|
2756
|
+
get description(): string;
|
|
2757
|
+
}
|
|
2758
|
+
export interface gpuGPUSupportedFeatures {
|
|
2759
|
+
has(name: string): boolean;
|
|
2760
|
+
keys(): string[];
|
|
2761
|
+
}
|
|
2762
|
+
export interface gpuGPUSupportedLimits {
|
|
2763
|
+
get maxTextureDimension1D(): number;
|
|
2764
|
+
get maxTextureDimension2D(): number;
|
|
2765
|
+
get maxTextureDimension3D(): number;
|
|
2766
|
+
get maxTextureArrayLayers(): number;
|
|
2767
|
+
get maxBindGroups(): number;
|
|
2768
|
+
get maxBindingsPerBindGroup(): number;
|
|
2769
|
+
get maxDynamicUniformBuffersPerPipelineLayout(): number;
|
|
2770
|
+
get maxDynamicStorageBuffersPerPipelineLayout(): number;
|
|
2771
|
+
get maxSampledTexturesPerShaderStage(): number;
|
|
2772
|
+
get maxSamplersPerShaderStage(): number;
|
|
2773
|
+
get maxStorageBuffersPerShaderStage(): number;
|
|
2774
|
+
get maxStorageTexturesPerShaderStage(): number;
|
|
2775
|
+
get maxUniformBuffersPerShaderStage(): number;
|
|
2776
|
+
get maxUniformBufferBindingSize(): number | bigint;
|
|
2777
|
+
get maxStorageBufferBindingSize(): number | bigint;
|
|
2778
|
+
get minUniformBufferOffsetAlignment(): number;
|
|
2779
|
+
get minStorageBufferOffsetAlignment(): number;
|
|
2780
|
+
get maxVertexBuffers(): number;
|
|
2781
|
+
get maxBufferSize(): number | bigint;
|
|
2782
|
+
get maxVertexAttributes(): number;
|
|
2783
|
+
get maxVertexBufferArrayStride(): number;
|
|
2784
|
+
get maxInterStageShaderComponents(): number;
|
|
2785
|
+
get maxInterStageShaderVariables(): number;
|
|
2786
|
+
get maxColorAttachments(): number;
|
|
2787
|
+
get maxColorAttachmentBytesPerSample(): number;
|
|
2788
|
+
get maxComputeWorkgroupStorageSize(): number;
|
|
2789
|
+
get maxComputeInvocationsPerWorkgroup(): number;
|
|
2790
|
+
get maxComputeWorkgroupSizeX(): number;
|
|
2791
|
+
get maxComputeWorkgroupSizeY(): number;
|
|
2792
|
+
get maxComputeWorkgroupSizeZ(): number;
|
|
2793
|
+
get maxComputeWorkgroupsPerDimension(): number;
|
|
2794
|
+
}
|
|
2795
|
+
export declare abstract class gpuGPUError {
|
|
2796
|
+
get message(): string;
|
|
2797
|
+
}
|
|
2798
|
+
export declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
|
|
2799
|
+
export declare abstract class gpuGPUInternalError extends gpuGPUError {}
|
|
2800
|
+
export declare abstract class gpuGPUValidationError extends gpuGPUError {}
|
|
2801
|
+
export declare abstract class gpuGPUDeviceLostInfo {
|
|
2802
|
+
get message(): string;
|
|
2803
|
+
get reason(): string;
|
|
2804
|
+
}
|
|
2805
|
+
export interface gpuGPUCompilationMessage {
|
|
2806
|
+
get message(): string;
|
|
2807
|
+
get type(): string;
|
|
2808
|
+
get lineNum(): number;
|
|
2809
|
+
get linePos(): number;
|
|
2810
|
+
get offset(): number;
|
|
2811
|
+
get length(): number;
|
|
2812
|
+
}
|
|
2813
|
+
export interface gpuGPUCompilationInfo {
|
|
2814
|
+
get messages(): gpuGPUCompilationMessage[];
|
|
2815
|
+
}
|
|
2816
|
+
export declare abstract class gpuGPUTextureUsage {
|
|
2817
|
+
static readonly COPY_SRC: number;
|
|
2818
|
+
static readonly COPY_DST: number;
|
|
2819
|
+
static readonly TEXTURE_BINDING: number;
|
|
2820
|
+
static readonly STORAGE_BINDING: number;
|
|
2821
|
+
static readonly RENDER_ATTACHMENT: number;
|
|
2822
|
+
}
|
|
2823
|
+
export interface gpuGPUTextureDescriptor {
|
|
2824
|
+
label: string;
|
|
2825
|
+
size: number[] | gpuGPUExtent3DDict;
|
|
2826
|
+
mipLevelCount?: number;
|
|
2827
|
+
sampleCount?: number;
|
|
2828
|
+
dimension?: string;
|
|
2829
|
+
format: string;
|
|
2830
|
+
usage: number;
|
|
2831
|
+
viewFormats?: string[];
|
|
2832
|
+
}
|
|
2833
|
+
export interface gpuGPUExtent3DDict {
|
|
2834
|
+
width: number;
|
|
2835
|
+
height?: number;
|
|
2836
|
+
depthOrArrayLayers?: number;
|
|
2837
|
+
}
|
|
2838
|
+
export interface gpuGPUTexture {
|
|
2839
|
+
createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
|
|
2840
|
+
destroy(): void;
|
|
2841
|
+
get width(): number;
|
|
2842
|
+
get height(): number;
|
|
2843
|
+
get depthOrArrayLayers(): number;
|
|
2844
|
+
get mipLevelCount(): number;
|
|
2845
|
+
get dimension(): string;
|
|
2846
|
+
get format(): string;
|
|
2847
|
+
get usage(): number;
|
|
2848
|
+
}
|
|
2849
|
+
export interface gpuGPUTextureView {}
|
|
2850
|
+
export interface gpuGPUTextureViewDescriptor {
|
|
2851
|
+
label: string;
|
|
2852
|
+
format: string;
|
|
2853
|
+
dimension: string;
|
|
2854
|
+
aspect?: string;
|
|
2855
|
+
baseMipLevel?: number;
|
|
2856
|
+
mipLevelCount: number;
|
|
2857
|
+
baseArrayLayer?: number;
|
|
2858
|
+
arrayLayerCount: number;
|
|
2859
|
+
}
|
|
2860
|
+
export declare abstract class gpuGPUColorWrite {
|
|
2861
|
+
static readonly RED: number;
|
|
2862
|
+
static readonly GREEN: number;
|
|
2863
|
+
static readonly BLUE: number;
|
|
2864
|
+
static readonly ALPHA: number;
|
|
2865
|
+
static readonly ALL: number;
|
|
2866
|
+
}
|
|
2867
|
+
export interface gpuGPURenderPipeline {}
|
|
2868
|
+
export interface gpuGPURenderPipelineDescriptor {
|
|
2869
|
+
label?: string;
|
|
2870
|
+
layout: string | gpuGPUPipelineLayout;
|
|
2871
|
+
vertex: gpuGPUVertexState;
|
|
2872
|
+
primitive?: gpuGPUPrimitiveState;
|
|
2873
|
+
depthStencil?: gpuGPUDepthStencilState;
|
|
2874
|
+
multisample?: gpuGPUMultisampleState;
|
|
2875
|
+
fragment?: gpuGPUFragmentState;
|
|
2876
|
+
}
|
|
2877
|
+
export interface gpuGPUVertexState {
|
|
2878
|
+
module: gpuGPUShaderModule;
|
|
2879
|
+
entryPoint: string;
|
|
2880
|
+
constants?: Record<string, number>;
|
|
2881
|
+
buffers?: gpuGPUVertexBufferLayout[];
|
|
2882
|
+
}
|
|
2883
|
+
export interface gpuGPUVertexBufferLayout {
|
|
2884
|
+
arrayStride: number | bigint;
|
|
2885
|
+
stepMode?: string;
|
|
2886
|
+
attributes: gpuGPUVertexAttribute[];
|
|
2887
|
+
}
|
|
2888
|
+
export interface gpuGPUVertexAttribute {
|
|
2889
|
+
format: string;
|
|
2890
|
+
offset: number | bigint;
|
|
2891
|
+
shaderLocation: number;
|
|
2892
|
+
}
|
|
2893
|
+
export interface gpuGPUPrimitiveState {
|
|
2894
|
+
topology?: string;
|
|
2895
|
+
stripIndexFormat?: string;
|
|
2896
|
+
frontFace?: string;
|
|
2897
|
+
cullMode?: string;
|
|
2898
|
+
unclippedDepth?: boolean;
|
|
2899
|
+
}
|
|
2900
|
+
export interface gpuGPUStencilFaceState {
|
|
2901
|
+
compare?: string;
|
|
2902
|
+
failOp?: string;
|
|
2903
|
+
depthFailOp?: string;
|
|
2904
|
+
passOp?: string;
|
|
2905
|
+
}
|
|
2906
|
+
export interface gpuGPUDepthStencilState {
|
|
2907
|
+
format: string;
|
|
2908
|
+
depthWriteEnabled: boolean;
|
|
2909
|
+
depthCompare: string;
|
|
2910
|
+
stencilFront?: gpuGPUStencilFaceState;
|
|
2911
|
+
stencilBack?: gpuGPUStencilFaceState;
|
|
2912
|
+
stencilReadMask?: number;
|
|
2913
|
+
stencilWriteMask?: number;
|
|
2914
|
+
depthBias?: number;
|
|
2915
|
+
depthBiasSlopeScale?: number;
|
|
2916
|
+
depthBiasClamp?: number;
|
|
2917
|
+
}
|
|
2918
|
+
export interface gpuGPUMultisampleState {
|
|
2919
|
+
count?: number;
|
|
2920
|
+
mask?: number;
|
|
2921
|
+
alphaToCoverageEnabled?: boolean;
|
|
2922
|
+
}
|
|
2923
|
+
export interface gpuGPUFragmentState {
|
|
2924
|
+
module: gpuGPUShaderModule;
|
|
2925
|
+
entryPoint: string;
|
|
2926
|
+
constants?: Record<string, number>;
|
|
2927
|
+
targets: gpuGPUColorTargetState[];
|
|
2928
|
+
}
|
|
2929
|
+
export interface gpuGPUColorTargetState {
|
|
2930
|
+
format: string;
|
|
2931
|
+
blend: gpuGPUBlendState;
|
|
2932
|
+
writeMask?: number;
|
|
2933
|
+
}
|
|
2934
|
+
export interface gpuGPUBlendState {
|
|
2935
|
+
color: gpuGPUBlendComponent;
|
|
2936
|
+
alpha: gpuGPUBlendComponent;
|
|
2937
|
+
}
|
|
2938
|
+
export interface gpuGPUBlendComponent {
|
|
2939
|
+
operation?: string;
|
|
2940
|
+
srcFactor?: string;
|
|
2941
|
+
dstFactor?: string;
|
|
2942
|
+
}
|
|
2943
|
+
export interface gpuGPURenderPassEncoder {
|
|
2944
|
+
setPipeline(pipeline: gpuGPURenderPipeline): void;
|
|
2945
|
+
draw(
|
|
2946
|
+
vertexCount: number,
|
|
2947
|
+
instanceCount?: number,
|
|
2948
|
+
firstVertex?: number,
|
|
2949
|
+
firstInstance?: number,
|
|
2950
|
+
): void;
|
|
2951
|
+
end(): void;
|
|
2952
|
+
}
|
|
2953
|
+
export interface gpuGPURenderPassDescriptor {
|
|
2954
|
+
label?: string;
|
|
2955
|
+
colorAttachments: gpuGPURenderPassColorAttachment[];
|
|
2956
|
+
depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
|
|
2957
|
+
occlusionQuerySet?: gpuGPUQuerySet;
|
|
2958
|
+
timestampWrites?: gpuGPURenderPassTimestampWrites;
|
|
2959
|
+
maxDrawCount?: number | bigint;
|
|
2960
|
+
}
|
|
2961
|
+
export interface gpuGPURenderPassColorAttachment {
|
|
2962
|
+
view: gpuGPUTextureView;
|
|
2963
|
+
depthSlice?: number;
|
|
2964
|
+
resolveTarget?: gpuGPUTextureView;
|
|
2965
|
+
clearValue?: number[] | gpuGPUColorDict;
|
|
2966
|
+
loadOp: string;
|
|
2967
|
+
storeOp: string;
|
|
2968
|
+
}
|
|
2969
|
+
export interface gpuGPUColorDict {
|
|
2970
|
+
r: number;
|
|
2971
|
+
g: number;
|
|
2972
|
+
b: number;
|
|
2973
|
+
a: number;
|
|
2974
|
+
}
|
|
2975
|
+
export interface gpuGPURenderPassDepthStencilAttachment {
|
|
2976
|
+
view: gpuGPUTextureView;
|
|
2977
|
+
depthClearValue?: number;
|
|
2978
|
+
depthLoadOp?: string;
|
|
2979
|
+
depthStoreOp?: string;
|
|
2980
|
+
depthReadOnly?: boolean;
|
|
2981
|
+
stencilClearValue?: number;
|
|
2982
|
+
stencilLoadOp?: string;
|
|
2983
|
+
stencilStoreOp?: string;
|
|
2984
|
+
stencilReadOnly?: boolean;
|
|
2985
|
+
}
|
|
2986
|
+
export interface gpuGPURenderPassTimestampWrites {
|
|
2987
|
+
querySet: gpuGPUQuerySet;
|
|
2988
|
+
beginningOfPassWriteIndex?: number;
|
|
2989
|
+
endOfPassWriteIndex?: number;
|
|
2990
|
+
}
|
|
2991
|
+
export interface gpuGPUImageCopyTexture {
|
|
2992
|
+
texture: gpuGPUTexture;
|
|
2993
|
+
mipLevel?: number;
|
|
2994
|
+
origin?: number[] | gpuGPUOrigin3DDict;
|
|
2995
|
+
aspect?: string;
|
|
2996
|
+
}
|
|
2997
|
+
export interface gpuGPUImageCopyBuffer {
|
|
2998
|
+
buffer: gpuGPUBuffer;
|
|
2999
|
+
offset?: number | bigint;
|
|
3000
|
+
bytesPerRow?: number;
|
|
3001
|
+
rowsPerImage?: number;
|
|
3002
|
+
}
|
|
3003
|
+
export interface gpuGPUOrigin3DDict {
|
|
3004
|
+
x?: number;
|
|
3005
|
+
y?: number;
|
|
3006
|
+
z?: number;
|
|
3007
|
+
}
|
|
1886
3008
|
export interface BasicImageTransformations {
|
|
1887
3009
|
/**
|
|
1888
3010
|
* Maximum width in image pixels. The value must be an integer.
|
|
@@ -2322,7 +3444,7 @@ export interface IncomingRequestCfPropertiesBotManagementEnterprise
|
|
|
2322
3444
|
};
|
|
2323
3445
|
}
|
|
2324
3446
|
export interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
|
|
2325
|
-
HostMetadata
|
|
3447
|
+
HostMetadata,
|
|
2326
3448
|
> {
|
|
2327
3449
|
/**
|
|
2328
3450
|
* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
|
|
@@ -2854,25 +3976,51 @@ export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
|
|
|
2854
3976
|
export type CfProperties<HostMetadata = unknown> =
|
|
2855
3977
|
| IncomingRequestCfProperties<HostMetadata>
|
|
2856
3978
|
| RequestInitCfProperties;
|
|
2857
|
-
export interface
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
3979
|
+
export interface D1Meta {
|
|
3980
|
+
duration: number;
|
|
3981
|
+
size_after: number;
|
|
3982
|
+
rows_read: number;
|
|
3983
|
+
rows_written: number;
|
|
3984
|
+
last_row_id: number;
|
|
3985
|
+
changed_db: boolean;
|
|
3986
|
+
changes: number;
|
|
3987
|
+
}
|
|
3988
|
+
export interface D1Response {
|
|
3989
|
+
success: true;
|
|
3990
|
+
meta: D1Meta & Record<string, unknown>;
|
|
3991
|
+
error?: never;
|
|
3992
|
+
}
|
|
3993
|
+
export type D1Result<T = unknown> = D1Response & {
|
|
3994
|
+
results: T[];
|
|
3995
|
+
};
|
|
3996
|
+
export interface D1ExecResult {
|
|
3997
|
+
count: number;
|
|
3998
|
+
duration: number;
|
|
2862
3999
|
}
|
|
2863
4000
|
export declare abstract class D1Database {
|
|
2864
4001
|
prepare(query: string): D1PreparedStatement;
|
|
2865
4002
|
dump(): Promise<ArrayBuffer>;
|
|
2866
4003
|
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
|
|
2867
|
-
exec
|
|
4004
|
+
exec(query: string): Promise<D1ExecResult>;
|
|
2868
4005
|
}
|
|
2869
4006
|
export declare abstract class D1PreparedStatement {
|
|
2870
|
-
bind(...values:
|
|
2871
|
-
first<T = unknown>(colName
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
4007
|
+
bind(...values: unknown[]): D1PreparedStatement;
|
|
4008
|
+
first<T = unknown>(colName: string): Promise<T | null>;
|
|
4009
|
+
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
4010
|
+
run(): Promise<D1Response>;
|
|
4011
|
+
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4012
|
+
raw<T = unknown[]>(options: {
|
|
4013
|
+
columnNames: true;
|
|
4014
|
+
}): Promise<[string[], ...T[]]>;
|
|
4015
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
4016
|
+
}
|
|
4017
|
+
// `Disposable` was added to TypeScript's standard lib types in version 5.2.
|
|
4018
|
+
// To support older TypeScript versions, define an empty `Disposable` interface.
|
|
4019
|
+
// Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
|
|
4020
|
+
// but this will ensure type checking on older versions still passes.
|
|
4021
|
+
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
4022
|
+
// ignored when `Disposable` is included in the standard lib.
|
|
4023
|
+
export interface Disposable {}
|
|
2876
4024
|
/**
|
|
2877
4025
|
* An email message that can be sent from a Worker.
|
|
2878
4026
|
*/
|
|
@@ -2893,7 +4041,7 @@ export interface ForwardableEmailMessage extends EmailMessage {
|
|
|
2893
4041
|
/**
|
|
2894
4042
|
* Stream of the email message content.
|
|
2895
4043
|
*/
|
|
2896
|
-
readonly raw: ReadableStream
|
|
4044
|
+
readonly raw: ReadableStream<Uint8Array>;
|
|
2897
4045
|
/**
|
|
2898
4046
|
* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
|
|
2899
4047
|
*/
|
|
@@ -2928,11 +4076,58 @@ export declare abstract class EmailEvent extends ExtendableEvent {
|
|
|
2928
4076
|
export type EmailExportedHandler<Env = unknown> = (
|
|
2929
4077
|
message: ForwardableEmailMessage,
|
|
2930
4078
|
env: Env,
|
|
2931
|
-
ctx: ExecutionContext
|
|
4079
|
+
ctx: ExecutionContext,
|
|
2932
4080
|
) => void | Promise<void>;
|
|
4081
|
+
export interface Hyperdrive {
|
|
4082
|
+
/**
|
|
4083
|
+
* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
|
|
4084
|
+
*
|
|
4085
|
+
* Calling this method returns an idential socket to if you call
|
|
4086
|
+
* `connect("host:port")` using the `host` and `port` fields from this object.
|
|
4087
|
+
* Pick whichever approach works better with your preferred DB client library.
|
|
4088
|
+
*
|
|
4089
|
+
* Note that this socket is not yet authenticated -- it's expected that your
|
|
4090
|
+
* code (or preferably, the client library of your choice) will authenticate
|
|
4091
|
+
* using the information in this class's readonly fields.
|
|
4092
|
+
*/
|
|
4093
|
+
connect(): Socket;
|
|
4094
|
+
/**
|
|
4095
|
+
* A valid DB connection string that can be passed straight into the typical
|
|
4096
|
+
* client library/driver/ORM. This will typically be the easiest way to use
|
|
4097
|
+
* Hyperdrive.
|
|
4098
|
+
*/
|
|
4099
|
+
readonly connectionString: string;
|
|
4100
|
+
/*
|
|
4101
|
+
* A randomly generated hostname that is only valid within the context of the
|
|
4102
|
+
* currently running Worker which, when passed into `connect()` function from
|
|
4103
|
+
* the "cloudflare:sockets" module, will connect to the Hyperdrive instance
|
|
4104
|
+
* for your database.
|
|
4105
|
+
*/
|
|
4106
|
+
readonly host: string;
|
|
4107
|
+
/*
|
|
4108
|
+
* The port that must be paired the the host field when connecting.
|
|
4109
|
+
*/
|
|
4110
|
+
readonly port: number;
|
|
4111
|
+
/*
|
|
4112
|
+
* The username to use when authenticating to your database via Hyperdrive.
|
|
4113
|
+
* Unlike the host and password, this will be the same every time
|
|
4114
|
+
*/
|
|
4115
|
+
readonly user: string;
|
|
4116
|
+
/*
|
|
4117
|
+
* The randomly generated password to use when authenticating to your
|
|
4118
|
+
* database via Hyperdrive. Like the host field, this password is only valid
|
|
4119
|
+
* within the context of the currently running Worker instance from which
|
|
4120
|
+
* it's read.
|
|
4121
|
+
*/
|
|
4122
|
+
readonly password: string;
|
|
4123
|
+
/*
|
|
4124
|
+
* The name of the database to connect to.
|
|
4125
|
+
*/
|
|
4126
|
+
readonly database: string;
|
|
4127
|
+
}
|
|
2933
4128
|
export type Params<P extends string = any> = Record<P, string | string[]>;
|
|
2934
4129
|
export type EventContext<Env, P extends string, Data> = {
|
|
2935
|
-
request: Request
|
|
4130
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
2936
4131
|
functionPath: string;
|
|
2937
4132
|
waitUntil: (promise: Promise<any>) => void;
|
|
2938
4133
|
passThroughOnException: () => void;
|
|
@@ -2948,10 +4143,10 @@ export type EventContext<Env, P extends string, Data> = {
|
|
|
2948
4143
|
export type PagesFunction<
|
|
2949
4144
|
Env = unknown,
|
|
2950
4145
|
Params extends string = any,
|
|
2951
|
-
Data extends Record<string, unknown> = Record<string, unknown
|
|
4146
|
+
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
2952
4147
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
2953
4148
|
export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
2954
|
-
request: Request
|
|
4149
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
2955
4150
|
functionPath: string;
|
|
2956
4151
|
waitUntil: (promise: Promise<any>) => void;
|
|
2957
4152
|
passThroughOnException: () => void;
|
|
@@ -2969,14 +4164,14 @@ export type PagesPluginFunction<
|
|
|
2969
4164
|
Env = unknown,
|
|
2970
4165
|
Params extends string = any,
|
|
2971
4166
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
2972
|
-
PluginArgs = unknown
|
|
4167
|
+
PluginArgs = unknown,
|
|
2973
4168
|
> = (
|
|
2974
|
-
context: EventPluginContext<Env, Params, Data, PluginArgs
|
|
4169
|
+
context: EventPluginContext<Env, Params, Data, PluginArgs>,
|
|
2975
4170
|
) => Response | Promise<Response>;
|
|
2976
|
-
// https://developers.cloudflare.com/pub-sub/
|
|
2977
4171
|
// PubSubMessage represents an incoming PubSub message.
|
|
2978
4172
|
// The message includes metadata about the broker, the client, and the payload
|
|
2979
4173
|
// itself.
|
|
4174
|
+
// https://developers.cloudflare.com/pub-sub/
|
|
2980
4175
|
export interface PubSubMessage {
|
|
2981
4176
|
// Message ID
|
|
2982
4177
|
readonly mid: number;
|
|
@@ -3007,7 +4202,320 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
|
|
|
3007
4202
|
// Key Identifier of the JWK
|
|
3008
4203
|
readonly kid: string;
|
|
3009
4204
|
}
|
|
3010
|
-
//
|
|
4205
|
+
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4206
|
+
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4207
|
+
// strips all `module` blocks.
|
|
4208
|
+
export declare namespace Rpc {
|
|
4209
|
+
// Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
|
|
4210
|
+
// TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
|
|
4211
|
+
// For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
|
|
4212
|
+
// accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
|
|
4213
|
+
export const __RPC_STUB_BRAND: "__RPC_STUB_BRAND";
|
|
4214
|
+
export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
|
|
4215
|
+
export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
|
|
4216
|
+
export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
|
|
4217
|
+
export interface RpcTargetBranded {
|
|
4218
|
+
[__RPC_TARGET_BRAND]: never;
|
|
4219
|
+
}
|
|
4220
|
+
export interface WorkerEntrypointBranded {
|
|
4221
|
+
[__WORKER_ENTRYPOINT_BRAND]: never;
|
|
4222
|
+
}
|
|
4223
|
+
export interface DurableObjectBranded {
|
|
4224
|
+
[__DURABLE_OBJECT_BRAND]: never;
|
|
4225
|
+
}
|
|
4226
|
+
export type EntrypointBranded =
|
|
4227
|
+
| WorkerEntrypointBranded
|
|
4228
|
+
| DurableObjectBranded;
|
|
4229
|
+
// Types that can be used through `Stub`s
|
|
4230
|
+
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
4231
|
+
// Types that can be passed over RPC
|
|
4232
|
+
type Serializable =
|
|
4233
|
+
// Structured cloneables
|
|
4234
|
+
| void
|
|
4235
|
+
| undefined
|
|
4236
|
+
| null
|
|
4237
|
+
| boolean
|
|
4238
|
+
| number
|
|
4239
|
+
| bigint
|
|
4240
|
+
| string
|
|
4241
|
+
| TypedArray
|
|
4242
|
+
| ArrayBuffer
|
|
4243
|
+
| DataView
|
|
4244
|
+
| Date
|
|
4245
|
+
| Error
|
|
4246
|
+
| RegExp
|
|
4247
|
+
// Structured cloneable composites
|
|
4248
|
+
| Map<Serializable, Serializable>
|
|
4249
|
+
| Set<Serializable>
|
|
4250
|
+
| ReadonlyArray<Serializable>
|
|
4251
|
+
| {
|
|
4252
|
+
[key: string | number]: Serializable;
|
|
4253
|
+
}
|
|
4254
|
+
// Special types
|
|
4255
|
+
| ReadableStream<Uint8Array>
|
|
4256
|
+
| WritableStream<Uint8Array>
|
|
4257
|
+
| Request
|
|
4258
|
+
| Response
|
|
4259
|
+
| Headers
|
|
4260
|
+
| Stub<Stubable>
|
|
4261
|
+
// Serialized as stubs, see `Stubify`
|
|
4262
|
+
| Stubable;
|
|
4263
|
+
// Base type for all RPC stubs, including common memory management methods.
|
|
4264
|
+
// `T` is used as a marker type for unwrapping `Stub`s later.
|
|
4265
|
+
interface StubBase<T extends Stubable> extends Disposable {
|
|
4266
|
+
[__RPC_STUB_BRAND]: T;
|
|
4267
|
+
dup(): this;
|
|
4268
|
+
}
|
|
4269
|
+
export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
|
|
4270
|
+
// Recursively rewrite all `Stubable` types with `Stub`s
|
|
4271
|
+
type Stubify<T> = T extends Stubable
|
|
4272
|
+
? Stub<T>
|
|
4273
|
+
: T extends Map<infer K, infer V>
|
|
4274
|
+
? Map<Stubify<K>, Stubify<V>>
|
|
4275
|
+
: T extends Set<infer V>
|
|
4276
|
+
? Set<Stubify<V>>
|
|
4277
|
+
: T extends Array<infer V>
|
|
4278
|
+
? Array<Stubify<V>>
|
|
4279
|
+
: T extends ReadonlyArray<infer V>
|
|
4280
|
+
? ReadonlyArray<Stubify<V>>
|
|
4281
|
+
: T extends {
|
|
4282
|
+
[key: string | number]: unknown;
|
|
4283
|
+
}
|
|
4284
|
+
? {
|
|
4285
|
+
[K in keyof T]: Stubify<T[K]>;
|
|
4286
|
+
}
|
|
4287
|
+
: T;
|
|
4288
|
+
// Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
|
|
4289
|
+
// Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
|
|
4290
|
+
// `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
|
|
4291
|
+
type Unstubify<T> =
|
|
4292
|
+
T extends StubBase<infer V>
|
|
4293
|
+
? V
|
|
4294
|
+
: T extends Map<infer K, infer V>
|
|
4295
|
+
? Map<Unstubify<K>, Unstubify<V>>
|
|
4296
|
+
: T extends Set<infer V>
|
|
4297
|
+
? Set<Unstubify<V>>
|
|
4298
|
+
: T extends Array<infer V>
|
|
4299
|
+
? Array<Unstubify<V>>
|
|
4300
|
+
: T extends ReadonlyArray<infer V>
|
|
4301
|
+
? ReadonlyArray<Unstubify<V>>
|
|
4302
|
+
: T extends {
|
|
4303
|
+
[key: string | number]: unknown;
|
|
4304
|
+
}
|
|
4305
|
+
? {
|
|
4306
|
+
[K in keyof T]: Unstubify<T[K]>;
|
|
4307
|
+
}
|
|
4308
|
+
: T;
|
|
4309
|
+
type UnstubifyAll<A extends any[]> = {
|
|
4310
|
+
[I in keyof A]: Unstubify<A[I]>;
|
|
4311
|
+
};
|
|
4312
|
+
// Utility type for adding `Provider`/`Disposable`s to `object` types only.
|
|
4313
|
+
// Note `unknown & T` is equivalent to `T`.
|
|
4314
|
+
type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
|
|
4315
|
+
type MaybeDisposable<T> = T extends object ? Disposable : unknown;
|
|
4316
|
+
// Type for method return or property on an RPC interface.
|
|
4317
|
+
// - Stubable types are replaced by stubs.
|
|
4318
|
+
// - Serializable types are passed by value, with stubable types replaced by stubs
|
|
4319
|
+
// and a top-level `Disposer`.
|
|
4320
|
+
// Everything else can't be passed over PRC.
|
|
4321
|
+
// Technically, we use custom thenables here, but they quack like `Promise`s.
|
|
4322
|
+
// Intersecting with `(Maybe)Provider` allows pipelining.
|
|
4323
|
+
type Result<R> = R extends Stubable
|
|
4324
|
+
? Promise<Stub<R>> & Provider<R>
|
|
4325
|
+
: R extends Serializable
|
|
4326
|
+
? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
|
|
4327
|
+
: never;
|
|
4328
|
+
// Type for method or property on an RPC interface.
|
|
4329
|
+
// For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
|
|
4330
|
+
// Unwrapping `Stub`s allows calling with `Stubable` arguments.
|
|
4331
|
+
// For properties, rewrite types to be `Result`s.
|
|
4332
|
+
// In each case, unwrap `Promise`s.
|
|
4333
|
+
type MethodOrProperty<V> = V extends (...args: infer P) => infer R
|
|
4334
|
+
? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
|
|
4335
|
+
: Result<Awaited<V>>;
|
|
4336
|
+
// Type for the callable part of an `Provider` if `T` is callable.
|
|
4337
|
+
// This is intersected with methods/properties.
|
|
4338
|
+
type MaybeCallableProvider<T> = T extends (...args: any[]) => any
|
|
4339
|
+
? MethodOrProperty<T>
|
|
4340
|
+
: unknown;
|
|
4341
|
+
// Base type for all other types providing RPC-like interfaces.
|
|
4342
|
+
// Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
|
|
4343
|
+
// `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
|
|
4344
|
+
export type Provider<
|
|
4345
|
+
T extends object,
|
|
4346
|
+
Reserved extends string = never,
|
|
4347
|
+
> = MaybeCallableProvider<T> & {
|
|
4348
|
+
[K in Exclude<
|
|
4349
|
+
keyof T,
|
|
4350
|
+
Reserved | symbol | keyof StubBase<never>
|
|
4351
|
+
>]: MethodOrProperty<T[K]>;
|
|
4352
|
+
};
|
|
4353
|
+
}
|
|
4354
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
4355
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4356
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4357
|
+
/**
|
|
4358
|
+
* Data types supported for holding vector metadata.
|
|
4359
|
+
*/
|
|
4360
|
+
export type VectorizeVectorMetadataValue = string | number | boolean | string[];
|
|
4361
|
+
/**
|
|
4362
|
+
* Additional information to associate with a vector.
|
|
4363
|
+
*/
|
|
4364
|
+
export type VectorizeVectorMetadata =
|
|
4365
|
+
| VectorizeVectorMetadataValue
|
|
4366
|
+
| Record<string, VectorizeVectorMetadataValue>;
|
|
4367
|
+
export type VectorFloatArray = Float32Array | Float64Array;
|
|
4368
|
+
export interface VectorizeError {
|
|
4369
|
+
code?: number;
|
|
4370
|
+
error: string;
|
|
4371
|
+
}
|
|
4372
|
+
/**
|
|
4373
|
+
* Comparison logic/operation to use for metadata filtering.
|
|
4374
|
+
*
|
|
4375
|
+
* This list is expected to grow as support for more operations are released.
|
|
4376
|
+
*/
|
|
4377
|
+
export type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
|
|
4378
|
+
/**
|
|
4379
|
+
* Filter criteria for vector metadata used to limit the retrieved query result set.
|
|
4380
|
+
*/
|
|
4381
|
+
export type VectorizeVectorMetadataFilter = {
|
|
4382
|
+
[field: string]:
|
|
4383
|
+
| Exclude<VectorizeVectorMetadataValue, string[]>
|
|
4384
|
+
| null
|
|
4385
|
+
| {
|
|
4386
|
+
[Op in VectorizeVectorMetadataFilterOp]?: Exclude<
|
|
4387
|
+
VectorizeVectorMetadataValue,
|
|
4388
|
+
string[]
|
|
4389
|
+
> | null;
|
|
4390
|
+
};
|
|
4391
|
+
};
|
|
4392
|
+
/**
|
|
4393
|
+
* Supported distance metrics for an index.
|
|
4394
|
+
* Distance metrics determine how other "similar" vectors are determined.
|
|
4395
|
+
*/
|
|
4396
|
+
export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
4397
|
+
export interface VectorizeQueryOptions {
|
|
4398
|
+
topK?: number;
|
|
4399
|
+
namespace?: string;
|
|
4400
|
+
returnValues?: boolean;
|
|
4401
|
+
returnMetadata?: boolean;
|
|
4402
|
+
filter?: VectorizeVectorMetadataFilter;
|
|
4403
|
+
}
|
|
4404
|
+
/**
|
|
4405
|
+
* Information about the configuration of an index.
|
|
4406
|
+
*/
|
|
4407
|
+
export type VectorizeIndexConfig =
|
|
4408
|
+
| {
|
|
4409
|
+
dimensions: number;
|
|
4410
|
+
metric: VectorizeDistanceMetric;
|
|
4411
|
+
}
|
|
4412
|
+
| {
|
|
4413
|
+
preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
|
|
4414
|
+
};
|
|
4415
|
+
/**
|
|
4416
|
+
* Metadata about an existing index.
|
|
4417
|
+
*/
|
|
4418
|
+
export interface VectorizeIndexDetails {
|
|
4419
|
+
/** The unique ID of the index */
|
|
4420
|
+
readonly id: string;
|
|
4421
|
+
/** The name of the index. */
|
|
4422
|
+
name: string;
|
|
4423
|
+
/** (optional) A human readable description for the index. */
|
|
4424
|
+
description?: string;
|
|
4425
|
+
/** The index configuration, including the dimension size and distance metric. */
|
|
4426
|
+
config: VectorizeIndexConfig;
|
|
4427
|
+
/** The number of records containing vectors within the index. */
|
|
4428
|
+
vectorsCount: number;
|
|
4429
|
+
}
|
|
4430
|
+
/**
|
|
4431
|
+
* Represents a single vector value set along with its associated metadata.
|
|
4432
|
+
*/
|
|
4433
|
+
export interface VectorizeVector {
|
|
4434
|
+
/** 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. */
|
|
4435
|
+
id: string;
|
|
4436
|
+
/** The vector values */
|
|
4437
|
+
values: VectorFloatArray | number[];
|
|
4438
|
+
/** The namespace this vector belongs to. */
|
|
4439
|
+
namespace?: string;
|
|
4440
|
+
/** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
|
|
4441
|
+
metadata?: Record<string, VectorizeVectorMetadata>;
|
|
4442
|
+
}
|
|
4443
|
+
/**
|
|
4444
|
+
* Represents a matched vector for a query along with its score and (if specified) the matching vector information.
|
|
4445
|
+
*/
|
|
4446
|
+
export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
4447
|
+
Omit<VectorizeVector, "values"> & {
|
|
4448
|
+
/** The score or rank for similarity, when returned as a result */
|
|
4449
|
+
score: number;
|
|
4450
|
+
};
|
|
4451
|
+
/**
|
|
4452
|
+
* A set of vector {@link VectorizeMatch} for a particular query.
|
|
4453
|
+
*/
|
|
4454
|
+
export interface VectorizeMatches {
|
|
4455
|
+
matches: VectorizeMatch[];
|
|
4456
|
+
count: number;
|
|
4457
|
+
}
|
|
4458
|
+
/**
|
|
4459
|
+
* Results of an operation that performed a mutation on a set of vectors.
|
|
4460
|
+
* Here, `ids` is a list of vectors that were successfully processed.
|
|
4461
|
+
*/
|
|
4462
|
+
export interface VectorizeVectorMutation {
|
|
4463
|
+
/* List of ids of vectors that were successfully processed. */
|
|
4464
|
+
ids: string[];
|
|
4465
|
+
/* Total count of the number of processed vectors. */
|
|
4466
|
+
count: number;
|
|
4467
|
+
}
|
|
4468
|
+
export declare abstract class VectorizeIndex {
|
|
4469
|
+
/**
|
|
4470
|
+
* Get information about the currently bound index.
|
|
4471
|
+
* @returns A promise that resolves with information about the current index.
|
|
4472
|
+
*/
|
|
4473
|
+
public describe(): Promise<VectorizeIndexDetails>;
|
|
4474
|
+
/**
|
|
4475
|
+
* Use the provided vector to perform a similarity search across the index.
|
|
4476
|
+
* @param vector Input vector that will be used to drive the similarity search.
|
|
4477
|
+
* @param options Configuration options to massage the returned data.
|
|
4478
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
4479
|
+
*/
|
|
4480
|
+
public query(
|
|
4481
|
+
vector: VectorFloatArray | number[],
|
|
4482
|
+
options: VectorizeQueryOptions,
|
|
4483
|
+
): Promise<VectorizeMatches>;
|
|
4484
|
+
/**
|
|
4485
|
+
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
4486
|
+
* @param vectors List of vectors that will be inserted.
|
|
4487
|
+
* @returns A promise that resolves with the ids & count of records that were successfully processed.
|
|
4488
|
+
*/
|
|
4489
|
+
public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
|
|
4490
|
+
/**
|
|
4491
|
+
* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
|
|
4492
|
+
* @param vectors List of vectors that will be upserted.
|
|
4493
|
+
* @returns A promise that resolves with the ids & count of records that were successfully processed.
|
|
4494
|
+
*/
|
|
4495
|
+
public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
|
|
4496
|
+
/**
|
|
4497
|
+
* Delete a list of vectors with a matching id.
|
|
4498
|
+
* @param ids List of vector ids that should be deleted.
|
|
4499
|
+
* @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted).
|
|
4500
|
+
*/
|
|
4501
|
+
public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>;
|
|
4502
|
+
/**
|
|
4503
|
+
* Get a list of vectors with a matching id.
|
|
4504
|
+
* @param ids List of vector ids that should be returned.
|
|
4505
|
+
* @returns A promise that resolves with the raw unscored vectors matching the id set.
|
|
4506
|
+
*/
|
|
4507
|
+
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
4508
|
+
}
|
|
4509
|
+
/**
|
|
4510
|
+
* The interface for "version_metadata" binding
|
|
4511
|
+
* providing metadata about the Worker Version using this binding.
|
|
4512
|
+
*/
|
|
4513
|
+
export type WorkerVersionMetadata = {
|
|
4514
|
+
/** The ID of the Worker Version using this binding */
|
|
4515
|
+
id: string;
|
|
4516
|
+
/** The tag of the Worker Version using this binding */
|
|
4517
|
+
tag: string;
|
|
4518
|
+
};
|
|
3011
4519
|
export interface DynamicDispatchLimits {
|
|
3012
4520
|
/**
|
|
3013
4521
|
* Limit CPU time in milliseconds.
|
|
@@ -3043,6 +4551,6 @@ export interface DispatchNamespace {
|
|
|
3043
4551
|
args?: {
|
|
3044
4552
|
[key: string]: any;
|
|
3045
4553
|
},
|
|
3046
|
-
options?: DynamicDispatchOptions
|
|
4554
|
+
options?: DynamicDispatchOptions,
|
|
3047
4555
|
): Fetcher;
|
|
3048
4556
|
}
|