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