@cloudflare/workers-types 0.20240405.1 → 0.20240712.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,11 +14,16 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
  /* eslint-disable */
16
16
  // noinspection JSUnusedGlobalSymbols
17
+ /**
18
+ * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
19
+ *
20
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
21
+ */
17
22
  declare class DOMException extends Error {
18
23
  constructor(message?: string, name?: string);
19
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
24
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
20
25
  readonly message: string;
21
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
26
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
22
27
  readonly name: string;
23
28
  /**
24
29
  * @deprecated
@@ -26,7 +31,6 @@ declare class DOMException extends Error {
26
31
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
27
32
  */
28
33
  readonly code: number;
29
- readonly stack: any;
30
34
  static readonly INDEX_SIZE_ERR: number;
31
35
  static readonly DOMSTRING_SIZE_ERR: number;
32
36
  static readonly HIERARCHY_REQUEST_ERR: number;
@@ -52,8 +56,10 @@ declare class DOMException extends Error {
52
56
  static readonly TIMEOUT_ERR: number;
53
57
  static readonly INVALID_NODE_TYPE_ERR: number;
54
58
  static readonly DATA_CLONE_ERR: number;
59
+ get stack(): any;
60
+ set stack(value: any);
55
61
  }
56
- declare type WorkerGlobalScopeEventMap = {
62
+ type WorkerGlobalScopeEventMap = {
57
63
  fetch: FetchEvent;
58
64
  scheduled: ScheduledEvent;
59
65
  queue: QueueEvent;
@@ -63,50 +69,50 @@ declare type WorkerGlobalScopeEventMap = {
63
69
  declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
64
70
  EventTarget: typeof EventTarget;
65
71
  }
66
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
67
- declare interface Console {
72
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
73
+ interface Console {
68
74
  "assert"(condition?: boolean, ...data: any[]): void;
69
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
75
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
70
76
  clear(): void;
71
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
77
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
72
78
  count(label?: string): void;
73
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
79
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
74
80
  countReset(label?: string): void;
75
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
81
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
76
82
  debug(...data: any[]): void;
77
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
83
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
78
84
  dir(item?: any, options?: any): void;
79
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
85
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
80
86
  dirxml(...data: any[]): void;
81
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
87
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
82
88
  error(...data: any[]): void;
83
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
89
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
84
90
  group(...data: any[]): void;
85
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
91
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
86
92
  groupCollapsed(...data: any[]): void;
87
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
93
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
88
94
  groupEnd(): void;
89
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
95
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
90
96
  info(...data: any[]): void;
91
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
97
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
92
98
  log(...data: any[]): void;
93
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
99
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
94
100
  table(tabularData?: any, properties?: string[]): void;
95
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
101
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
96
102
  time(label?: string): void;
97
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
103
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
98
104
  timeEnd(label?: string): void;
99
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
105
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
100
106
  timeLog(label?: string, ...data: any[]): void;
101
107
  timeStamp(label?: string): void;
102
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
108
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
103
109
  trace(...data: any[]): void;
104
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
110
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
105
111
  warn(...data: any[]): void;
106
112
  }
107
113
  declare const console: Console;
108
- declare type BufferSource = ArrayBufferView | ArrayBuffer;
109
- declare type TypedArray =
114
+ type BufferSource = ArrayBufferView | ArrayBuffer;
115
+ type TypedArray =
110
116
  | Int8Array
111
117
  | Uint8Array
112
118
  | Uint8ClampedArray
@@ -194,10 +200,11 @@ declare namespace WebAssembly {
194
200
  }
195
201
  /**
196
202
  * This ServiceWorker API interface represents the global execution context of a service worker.
203
+ * Available only in secure contexts.
197
204
  *
198
205
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
199
206
  */
200
- declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
207
+ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
201
208
  DOMException: typeof DOMException;
202
209
  WorkerGlobalScope: typeof WorkerGlobalScope;
203
210
  btoa(data: string): string;
@@ -218,6 +225,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
218
225
  clearInterval(timeoutId: number | null): void;
219
226
  queueMicrotask(task: Function): void;
220
227
  structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
228
+ reportError(error: any): void;
221
229
  fetch(
222
230
  input: RequestInfo,
223
231
  init?: RequestInit<RequestInitCfProperties>,
@@ -246,10 +254,13 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
246
254
  TransformStream: typeof TransformStream;
247
255
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
248
256
  CountQueuingStrategy: typeof CountQueuingStrategy;
257
+ ErrorEvent: typeof ErrorEvent;
258
+ EventSource: typeof EventSource;
249
259
  ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
250
260
  ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
251
261
  ReadableByteStreamController: typeof ReadableByteStreamController;
252
262
  WritableStreamDefaultController: typeof WritableStreamDefaultController;
263
+ TransformStreamDefaultController: typeof TransformStreamDefaultController;
253
264
  CompressionStream: typeof CompressionStream;
254
265
  DecompressionStream: typeof DecompressionStream;
255
266
  TextEncoderStream: typeof TextEncoderStream;
@@ -281,16 +292,16 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
281
292
  FixedLengthStream: typeof FixedLengthStream;
282
293
  IdentityTransformStream: typeof IdentityTransformStream;
283
294
  HTMLRewriter: typeof HTMLRewriter;
284
- GPUAdapter: typeof gpuGPUAdapter;
285
- GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
286
- GPUValidationError: typeof gpuGPUValidationError;
287
- GPUInternalError: typeof gpuGPUInternalError;
288
- GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
289
- GPUBufferUsage: typeof gpuGPUBufferUsage;
290
- GPUShaderStage: typeof gpuGPUShaderStage;
291
- GPUMapMode: typeof gpuGPUMapMode;
292
- GPUTextureUsage: typeof gpuGPUTextureUsage;
293
- GPUColorWrite: typeof gpuGPUColorWrite;
295
+ GPUAdapter: typeof GPUAdapter;
296
+ GPUOutOfMemoryError: typeof GPUOutOfMemoryError;
297
+ GPUValidationError: typeof GPUValidationError;
298
+ GPUInternalError: typeof GPUInternalError;
299
+ GPUDeviceLostInfo: typeof GPUDeviceLostInfo;
300
+ GPUBufferUsage: typeof GPUBufferUsage;
301
+ GPUShaderStage: typeof GPUShaderStage;
302
+ GPUMapMode: typeof GPUMapMode;
303
+ GPUTextureUsage: typeof GPUTextureUsage;
304
+ GPUColorWrite: typeof GPUColorWrite;
294
305
  }
295
306
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
296
307
  type: Type,
@@ -312,94 +323,112 @@ declare function removeEventListener<
312
323
  declare function dispatchEvent(
313
324
  event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
314
325
  ): boolean;
315
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
326
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
316
327
  declare function btoa(data: string): string;
317
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
328
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
318
329
  declare function atob(data: string): string;
319
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
330
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
320
331
  declare function setTimeout(
321
332
  callback: (...args: any[]) => void,
322
333
  msDelay?: number,
323
334
  ): number;
324
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
335
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
325
336
  declare function setTimeout<Args extends any[]>(
326
337
  callback: (...args: Args) => void,
327
338
  msDelay?: number,
328
339
  ...args: Args
329
340
  ): number;
330
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
341
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
331
342
  declare function clearTimeout(timeoutId: number | null): void;
332
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
343
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
333
344
  declare function setInterval(
334
345
  callback: (...args: any[]) => void,
335
346
  msDelay?: number,
336
347
  ): number;
337
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
348
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
338
349
  declare function setInterval<Args extends any[]>(
339
350
  callback: (...args: Args) => void,
340
351
  msDelay?: number,
341
352
  ...args: Args
342
353
  ): number;
343
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
354
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
344
355
  declare function clearInterval(timeoutId: number | null): void;
345
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
356
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
346
357
  declare function queueMicrotask(task: Function): void;
347
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
358
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
348
359
  declare function structuredClone<T>(
349
360
  value: T,
350
361
  options?: StructuredSerializeOptions,
351
362
  ): T;
352
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
363
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/reportError) */
364
+ declare function reportError(error: any): void;
365
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
353
366
  declare function fetch(
354
367
  input: RequestInfo,
355
368
  init?: RequestInit<RequestInitCfProperties>,
356
369
  ): Promise<Response>;
357
370
  declare const self: ServiceWorkerGlobalScope;
371
+ /**
372
+ * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
373
+ * The Workers runtime implements the full surface of this API, but with some differences in
374
+ * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
375
+ * compared to those implemented in most browsers.
376
+ *
377
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
378
+ */
358
379
  declare const crypto: Crypto;
380
+ /**
381
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
382
+ *
383
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
384
+ */
359
385
  declare const caches: CacheStorage;
360
386
  declare const scheduler: Scheduler;
387
+ /**
388
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
389
+ * as well as timing of subrequests and other operations.
390
+ *
391
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
392
+ */
361
393
  declare const performance: Performance;
362
394
  declare const origin: string;
363
395
  declare const navigator: Navigator;
364
- declare interface TestController {}
365
- declare interface ExecutionContext {
396
+ interface TestController {}
397
+ interface ExecutionContext {
366
398
  waitUntil(promise: Promise<any>): void;
367
399
  passThroughOnException(): void;
368
400
  }
369
- declare type ExportedHandlerFetchHandler<
370
- Env = unknown,
371
- CfHostMetadata = unknown,
372
- > = (
401
+ type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (
373
402
  request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
374
403
  env: Env,
375
404
  ctx: ExecutionContext,
376
405
  ) => Response | Promise<Response>;
377
- declare type ExportedHandlerTailHandler<Env = unknown> = (
406
+ type ExportedHandlerTailHandler<Env = unknown> = (
378
407
  events: TraceItem[],
379
408
  env: Env,
380
409
  ctx: ExecutionContext,
381
410
  ) => void | Promise<void>;
382
- declare type ExportedHandlerTraceHandler<Env = unknown> = (
411
+ type ExportedHandlerTraceHandler<Env = unknown> = (
383
412
  traces: TraceItem[],
384
413
  env: Env,
385
414
  ctx: ExecutionContext,
386
415
  ) => void | Promise<void>;
387
- declare type ExportedHandlerScheduledHandler<Env = unknown> = (
416
+ type ExportedHandlerScheduledHandler<Env = unknown> = (
388
417
  controller: ScheduledController,
389
418
  env: Env,
390
419
  ctx: ExecutionContext,
391
420
  ) => void | Promise<void>;
392
- declare type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
421
+ type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
393
422
  batch: MessageBatch<Message>,
394
423
  env: Env,
395
424
  ctx: ExecutionContext,
396
425
  ) => void | Promise<void>;
397
- declare type ExportedHandlerTestHandler<Env = unknown> = (
426
+ type ExportedHandlerTestHandler<Env = unknown> = (
398
427
  controller: TestController,
399
428
  env: Env,
400
429
  ctx: ExecutionContext,
401
430
  ) => void | Promise<void>;
402
- declare interface ExportedHandler<
431
+ interface ExportedHandler<
403
432
  Env = unknown,
404
433
  QueueHandlerMessage = unknown,
405
434
  CfHostMetadata = unknown,
@@ -412,13 +441,14 @@ declare interface ExportedHandler<
412
441
  email?: EmailExportedHandler<Env>;
413
442
  queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
414
443
  }
415
- declare interface StructuredSerializeOptions {
444
+ interface StructuredSerializeOptions {
416
445
  transfer?: any[];
417
446
  }
447
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
418
448
  declare abstract class PromiseRejectionEvent extends Event {
419
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
449
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
420
450
  readonly promise: Promise<any>;
421
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
451
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
422
452
  readonly reason: any;
423
453
  }
424
454
  declare abstract class Navigator {
@@ -433,24 +463,25 @@ declare abstract class Navigator {
433
463
  | FormData,
434
464
  ): boolean;
435
465
  readonly userAgent: string;
436
- readonly gpu: gpuGPU;
466
+ readonly gpu: GPU;
437
467
  }
438
468
  /**
439
- * 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.
469
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
470
+ * as well as timing of subrequests and other operations.
440
471
  *
441
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
472
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
442
473
  */
443
- declare interface Performance {
444
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
474
+ interface Performance {
475
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
445
476
  readonly timeOrigin: number;
446
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
477
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
447
478
  now(): number;
448
479
  }
449
- declare interface AlarmInvocationInfo {
480
+ interface AlarmInvocationInfo {
450
481
  readonly isRetry: boolean;
451
482
  readonly retryCount: number;
452
483
  }
453
- declare interface DurableObject {
484
+ interface DurableObject {
454
485
  fetch(request: Request): Response | Promise<Response>;
455
486
  alarm?(): void | Promise<void>;
456
487
  webSocketMessage?(
@@ -465,7 +496,7 @@ declare interface DurableObject {
465
496
  ): void | Promise<void>;
466
497
  webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
467
498
  }
468
- declare type DurableObjectStub<
499
+ type DurableObjectStub<
469
500
  T extends Rpc.DurableObjectBranded | undefined = undefined,
470
501
  > = Fetcher<
471
502
  T,
@@ -474,12 +505,12 @@ declare type DurableObjectStub<
474
505
  readonly id: DurableObjectId;
475
506
  readonly name?: string;
476
507
  };
477
- declare interface DurableObjectId {
508
+ interface DurableObjectId {
478
509
  toString(): string;
479
510
  equals(other: DurableObjectId): boolean;
480
511
  readonly name?: string;
481
512
  }
482
- declare interface DurableObjectNamespace<
513
+ interface DurableObjectNamespace<
483
514
  T extends Rpc.DurableObjectBranded | undefined = undefined,
484
515
  > {
485
516
  newUniqueId(
@@ -495,11 +526,11 @@ declare interface DurableObjectNamespace<
495
526
  jurisdiction: DurableObjectJurisdiction,
496
527
  ): DurableObjectNamespace<T>;
497
528
  }
498
- declare type DurableObjectJurisdiction = "eu" | "fedramp";
499
- declare interface DurableObjectNamespaceNewUniqueIdOptions {
529
+ type DurableObjectJurisdiction = "eu" | "fedramp";
530
+ interface DurableObjectNamespaceNewUniqueIdOptions {
500
531
  jurisdiction?: DurableObjectJurisdiction;
501
532
  }
502
- declare type DurableObjectLocationHint =
533
+ type DurableObjectLocationHint =
503
534
  | "wnam"
504
535
  | "enam"
505
536
  | "sam"
@@ -509,10 +540,10 @@ declare type DurableObjectLocationHint =
509
540
  | "oc"
510
541
  | "afr"
511
542
  | "me";
512
- declare interface DurableObjectNamespaceGetDurableObjectOptions {
543
+ interface DurableObjectNamespaceGetDurableObjectOptions {
513
544
  locationHint?: DurableObjectLocationHint;
514
545
  }
515
- declare interface DurableObjectState {
546
+ interface DurableObjectState {
516
547
  waitUntil(promise: Promise<any>): void;
517
548
  readonly id: DurableObjectId;
518
549
  readonly storage: DurableObjectStorage;
@@ -526,7 +557,7 @@ declare interface DurableObjectState {
526
557
  getHibernatableWebSocketEventTimeout(): number | null;
527
558
  getTags(ws: WebSocket): string[];
528
559
  }
529
- declare interface DurableObjectTransaction {
560
+ interface DurableObjectTransaction {
530
561
  get<T = unknown>(
531
562
  key: string,
532
563
  options?: DurableObjectGetOptions,
@@ -557,7 +588,7 @@ declare interface DurableObjectTransaction {
557
588
  ): Promise<void>;
558
589
  deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
559
590
  }
560
- declare interface DurableObjectStorage {
591
+ interface DurableObjectStorage {
561
592
  get<T = unknown>(
562
593
  key: string,
563
594
  options?: DurableObjectGetOptions,
@@ -593,7 +624,7 @@ declare interface DurableObjectStorage {
593
624
  sync(): Promise<void>;
594
625
  transactionSync<T>(closure: () => T): T;
595
626
  }
596
- declare interface DurableObjectListOptions {
627
+ interface DurableObjectListOptions {
597
628
  start?: string;
598
629
  startAfter?: string;
599
630
  end?: string;
@@ -603,19 +634,19 @@ declare interface DurableObjectListOptions {
603
634
  allowConcurrency?: boolean;
604
635
  noCache?: boolean;
605
636
  }
606
- declare interface DurableObjectGetOptions {
637
+ interface DurableObjectGetOptions {
607
638
  allowConcurrency?: boolean;
608
639
  noCache?: boolean;
609
640
  }
610
- declare interface DurableObjectGetAlarmOptions {
641
+ interface DurableObjectGetAlarmOptions {
611
642
  allowConcurrency?: boolean;
612
643
  }
613
- declare interface DurableObjectPutOptions {
644
+ interface DurableObjectPutOptions {
614
645
  allowConcurrency?: boolean;
615
646
  allowUnconfirmed?: boolean;
616
647
  noCache?: boolean;
617
648
  }
618
- declare interface DurableObjectSetAlarmOptions {
649
+ interface DurableObjectSetAlarmOptions {
619
650
  allowConcurrency?: boolean;
620
651
  allowUnconfirmed?: boolean;
621
652
  }
@@ -624,14 +655,19 @@ declare class WebSocketRequestResponsePair {
624
655
  get request(): string;
625
656
  get response(): string;
626
657
  }
627
- declare interface AnalyticsEngineDataset {
658
+ interface AnalyticsEngineDataset {
628
659
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
629
660
  }
630
- declare interface AnalyticsEngineDataPoint {
661
+ interface AnalyticsEngineDataPoint {
631
662
  indexes?: ((ArrayBuffer | string) | null)[];
632
663
  doubles?: number[];
633
664
  blobs?: ((ArrayBuffer | string) | null)[];
634
665
  }
666
+ /**
667
+ * An event which takes place in the DOM.
668
+ *
669
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
670
+ */
635
671
  declare class Event {
636
672
  constructor(type: string, init?: EventInit);
637
673
  /**
@@ -741,20 +777,25 @@ declare class Event {
741
777
  static readonly AT_TARGET: number;
742
778
  static readonly BUBBLING_PHASE: number;
743
779
  }
744
- declare interface EventInit {
780
+ interface EventInit {
745
781
  bubbles?: boolean;
746
782
  cancelable?: boolean;
747
783
  composed?: boolean;
748
784
  }
749
- declare type EventListener<EventType extends Event = Event> = (
785
+ type EventListener<EventType extends Event = Event> = (
750
786
  event: EventType,
751
787
  ) => void;
752
- declare interface EventListenerObject<EventType extends Event = Event> {
788
+ interface EventListenerObject<EventType extends Event = Event> {
753
789
  handleEvent(event: EventType): void;
754
790
  }
755
- declare type EventListenerOrEventListenerObject<
756
- EventType extends Event = Event,
757
- > = EventListener<EventType> | EventListenerObject<EventType>;
791
+ type EventListenerOrEventListenerObject<EventType extends Event = Event> =
792
+ | EventListener<EventType>
793
+ | EventListenerObject<EventType>;
794
+ /**
795
+ * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
796
+ *
797
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
798
+ */
758
799
  declare class EventTarget<
759
800
  EventMap extends Record<string, Event> = Record<string, Event>,
760
801
  > {
@@ -798,18 +839,23 @@ declare class EventTarget<
798
839
  */
799
840
  dispatchEvent(event: EventMap[keyof EventMap]): boolean;
800
841
  }
801
- declare interface EventTargetEventListenerOptions {
842
+ interface EventTargetEventListenerOptions {
802
843
  capture?: boolean;
803
844
  }
804
- declare interface EventTargetAddEventListenerOptions {
845
+ interface EventTargetAddEventListenerOptions {
805
846
  capture?: boolean;
806
847
  passive?: boolean;
807
848
  once?: boolean;
808
849
  signal?: AbortSignal;
809
850
  }
810
- declare interface EventTargetHandlerObject {
851
+ interface EventTargetHandlerObject {
811
852
  handleEvent: (event: Event) => any | undefined;
812
853
  }
854
+ /**
855
+ * A controller object that allows you to abort one or more DOM requests as and when desired.
856
+ *
857
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
858
+ */
813
859
  declare class AbortController {
814
860
  constructor();
815
861
  /**
@@ -825,11 +871,17 @@ declare class AbortController {
825
871
  */
826
872
  abort(reason?: any): void;
827
873
  }
874
+ /**
875
+ * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
876
+ *
877
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
878
+ */
828
879
  declare abstract class AbortSignal extends EventTarget {
829
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
880
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
830
881
  static abort(reason?: any): AbortSignal;
831
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
882
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
832
883
  static timeout(delay: number): AbortSignal;
884
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
833
885
  static any(signals: AbortSignal[]): AbortSignal;
834
886
  /**
835
887
  * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
@@ -837,25 +889,31 @@ declare abstract class AbortSignal extends EventTarget {
837
889
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
838
890
  */
839
891
  get aborted(): boolean;
840
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
892
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
841
893
  get reason(): any;
842
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
894
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
843
895
  get onabort(): any | null;
844
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
896
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
845
897
  set onabort(value: any | null);
846
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
898
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
847
899
  throwIfAborted(): void;
848
900
  }
849
- declare interface Scheduler {
901
+ interface Scheduler {
850
902
  wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
851
903
  }
852
- declare interface SchedulerWaitOptions {
904
+ interface SchedulerWaitOptions {
853
905
  signal?: AbortSignal;
854
906
  }
907
+ /**
908
+ * Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
909
+ *
910
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
911
+ */
855
912
  declare abstract class ExtendableEvent extends Event {
856
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
913
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
857
914
  waitUntil(promise: Promise<any>): void;
858
915
  }
916
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
859
917
  declare class CustomEvent<T = any> extends Event {
860
918
  constructor(type: string, init?: CustomEventCustomEventInit);
861
919
  /**
@@ -865,64 +923,96 @@ declare class CustomEvent<T = any> extends Event {
865
923
  */
866
924
  get detail(): T;
867
925
  }
868
- declare interface CustomEventCustomEventInit {
926
+ interface CustomEventCustomEventInit {
869
927
  bubbles?: boolean;
870
928
  cancelable?: boolean;
871
929
  composed?: boolean;
872
930
  detail?: any;
873
931
  }
932
+ /**
933
+ * A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.
934
+ *
935
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
936
+ */
874
937
  declare class Blob {
875
938
  constructor(
876
- bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
939
+ type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
877
940
  options?: BlobOptions,
878
941
  );
879
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
942
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
880
943
  get size(): number;
881
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
944
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
882
945
  get type(): string;
883
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
946
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
884
947
  slice(start?: number, end?: number, type?: string): Blob;
885
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
948
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
886
949
  arrayBuffer(): Promise<ArrayBuffer>;
887
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
950
+ bytes(): Promise<Uint8Array>;
951
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
888
952
  text(): Promise<string>;
889
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
953
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
890
954
  stream(): ReadableStream;
891
955
  }
892
- declare interface BlobOptions {
956
+ interface BlobOptions {
893
957
  type?: string;
894
958
  }
959
+ /**
960
+ * Provides information about files and allows JavaScript in a web page to access their content.
961
+ *
962
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
963
+ */
895
964
  declare class File extends Blob {
896
965
  constructor(
897
966
  bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
898
967
  name: string,
899
968
  options?: FileOptions,
900
969
  );
901
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
970
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
902
971
  get name(): string;
903
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
972
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
904
973
  get lastModified(): number;
905
974
  }
906
- declare interface FileOptions {
975
+ interface FileOptions {
907
976
  type?: string;
908
977
  lastModified?: number;
909
978
  }
979
+ /**
980
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
981
+ *
982
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
983
+ */
910
984
  declare abstract class CacheStorage {
911
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
985
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
912
986
  open(cacheName: string): Promise<Cache>;
913
987
  readonly default: Cache;
914
988
  }
989
+ /**
990
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
991
+ *
992
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
993
+ */
915
994
  declare abstract class Cache {
995
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
916
996
  delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
997
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
917
998
  match(
918
999
  request: RequestInfo,
919
1000
  options?: CacheQueryOptions,
920
1001
  ): Promise<Response | undefined>;
1002
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
921
1003
  put(request: RequestInfo, response: Response): Promise<void>;
922
1004
  }
923
- declare interface CacheQueryOptions {
1005
+ interface CacheQueryOptions {
924
1006
  ignoreMethod?: boolean;
925
1007
  }
1008
+ /**
1009
+ * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
1010
+ * The Workers runtime implements the full surface of this API, but with some differences in
1011
+ * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
1012
+ * compared to those implemented in most browsers.
1013
+ *
1014
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
1015
+ */
926
1016
  declare abstract class Crypto {
927
1017
  /**
928
1018
  * Available only in secure contexts.
@@ -930,7 +1020,7 @@ declare abstract class Crypto {
930
1020
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
931
1021
  */
932
1022
  get subtle(): SubtleCrypto;
933
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
1023
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
934
1024
  getRandomValues<
935
1025
  T extends
936
1026
  | Int8Array
@@ -950,39 +1040,50 @@ declare abstract class Crypto {
950
1040
  randomUUID(): string;
951
1041
  DigestStream: typeof DigestStream;
952
1042
  }
1043
+ /**
1044
+ * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
1045
+ * Available only in secure contexts.
1046
+ *
1047
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
1048
+ */
953
1049
  declare abstract class SubtleCrypto {
1050
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
954
1051
  encrypt(
955
1052
  algorithm: string | SubtleCryptoEncryptAlgorithm,
956
1053
  key: CryptoKey,
957
1054
  plainText: ArrayBuffer | ArrayBufferView,
958
1055
  ): Promise<ArrayBuffer>;
1056
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
959
1057
  decrypt(
960
1058
  algorithm: string | SubtleCryptoEncryptAlgorithm,
961
1059
  key: CryptoKey,
962
1060
  cipherText: ArrayBuffer | ArrayBufferView,
963
1061
  ): Promise<ArrayBuffer>;
1062
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
964
1063
  sign(
965
1064
  algorithm: string | SubtleCryptoSignAlgorithm,
966
1065
  key: CryptoKey,
967
1066
  data: ArrayBuffer | ArrayBufferView,
968
1067
  ): Promise<ArrayBuffer>;
1068
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
969
1069
  verify(
970
1070
  algorithm: string | SubtleCryptoSignAlgorithm,
971
1071
  key: CryptoKey,
972
1072
  signature: ArrayBuffer | ArrayBufferView,
973
1073
  data: ArrayBuffer | ArrayBufferView,
974
1074
  ): Promise<boolean>;
1075
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
975
1076
  digest(
976
1077
  algorithm: string | SubtleCryptoHashAlgorithm,
977
1078
  data: ArrayBuffer | ArrayBufferView,
978
1079
  ): Promise<ArrayBuffer>;
979
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
1080
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
980
1081
  generateKey(
981
1082
  algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
982
1083
  extractable: boolean,
983
1084
  keyUsages: string[],
984
1085
  ): Promise<CryptoKey | CryptoKeyPair>;
985
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
1086
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
986
1087
  deriveKey(
987
1088
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
988
1089
  baseKey: CryptoKey,
@@ -990,12 +1091,13 @@ declare abstract class SubtleCrypto {
990
1091
  extractable: boolean,
991
1092
  keyUsages: string[],
992
1093
  ): Promise<CryptoKey>;
1094
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
993
1095
  deriveBits(
994
1096
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
995
1097
  baseKey: CryptoKey,
996
- length: number | null,
1098
+ length?: number | null,
997
1099
  ): Promise<ArrayBuffer>;
998
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
1100
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
999
1101
  importKey(
1000
1102
  format: string,
1001
1103
  keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
@@ -1003,14 +1105,16 @@ declare abstract class SubtleCrypto {
1003
1105
  extractable: boolean,
1004
1106
  keyUsages: string[],
1005
1107
  ): Promise<CryptoKey>;
1108
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
1006
1109
  exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
1110
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
1007
1111
  wrapKey(
1008
1112
  format: string,
1009
1113
  key: CryptoKey,
1010
1114
  wrappingKey: CryptoKey,
1011
1115
  wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
1012
1116
  ): Promise<ArrayBuffer>;
1013
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
1117
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
1014
1118
  unwrapKey(
1015
1119
  format: string,
1016
1120
  wrappedKey: ArrayBuffer | ArrayBufferView,
@@ -1025,12 +1129,18 @@ declare abstract class SubtleCrypto {
1025
1129
  b: ArrayBuffer | ArrayBufferView,
1026
1130
  ): boolean;
1027
1131
  }
1132
+ /**
1133
+ * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
1134
+ * Available only in secure contexts.
1135
+ *
1136
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
1137
+ */
1028
1138
  declare abstract class CryptoKey {
1029
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
1139
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
1030
1140
  readonly type: string;
1031
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
1141
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
1032
1142
  readonly extractable: boolean;
1033
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
1143
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
1034
1144
  readonly algorithm:
1035
1145
  | CryptoKeyKeyAlgorithm
1036
1146
  | CryptoKeyAesKeyAlgorithm
@@ -1038,14 +1148,14 @@ declare abstract class CryptoKey {
1038
1148
  | CryptoKeyRsaKeyAlgorithm
1039
1149
  | CryptoKeyEllipticKeyAlgorithm
1040
1150
  | CryptoKeyArbitraryKeyAlgorithm;
1041
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
1151
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
1042
1152
  readonly usages: string[];
1043
1153
  }
1044
- declare interface CryptoKeyPair {
1154
+ interface CryptoKeyPair {
1045
1155
  publicKey: CryptoKey;
1046
1156
  privateKey: CryptoKey;
1047
1157
  }
1048
- declare interface JsonWebKey {
1158
+ interface JsonWebKey {
1049
1159
  kty: string;
1050
1160
  use?: string;
1051
1161
  key_ops?: string[];
@@ -1065,12 +1175,12 @@ declare interface JsonWebKey {
1065
1175
  oth?: RsaOtherPrimesInfo[];
1066
1176
  k?: string;
1067
1177
  }
1068
- declare interface RsaOtherPrimesInfo {
1178
+ interface RsaOtherPrimesInfo {
1069
1179
  r?: string;
1070
1180
  d?: string;
1071
1181
  t?: string;
1072
1182
  }
1073
- declare interface SubtleCryptoDeriveKeyAlgorithm {
1183
+ interface SubtleCryptoDeriveKeyAlgorithm {
1074
1184
  name: string;
1075
1185
  salt?: ArrayBuffer;
1076
1186
  iterations?: number;
@@ -1078,7 +1188,7 @@ declare interface SubtleCryptoDeriveKeyAlgorithm {
1078
1188
  $public?: CryptoKey;
1079
1189
  info?: ArrayBuffer;
1080
1190
  }
1081
- declare interface SubtleCryptoEncryptAlgorithm {
1191
+ interface SubtleCryptoEncryptAlgorithm {
1082
1192
  name: string;
1083
1193
  iv?: ArrayBuffer;
1084
1194
  additionalData?: ArrayBuffer;
@@ -1087,7 +1197,7 @@ declare interface SubtleCryptoEncryptAlgorithm {
1087
1197
  length?: number;
1088
1198
  label?: ArrayBuffer;
1089
1199
  }
1090
- declare interface SubtleCryptoGenerateKeyAlgorithm {
1200
+ interface SubtleCryptoGenerateKeyAlgorithm {
1091
1201
  name: string;
1092
1202
  hash?: string | SubtleCryptoHashAlgorithm;
1093
1203
  modulusLength?: number;
@@ -1095,45 +1205,45 @@ declare interface SubtleCryptoGenerateKeyAlgorithm {
1095
1205
  length?: number;
1096
1206
  namedCurve?: string;
1097
1207
  }
1098
- declare interface SubtleCryptoHashAlgorithm {
1208
+ interface SubtleCryptoHashAlgorithm {
1099
1209
  name: string;
1100
1210
  }
1101
- declare interface SubtleCryptoImportKeyAlgorithm {
1211
+ interface SubtleCryptoImportKeyAlgorithm {
1102
1212
  name: string;
1103
1213
  hash?: string | SubtleCryptoHashAlgorithm;
1104
1214
  length?: number;
1105
1215
  namedCurve?: string;
1106
1216
  compressed?: boolean;
1107
1217
  }
1108
- declare interface SubtleCryptoSignAlgorithm {
1218
+ interface SubtleCryptoSignAlgorithm {
1109
1219
  name: string;
1110
1220
  hash?: string | SubtleCryptoHashAlgorithm;
1111
1221
  dataLength?: number;
1112
1222
  saltLength?: number;
1113
1223
  }
1114
- declare interface CryptoKeyKeyAlgorithm {
1224
+ interface CryptoKeyKeyAlgorithm {
1115
1225
  name: string;
1116
1226
  }
1117
- declare interface CryptoKeyAesKeyAlgorithm {
1227
+ interface CryptoKeyAesKeyAlgorithm {
1118
1228
  name: string;
1119
1229
  length: number;
1120
1230
  }
1121
- declare interface CryptoKeyHmacKeyAlgorithm {
1231
+ interface CryptoKeyHmacKeyAlgorithm {
1122
1232
  name: string;
1123
1233
  hash: CryptoKeyKeyAlgorithm;
1124
1234
  length: number;
1125
1235
  }
1126
- declare interface CryptoKeyRsaKeyAlgorithm {
1236
+ interface CryptoKeyRsaKeyAlgorithm {
1127
1237
  name: string;
1128
1238
  modulusLength: number;
1129
1239
  publicExponent: ArrayBuffer | (ArrayBuffer | ArrayBufferView);
1130
1240
  hash?: CryptoKeyKeyAlgorithm;
1131
1241
  }
1132
- declare interface CryptoKeyEllipticKeyAlgorithm {
1242
+ interface CryptoKeyEllipticKeyAlgorithm {
1133
1243
  name: string;
1134
1244
  namedCurve: string;
1135
1245
  }
1136
- declare interface CryptoKeyArbitraryKeyAlgorithm {
1246
+ interface CryptoKeyArbitraryKeyAlgorithm {
1137
1247
  name: string;
1138
1248
  hash?: CryptoKeyKeyAlgorithm;
1139
1249
  namedCurve?: string;
@@ -1144,7 +1254,13 @@ declare class DigestStream extends WritableStream<
1144
1254
  > {
1145
1255
  constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1146
1256
  get digest(): Promise<ArrayBuffer>;
1257
+ get bytesWritten(): number | bigint;
1147
1258
  }
1259
+ /**
1260
+ * A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1261
+ *
1262
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1263
+ */
1148
1264
  declare class TextDecoder {
1149
1265
  constructor(decoder?: string, options?: TextDecoderConstructorOptions);
1150
1266
  /**
@@ -1170,6 +1286,11 @@ declare class TextDecoder {
1170
1286
  get fatal(): boolean;
1171
1287
  get ignoreBOM(): boolean;
1172
1288
  }
1289
+ /**
1290
+ * TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1291
+ *
1292
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
1293
+ */
1173
1294
  declare class TextEncoder {
1174
1295
  constructor();
1175
1296
  /**
@@ -1189,32 +1310,70 @@ declare class TextEncoder {
1189
1310
  ): TextEncoderEncodeIntoResult;
1190
1311
  get encoding(): string;
1191
1312
  }
1192
- declare interface TextDecoderConstructorOptions {
1313
+ interface TextDecoderConstructorOptions {
1193
1314
  fatal: boolean;
1194
1315
  ignoreBOM: boolean;
1195
1316
  }
1196
- declare interface TextDecoderDecodeOptions {
1317
+ interface TextDecoderDecodeOptions {
1197
1318
  stream: boolean;
1198
1319
  }
1199
- declare interface TextEncoderEncodeIntoResult {
1320
+ interface TextEncoderEncodeIntoResult {
1200
1321
  read: number;
1201
1322
  written: number;
1202
1323
  }
1324
+ /**
1325
+ * Events providing information related to errors in scripts or in files.
1326
+ *
1327
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
1328
+ */
1329
+ declare class ErrorEvent extends Event {
1330
+ constructor(type: string, init?: ErrorEventErrorEventInit);
1331
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1332
+ get filename(): string;
1333
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1334
+ get message(): string;
1335
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1336
+ get lineno(): number;
1337
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1338
+ get colno(): number;
1339
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1340
+ get error(): any;
1341
+ }
1342
+ interface ErrorEventErrorEventInit {
1343
+ message?: string;
1344
+ filename?: string;
1345
+ lineno?: number;
1346
+ colno?: number;
1347
+ error?: any;
1348
+ }
1349
+ /**
1350
+ * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
1351
+ *
1352
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
1353
+ */
1203
1354
  declare class FormData {
1204
1355
  constructor();
1356
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1205
1357
  append(name: string, value: string): void;
1358
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1206
1359
  append(name: string, value: Blob, filename?: string): void;
1360
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
1207
1361
  delete(name: string): void;
1362
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
1208
1363
  get(name: string): (File | string) | null;
1364
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
1209
1365
  getAll(name: string): (File | string)[];
1366
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
1210
1367
  has(name: string): boolean;
1368
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1211
1369
  set(name: string, value: string): void;
1370
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1212
1371
  set(name: string, value: Blob, filename?: string): void;
1213
- /** Returns an array of key, value pairs for every entry in the list. */
1372
+ /* Returns an array of key, value pairs for every entry in the list. */
1214
1373
  entries(): IterableIterator<[key: string, value: File | string]>;
1215
- /** Returns a list of keys in the list. */
1374
+ /* Returns a list of keys in the list. */
1216
1375
  keys(): IterableIterator<string>;
1217
- /** Returns a list of values in the list. */
1376
+ /* Returns a list of values in the list. */
1218
1377
  values(): IterableIterator<File | string>;
1219
1378
  forEach<This = unknown>(
1220
1379
  callback: (
@@ -1227,7 +1386,7 @@ declare class FormData {
1227
1386
  ): void;
1228
1387
  [Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
1229
1388
  }
1230
- declare interface ContentOptions {
1389
+ interface ContentOptions {
1231
1390
  html?: boolean;
1232
1391
  }
1233
1392
  declare class HTMLRewriter {
@@ -1239,23 +1398,23 @@ declare class HTMLRewriter {
1239
1398
  onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
1240
1399
  transform(response: Response): Response;
1241
1400
  }
1242
- declare interface HTMLRewriterElementContentHandlers {
1401
+ interface HTMLRewriterElementContentHandlers {
1243
1402
  element?(element: Element): void | Promise<void>;
1244
1403
  comments?(comment: Comment): void | Promise<void>;
1245
1404
  text?(element: Text): void | Promise<void>;
1246
1405
  }
1247
- declare interface HTMLRewriterDocumentContentHandlers {
1406
+ interface HTMLRewriterDocumentContentHandlers {
1248
1407
  doctype?(doctype: Doctype): void | Promise<void>;
1249
1408
  comments?(comment: Comment): void | Promise<void>;
1250
1409
  text?(text: Text): void | Promise<void>;
1251
1410
  end?(end: DocumentEnd): void | Promise<void>;
1252
1411
  }
1253
- declare interface Doctype {
1412
+ interface Doctype {
1254
1413
  readonly name: string | null;
1255
1414
  readonly publicId: string | null;
1256
1415
  readonly systemId: string | null;
1257
1416
  }
1258
- declare interface Element {
1417
+ interface Element {
1259
1418
  tagName: string;
1260
1419
  readonly attributes: IterableIterator<string[]>;
1261
1420
  readonly removed: boolean;
@@ -1274,13 +1433,13 @@ declare interface Element {
1274
1433
  setInnerContent(content: string, options?: ContentOptions): Element;
1275
1434
  onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
1276
1435
  }
1277
- declare interface EndTag {
1436
+ interface EndTag {
1278
1437
  name: string;
1279
1438
  before(content: string, options?: ContentOptions): EndTag;
1280
1439
  after(content: string, options?: ContentOptions): EndTag;
1281
1440
  remove(): EndTag;
1282
1441
  }
1283
- declare interface Comment {
1442
+ interface Comment {
1284
1443
  text: string;
1285
1444
  readonly removed: boolean;
1286
1445
  before(content: string, options?: ContentOptions): Comment;
@@ -1288,7 +1447,7 @@ declare interface Comment {
1288
1447
  replace(content: string, options?: ContentOptions): Comment;
1289
1448
  remove(): Comment;
1290
1449
  }
1291
- declare interface Text {
1450
+ interface Text {
1292
1451
  readonly text: string;
1293
1452
  readonly lastInTextNode: boolean;
1294
1453
  readonly removed: boolean;
@@ -1297,41 +1456,56 @@ declare interface Text {
1297
1456
  replace(content: string, options?: ContentOptions): Text;
1298
1457
  remove(): Text;
1299
1458
  }
1300
- declare interface DocumentEnd {
1459
+ interface DocumentEnd {
1301
1460
  append(content: string, options?: ContentOptions): DocumentEnd;
1302
1461
  }
1462
+ /**
1463
+ * This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.
1464
+ *
1465
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
1466
+ */
1303
1467
  declare abstract class FetchEvent extends ExtendableEvent {
1304
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1468
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1305
1469
  readonly request: Request;
1306
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1470
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1307
1471
  respondWith(promise: Response | Promise<Response>): void;
1308
1472
  passThroughOnException(): void;
1309
1473
  }
1310
- declare type HeadersInit =
1474
+ type HeadersInit =
1311
1475
  | Headers
1312
1476
  | Iterable<Iterable<string>>
1313
1477
  | Record<string, string>;
1478
+ /**
1479
+ * This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.
1480
+ *
1481
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
1482
+ */
1314
1483
  declare class Headers {
1315
1484
  constructor(init?: HeadersInit);
1485
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
1316
1486
  get(name: string): string | null;
1317
1487
  getAll(name: string): string[];
1488
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
1318
1489
  has(name: string): boolean;
1490
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
1319
1491
  set(name: string, value: string): void;
1492
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
1320
1493
  append(name: string, value: string): void;
1494
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
1321
1495
  delete(name: string): void;
1322
1496
  forEach<This = unknown>(
1323
1497
  callback: (this: This, value: string, key: string, parent: Headers) => void,
1324
1498
  thisArg?: This,
1325
1499
  ): void;
1326
- /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
1500
+ /* Returns an iterator allowing to go through all key/value pairs contained in this object. */
1327
1501
  entries(): IterableIterator<[key: string, value: string]>;
1328
- /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1502
+ /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1329
1503
  keys(): IterableIterator<string>;
1330
- /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1504
+ /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1331
1505
  values(): IterableIterator<string>;
1332
1506
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
1333
1507
  }
1334
- declare type BodyInit =
1508
+ type BodyInit =
1335
1509
  | ReadableStream<Uint8Array>
1336
1510
  | string
1337
1511
  | ArrayBuffer
@@ -1340,38 +1514,51 @@ declare type BodyInit =
1340
1514
  | URLSearchParams
1341
1515
  | FormData;
1342
1516
  declare abstract class Body {
1517
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
1343
1518
  get body(): ReadableStream | null;
1519
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
1344
1520
  get bodyUsed(): boolean;
1521
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
1345
1522
  arrayBuffer(): Promise<ArrayBuffer>;
1523
+ bytes(): Promise<Uint8Array>;
1524
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
1346
1525
  text(): Promise<string>;
1526
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
1347
1527
  json<T>(): Promise<T>;
1528
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
1348
1529
  formData(): Promise<FormData>;
1530
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
1349
1531
  blob(): Promise<Blob>;
1350
1532
  }
1533
+ /**
1534
+ * This Fetch API interface represents the response to a request.
1535
+ *
1536
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1537
+ */
1351
1538
  declare class Response extends Body {
1352
1539
  constructor(body?: BodyInit | null, init?: ResponseInit);
1353
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1540
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1354
1541
  static redirect(url: string, status?: number): Response;
1355
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1542
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1356
1543
  static json(any: any, maybeInit?: ResponseInit | Response): Response;
1357
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1544
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1358
1545
  clone(): Response;
1359
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1546
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1360
1547
  get status(): number;
1361
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1548
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1362
1549
  get statusText(): string;
1363
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1550
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1364
1551
  get headers(): Headers;
1365
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1552
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1366
1553
  get ok(): boolean;
1367
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1554
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1368
1555
  get redirected(): boolean;
1369
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1556
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1370
1557
  get url(): string;
1371
1558
  get webSocket(): WebSocket | null;
1372
1559
  get cf(): any | undefined;
1373
1560
  }
1374
- declare interface ResponseInit {
1561
+ interface ResponseInit {
1375
1562
  status?: number;
1376
1563
  statusText?: string;
1377
1564
  headers?: HeadersInit;
@@ -1379,16 +1566,21 @@ declare interface ResponseInit {
1379
1566
  webSocket?: WebSocket | null;
1380
1567
  encodeBody?: "automatic" | "manual";
1381
1568
  }
1382
- declare type RequestInfo<
1383
- CfHostMetadata = unknown,
1384
- Cf = CfProperties<CfHostMetadata>,
1385
- > = Request<CfHostMetadata, Cf> | string | URL;
1569
+ type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
1570
+ | Request<CfHostMetadata, Cf>
1571
+ | string
1572
+ | URL;
1573
+ /**
1574
+ * This Fetch API interface represents a resource request.
1575
+ *
1576
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1577
+ */
1386
1578
  declare class Request<
1387
1579
  CfHostMetadata = unknown,
1388
1580
  Cf = CfProperties<CfHostMetadata>,
1389
1581
  > extends Body {
1390
1582
  constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
1391
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1583
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1392
1584
  clone(): Request<CfHostMetadata, Cf>;
1393
1585
  /**
1394
1586
  * Returns request's HTTP method, which is "GET" by default.
@@ -1435,26 +1627,25 @@ declare class Request<
1435
1627
  */
1436
1628
  get keepalive(): boolean;
1437
1629
  }
1438
- declare interface RequestInit<Cf = CfProperties> {
1439
- /** A string to set request's method. */
1630
+ interface RequestInit<Cf = CfProperties> {
1631
+ /* A string to set request's method. */
1440
1632
  method?: string;
1441
- /** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
1633
+ /* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
1442
1634
  headers?: HeadersInit;
1443
- /** A BodyInit object or null to set request's body. */
1635
+ /* A BodyInit object or null to set request's body. */
1444
1636
  body?: BodyInit | null;
1445
- /** A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */
1637
+ /* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */
1446
1638
  redirect?: string;
1447
1639
  fetcher?: Fetcher | null;
1448
1640
  cf?: Cf;
1449
- /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1641
+ /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1450
1642
  integrity?: string;
1451
- /** An AbortSignal to set request's signal. */
1643
+ /* An AbortSignal to set request's signal. */
1452
1644
  signal?: AbortSignal | null;
1453
1645
  }
1454
- declare type Service<
1455
- T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
1456
- > = Fetcher<T>;
1457
- declare type Fetcher<
1646
+ type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> =
1647
+ Fetcher<T>;
1648
+ type Fetcher<
1458
1649
  T extends Rpc.EntrypointBranded | undefined = undefined,
1459
1650
  Reserved extends string = never,
1460
1651
  > = (T extends Rpc.EntrypointBranded
@@ -1463,16 +1654,16 @@ declare type Fetcher<
1463
1654
  fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
1464
1655
  connect(address: SocketAddress | string, options?: SocketOptions): Socket;
1465
1656
  };
1466
- declare interface FetcherPutOptions {
1657
+ interface FetcherPutOptions {
1467
1658
  expiration?: number;
1468
1659
  expirationTtl?: number;
1469
1660
  }
1470
- declare interface KVNamespaceListKey<Metadata, Key extends string = string> {
1661
+ interface KVNamespaceListKey<Metadata, Key extends string = string> {
1471
1662
  name: Key;
1472
1663
  expiration?: number;
1473
1664
  metadata?: Metadata;
1474
1665
  }
1475
- declare type KVNamespaceListResult<Metadata, Key extends string = string> =
1666
+ type KVNamespaceListResult<Metadata, Key extends string = string> =
1476
1667
  | {
1477
1668
  list_complete: false;
1478
1669
  keys: KVNamespaceListKey<Metadata, Key>[];
@@ -1484,7 +1675,7 @@ declare type KVNamespaceListResult<Metadata, Key extends string = string> =
1484
1675
  keys: KVNamespaceListKey<Metadata, Key>[];
1485
1676
  cacheStatus: string | null;
1486
1677
  };
1487
- declare interface KVNamespace<Key extends string = string> {
1678
+ interface KVNamespace<Key extends string = string> {
1488
1679
  get(
1489
1680
  key: Key,
1490
1681
  options?: Partial<KVNamespaceGetOptions<undefined>>,
@@ -1558,49 +1749,49 @@ declare interface KVNamespace<Key extends string = string> {
1558
1749
  ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1559
1750
  delete(key: Key): Promise<void>;
1560
1751
  }
1561
- declare interface KVNamespaceListOptions {
1752
+ interface KVNamespaceListOptions {
1562
1753
  limit?: number;
1563
1754
  prefix?: string | null;
1564
1755
  cursor?: string | null;
1565
1756
  }
1566
- declare interface KVNamespaceGetOptions<Type> {
1757
+ interface KVNamespaceGetOptions<Type> {
1567
1758
  type: Type;
1568
1759
  cacheTtl?: number;
1569
1760
  }
1570
- declare interface KVNamespacePutOptions {
1761
+ interface KVNamespacePutOptions {
1571
1762
  expiration?: number;
1572
1763
  expirationTtl?: number;
1573
1764
  metadata?: any | null;
1574
1765
  }
1575
- declare interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
1766
+ interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
1576
1767
  value: Value | null;
1577
1768
  metadata: Metadata | null;
1578
1769
  cacheStatus: string | null;
1579
1770
  }
1580
- declare type QueueContentType = "text" | "bytes" | "json" | "v8";
1581
- declare interface Queue<Body = unknown> {
1771
+ type QueueContentType = "text" | "bytes" | "json" | "v8";
1772
+ interface Queue<Body = unknown> {
1582
1773
  send(message: Body, options?: QueueSendOptions): Promise<void>;
1583
1774
  sendBatch(
1584
1775
  messages: Iterable<MessageSendRequest<Body>>,
1585
1776
  options?: QueueSendBatchOptions,
1586
1777
  ): Promise<void>;
1587
1778
  }
1588
- declare interface QueueSendOptions {
1779
+ interface QueueSendOptions {
1589
1780
  contentType?: QueueContentType;
1590
1781
  delaySeconds?: number;
1591
1782
  }
1592
- declare interface QueueSendBatchOptions {
1783
+ interface QueueSendBatchOptions {
1593
1784
  delaySeconds?: number;
1594
1785
  }
1595
- declare interface MessageSendRequest<Body = unknown> {
1786
+ interface MessageSendRequest<Body = unknown> {
1596
1787
  body: Body;
1597
1788
  contentType?: QueueContentType;
1598
1789
  delaySeconds?: number;
1599
1790
  }
1600
- declare interface QueueRetryOptions {
1791
+ interface QueueRetryOptions {
1601
1792
  delaySeconds?: number;
1602
1793
  }
1603
- declare interface Message<Body = unknown> {
1794
+ interface Message<Body = unknown> {
1604
1795
  readonly id: string;
1605
1796
  readonly timestamp: Date;
1606
1797
  readonly body: Body;
@@ -1608,26 +1799,26 @@ declare interface Message<Body = unknown> {
1608
1799
  retry(options?: QueueRetryOptions): void;
1609
1800
  ack(): void;
1610
1801
  }
1611
- declare interface QueueEvent<Body = unknown> extends ExtendableEvent {
1802
+ interface QueueEvent<Body = unknown> extends ExtendableEvent {
1612
1803
  readonly messages: readonly Message<Body>[];
1613
1804
  readonly queue: string;
1614
1805
  retryAll(options?: QueueRetryOptions): void;
1615
1806
  ackAll(): void;
1616
1807
  }
1617
- declare interface MessageBatch<Body = unknown> {
1808
+ interface MessageBatch<Body = unknown> {
1618
1809
  readonly messages: readonly Message<Body>[];
1619
1810
  readonly queue: string;
1620
1811
  retryAll(options?: QueueRetryOptions): void;
1621
1812
  ackAll(): void;
1622
1813
  }
1623
- declare interface R2Error extends Error {
1814
+ interface R2Error extends Error {
1624
1815
  readonly name: string;
1625
1816
  readonly code: number;
1626
1817
  readonly message: string;
1627
1818
  readonly action: string;
1628
1819
  readonly stack: any;
1629
1820
  }
1630
- declare interface R2ListOptions {
1821
+ interface R2ListOptions {
1631
1822
  limit?: number;
1632
1823
  prefix?: string;
1633
1824
  cursor?: string;
@@ -1676,7 +1867,7 @@ declare abstract class R2Bucket {
1676
1867
  delete(keys: string | string[]): Promise<void>;
1677
1868
  list(options?: R2ListOptions): Promise<R2Objects>;
1678
1869
  }
1679
- declare interface R2MultipartUpload {
1870
+ interface R2MultipartUpload {
1680
1871
  readonly key: string;
1681
1872
  readonly uploadId: string;
1682
1873
  uploadPart(
@@ -1686,7 +1877,7 @@ declare interface R2MultipartUpload {
1686
1877
  abort(): Promise<void>;
1687
1878
  complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
1688
1879
  }
1689
- declare interface R2UploadedPart {
1880
+ interface R2UploadedPart {
1690
1881
  partNumber: number;
1691
1882
  etag: string;
1692
1883
  }
@@ -1704,7 +1895,7 @@ declare abstract class R2Object {
1704
1895
  readonly storageClass: string;
1705
1896
  writeHttpMetadata(headers: Headers): void;
1706
1897
  }
1707
- declare interface R2ObjectBody extends R2Object {
1898
+ interface R2ObjectBody extends R2Object {
1708
1899
  get body(): ReadableStream;
1709
1900
  get bodyUsed(): boolean;
1710
1901
  arrayBuffer(): Promise<ArrayBuffer>;
@@ -1712,7 +1903,7 @@ declare interface R2ObjectBody extends R2Object {
1712
1903
  json<T>(): Promise<T>;
1713
1904
  blob(): Promise<Blob>;
1714
1905
  }
1715
- declare type R2Range =
1906
+ type R2Range =
1716
1907
  | {
1717
1908
  offset: number;
1718
1909
  length?: number;
@@ -1724,18 +1915,18 @@ declare type R2Range =
1724
1915
  | {
1725
1916
  suffix: number;
1726
1917
  };
1727
- declare interface R2Conditional {
1918
+ interface R2Conditional {
1728
1919
  etagMatches?: string;
1729
1920
  etagDoesNotMatch?: string;
1730
1921
  uploadedBefore?: Date;
1731
1922
  uploadedAfter?: Date;
1732
1923
  secondsGranularity?: boolean;
1733
1924
  }
1734
- declare interface R2GetOptions {
1925
+ interface R2GetOptions {
1735
1926
  onlyIf?: R2Conditional | Headers;
1736
1927
  range?: R2Range | Headers;
1737
1928
  }
1738
- declare interface R2PutOptions {
1929
+ interface R2PutOptions {
1739
1930
  onlyIf?: R2Conditional | Headers;
1740
1931
  httpMetadata?: R2HTTPMetadata | Headers;
1741
1932
  customMetadata?: Record<string, string>;
@@ -1746,12 +1937,12 @@ declare interface R2PutOptions {
1746
1937
  sha512?: ArrayBuffer | string;
1747
1938
  storageClass?: string;
1748
1939
  }
1749
- declare interface R2MultipartOptions {
1940
+ interface R2MultipartOptions {
1750
1941
  httpMetadata?: R2HTTPMetadata | Headers;
1751
1942
  customMetadata?: Record<string, string>;
1752
1943
  storageClass?: string;
1753
1944
  }
1754
- declare interface R2Checksums {
1945
+ interface R2Checksums {
1755
1946
  readonly md5?: ArrayBuffer;
1756
1947
  readonly sha1?: ArrayBuffer;
1757
1948
  readonly sha256?: ArrayBuffer;
@@ -1759,14 +1950,14 @@ declare interface R2Checksums {
1759
1950
  readonly sha512?: ArrayBuffer;
1760
1951
  toJSON(): R2StringChecksums;
1761
1952
  }
1762
- declare interface R2StringChecksums {
1953
+ interface R2StringChecksums {
1763
1954
  md5?: string;
1764
1955
  sha1?: string;
1765
1956
  sha256?: string;
1766
1957
  sha384?: string;
1767
1958
  sha512?: string;
1768
1959
  }
1769
- declare interface R2HTTPMetadata {
1960
+ interface R2HTTPMetadata {
1770
1961
  contentType?: string;
1771
1962
  contentLanguage?: string;
1772
1963
  contentDisposition?: string;
@@ -1774,7 +1965,7 @@ declare interface R2HTTPMetadata {
1774
1965
  cacheControl?: string;
1775
1966
  cacheExpiry?: Date;
1776
1967
  }
1777
- declare type R2Objects = {
1968
+ type R2Objects = {
1778
1969
  objects: R2Object[];
1779
1970
  delimitedPrefixes: string[];
1780
1971
  } & (
@@ -1791,16 +1982,16 @@ declare abstract class ScheduledEvent extends ExtendableEvent {
1791
1982
  readonly cron: string;
1792
1983
  noRetry(): void;
1793
1984
  }
1794
- declare interface ScheduledController {
1985
+ interface ScheduledController {
1795
1986
  readonly scheduledTime: number;
1796
1987
  readonly cron: string;
1797
1988
  noRetry(): void;
1798
1989
  }
1799
- declare interface QueuingStrategy<T = any> {
1990
+ interface QueuingStrategy<T = any> {
1800
1991
  highWaterMark?: number | bigint;
1801
1992
  size?: (chunk: T) => number | bigint;
1802
1993
  }
1803
- declare interface UnderlyingSink<W = any> {
1994
+ interface UnderlyingSink<W = any> {
1804
1995
  type?: string;
1805
1996
  start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
1806
1997
  write?: (
@@ -1810,14 +2001,14 @@ declare interface UnderlyingSink<W = any> {
1810
2001
  abort?: (reason: any) => void | Promise<void>;
1811
2002
  close?: () => void | Promise<void>;
1812
2003
  }
1813
- declare interface UnderlyingByteSource {
2004
+ interface UnderlyingByteSource {
1814
2005
  type: "bytes";
1815
2006
  autoAllocateChunkSize?: number;
1816
2007
  start?: (controller: ReadableByteStreamController) => void | Promise<void>;
1817
2008
  pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
1818
2009
  cancel?: (reason: any) => void | Promise<void>;
1819
2010
  }
1820
- declare interface UnderlyingSource<R = any> {
2011
+ interface UnderlyingSource<R = any> {
1821
2012
  type?: "" | undefined;
1822
2013
  start?: (
1823
2014
  controller: ReadableStreamDefaultController<R>,
@@ -1828,7 +2019,7 @@ declare interface UnderlyingSource<R = any> {
1828
2019
  cancel?: (reason: any) => void | Promise<void>;
1829
2020
  expectedLength?: number | bigint;
1830
2021
  }
1831
- declare interface Transformer<I = any, O = any> {
2022
+ interface Transformer<I = any, O = any> {
1832
2023
  readableType?: string;
1833
2024
  writableType?: string;
1834
2025
  start?: (
@@ -1844,7 +2035,7 @@ declare interface Transformer<I = any, O = any> {
1844
2035
  cancel?: (reason: any) => void | Promise<void>;
1845
2036
  expectedLength?: number;
1846
2037
  }
1847
- declare interface StreamPipeOptions {
2038
+ interface StreamPipeOptions {
1848
2039
  /**
1849
2040
  * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
1850
2041
  *
@@ -1867,7 +2058,7 @@ declare interface StreamPipeOptions {
1867
2058
  preventCancel?: boolean;
1868
2059
  signal?: AbortSignal;
1869
2060
  }
1870
- declare type ReadableStreamReadResult<R = any> =
2061
+ type ReadableStreamReadResult<R = any> =
1871
2062
  | {
1872
2063
  done: false;
1873
2064
  value: R;
@@ -1881,32 +2072,37 @@ declare type ReadableStreamReadResult<R = any> =
1881
2072
  *
1882
2073
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1883
2074
  */
1884
- declare interface ReadableStream<R = any> {
1885
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
2075
+ interface ReadableStream<R = any> {
2076
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
1886
2077
  get locked(): boolean;
1887
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
2078
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
1888
2079
  cancel(reason?: any): Promise<void>;
1889
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2080
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1890
2081
  getReader(): ReadableStreamDefaultReader<R>;
1891
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2082
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1892
2083
  getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1893
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
2084
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
1894
2085
  pipeThrough<T>(
1895
2086
  transform: ReadableWritablePair<T, R>,
1896
2087
  options?: StreamPipeOptions,
1897
2088
  ): ReadableStream<T>;
1898
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
2089
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
1899
2090
  pipeTo(
1900
2091
  destination: WritableStream<R>,
1901
2092
  options?: StreamPipeOptions,
1902
2093
  ): Promise<void>;
1903
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
2094
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
1904
2095
  tee(): [ReadableStream<R>, ReadableStream<R>];
1905
2096
  values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1906
2097
  [Symbol.asyncIterator](
1907
2098
  options?: ReadableStreamValuesOptions,
1908
2099
  ): AsyncIterableIterator<R>;
1909
2100
  }
2101
+ /**
2102
+ * 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.
2103
+ *
2104
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
2105
+ */
1910
2106
  declare const ReadableStream: {
1911
2107
  prototype: ReadableStream;
1912
2108
  new (
@@ -1918,34 +2114,36 @@ declare const ReadableStream: {
1918
2114
  strategy?: QueuingStrategy<R>,
1919
2115
  ): ReadableStream<R>;
1920
2116
  };
2117
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
1921
2118
  declare class ReadableStreamDefaultReader<R = any> {
1922
2119
  constructor(stream: ReadableStream);
1923
2120
  get closed(): Promise<void>;
1924
2121
  cancel(reason?: any): Promise<void>;
1925
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
2122
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
1926
2123
  read(): Promise<ReadableStreamReadResult<R>>;
1927
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
2124
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
1928
2125
  releaseLock(): void;
1929
2126
  }
2127
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
1930
2128
  declare class ReadableStreamBYOBReader {
1931
2129
  constructor(stream: ReadableStream);
1932
2130
  get closed(): Promise<void>;
1933
2131
  cancel(reason?: any): Promise<void>;
1934
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
2132
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
1935
2133
  read<T extends ArrayBufferView>(
1936
2134
  view: T,
1937
2135
  ): Promise<ReadableStreamReadResult<T>>;
1938
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
2136
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
1939
2137
  releaseLock(): void;
1940
2138
  readAtLeast<T extends ArrayBufferView>(
1941
2139
  minElements: number,
1942
2140
  view: T,
1943
2141
  ): Promise<ReadableStreamReadResult<T>>;
1944
2142
  }
1945
- declare interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
2143
+ interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
1946
2144
  min?: number;
1947
2145
  }
1948
- declare interface ReadableStreamGetReaderOptions {
2146
+ interface ReadableStreamGetReaderOptions {
1949
2147
  /**
1950
2148
  * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
1951
2149
  *
@@ -1953,55 +2151,63 @@ declare interface ReadableStreamGetReaderOptions {
1953
2151
  */
1954
2152
  mode: "byob";
1955
2153
  }
2154
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
1956
2155
  declare abstract class ReadableStreamBYOBRequest {
1957
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
2156
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
1958
2157
  get view(): Uint8Array | null;
1959
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
2158
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
1960
2159
  respond(bytesWritten: number): void;
1961
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
2160
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
1962
2161
  respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
1963
2162
  get atLeast(): number | null;
1964
2163
  }
2164
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
1965
2165
  declare abstract class ReadableStreamDefaultController<R = any> {
1966
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
2166
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
1967
2167
  get desiredSize(): number | null;
1968
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
2168
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
1969
2169
  close(): void;
1970
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
2170
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
1971
2171
  enqueue(chunk?: R): void;
1972
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
2172
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
1973
2173
  error(reason: any): void;
1974
2174
  }
2175
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
1975
2176
  declare abstract class ReadableByteStreamController {
1976
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
2177
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
1977
2178
  get byobRequest(): ReadableStreamBYOBRequest | null;
1978
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
2179
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
1979
2180
  get desiredSize(): number | null;
1980
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
2181
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
1981
2182
  close(): void;
1982
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
2183
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
1983
2184
  enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
1984
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
2185
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
1985
2186
  error(reason: any): void;
1986
2187
  }
2188
+ /**
2189
+ * 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.
2190
+ *
2191
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
2192
+ */
1987
2193
  declare abstract class WritableStreamDefaultController {
1988
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
2194
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
1989
2195
  get signal(): AbortSignal;
1990
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
2196
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
1991
2197
  error(reason?: any): void;
1992
2198
  }
1993
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
1994
- declare interface TransformStreamDefaultController<O = any> {
1995
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
2199
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
2200
+ declare abstract class TransformStreamDefaultController<O = any> {
2201
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
1996
2202
  get desiredSize(): number | null;
1997
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
2203
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
1998
2204
  enqueue(chunk?: O): void;
1999
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
2205
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
2000
2206
  error(reason: any): void;
2001
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
2207
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
2002
2208
  terminate(): void;
2003
2209
  }
2004
- declare interface ReadableWritablePair<R = any, W = any> {
2210
+ interface ReadableWritablePair<R = any, W = any> {
2005
2211
  /**
2006
2212
  * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
2007
2213
  *
@@ -2010,46 +2216,57 @@ declare interface ReadableWritablePair<R = any, W = any> {
2010
2216
  writable: WritableStream<W>;
2011
2217
  readable: ReadableStream<R>;
2012
2218
  }
2219
+ /**
2220
+ * This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
2221
+ *
2222
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
2223
+ */
2013
2224
  declare class WritableStream<W = any> {
2014
2225
  constructor(
2015
2226
  underlyingSink?: UnderlyingSink,
2016
2227
  queuingStrategy?: QueuingStrategy,
2017
2228
  );
2018
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
2229
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
2019
2230
  get locked(): boolean;
2020
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
2231
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
2021
2232
  abort(reason?: any): Promise<void>;
2022
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
2233
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
2023
2234
  close(): Promise<void>;
2024
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
2235
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
2025
2236
  getWriter(): WritableStreamDefaultWriter<W>;
2026
2237
  }
2238
+ /**
2239
+ * This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.
2240
+ *
2241
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
2242
+ */
2027
2243
  declare class WritableStreamDefaultWriter<W = any> {
2028
2244
  constructor(stream: WritableStream);
2029
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
2245
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
2030
2246
  get closed(): Promise<void>;
2031
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
2247
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
2032
2248
  get ready(): Promise<void>;
2033
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
2249
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
2034
2250
  get desiredSize(): number | null;
2035
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
2251
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
2036
2252
  abort(reason?: any): Promise<void>;
2037
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
2253
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
2038
2254
  close(): Promise<void>;
2039
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
2255
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
2040
2256
  write(chunk?: W): Promise<void>;
2041
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
2257
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
2042
2258
  releaseLock(): void;
2043
2259
  }
2260
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
2044
2261
  declare class TransformStream<I = any, O = any> {
2045
2262
  constructor(
2046
2263
  transformer?: Transformer<I, O>,
2047
2264
  writableStrategy?: QueuingStrategy<I>,
2048
2265
  readableStrategy?: QueuingStrategy<O>,
2049
2266
  );
2050
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
2267
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
2051
2268
  get readable(): ReadableStream<O>;
2052
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
2269
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
2053
2270
  get writable(): WritableStream<I>;
2054
2271
  }
2055
2272
  declare class FixedLengthStream extends IdentityTransformStream {
@@ -2064,28 +2281,32 @@ declare class IdentityTransformStream extends TransformStream<
2064
2281
  > {
2065
2282
  constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2066
2283
  }
2067
- declare interface IdentityTransformStreamQueuingStrategy {
2284
+ interface IdentityTransformStreamQueuingStrategy {
2068
2285
  highWaterMark?: number | bigint;
2069
2286
  }
2070
- declare interface ReadableStreamValuesOptions {
2287
+ interface ReadableStreamValuesOptions {
2071
2288
  preventCancel?: boolean;
2072
2289
  }
2290
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
2073
2291
  declare class CompressionStream extends TransformStream<
2074
2292
  ArrayBuffer | ArrayBufferView,
2075
2293
  Uint8Array
2076
2294
  > {
2077
2295
  constructor(format: "gzip" | "deflate" | "deflate-raw");
2078
2296
  }
2297
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
2079
2298
  declare class DecompressionStream extends TransformStream<
2080
2299
  ArrayBuffer | ArrayBufferView,
2081
2300
  Uint8Array
2082
2301
  > {
2083
2302
  constructor(format: "gzip" | "deflate" | "deflate-raw");
2084
2303
  }
2304
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
2085
2305
  declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
2086
2306
  constructor();
2087
2307
  get encoding(): string;
2088
2308
  }
2309
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
2089
2310
  declare class TextDecoderStream extends TransformStream<
2090
2311
  ArrayBuffer | ArrayBufferView,
2091
2312
  string
@@ -2095,27 +2316,37 @@ declare class TextDecoderStream extends TransformStream<
2095
2316
  get fatal(): boolean;
2096
2317
  get ignoreBOM(): boolean;
2097
2318
  }
2098
- declare interface TextDecoderStreamTextDecoderStreamInit {
2319
+ interface TextDecoderStreamTextDecoderStreamInit {
2099
2320
  fatal?: boolean;
2100
2321
  ignoreBOM?: boolean;
2101
2322
  }
2323
+ /**
2324
+ * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2325
+ *
2326
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
2327
+ */
2102
2328
  declare class ByteLengthQueuingStrategy
2103
2329
  implements QueuingStrategy<ArrayBufferView>
2104
2330
  {
2105
2331
  constructor(init: QueuingStrategyInit);
2106
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
2332
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
2107
2333
  get highWaterMark(): number;
2108
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
2334
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
2109
2335
  get size(): (chunk?: any) => number;
2110
2336
  }
2337
+ /**
2338
+ * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2339
+ *
2340
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
2341
+ */
2111
2342
  declare class CountQueuingStrategy implements QueuingStrategy {
2112
2343
  constructor(init: QueuingStrategyInit);
2113
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
2344
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
2114
2345
  get highWaterMark(): number;
2115
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
2346
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
2116
2347
  get size(): (chunk?: any) => number;
2117
2348
  }
2118
- declare interface QueuingStrategyInit {
2349
+ interface QueuingStrategyInit {
2119
2350
  /**
2120
2351
  * Creates a new ByteLengthQueuingStrategy with the provided high water mark.
2121
2352
  *
@@ -2123,7 +2354,7 @@ declare interface QueuingStrategyInit {
2123
2354
  */
2124
2355
  highWaterMark: number;
2125
2356
  }
2126
- declare interface ScriptVersion {
2357
+ interface ScriptVersion {
2127
2358
  id?: string;
2128
2359
  tag?: string;
2129
2360
  message?: string;
@@ -2132,7 +2363,7 @@ declare abstract class TailEvent extends ExtendableEvent {
2132
2363
  readonly events: TraceItem[];
2133
2364
  readonly traces: TraceItem[];
2134
2365
  }
2135
- declare interface TraceItem {
2366
+ interface TraceItem {
2136
2367
  readonly event:
2137
2368
  | (
2138
2369
  | TraceItemFetchEventInfo
@@ -2157,156 +2388,195 @@ declare interface TraceItem {
2157
2388
  readonly scriptTags?: string[];
2158
2389
  readonly outcome: string;
2159
2390
  }
2160
- declare interface TraceItemAlarmEventInfo {
2391
+ interface TraceItemAlarmEventInfo {
2161
2392
  readonly scheduledTime: Date;
2162
2393
  }
2163
- declare interface TraceItemCustomEventInfo {}
2164
- declare interface TraceItemScheduledEventInfo {
2394
+ interface TraceItemCustomEventInfo {}
2395
+ interface TraceItemScheduledEventInfo {
2165
2396
  readonly scheduledTime: number;
2166
2397
  readonly cron: string;
2167
2398
  }
2168
- declare interface TraceItemQueueEventInfo {
2399
+ interface TraceItemQueueEventInfo {
2169
2400
  readonly queue: string;
2170
2401
  readonly batchSize: number;
2171
2402
  }
2172
- declare interface TraceItemEmailEventInfo {
2403
+ interface TraceItemEmailEventInfo {
2173
2404
  readonly mailFrom: string;
2174
2405
  readonly rcptTo: string;
2175
2406
  readonly rawSize: number;
2176
2407
  }
2177
- declare interface TraceItemTailEventInfo {
2408
+ interface TraceItemTailEventInfo {
2178
2409
  readonly consumedEvents: TraceItemTailEventInfoTailItem[];
2179
2410
  }
2180
- declare interface TraceItemTailEventInfoTailItem {
2411
+ interface TraceItemTailEventInfoTailItem {
2181
2412
  readonly scriptName: string | null;
2182
2413
  }
2183
- declare interface TraceItemFetchEventInfo {
2414
+ interface TraceItemFetchEventInfo {
2184
2415
  readonly response?: TraceItemFetchEventInfoResponse;
2185
2416
  readonly request: TraceItemFetchEventInfoRequest;
2186
2417
  }
2187
- declare interface TraceItemFetchEventInfoRequest {
2418
+ interface TraceItemFetchEventInfoRequest {
2188
2419
  readonly cf?: any;
2189
2420
  readonly headers: Record<string, string>;
2190
2421
  readonly method: string;
2191
2422
  readonly url: string;
2192
2423
  getUnredacted(): TraceItemFetchEventInfoRequest;
2193
2424
  }
2194
- declare interface TraceItemFetchEventInfoResponse {
2425
+ interface TraceItemFetchEventInfoResponse {
2195
2426
  readonly status: number;
2196
2427
  }
2197
- declare interface TraceItemJsRpcEventInfo {
2428
+ interface TraceItemJsRpcEventInfo {
2198
2429
  readonly rpcMethod: string;
2199
2430
  }
2200
- declare interface TraceItemHibernatableWebSocketEventInfo {
2431
+ interface TraceItemHibernatableWebSocketEventInfo {
2201
2432
  readonly getWebSocketEvent:
2202
2433
  | TraceItemHibernatableWebSocketEventInfoMessage
2203
2434
  | TraceItemHibernatableWebSocketEventInfoClose
2204
2435
  | TraceItemHibernatableWebSocketEventInfoError;
2205
2436
  }
2206
- declare interface TraceItemHibernatableWebSocketEventInfoMessage {
2437
+ interface TraceItemHibernatableWebSocketEventInfoMessage {
2207
2438
  readonly webSocketEventType: string;
2208
2439
  }
2209
- declare interface TraceItemHibernatableWebSocketEventInfoClose {
2440
+ interface TraceItemHibernatableWebSocketEventInfoClose {
2210
2441
  readonly webSocketEventType: string;
2211
2442
  readonly code: number;
2212
2443
  readonly wasClean: boolean;
2213
2444
  }
2214
- declare interface TraceItemHibernatableWebSocketEventInfoError {
2445
+ interface TraceItemHibernatableWebSocketEventInfoError {
2215
2446
  readonly webSocketEventType: string;
2216
2447
  }
2217
- declare interface TraceLog {
2448
+ interface TraceLog {
2218
2449
  readonly timestamp: number;
2219
2450
  readonly level: string;
2220
2451
  readonly message: any;
2221
2452
  }
2222
- declare interface TraceException {
2453
+ interface TraceException {
2223
2454
  readonly timestamp: number;
2224
2455
  readonly message: string;
2225
2456
  readonly name: string;
2226
2457
  readonly stack?: string;
2227
2458
  }
2228
- declare interface TraceDiagnosticChannelEvent {
2459
+ interface TraceDiagnosticChannelEvent {
2229
2460
  readonly timestamp: number;
2230
2461
  readonly channel: string;
2231
2462
  readonly message: any;
2232
2463
  }
2233
- declare interface TraceMetrics {
2464
+ interface TraceMetrics {
2234
2465
  readonly cpuTime: number;
2235
2466
  readonly wallTime: number;
2236
2467
  }
2237
- declare interface UnsafeTraceMetrics {
2468
+ interface UnsafeTraceMetrics {
2238
2469
  fromTrace(item: TraceItem): TraceMetrics;
2239
2470
  }
2471
+ /**
2472
+ * The URL interface represents an object providing static methods used for creating object URLs.
2473
+ *
2474
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
2475
+ */
2240
2476
  declare class URL {
2241
2477
  constructor(url: string | URL, base?: string | URL);
2242
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2478
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2243
2479
  get origin(): string;
2244
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2480
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2245
2481
  get href(): string;
2246
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2482
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2247
2483
  set href(value: string);
2248
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2484
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2249
2485
  get protocol(): string;
2250
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2486
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2251
2487
  set protocol(value: string);
2252
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2488
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2253
2489
  get username(): string;
2254
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2490
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2255
2491
  set username(value: string);
2256
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2492
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2257
2493
  get password(): string;
2258
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2494
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2259
2495
  set password(value: string);
2260
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2496
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2261
2497
  get host(): string;
2262
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2498
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2263
2499
  set host(value: string);
2264
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2500
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2265
2501
  get hostname(): string;
2266
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2502
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2267
2503
  set hostname(value: string);
2268
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2504
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2269
2505
  get port(): string;
2270
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2506
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2271
2507
  set port(value: string);
2272
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2508
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2273
2509
  get pathname(): string;
2274
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2510
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2275
2511
  set pathname(value: string);
2276
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2512
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2277
2513
  get search(): string;
2278
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2514
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2279
2515
  set search(value: string);
2280
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2516
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2281
2517
  get hash(): string;
2282
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2518
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2283
2519
  set hash(value: string);
2284
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2520
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2285
2521
  get searchParams(): URLSearchParams;
2286
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2522
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2287
2523
  toJSON(): string;
2524
+ /*function toString() { [native code] }*/
2288
2525
  toString(): string;
2289
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2526
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2290
2527
  static canParse(url: string, base?: string): boolean;
2291
2528
  static parse(url: string, base?: string): URL | null;
2292
2529
  }
2530
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
2293
2531
  declare class URLSearchParams {
2294
2532
  constructor(
2295
2533
  init?: Iterable<Iterable<string>> | Record<string, string> | string,
2296
2534
  );
2535
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
2297
2536
  get size(): number;
2537
+ /**
2538
+ * Appends a specified key/value pair as a new search parameter.
2539
+ *
2540
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
2541
+ */
2298
2542
  append(name: string, value: string): void;
2543
+ /**
2544
+ * Deletes the given search parameter, and its associated value, from the list of all search parameters.
2545
+ *
2546
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
2547
+ */
2299
2548
  delete(name: string): void;
2549
+ /**
2550
+ * Returns the first value associated to the given search parameter.
2551
+ *
2552
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
2553
+ */
2300
2554
  get(name: string): string | null;
2555
+ /**
2556
+ * Returns all the values association with a given search parameter.
2557
+ *
2558
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
2559
+ */
2301
2560
  getAll(name: string): string[];
2561
+ /**
2562
+ * Returns a Boolean indicating if such a search parameter exists.
2563
+ *
2564
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
2565
+ */
2302
2566
  has(name: string): boolean;
2567
+ /**
2568
+ * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
2569
+ *
2570
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
2571
+ */
2303
2572
  set(name: string, value: string): void;
2573
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
2304
2574
  sort(): void;
2305
- /** Returns an array of key, value pairs for every entry in the search params. */
2575
+ /* Returns an array of key, value pairs for every entry in the search params. */
2306
2576
  entries(): IterableIterator<[key: string, value: string]>;
2307
- /** Returns a list of keys in the search params. */
2577
+ /* Returns a list of keys in the search params. */
2308
2578
  keys(): IterableIterator<string>;
2309
- /** Returns a list of values in the search params. */
2579
+ /* Returns a list of values in the search params. */
2310
2580
  values(): IterableIterator<string>;
2311
2581
  forEach<This = unknown>(
2312
2582
  callback: (
@@ -2317,6 +2587,7 @@ declare class URLSearchParams {
2317
2587
  ) => void,
2318
2588
  thisArg?: This,
2319
2589
  ): void;
2590
+ /*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
2320
2591
  toString(): string;
2321
2592
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
2322
2593
  }
@@ -2340,7 +2611,7 @@ declare class URLPattern {
2340
2611
  baseURL?: string,
2341
2612
  ): URLPatternURLPatternResult | null;
2342
2613
  }
2343
- declare interface URLPatternURLPatternInit {
2614
+ interface URLPatternURLPatternInit {
2344
2615
  protocol?: string;
2345
2616
  username?: string;
2346
2617
  password?: string;
@@ -2351,11 +2622,11 @@ declare interface URLPatternURLPatternInit {
2351
2622
  hash?: string;
2352
2623
  baseURL?: string;
2353
2624
  }
2354
- declare interface URLPatternURLPatternComponentResult {
2625
+ interface URLPatternURLPatternComponentResult {
2355
2626
  input: string;
2356
2627
  groups: Record<string, string>;
2357
2628
  }
2358
- declare interface URLPatternURLPatternResult {
2629
+ interface URLPatternURLPatternResult {
2359
2630
  inputs: (string | URLPatternURLPatternInit)[];
2360
2631
  protocol: URLPatternURLPatternComponentResult;
2361
2632
  username: URLPatternURLPatternComponentResult;
@@ -2366,9 +2637,14 @@ declare interface URLPatternURLPatternResult {
2366
2637
  search: URLPatternURLPatternComponentResult;
2367
2638
  hash: URLPatternURLPatternComponentResult;
2368
2639
  }
2369
- declare interface URLPatternURLPatternOptions {
2640
+ interface URLPatternURLPatternOptions {
2370
2641
  ignoreCase?: boolean;
2371
2642
  }
2643
+ /**
2644
+ * A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
2645
+ *
2646
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
2647
+ */
2372
2648
  declare class CloseEvent extends Event {
2373
2649
  constructor(type: string, initializer?: CloseEventInit);
2374
2650
  /**
@@ -2390,41 +2666,39 @@ declare class CloseEvent extends Event {
2390
2666
  */
2391
2667
  readonly wasClean: boolean;
2392
2668
  }
2393
- declare interface CloseEventInit {
2669
+ interface CloseEventInit {
2394
2670
  code?: number;
2395
2671
  reason?: string;
2396
2672
  wasClean?: boolean;
2397
2673
  }
2674
+ /**
2675
+ * A message received by a target object.
2676
+ *
2677
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
2678
+ */
2398
2679
  declare class MessageEvent extends Event {
2399
2680
  constructor(type: string, initializer: MessageEventInit);
2681
+ /**
2682
+ * Returns the data of the message.
2683
+ *
2684
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
2685
+ */
2400
2686
  readonly data: ArrayBuffer | string;
2401
2687
  }
2402
- declare interface MessageEventInit {
2688
+ interface MessageEventInit {
2403
2689
  data: ArrayBuffer | string;
2404
2690
  }
2405
- /**
2406
- * Events providing information related to errors in scripts or in files.
2407
- *
2408
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
2409
- */
2410
- declare interface ErrorEvent extends Event {
2411
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
2412
- readonly filename: string;
2413
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
2414
- readonly message: string;
2415
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
2416
- readonly lineno: number;
2417
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
2418
- readonly colno: number;
2419
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
2420
- readonly error: any;
2421
- }
2422
- declare type WebSocketEventMap = {
2691
+ type WebSocketEventMap = {
2423
2692
  close: CloseEvent;
2424
2693
  message: MessageEvent;
2425
2694
  open: Event;
2426
2695
  error: ErrorEvent;
2427
2696
  };
2697
+ /**
2698
+ * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2699
+ *
2700
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2701
+ */
2428
2702
  declare class WebSocket extends EventTarget<WebSocketEventMap> {
2429
2703
  constructor(url: string, protocols?: string[] | string);
2430
2704
  accept(): void;
@@ -2481,7 +2755,7 @@ declare const WebSocketPair: {
2481
2755
  1: WebSocket;
2482
2756
  };
2483
2757
  };
2484
- declare interface Socket {
2758
+ interface Socket {
2485
2759
  get readable(): ReadableStream;
2486
2760
  get writable(): WritableStream;
2487
2761
  get closed(): Promise<void>;
@@ -2489,80 +2763,77 @@ declare interface Socket {
2489
2763
  close(): Promise<void>;
2490
2764
  startTls(options?: TlsOptions): Socket;
2491
2765
  }
2492
- declare interface SocketOptions {
2766
+ interface SocketOptions {
2493
2767
  secureTransport?: string;
2494
2768
  allowHalfOpen: boolean;
2769
+ highWaterMark?: number | bigint;
2495
2770
  }
2496
- declare interface SocketAddress {
2771
+ interface SocketAddress {
2497
2772
  hostname: string;
2498
2773
  port: number;
2499
2774
  }
2500
- declare interface TlsOptions {
2775
+ interface TlsOptions {
2501
2776
  expectedServerHostname?: string;
2502
2777
  }
2503
- declare interface SocketInfo {
2778
+ interface SocketInfo {
2504
2779
  remoteAddress?: string;
2505
2780
  localAddress?: string;
2506
2781
  }
2507
- declare interface gpuGPU {
2508
- requestAdapter(
2509
- param1?: gpuGPURequestAdapterOptions,
2510
- ): Promise<gpuGPUAdapter | null>;
2782
+ interface GPU {
2783
+ requestAdapter(param1?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
2511
2784
  }
2512
- declare abstract class gpuGPUAdapter {
2513
- requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
2514
- requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
2515
- get features(): gpuGPUSupportedFeatures;
2516
- get limits(): gpuGPUSupportedLimits;
2785
+ declare abstract class GPUAdapter {
2786
+ requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
2787
+ requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
2788
+ get features(): GPUSupportedFeatures;
2789
+ get limits(): GPUSupportedLimits;
2517
2790
  }
2518
- declare interface gpuGPUDevice extends EventTarget {
2519
- createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
2791
+ interface GPUDevice extends EventTarget {
2792
+ createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
2520
2793
  createBindGroupLayout(
2521
- descriptor: gpuGPUBindGroupLayoutDescriptor,
2522
- ): gpuGPUBindGroupLayout;
2523
- createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
2524
- createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
2525
- createShaderModule(
2526
- descriptor: gpuGPUShaderModuleDescriptor,
2527
- ): gpuGPUShaderModule;
2794
+ descriptor: GPUBindGroupLayoutDescriptor,
2795
+ ): GPUBindGroupLayout;
2796
+ createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
2797
+ createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
2798
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
2528
2799
  createPipelineLayout(
2529
- descriptor: gpuGPUPipelineLayoutDescriptor,
2530
- ): gpuGPUPipelineLayout;
2800
+ descriptor: GPUPipelineLayoutDescriptor,
2801
+ ): GPUPipelineLayout;
2531
2802
  createComputePipeline(
2532
- descriptor: gpuGPUComputePipelineDescriptor,
2533
- ): gpuGPUComputePipeline;
2803
+ descriptor: GPUComputePipelineDescriptor,
2804
+ ): GPUComputePipeline;
2534
2805
  createRenderPipeline(
2535
- descriptor: gpuGPURenderPipelineDescriptor,
2536
- ): gpuGPURenderPipeline;
2806
+ descriptor: GPURenderPipelineDescriptor,
2807
+ ): GPURenderPipeline;
2537
2808
  createCommandEncoder(
2538
- descriptor?: gpuGPUCommandEncoderDescriptor,
2539
- ): gpuGPUCommandEncoder;
2540
- createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
2809
+ descriptor?: GPUCommandEncoderDescriptor,
2810
+ ): GPUCommandEncoder;
2811
+ createTexture(param1: GPUTextureDescriptor): GPUTexture;
2541
2812
  destroy(): void;
2542
- createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
2813
+ createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
2543
2814
  pushErrorScope(filter: string): void;
2544
- popErrorScope(): Promise<gpuGPUError | null>;
2545
- get queue(): gpuGPUQueue;
2546
- get lost(): Promise<gpuGPUDeviceLostInfo>;
2547
- get features(): gpuGPUSupportedFeatures;
2548
- get limits(): gpuGPUSupportedLimits;
2815
+ popErrorScope(): Promise<GPUError | null>;
2816
+ get queue(): GPUQueue;
2817
+ get lost(): Promise<GPUDeviceLostInfo>;
2818
+ get features(): GPUSupportedFeatures;
2819
+ get limits(): GPUSupportedLimits;
2549
2820
  }
2550
- declare interface gpuGPUDeviceDescriptor {
2821
+ interface GPUDeviceDescriptor {
2551
2822
  label?: string;
2552
2823
  requiredFeatures?: string[];
2553
2824
  requiredLimits?: Record<string, number | bigint>;
2554
- defaultQueue?: gpuGPUQueueDescriptor;
2825
+ defaultQueue?: GPUQueueDescriptor;
2555
2826
  }
2556
- declare interface gpuGPUBufferDescriptor {
2827
+ interface GPUBufferDescriptor {
2557
2828
  label: string;
2558
2829
  size: number | bigint;
2559
2830
  usage: number;
2560
2831
  mappedAtCreation: boolean;
2561
2832
  }
2562
- declare interface gpuGPUQueueDescriptor {
2833
+ interface GPUQueueDescriptor {
2563
2834
  label?: string;
2564
2835
  }
2565
- declare abstract class gpuGPUBufferUsage {
2836
+ declare abstract class GPUBufferUsage {
2566
2837
  static readonly MAP_READ: number;
2567
2838
  static readonly MAP_WRITE: number;
2568
2839
  static readonly COPY_SRC: number;
@@ -2574,7 +2845,7 @@ declare abstract class gpuGPUBufferUsage {
2574
2845
  static readonly INDIRECT: number;
2575
2846
  static readonly QUERY_RESOLVE: number;
2576
2847
  }
2577
- declare interface gpuGPUBuffer {
2848
+ interface GPUBuffer {
2578
2849
  getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2579
2850
  unmap(): void;
2580
2851
  destroy(): void;
@@ -2587,59 +2858,59 @@ declare interface gpuGPUBuffer {
2587
2858
  get usage(): number;
2588
2859
  get mapState(): string;
2589
2860
  }
2590
- declare abstract class gpuGPUShaderStage {
2861
+ declare abstract class GPUShaderStage {
2591
2862
  static readonly VERTEX: number;
2592
2863
  static readonly FRAGMENT: number;
2593
2864
  static readonly COMPUTE: number;
2594
2865
  }
2595
- declare interface gpuGPUBindGroupLayoutDescriptor {
2866
+ interface GPUBindGroupLayoutDescriptor {
2596
2867
  label?: string;
2597
- entries: gpuGPUBindGroupLayoutEntry[];
2868
+ entries: GPUBindGroupLayoutEntry[];
2598
2869
  }
2599
- declare interface gpuGPUBindGroupLayoutEntry {
2870
+ interface GPUBindGroupLayoutEntry {
2600
2871
  binding: number;
2601
2872
  visibility: number;
2602
- buffer?: gpuGPUBufferBindingLayout;
2603
- sampler?: gpuGPUSamplerBindingLayout;
2604
- texture?: gpuGPUTextureBindingLayout;
2605
- storageTexture?: gpuGPUStorageTextureBindingLayout;
2873
+ buffer?: GPUBufferBindingLayout;
2874
+ sampler?: GPUSamplerBindingLayout;
2875
+ texture?: GPUTextureBindingLayout;
2876
+ storageTexture?: GPUStorageTextureBindingLayout;
2606
2877
  }
2607
- declare interface gpuGPUStorageTextureBindingLayout {
2878
+ interface GPUStorageTextureBindingLayout {
2608
2879
  access?: string;
2609
2880
  format: string;
2610
2881
  viewDimension?: string;
2611
2882
  }
2612
- declare interface gpuGPUTextureBindingLayout {
2883
+ interface GPUTextureBindingLayout {
2613
2884
  sampleType?: string;
2614
2885
  viewDimension?: string;
2615
2886
  multisampled?: boolean;
2616
2887
  }
2617
- declare interface gpuGPUSamplerBindingLayout {
2888
+ interface GPUSamplerBindingLayout {
2618
2889
  type?: string;
2619
2890
  }
2620
- declare interface gpuGPUBufferBindingLayout {
2891
+ interface GPUBufferBindingLayout {
2621
2892
  type?: string;
2622
2893
  hasDynamicOffset?: boolean;
2623
2894
  minBindingSize?: number | bigint;
2624
2895
  }
2625
- declare interface gpuGPUBindGroupLayout {}
2626
- declare interface gpuGPUBindGroup {}
2627
- declare interface gpuGPUBindGroupDescriptor {
2896
+ interface GPUBindGroupLayout {}
2897
+ interface GPUBindGroup {}
2898
+ interface GPUBindGroupDescriptor {
2628
2899
  label?: string;
2629
- layout: gpuGPUBindGroupLayout;
2630
- entries: gpuGPUBindGroupEntry[];
2900
+ layout: GPUBindGroupLayout;
2901
+ entries: GPUBindGroupEntry[];
2631
2902
  }
2632
- declare interface gpuGPUBindGroupEntry {
2903
+ interface GPUBindGroupEntry {
2633
2904
  binding: number;
2634
- resource: gpuGPUBufferBinding | gpuGPUSampler;
2905
+ resource: GPUBufferBinding | GPUSampler;
2635
2906
  }
2636
- declare interface gpuGPUBufferBinding {
2637
- buffer: gpuGPUBuffer;
2907
+ interface GPUBufferBinding {
2908
+ buffer: GPUBuffer;
2638
2909
  offset?: number | bigint;
2639
2910
  size?: number | bigint;
2640
2911
  }
2641
- declare interface gpuGPUSampler {}
2642
- declare interface gpuGPUSamplerDescriptor {
2912
+ interface GPUSampler {}
2913
+ interface GPUSamplerDescriptor {
2643
2914
  label?: string;
2644
2915
  addressModeU?: string;
2645
2916
  addressModeV?: string;
@@ -2652,76 +2923,74 @@ declare interface gpuGPUSamplerDescriptor {
2652
2923
  compare: string;
2653
2924
  maxAnisotropy?: number;
2654
2925
  }
2655
- declare interface gpuGPUShaderModule {
2656
- getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2926
+ interface GPUShaderModule {
2927
+ getCompilationInfo(): Promise<GPUCompilationInfo>;
2657
2928
  }
2658
- declare interface gpuGPUShaderModuleDescriptor {
2929
+ interface GPUShaderModuleDescriptor {
2659
2930
  label?: string;
2660
2931
  code: string;
2661
2932
  }
2662
- declare interface gpuGPUPipelineLayout {}
2663
- declare interface gpuGPUPipelineLayoutDescriptor {
2933
+ interface GPUPipelineLayout {}
2934
+ interface GPUPipelineLayoutDescriptor {
2664
2935
  label?: string;
2665
- bindGroupLayouts: gpuGPUBindGroupLayout[];
2936
+ bindGroupLayouts: GPUBindGroupLayout[];
2666
2937
  }
2667
- declare interface gpuGPUComputePipeline {
2668
- getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2938
+ interface GPUComputePipeline {
2939
+ getBindGroupLayout(index: number): GPUBindGroupLayout;
2669
2940
  }
2670
- declare interface gpuGPUComputePipelineDescriptor {
2941
+ interface GPUComputePipelineDescriptor {
2671
2942
  label?: string;
2672
- compute: gpuGPUProgrammableStage;
2673
- layout: string | gpuGPUPipelineLayout;
2943
+ compute: GPUProgrammableStage;
2944
+ layout: string | GPUPipelineLayout;
2674
2945
  }
2675
- declare interface gpuGPUProgrammableStage {
2676
- module: gpuGPUShaderModule;
2946
+ interface GPUProgrammableStage {
2947
+ module: GPUShaderModule;
2677
2948
  entryPoint: string;
2678
2949
  constants?: Record<string, number>;
2679
2950
  }
2680
- declare interface gpuGPUCommandEncoder {
2951
+ interface GPUCommandEncoder {
2681
2952
  get label(): string;
2682
2953
  beginComputePass(
2683
- descriptor?: gpuGPUComputePassDescriptor,
2684
- ): gpuGPUComputePassEncoder;
2685
- beginRenderPass(
2686
- descriptor: gpuGPURenderPassDescriptor,
2687
- ): gpuGPURenderPassEncoder;
2954
+ descriptor?: GPUComputePassDescriptor,
2955
+ ): GPUComputePassEncoder;
2956
+ beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
2688
2957
  copyBufferToBuffer(
2689
- source: gpuGPUBuffer,
2958
+ source: GPUBuffer,
2690
2959
  sourceOffset: number | bigint,
2691
- destination: gpuGPUBuffer,
2960
+ destination: GPUBuffer,
2692
2961
  destinationOffset: number | bigint,
2693
2962
  size: number | bigint,
2694
2963
  ): void;
2695
- finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2964
+ finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
2696
2965
  copyTextureToBuffer(
2697
- source: gpuGPUImageCopyTexture,
2698
- destination: gpuGPUImageCopyBuffer,
2699
- copySize: Iterable<number> | gpuGPUExtent3DDict,
2966
+ source: GPUImageCopyTexture,
2967
+ destination: GPUImageCopyBuffer,
2968
+ copySize: Iterable<number> | GPUExtent3DDict,
2700
2969
  ): void;
2701
2970
  copyBufferToTexture(
2702
- source: gpuGPUImageCopyBuffer,
2703
- destination: gpuGPUImageCopyTexture,
2704
- copySize: Iterable<number> | gpuGPUExtent3DDict,
2971
+ source: GPUImageCopyBuffer,
2972
+ destination: GPUImageCopyTexture,
2973
+ copySize: Iterable<number> | GPUExtent3DDict,
2705
2974
  ): void;
2706
2975
  copyTextureToTexture(
2707
- source: gpuGPUImageCopyTexture,
2708
- destination: gpuGPUImageCopyTexture,
2709
- copySize: Iterable<number> | gpuGPUExtent3DDict,
2976
+ source: GPUImageCopyTexture,
2977
+ destination: GPUImageCopyTexture,
2978
+ copySize: Iterable<number> | GPUExtent3DDict,
2710
2979
  ): void;
2711
2980
  clearBuffer(
2712
- buffer: gpuGPUBuffer,
2981
+ buffer: GPUBuffer,
2713
2982
  offset?: number | bigint,
2714
2983
  size?: number | bigint,
2715
2984
  ): void;
2716
2985
  }
2717
- declare interface gpuGPUCommandEncoderDescriptor {
2986
+ interface GPUCommandEncoderDescriptor {
2718
2987
  label?: string;
2719
2988
  }
2720
- declare interface gpuGPUComputePassEncoder {
2721
- setPipeline(pipeline: gpuGPUComputePipeline): void;
2989
+ interface GPUComputePassEncoder {
2990
+ setPipeline(pipeline: GPUComputePipeline): void;
2722
2991
  setBindGroup(
2723
2992
  index: number,
2724
- bindGroup: gpuGPUBindGroup | null,
2993
+ bindGroup: GPUBindGroup | null,
2725
2994
  dynamicOffsets?: Iterable<number>,
2726
2995
  ): void;
2727
2996
  dispatchWorkgroups(
@@ -2731,52 +3000,52 @@ declare interface gpuGPUComputePassEncoder {
2731
3000
  ): void;
2732
3001
  end(): void;
2733
3002
  }
2734
- declare interface gpuGPUComputePassDescriptor {
3003
+ interface GPUComputePassDescriptor {
2735
3004
  label?: string;
2736
- timestampWrites?: gpuGPUComputePassTimestampWrites;
3005
+ timestampWrites?: GPUComputePassTimestampWrites;
2737
3006
  }
2738
- declare interface gpuGPUQuerySet {}
2739
- declare interface gpuGPUQuerySetDescriptor {
3007
+ interface GPUQuerySet {}
3008
+ interface GPUQuerySetDescriptor {
2740
3009
  label?: string;
2741
3010
  }
2742
- declare interface gpuGPUComputePassTimestampWrites {
2743
- querySet: gpuGPUQuerySet;
3011
+ interface GPUComputePassTimestampWrites {
3012
+ querySet: GPUQuerySet;
2744
3013
  beginningOfPassWriteIndex?: number;
2745
3014
  endOfPassWriteIndex?: number;
2746
3015
  }
2747
- declare interface gpuGPUCommandBufferDescriptor {
3016
+ interface GPUCommandBufferDescriptor {
2748
3017
  label?: string;
2749
3018
  }
2750
- declare interface gpuGPUCommandBuffer {}
2751
- declare interface gpuGPUQueue {
2752
- submit(commandBuffers: gpuGPUCommandBuffer[]): void;
3019
+ interface GPUCommandBuffer {}
3020
+ interface GPUQueue {
3021
+ submit(commandBuffers: GPUCommandBuffer[]): void;
2753
3022
  writeBuffer(
2754
- buffer: gpuGPUBuffer,
3023
+ buffer: GPUBuffer,
2755
3024
  bufferOffset: number | bigint,
2756
3025
  data: ArrayBuffer | ArrayBufferView,
2757
3026
  dataOffset?: number | bigint,
2758
3027
  size?: number | bigint,
2759
3028
  ): void;
2760
3029
  }
2761
- declare abstract class gpuGPUMapMode {
3030
+ declare abstract class GPUMapMode {
2762
3031
  static readonly READ: number;
2763
3032
  static readonly WRITE: number;
2764
3033
  }
2765
- declare interface gpuGPURequestAdapterOptions {
3034
+ interface GPURequestAdapterOptions {
2766
3035
  powerPreference: string;
2767
3036
  forceFallbackAdapter?: boolean;
2768
3037
  }
2769
- declare interface gpuGPUAdapterInfo {
3038
+ interface GPUAdapterInfo {
2770
3039
  get vendor(): string;
2771
3040
  get architecture(): string;
2772
3041
  get device(): string;
2773
3042
  get description(): string;
2774
3043
  }
2775
- declare interface gpuGPUSupportedFeatures {
3044
+ interface GPUSupportedFeatures {
2776
3045
  has(name: string): boolean;
2777
3046
  keys(): string[];
2778
3047
  }
2779
- declare interface gpuGPUSupportedLimits {
3048
+ interface GPUSupportedLimits {
2780
3049
  get maxTextureDimension1D(): number;
2781
3050
  get maxTextureDimension2D(): number;
2782
3051
  get maxTextureDimension3D(): number;
@@ -2809,17 +3078,17 @@ declare interface gpuGPUSupportedLimits {
2809
3078
  get maxComputeWorkgroupSizeZ(): number;
2810
3079
  get maxComputeWorkgroupsPerDimension(): number;
2811
3080
  }
2812
- declare abstract class gpuGPUError {
3081
+ declare abstract class GPUError {
2813
3082
  get message(): string;
2814
3083
  }
2815
- declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
2816
- declare abstract class gpuGPUInternalError extends gpuGPUError {}
2817
- declare abstract class gpuGPUValidationError extends gpuGPUError {}
2818
- declare abstract class gpuGPUDeviceLostInfo {
3084
+ declare abstract class GPUOutOfMemoryError extends GPUError {}
3085
+ declare abstract class GPUInternalError extends GPUError {}
3086
+ declare abstract class GPUValidationError extends GPUError {}
3087
+ declare abstract class GPUDeviceLostInfo {
2819
3088
  get message(): string;
2820
3089
  get reason(): string;
2821
3090
  }
2822
- declare interface gpuGPUCompilationMessage {
3091
+ interface GPUCompilationMessage {
2823
3092
  get message(): string;
2824
3093
  get type(): string;
2825
3094
  get lineNum(): number;
@@ -2827,19 +3096,19 @@ declare interface gpuGPUCompilationMessage {
2827
3096
  get offset(): number;
2828
3097
  get length(): number;
2829
3098
  }
2830
- declare interface gpuGPUCompilationInfo {
2831
- get messages(): gpuGPUCompilationMessage[];
3099
+ interface GPUCompilationInfo {
3100
+ get messages(): GPUCompilationMessage[];
2832
3101
  }
2833
- declare abstract class gpuGPUTextureUsage {
3102
+ declare abstract class GPUTextureUsage {
2834
3103
  static readonly COPY_SRC: number;
2835
3104
  static readonly COPY_DST: number;
2836
3105
  static readonly TEXTURE_BINDING: number;
2837
3106
  static readonly STORAGE_BINDING: number;
2838
3107
  static readonly RENDER_ATTACHMENT: number;
2839
3108
  }
2840
- declare interface gpuGPUTextureDescriptor {
3109
+ interface GPUTextureDescriptor {
2841
3110
  label: string;
2842
- size: number[] | gpuGPUExtent3DDict;
3111
+ size: number[] | GPUExtent3DDict;
2843
3112
  mipLevelCount?: number;
2844
3113
  sampleCount?: number;
2845
3114
  dimension?: string;
@@ -2847,13 +3116,13 @@ declare interface gpuGPUTextureDescriptor {
2847
3116
  usage: number;
2848
3117
  viewFormats?: string[];
2849
3118
  }
2850
- declare interface gpuGPUExtent3DDict {
3119
+ interface GPUExtent3DDict {
2851
3120
  width: number;
2852
3121
  height?: number;
2853
3122
  depthOrArrayLayers?: number;
2854
3123
  }
2855
- declare interface gpuGPUTexture {
2856
- createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
3124
+ interface GPUTexture {
3125
+ createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
2857
3126
  destroy(): void;
2858
3127
  get width(): number;
2859
3128
  get height(): number;
@@ -2863,8 +3132,8 @@ declare interface gpuGPUTexture {
2863
3132
  get format(): string;
2864
3133
  get usage(): number;
2865
3134
  }
2866
- declare interface gpuGPUTextureView {}
2867
- declare interface gpuGPUTextureViewDescriptor {
3135
+ interface GPUTextureView {}
3136
+ interface GPUTextureViewDescriptor {
2868
3137
  label: string;
2869
3138
  format: string;
2870
3139
  dimension: string;
@@ -2874,91 +3143,91 @@ declare interface gpuGPUTextureViewDescriptor {
2874
3143
  baseArrayLayer?: number;
2875
3144
  arrayLayerCount: number;
2876
3145
  }
2877
- declare abstract class gpuGPUColorWrite {
3146
+ declare abstract class GPUColorWrite {
2878
3147
  static readonly RED: number;
2879
3148
  static readonly GREEN: number;
2880
3149
  static readonly BLUE: number;
2881
3150
  static readonly ALPHA: number;
2882
3151
  static readonly ALL: number;
2883
3152
  }
2884
- declare interface gpuGPURenderPipeline {}
2885
- declare interface gpuGPURenderPipelineDescriptor {
3153
+ interface GPURenderPipeline {}
3154
+ interface GPURenderPipelineDescriptor {
2886
3155
  label?: string;
2887
- layout: string | gpuGPUPipelineLayout;
2888
- vertex: gpuGPUVertexState;
2889
- primitive?: gpuGPUPrimitiveState;
2890
- depthStencil?: gpuGPUDepthStencilState;
2891
- multisample?: gpuGPUMultisampleState;
2892
- fragment?: gpuGPUFragmentState;
2893
- }
2894
- declare interface gpuGPUVertexState {
2895
- module: gpuGPUShaderModule;
3156
+ layout: string | GPUPipelineLayout;
3157
+ vertex: GPUVertexState;
3158
+ primitive?: GPUPrimitiveState;
3159
+ depthStencil?: GPUDepthStencilState;
3160
+ multisample?: GPUMultisampleState;
3161
+ fragment?: GPUFragmentState;
3162
+ }
3163
+ interface GPUVertexState {
3164
+ module: GPUShaderModule;
2896
3165
  entryPoint: string;
2897
3166
  constants?: Record<string, number>;
2898
- buffers?: gpuGPUVertexBufferLayout[];
3167
+ buffers?: GPUVertexBufferLayout[];
2899
3168
  }
2900
- declare interface gpuGPUVertexBufferLayout {
3169
+ interface GPUVertexBufferLayout {
2901
3170
  arrayStride: number | bigint;
2902
3171
  stepMode?: string;
2903
- attributes: gpuGPUVertexAttribute[];
3172
+ attributes: GPUVertexAttribute[];
2904
3173
  }
2905
- declare interface gpuGPUVertexAttribute {
3174
+ interface GPUVertexAttribute {
2906
3175
  format: string;
2907
3176
  offset: number | bigint;
2908
3177
  shaderLocation: number;
2909
3178
  }
2910
- declare interface gpuGPUPrimitiveState {
3179
+ interface GPUPrimitiveState {
2911
3180
  topology?: string;
2912
3181
  stripIndexFormat?: string;
2913
3182
  frontFace?: string;
2914
3183
  cullMode?: string;
2915
3184
  unclippedDepth?: boolean;
2916
3185
  }
2917
- declare interface gpuGPUStencilFaceState {
3186
+ interface GPUStencilFaceState {
2918
3187
  compare?: string;
2919
3188
  failOp?: string;
2920
3189
  depthFailOp?: string;
2921
3190
  passOp?: string;
2922
3191
  }
2923
- declare interface gpuGPUDepthStencilState {
3192
+ interface GPUDepthStencilState {
2924
3193
  format: string;
2925
3194
  depthWriteEnabled: boolean;
2926
3195
  depthCompare: string;
2927
- stencilFront?: gpuGPUStencilFaceState;
2928
- stencilBack?: gpuGPUStencilFaceState;
3196
+ stencilFront?: GPUStencilFaceState;
3197
+ stencilBack?: GPUStencilFaceState;
2929
3198
  stencilReadMask?: number;
2930
3199
  stencilWriteMask?: number;
2931
3200
  depthBias?: number;
2932
3201
  depthBiasSlopeScale?: number;
2933
3202
  depthBiasClamp?: number;
2934
3203
  }
2935
- declare interface gpuGPUMultisampleState {
3204
+ interface GPUMultisampleState {
2936
3205
  count?: number;
2937
3206
  mask?: number;
2938
3207
  alphaToCoverageEnabled?: boolean;
2939
3208
  }
2940
- declare interface gpuGPUFragmentState {
2941
- module: gpuGPUShaderModule;
3209
+ interface GPUFragmentState {
3210
+ module: GPUShaderModule;
2942
3211
  entryPoint: string;
2943
3212
  constants?: Record<string, number>;
2944
- targets: gpuGPUColorTargetState[];
3213
+ targets: GPUColorTargetState[];
2945
3214
  }
2946
- declare interface gpuGPUColorTargetState {
3215
+ interface GPUColorTargetState {
2947
3216
  format: string;
2948
- blend: gpuGPUBlendState;
3217
+ blend: GPUBlendState;
2949
3218
  writeMask?: number;
2950
3219
  }
2951
- declare interface gpuGPUBlendState {
2952
- color: gpuGPUBlendComponent;
2953
- alpha: gpuGPUBlendComponent;
3220
+ interface GPUBlendState {
3221
+ color: GPUBlendComponent;
3222
+ alpha: GPUBlendComponent;
2954
3223
  }
2955
- declare interface gpuGPUBlendComponent {
3224
+ interface GPUBlendComponent {
2956
3225
  operation?: string;
2957
3226
  srcFactor?: string;
2958
3227
  dstFactor?: string;
2959
3228
  }
2960
- declare interface gpuGPURenderPassEncoder {
2961
- setPipeline(pipeline: gpuGPURenderPipeline): void;
3229
+ interface GPURenderPassEncoder {
3230
+ setPipeline(pipeline: GPURenderPipeline): void;
2962
3231
  draw(
2963
3232
  vertexCount: number,
2964
3233
  instanceCount?: number,
@@ -2967,30 +3236,30 @@ declare interface gpuGPURenderPassEncoder {
2967
3236
  ): void;
2968
3237
  end(): void;
2969
3238
  }
2970
- declare interface gpuGPURenderPassDescriptor {
3239
+ interface GPURenderPassDescriptor {
2971
3240
  label?: string;
2972
- colorAttachments: gpuGPURenderPassColorAttachment[];
2973
- depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2974
- occlusionQuerySet?: gpuGPUQuerySet;
2975
- timestampWrites?: gpuGPURenderPassTimestampWrites;
3241
+ colorAttachments: GPURenderPassColorAttachment[];
3242
+ depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
3243
+ occlusionQuerySet?: GPUQuerySet;
3244
+ timestampWrites?: GPURenderPassTimestampWrites;
2976
3245
  maxDrawCount?: number | bigint;
2977
3246
  }
2978
- declare interface gpuGPURenderPassColorAttachment {
2979
- view: gpuGPUTextureView;
3247
+ interface GPURenderPassColorAttachment {
3248
+ view: GPUTextureView;
2980
3249
  depthSlice?: number;
2981
- resolveTarget?: gpuGPUTextureView;
2982
- clearValue?: number[] | gpuGPUColorDict;
3250
+ resolveTarget?: GPUTextureView;
3251
+ clearValue?: number[] | GPUColorDict;
2983
3252
  loadOp: string;
2984
3253
  storeOp: string;
2985
3254
  }
2986
- declare interface gpuGPUColorDict {
3255
+ interface GPUColorDict {
2987
3256
  r: number;
2988
3257
  g: number;
2989
3258
  b: number;
2990
3259
  a: number;
2991
3260
  }
2992
- declare interface gpuGPURenderPassDepthStencilAttachment {
2993
- view: gpuGPUTextureView;
3261
+ interface GPURenderPassDepthStencilAttachment {
3262
+ view: GPUTextureView;
2994
3263
  depthClearValue?: number;
2995
3264
  depthLoadOp?: string;
2996
3265
  depthStoreOp?: string;
@@ -3000,29 +3269,373 @@ declare interface gpuGPURenderPassDepthStencilAttachment {
3000
3269
  stencilStoreOp?: string;
3001
3270
  stencilReadOnly?: boolean;
3002
3271
  }
3003
- declare interface gpuGPURenderPassTimestampWrites {
3004
- querySet: gpuGPUQuerySet;
3272
+ interface GPURenderPassTimestampWrites {
3273
+ querySet: GPUQuerySet;
3005
3274
  beginningOfPassWriteIndex?: number;
3006
3275
  endOfPassWriteIndex?: number;
3007
3276
  }
3008
- declare interface gpuGPUImageCopyTexture {
3009
- texture: gpuGPUTexture;
3277
+ interface GPUImageCopyTexture {
3278
+ texture: GPUTexture;
3010
3279
  mipLevel?: number;
3011
- origin?: number[] | gpuGPUOrigin3DDict;
3280
+ origin?: number[] | GPUOrigin3DDict;
3012
3281
  aspect?: string;
3013
3282
  }
3014
- declare interface gpuGPUImageCopyBuffer {
3015
- buffer: gpuGPUBuffer;
3283
+ interface GPUImageCopyBuffer {
3284
+ buffer: GPUBuffer;
3016
3285
  offset?: number | bigint;
3017
3286
  bytesPerRow?: number;
3018
3287
  rowsPerImage?: number;
3019
3288
  }
3020
- declare interface gpuGPUOrigin3DDict {
3289
+ interface GPUOrigin3DDict {
3021
3290
  x?: number;
3022
3291
  y?: number;
3023
3292
  z?: number;
3024
3293
  }
3025
- declare interface BasicImageTransformations {
3294
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
3295
+ declare class EventSource {
3296
+ constructor(url: string, init?: EventSourceEventSourceInit);
3297
+ /**
3298
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3299
+ *
3300
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3301
+ */
3302
+ close(): void;
3303
+ /**
3304
+ * Returns the URL providing the event stream.
3305
+ *
3306
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3307
+ */
3308
+ get url(): string;
3309
+ /**
3310
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3311
+ *
3312
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3313
+ */
3314
+ get withCredentials(): boolean;
3315
+ /**
3316
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3317
+ *
3318
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3319
+ */
3320
+ get readyState(): number;
3321
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3322
+ get onopen(): any | null;
3323
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3324
+ set onopen(value: any | null);
3325
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3326
+ get onmessage(): any | null;
3327
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3328
+ set onmessage(value: any | null);
3329
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3330
+ get onerror(): any | null;
3331
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3332
+ set onerror(value: any | null);
3333
+ static readonly CONNECTING: number;
3334
+ static readonly OPEN: number;
3335
+ static readonly CLOSED: number;
3336
+ static from(stream: ReadableStream): EventSource;
3337
+ }
3338
+ interface EventSourceEventSourceInit {
3339
+ withCredentials?: boolean;
3340
+ fetcher?: Fetcher;
3341
+ }
3342
+ type AiImageClassificationInput = {
3343
+ image: number[];
3344
+ };
3345
+ type AiImageClassificationOutput = {
3346
+ score?: number;
3347
+ label?: string;
3348
+ }[];
3349
+ declare abstract class BaseAiImageClassification {
3350
+ inputs: AiImageClassificationInput;
3351
+ postProcessedOutputs: AiImageClassificationOutput;
3352
+ }
3353
+ type AiImageToTextInput = {
3354
+ image: number[];
3355
+ prompt?: string;
3356
+ max_tokens?: number;
3357
+ temperature?: number;
3358
+ top_p?: number;
3359
+ top_k?: number;
3360
+ seed?: number;
3361
+ repetition_penalty?: number;
3362
+ frequency_penalty?: number;
3363
+ presence_penalty?: number;
3364
+ raw?: boolean;
3365
+ messages?: RoleScopedChatInput[];
3366
+ };
3367
+ type AiImageToTextOutput = {
3368
+ description: string;
3369
+ };
3370
+ declare abstract class BaseAiImageToText {
3371
+ inputs: AiImageToTextInput;
3372
+ postProcessedOutputs: AiImageToTextOutput;
3373
+ }
3374
+ type AiObjectDetectionInput = {
3375
+ image: number[];
3376
+ };
3377
+ type AiObjectDetectionOutput = {
3378
+ score?: number;
3379
+ label?: string;
3380
+ }[];
3381
+ declare abstract class BaseAiObjectDetection {
3382
+ inputs: AiObjectDetectionInput;
3383
+ postProcessedOutputs: AiObjectDetectionOutput;
3384
+ }
3385
+ type AiSentenceSimilarityInput = {
3386
+ source: string;
3387
+ sentences: string[];
3388
+ };
3389
+ type AiSentenceSimilarityOutput = number[];
3390
+ declare abstract class BaseAiSentenceSimilarity {
3391
+ inputs: AiSentenceSimilarityInput;
3392
+ postProcessedOutputs: AiSentenceSimilarityOutput;
3393
+ }
3394
+ type AiSpeechRecognitionInput = {
3395
+ audio: number[];
3396
+ };
3397
+ type AiSpeechRecognitionOutput = {
3398
+ text?: string;
3399
+ words?: {
3400
+ word: string;
3401
+ start: number;
3402
+ end: number;
3403
+ }[];
3404
+ vtt?: string;
3405
+ };
3406
+ declare abstract class BaseAiSpeechRecognition {
3407
+ inputs: AiSpeechRecognitionInput;
3408
+ postProcessedOutputs: AiSpeechRecognitionOutput;
3409
+ }
3410
+ type AiSummarizationInput = {
3411
+ input_text: string;
3412
+ max_length?: number;
3413
+ };
3414
+ type AiSummarizationOutput = {
3415
+ summary: string;
3416
+ };
3417
+ declare abstract class BaseAiSummarization {
3418
+ inputs: AiSummarizationInput;
3419
+ postProcessedOutputs: AiSummarizationOutput;
3420
+ }
3421
+ type AiTextClassificationInput = {
3422
+ text: string;
3423
+ };
3424
+ type AiTextClassificationOutput = {
3425
+ score?: number;
3426
+ label?: string;
3427
+ }[];
3428
+ declare abstract class BaseAiTextClassification {
3429
+ inputs: AiTextClassificationInput;
3430
+ postProcessedOutputs: AiTextClassificationOutput;
3431
+ }
3432
+ type AiTextEmbeddingsInput = {
3433
+ text: string | string[];
3434
+ };
3435
+ type AiTextEmbeddingsOutput = {
3436
+ shape: number[];
3437
+ data: number[][];
3438
+ };
3439
+ declare abstract class BaseAiTextEmbeddings {
3440
+ inputs: AiTextEmbeddingsInput;
3441
+ postProcessedOutputs: AiTextEmbeddingsOutput;
3442
+ }
3443
+ type RoleScopedChatInput = {
3444
+ role: "user" | "assistant" | "system" | "tool";
3445
+ content: string;
3446
+ };
3447
+ type AiTextGenerationToolInput = {
3448
+ type: "function";
3449
+ function: {
3450
+ name: string;
3451
+ description: string;
3452
+ parameters?: {
3453
+ type: "object";
3454
+ properties: {
3455
+ [key: string]: {
3456
+ type: string;
3457
+ description?: string;
3458
+ };
3459
+ };
3460
+ required: string[];
3461
+ };
3462
+ };
3463
+ };
3464
+ type AiTextGenerationInput = {
3465
+ prompt?: string;
3466
+ raw?: boolean;
3467
+ stream?: boolean;
3468
+ max_tokens?: number;
3469
+ temperature?: number;
3470
+ top_p?: number;
3471
+ top_k?: number;
3472
+ seed?: number;
3473
+ repetition_penalty?: number;
3474
+ frequency_penalty?: number;
3475
+ presence_penalty?: number;
3476
+ messages?: RoleScopedChatInput[];
3477
+ tools?: AiTextGenerationToolInput[];
3478
+ };
3479
+ type AiTextGenerationOutput =
3480
+ | {
3481
+ response?: string;
3482
+ tool_calls?: {
3483
+ name: string;
3484
+ arguments: unknown;
3485
+ }[];
3486
+ }
3487
+ | ReadableStream;
3488
+ declare abstract class BaseAiTextGeneration {
3489
+ inputs: AiTextGenerationInput;
3490
+ postProcessedOutputs: AiTextGenerationOutput;
3491
+ }
3492
+ type AiTextToImageInput = {
3493
+ prompt: string;
3494
+ image?: number[];
3495
+ mask?: number[];
3496
+ num_steps?: number;
3497
+ strength?: number;
3498
+ guidance?: number;
3499
+ };
3500
+ type AiTextToImageOutput = Uint8Array;
3501
+ declare abstract class BaseAiTextToImage {
3502
+ inputs: AiTextToImageInput;
3503
+ postProcessedOutputs: AiTextToImageOutput;
3504
+ }
3505
+ type AiTranslationInput = {
3506
+ text: string;
3507
+ target_lang: string;
3508
+ source_lang?: string;
3509
+ };
3510
+ type AiTranslationOutput = {
3511
+ translated_text?: string;
3512
+ };
3513
+ declare abstract class BaseAiTranslation {
3514
+ inputs: AiTranslationInput;
3515
+ postProcessedOutputs: AiTranslationOutput;
3516
+ }
3517
+ type GatewayOptions = {
3518
+ id: string;
3519
+ cacheTtl?: number;
3520
+ skipCache?: boolean;
3521
+ metadata?: Record<string, number | string | boolean | null | bigint>;
3522
+ };
3523
+ type AiOptions = {
3524
+ gateway?: GatewayOptions;
3525
+ prefix?: string;
3526
+ extraHeaders?: object;
3527
+ };
3528
+ type BaseAiTextClassificationModels = "@cf/huggingface/distilbert-sst-2-int8";
3529
+ type BaseAiTextToImageModels =
3530
+ | "@cf/stabilityai/stable-diffusion-xl-base-1.0"
3531
+ | "@cf/runwayml/stable-diffusion-v1-5-inpainting"
3532
+ | "@cf/runwayml/stable-diffusion-v1-5-img2img"
3533
+ | "@cf/lykon/dreamshaper-8-lcm"
3534
+ | "@cf/bytedance/stable-diffusion-xl-lightning";
3535
+ type BaseAiTextEmbeddingsModels =
3536
+ | "@cf/baai/bge-small-en-v1.5"
3537
+ | "@cf/baai/bge-base-en-v1.5"
3538
+ | "@cf/baai/bge-large-en-v1.5";
3539
+ type BaseAiSpeechRecognitionModels =
3540
+ | "@cf/openai/whisper"
3541
+ | "@cf/openai/whisper-tiny-en"
3542
+ | "@cf/openai/whisper-sherpa";
3543
+ type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
3544
+ type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
3545
+ type BaseAiTextGenerationModels =
3546
+ | "@cf/meta/llama-3-8b-instruct"
3547
+ | "@cf/meta/llama-3-8b-instruct-awq"
3548
+ | "@cf/meta/llama-2-7b-chat-int8"
3549
+ | "@cf/mistral/mistral-7b-instruct-v0.1"
3550
+ | "@cf/mistral/mistral-7b-instruct-v0.2-lora"
3551
+ | "@cf/meta/llama-2-7b-chat-fp16"
3552
+ | "@hf/thebloke/llama-2-13b-chat-awq"
3553
+ | "@hf/thebloke/zephyr-7b-beta-awq"
3554
+ | "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
3555
+ | "@hf/thebloke/codellama-7b-instruct-awq"
3556
+ | "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
3557
+ | "@hf/thebloke/neural-chat-7b-v3-1-awq"
3558
+ | "@hf/thebloke/llamaguard-7b-awq"
3559
+ | "@hf/thebloke/deepseek-coder-6.7b-base-awq"
3560
+ | "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
3561
+ | "@hf/nousresearch/hermes-2-pro-mistral-7b"
3562
+ | "@hf/mistral/mistral-7b-instruct-v0.2"
3563
+ | "@hf/google/gemma-7b-it"
3564
+ | "@hf/nexusflow/starling-lm-7b-beta"
3565
+ | "@cf/deepseek-ai/deepseek-math-7b-instruct"
3566
+ | "@cf/defog/sqlcoder-7b-2"
3567
+ | "@cf/openchat/openchat-3.5-0106"
3568
+ | "@cf/tiiuae/falcon-7b-instruct"
3569
+ | "@cf/thebloke/discolm-german-7b-v1-awq"
3570
+ | "@cf/qwen/qwen1.5-0.5b-chat"
3571
+ | "@cf/qwen/qwen1.5-1.8b-chat"
3572
+ | "@cf/qwen/qwen1.5-7b-chat-awq"
3573
+ | "@cf/qwen/qwen1.5-14b-chat-awq"
3574
+ | "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
3575
+ | "@cf/microsoft/phi-2"
3576
+ | "@cf/google/gemma-2b-it-lora"
3577
+ | "@cf/google/gemma-7b-it-lora"
3578
+ | "@cf/meta-llama/llama-2-7b-chat-hf-lora"
3579
+ | "@cf/fblgit/una-cybertron-7b-v2-bf16"
3580
+ | "@cf/fblgit/una-cybertron-7b-v2-awq";
3581
+ type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
3582
+ type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
3583
+ type BaseAiImageToTextModels =
3584
+ | "@cf/unum/uform-gen2-qwen-500m"
3585
+ | "@cf/llava-hf/llava-1.5-7b-hf";
3586
+ declare abstract class Ai {
3587
+ run(
3588
+ model: BaseAiTextClassificationModels,
3589
+ inputs: BaseAiTextClassification["inputs"],
3590
+ options?: AiOptions,
3591
+ ): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
3592
+ run(
3593
+ model: BaseAiTextToImageModels,
3594
+ inputs: BaseAiTextToImage["inputs"],
3595
+ options?: AiOptions,
3596
+ ): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
3597
+ run(
3598
+ model: BaseAiTextEmbeddingsModels,
3599
+ inputs: BaseAiTextEmbeddings["inputs"],
3600
+ options?: AiOptions,
3601
+ ): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
3602
+ run(
3603
+ model: BaseAiSpeechRecognitionModels,
3604
+ inputs: BaseAiSpeechRecognition["inputs"],
3605
+ options?: AiOptions,
3606
+ ): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
3607
+ run(
3608
+ model: BaseAiImageClassificationModels,
3609
+ inputs: BaseAiImageClassification["inputs"],
3610
+ options?: AiOptions,
3611
+ ): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
3612
+ run(
3613
+ model: BaseAiObjectDetectionModels,
3614
+ inputs: BaseAiObjectDetection["inputs"],
3615
+ options?: AiOptions,
3616
+ ): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
3617
+ run(
3618
+ model: BaseAiTextGenerationModels,
3619
+ inputs: BaseAiTextGeneration["inputs"],
3620
+ options?: AiOptions,
3621
+ ): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
3622
+ run(
3623
+ model: BaseAiTranslationModels,
3624
+ inputs: BaseAiTranslation["inputs"],
3625
+ options?: AiOptions,
3626
+ ): Promise<BaseAiTranslation["postProcessedOutputs"]>;
3627
+ run(
3628
+ model: BaseAiSummarizationModels,
3629
+ inputs: BaseAiSummarization["inputs"],
3630
+ options?: AiOptions,
3631
+ ): Promise<BaseAiSummarization["postProcessedOutputs"]>;
3632
+ run(
3633
+ model: BaseAiImageToTextModels,
3634
+ inputs: BaseAiImageToText["inputs"],
3635
+ options?: AiOptions,
3636
+ ): Promise<BaseAiImageToText["postProcessedOutputs"]>;
3637
+ }
3638
+ interface BasicImageTransformations {
3026
3639
  /**
3027
3640
  * Maximum width in image pixels. The value must be an integer.
3028
3641
  */
@@ -3088,7 +3701,7 @@ declare interface BasicImageTransformations {
3088
3701
  */
3089
3702
  rotate?: 0 | 90 | 180 | 270 | 360;
3090
3703
  }
3091
- declare interface BasicImageTransformationsGravityCoordinates {
3704
+ interface BasicImageTransformationsGravityCoordinates {
3092
3705
  x: number;
3093
3706
  y: number;
3094
3707
  }
@@ -3101,7 +3714,7 @@ declare interface BasicImageTransformationsGravityCoordinates {
3101
3714
  * Note: Currently, these properties cannot be tested in the
3102
3715
  * playground.
3103
3716
  */
3104
- declare interface RequestInitCfProperties extends Record<string, unknown> {
3717
+ interface RequestInitCfProperties extends Record<string, unknown> {
3105
3718
  cacheEverything?: boolean;
3106
3719
  /**
3107
3720
  * A request's cache key is what determines if two requests are
@@ -3136,6 +3749,7 @@ declare interface RequestInitCfProperties extends Record<string, unknown> {
3136
3749
  minify?: RequestInitCfPropertiesImageMinify;
3137
3750
  mirage?: boolean;
3138
3751
  polish?: "lossy" | "lossless" | "off";
3752
+ r2?: RequestInitCfPropertiesR2;
3139
3753
  /**
3140
3754
  * Redirects the request to an alternate origin server. You can use this,
3141
3755
  * for example, to implement load balancing across several origins.
@@ -3151,8 +3765,7 @@ declare interface RequestInitCfProperties extends Record<string, unknown> {
3151
3765
  */
3152
3766
  resolveOverride?: string;
3153
3767
  }
3154
- declare interface RequestInitCfPropertiesImageDraw
3155
- extends BasicImageTransformations {
3768
+ interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
3156
3769
  /**
3157
3770
  * Absolute URL of the image file to use for the drawing. It can be any of
3158
3771
  * the supported file formats. For drawing of watermarks or non-rectangular
@@ -3189,8 +3802,7 @@ declare interface RequestInitCfPropertiesImageDraw
3189
3802
  bottom?: number;
3190
3803
  right?: number;
3191
3804
  }
3192
- declare interface RequestInitCfPropertiesImage
3193
- extends BasicImageTransformations {
3805
+ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
3194
3806
  /**
3195
3807
  * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
3196
3808
  * easier to specify higher-DPI sizes in <img srcset>.
@@ -3315,22 +3927,27 @@ declare interface RequestInitCfPropertiesImage
3315
3927
  */
3316
3928
  compression?: "fast";
3317
3929
  }
3318
- declare interface RequestInitCfPropertiesImageMinify {
3930
+ interface RequestInitCfPropertiesImageMinify {
3319
3931
  javascript?: boolean;
3320
3932
  css?: boolean;
3321
3933
  html?: boolean;
3322
3934
  }
3935
+ interface RequestInitCfPropertiesR2 {
3936
+ /**
3937
+ * Colo id of bucket that an object is stored in
3938
+ */
3939
+ bucketColoId?: number;
3940
+ }
3323
3941
  /**
3324
3942
  * Request metadata provided by Cloudflare's edge.
3325
3943
  */
3326
- declare type IncomingRequestCfProperties<HostMetadata = unknown> =
3944
+ type IncomingRequestCfProperties<HostMetadata = unknown> =
3327
3945
  IncomingRequestCfPropertiesBase &
3328
3946
  IncomingRequestCfPropertiesBotManagementEnterprise &
3329
3947
  IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> &
3330
3948
  IncomingRequestCfPropertiesGeographicInformation &
3331
3949
  IncomingRequestCfPropertiesCloudflareAccessOrApiShield;
3332
- declare interface IncomingRequestCfPropertiesBase
3333
- extends Record<string, unknown> {
3950
+ interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {
3334
3951
  /**
3335
3952
  * [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request.
3336
3953
  *
@@ -3408,7 +4025,7 @@ declare interface IncomingRequestCfPropertiesBase
3408
4025
  */
3409
4026
  tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata;
3410
4027
  }
3411
- declare interface IncomingRequestCfPropertiesBotManagementBase {
4028
+ interface IncomingRequestCfPropertiesBotManagementBase {
3412
4029
  /**
3413
4030
  * Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot,
3414
4031
  * represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human).
@@ -3435,7 +4052,7 @@ declare interface IncomingRequestCfPropertiesBotManagementBase {
3435
4052
  */
3436
4053
  detectionIds: number[];
3437
4054
  }
3438
- declare interface IncomingRequestCfPropertiesBotManagement {
4055
+ interface IncomingRequestCfPropertiesBotManagement {
3439
4056
  /**
3440
4057
  * Results of Cloudflare's Bot Management analysis
3441
4058
  */
@@ -3447,7 +4064,7 @@ declare interface IncomingRequestCfPropertiesBotManagement {
3447
4064
  */
3448
4065
  clientTrustScore: number;
3449
4066
  }
3450
- declare interface IncomingRequestCfPropertiesBotManagementEnterprise
4067
+ interface IncomingRequestCfPropertiesBotManagementEnterprise
3451
4068
  extends IncomingRequestCfPropertiesBotManagement {
3452
4069
  /**
3453
4070
  * Results of Cloudflare's Bot Management analysis
@@ -3460,9 +4077,7 @@ declare interface IncomingRequestCfPropertiesBotManagementEnterprise
3460
4077
  ja3Hash: string;
3461
4078
  };
3462
4079
  }
3463
- declare interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
3464
- HostMetadata,
3465
- > {
4080
+ interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {
3466
4081
  /**
3467
4082
  * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
3468
4083
  *
@@ -3471,7 +4086,7 @@ declare interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
3471
4086
  */
3472
4087
  hostMetadata: HostMetadata;
3473
4088
  }
3474
- declare interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
4089
+ interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
3475
4090
  /**
3476
4091
  * Information about the client certificate presented to Cloudflare.
3477
4092
  *
@@ -3493,7 +4108,7 @@ declare interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
3493
4108
  /**
3494
4109
  * Metadata about the request's TLS handshake
3495
4110
  */
3496
- declare interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
4111
+ interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
3497
4112
  /**
3498
4113
  * The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
3499
4114
  *
@@ -3522,7 +4137,7 @@ declare interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
3522
4137
  /**
3523
4138
  * Geographic data about the request's origin.
3524
4139
  */
3525
- declare interface IncomingRequestCfPropertiesGeographicInformation {
4140
+ interface IncomingRequestCfPropertiesGeographicInformation {
3526
4141
  /**
3527
4142
  * The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
3528
4143
  *
@@ -3599,7 +4214,7 @@ declare interface IncomingRequestCfPropertiesGeographicInformation {
3599
4214
  metroCode?: string;
3600
4215
  }
3601
4216
  /** Data about the incoming request's TLS certificate */
3602
- declare interface IncomingRequestCfPropertiesTLSClientAuth {
4217
+ interface IncomingRequestCfPropertiesTLSClientAuth {
3603
4218
  /** Always `"1"`, indicating that the certificate was presented */
3604
4219
  certPresented: "1";
3605
4220
  /**
@@ -3692,7 +4307,7 @@ declare interface IncomingRequestCfPropertiesTLSClientAuth {
3692
4307
  certNotAfter: string;
3693
4308
  }
3694
4309
  /** Placeholder values for TLS Client Authorization */
3695
- declare interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
4310
+ interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
3696
4311
  certPresented: "0";
3697
4312
  certVerified: "NONE";
3698
4313
  certRevoked: "0";
@@ -3990,10 +4605,10 @@ declare type Iso3166Alpha2Code =
3990
4605
  | "ZW";
3991
4606
  /** The 2-letter continent codes Cloudflare uses */
3992
4607
  declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
3993
- declare type CfProperties<HostMetadata = unknown> =
4608
+ type CfProperties<HostMetadata = unknown> =
3994
4609
  | IncomingRequestCfProperties<HostMetadata>
3995
4610
  | RequestInitCfProperties;
3996
- declare interface D1Meta {
4611
+ interface D1Meta {
3997
4612
  duration: number;
3998
4613
  size_after: number;
3999
4614
  rows_read: number;
@@ -4002,15 +4617,15 @@ declare interface D1Meta {
4002
4617
  changed_db: boolean;
4003
4618
  changes: number;
4004
4619
  }
4005
- declare interface D1Response {
4620
+ interface D1Response {
4006
4621
  success: true;
4007
4622
  meta: D1Meta & Record<string, unknown>;
4008
4623
  error?: never;
4009
4624
  }
4010
- declare type D1Result<T = unknown> = D1Response & {
4625
+ type D1Result<T = unknown> = D1Response & {
4011
4626
  results: T[];
4012
4627
  };
4013
- declare interface D1ExecResult {
4628
+ interface D1ExecResult {
4014
4629
  count: number;
4015
4630
  duration: number;
4016
4631
  }
@@ -4037,11 +4652,11 @@ declare abstract class D1PreparedStatement {
4037
4652
  // but this will ensure type checking on older versions still passes.
4038
4653
  // TypeScript's interface merging will ensure our empty interface is effectively
4039
4654
  // ignored when `Disposable` is included in the standard lib.
4040
- declare interface Disposable {}
4655
+ interface Disposable {}
4041
4656
  /**
4042
4657
  * An email message that can be sent from a Worker.
4043
4658
  */
4044
- declare interface EmailMessage {
4659
+ interface EmailMessage {
4045
4660
  /**
4046
4661
  * Envelope From attribute of the email message.
4047
4662
  */
@@ -4054,7 +4669,7 @@ declare interface EmailMessage {
4054
4669
  /**
4055
4670
  * An email message that is sent to a consumer Worker and can be rejected/forwarded.
4056
4671
  */
4057
- declare interface ForwardableEmailMessage extends EmailMessage {
4672
+ interface ForwardableEmailMessage extends EmailMessage {
4058
4673
  /**
4059
4674
  * Stream of the email message content.
4060
4675
  */
@@ -4084,7 +4699,7 @@ declare interface ForwardableEmailMessage extends EmailMessage {
4084
4699
  /**
4085
4700
  * A binding that allows a Worker to send email messages.
4086
4701
  */
4087
- declare interface SendEmail {
4702
+ interface SendEmail {
4088
4703
  send(message: EmailMessage): Promise<void>;
4089
4704
  }
4090
4705
  declare abstract class EmailEvent extends ExtendableEvent {
@@ -4102,7 +4717,7 @@ declare module "cloudflare:email" {
4102
4717
  };
4103
4718
  export { _EmailMessage as EmailMessage };
4104
4719
  }
4105
- declare interface Hyperdrive {
4720
+ interface Hyperdrive {
4106
4721
  /**
4107
4722
  * Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
4108
4723
  *
@@ -4149,8 +4764,8 @@ declare interface Hyperdrive {
4149
4764
  */
4150
4765
  readonly database: string;
4151
4766
  }
4152
- declare type Params<P extends string = any> = Record<P, string | string[]>;
4153
- declare type EventContext<Env, P extends string, Data> = {
4767
+ type Params<P extends string = any> = Record<P, string | string[]>;
4768
+ type EventContext<Env, P extends string, Data> = {
4154
4769
  request: Request<unknown, IncomingRequestCfProperties<unknown>>;
4155
4770
  functionPath: string;
4156
4771
  waitUntil: (promise: Promise<any>) => void;
@@ -4164,12 +4779,12 @@ declare type EventContext<Env, P extends string, Data> = {
4164
4779
  params: Params<P>;
4165
4780
  data: Data;
4166
4781
  };
4167
- declare type PagesFunction<
4782
+ type PagesFunction<
4168
4783
  Env = unknown,
4169
4784
  Params extends string = any,
4170
4785
  Data extends Record<string, unknown> = Record<string, unknown>,
4171
4786
  > = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
4172
- declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
4787
+ type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
4173
4788
  request: Request<unknown, IncomingRequestCfProperties<unknown>>;
4174
4789
  functionPath: string;
4175
4790
  waitUntil: (promise: Promise<any>) => void;
@@ -4184,7 +4799,7 @@ declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
4184
4799
  data: Data;
4185
4800
  pluginArgs: PluginArgs;
4186
4801
  };
4187
- declare type PagesPluginFunction<
4802
+ type PagesPluginFunction<
4188
4803
  Env = unknown,
4189
4804
  Params extends string = any,
4190
4805
  Data extends Record<string, unknown> = Record<string, unknown>,
@@ -4199,7 +4814,7 @@ declare module "assets:*" {
4199
4814
  // The message includes metadata about the broker, the client, and the payload
4200
4815
  // itself.
4201
4816
  // https://developers.cloudflare.com/pub-sub/
4202
- declare interface PubSubMessage {
4817
+ interface PubSubMessage {
4203
4818
  // Message ID
4204
4819
  readonly mid: number;
4205
4820
  // MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
@@ -4225,10 +4840,24 @@ declare interface PubSubMessage {
4225
4840
  payload: string | Uint8Array;
4226
4841
  }
4227
4842
  // JsonWebKey extended by kid parameter
4228
- declare interface JsonWebKeyWithKid extends JsonWebKey {
4843
+ interface JsonWebKeyWithKid extends JsonWebKey {
4229
4844
  // Key Identifier of the JWK
4230
4845
  readonly kid: string;
4231
4846
  }
4847
+ interface RateLimitOptions {
4848
+ key: string;
4849
+ }
4850
+ interface RateLimitOutcome {
4851
+ success: boolean;
4852
+ }
4853
+ interface RateLimit {
4854
+ /**
4855
+ * Rate limit a request based on the provided options.
4856
+ * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
4857
+ * @returns A promise that resolves with the outcome of the rate limit.
4858
+ */
4859
+ limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
4860
+ }
4232
4861
  // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
4233
4862
  // to referenced by `Fetcher`. This is included in the "importable" version of the types which
4234
4863
  // strips all `module` blocks.
@@ -4436,19 +5065,15 @@ declare module "cloudflare:sockets" {
4436
5065
  /**
4437
5066
  * Data types supported for holding vector metadata.
4438
5067
  */
4439
- declare type VectorizeVectorMetadataValue =
4440
- | string
4441
- | number
4442
- | boolean
4443
- | string[];
5068
+ type VectorizeVectorMetadataValue = string | number | boolean | string[];
4444
5069
  /**
4445
5070
  * Additional information to associate with a vector.
4446
5071
  */
4447
- declare type VectorizeVectorMetadata =
5072
+ type VectorizeVectorMetadata =
4448
5073
  | VectorizeVectorMetadataValue
4449
5074
  | Record<string, VectorizeVectorMetadataValue>;
4450
- declare type VectorFloatArray = Float32Array | Float64Array;
4451
- declare interface VectorizeError {
5075
+ type VectorFloatArray = Float32Array | Float64Array;
5076
+ interface VectorizeError {
4452
5077
  code?: number;
4453
5078
  error: string;
4454
5079
  }
@@ -4457,11 +5082,11 @@ declare interface VectorizeError {
4457
5082
  *
4458
5083
  * This list is expected to grow as support for more operations are released.
4459
5084
  */
4460
- declare type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
5085
+ type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
4461
5086
  /**
4462
5087
  * Filter criteria for vector metadata used to limit the retrieved query result set.
4463
5088
  */
4464
- declare type VectorizeVectorMetadataFilter = {
5089
+ type VectorizeVectorMetadataFilter = {
4465
5090
  [field: string]:
4466
5091
  | Exclude<VectorizeVectorMetadataValue, string[]>
4467
5092
  | null
@@ -4476,8 +5101,8 @@ declare type VectorizeVectorMetadataFilter = {
4476
5101
  * Supported distance metrics for an index.
4477
5102
  * Distance metrics determine how other "similar" vectors are determined.
4478
5103
  */
4479
- declare type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
4480
- declare interface VectorizeQueryOptions {
5104
+ type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5105
+ interface VectorizeQueryOptions {
4481
5106
  topK?: number;
4482
5107
  namespace?: string;
4483
5108
  returnValues?: boolean;
@@ -4487,7 +5112,7 @@ declare interface VectorizeQueryOptions {
4487
5112
  /**
4488
5113
  * Information about the configuration of an index.
4489
5114
  */
4490
- declare type VectorizeIndexConfig =
5115
+ type VectorizeIndexConfig =
4491
5116
  | {
4492
5117
  dimensions: number;
4493
5118
  metric: VectorizeDistanceMetric;
@@ -4498,7 +5123,7 @@ declare type VectorizeIndexConfig =
4498
5123
  /**
4499
5124
  * Metadata about an existing index.
4500
5125
  */
4501
- declare interface VectorizeIndexDetails {
5126
+ interface VectorizeIndexDetails {
4502
5127
  /** The unique ID of the index */
4503
5128
  readonly id: string;
4504
5129
  /** The name of the index. */
@@ -4513,7 +5138,7 @@ declare interface VectorizeIndexDetails {
4513
5138
  /**
4514
5139
  * Represents a single vector value set along with its associated metadata.
4515
5140
  */
4516
- declare interface VectorizeVector {
5141
+ interface VectorizeVector {
4517
5142
  /** 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. */
4518
5143
  id: string;
4519
5144
  /** The vector values */
@@ -4526,7 +5151,7 @@ declare interface VectorizeVector {
4526
5151
  /**
4527
5152
  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
4528
5153
  */
4529
- declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
5154
+ type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
4530
5155
  Omit<VectorizeVector, "values"> & {
4531
5156
  /** The score or rank for similarity, when returned as a result */
4532
5157
  score: number;
@@ -4534,7 +5159,7 @@ declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
4534
5159
  /**
4535
5160
  * A set of vector {@link VectorizeMatch} for a particular query.
4536
5161
  */
4537
- declare interface VectorizeMatches {
5162
+ interface VectorizeMatches {
4538
5163
  matches: VectorizeMatch[];
4539
5164
  count: number;
4540
5165
  }
@@ -4542,12 +5167,21 @@ declare interface VectorizeMatches {
4542
5167
  * Results of an operation that performed a mutation on a set of vectors.
4543
5168
  * Here, `ids` is a list of vectors that were successfully processed.
4544
5169
  */
4545
- declare interface VectorizeVectorMutation {
5170
+ interface VectorizeVectorMutation {
4546
5171
  /* List of ids of vectors that were successfully processed. */
4547
5172
  ids: string[];
4548
5173
  /* Total count of the number of processed vectors. */
4549
5174
  count: number;
4550
5175
  }
5176
+ /**
5177
+ * Results of an operation that performed a mutation on a set of vectors
5178
+ * with the v2 version of Vectorize.
5179
+ * Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
5180
+ */
5181
+ interface VectorizeVectorMutationV2 {
5182
+ /* The identifier for the last mutation processed by Vectorize. */
5183
+ mutationId: string;
5184
+ }
4551
5185
  declare abstract class VectorizeIndex {
4552
5186
  /**
4553
5187
  * Get information about the currently bound index.
@@ -4593,13 +5227,15 @@ declare abstract class VectorizeIndex {
4593
5227
  * The interface for "version_metadata" binding
4594
5228
  * providing metadata about the Worker Version using this binding.
4595
5229
  */
4596
- declare type WorkerVersionMetadata = {
5230
+ type WorkerVersionMetadata = {
4597
5231
  /** The ID of the Worker Version using this binding */
4598
5232
  id: string;
4599
5233
  /** The tag of the Worker Version using this binding */
4600
5234
  tag: string;
5235
+ /** The timestamp of when the Worker Version was uploaded */
5236
+ timestamp: string;
4601
5237
  };
4602
- declare interface DynamicDispatchLimits {
5238
+ interface DynamicDispatchLimits {
4603
5239
  /**
4604
5240
  * Limit CPU time in milliseconds.
4605
5241
  */
@@ -4609,7 +5245,7 @@ declare interface DynamicDispatchLimits {
4609
5245
  */
4610
5246
  subRequests?: number;
4611
5247
  }
4612
- declare interface DynamicDispatchOptions {
5248
+ interface DynamicDispatchOptions {
4613
5249
  /**
4614
5250
  * Limit resources of invoked Worker script.
4615
5251
  */
@@ -4621,7 +5257,7 @@ declare interface DynamicDispatchOptions {
4621
5257
  [key: string]: any;
4622
5258
  };
4623
5259
  }
4624
- declare interface DispatchNamespace {
5260
+ interface DispatchNamespace {
4625
5261
  /**
4626
5262
  * @param name Name of the Worker script.
4627
5263
  * @param args Arguments to Worker script.