@cloudflare/workers-types 0.20240405.1 → 0.20240712.0

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