@cloudflare/workers-types 4.20240320.1 → 4.20240402.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.
@@ -16,8 +16,15 @@ and limitations under the License.
16
16
  // noinspection JSUnusedGlobalSymbols
17
17
  export declare class DOMException extends Error {
18
18
  constructor(message?: string, name?: string);
19
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
19
20
  readonly message: string;
21
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
20
22
  readonly name: string;
23
+ /**
24
+ * @deprecated
25
+ *
26
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
27
+ */
21
28
  readonly code: number;
22
29
  readonly stack: any;
23
30
  static readonly INDEX_SIZE_ERR: number;
@@ -56,30 +63,61 @@ export type WorkerGlobalScopeEventMap = {
56
63
  export declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
57
64
  EventTarget: typeof EventTarget;
58
65
  }
66
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
59
67
  export interface Console {
60
68
  "assert"(condition?: boolean, ...data: any[]): void;
69
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
61
70
  clear(): void;
71
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
62
72
  count(label?: string): void;
73
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
63
74
  countReset(label?: string): void;
75
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
64
76
  debug(...data: any[]): void;
77
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
65
78
  dir(item?: any, options?: any): void;
79
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
66
80
  dirxml(...data: any[]): void;
81
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
67
82
  error(...data: any[]): void;
83
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
68
84
  group(...data: any[]): void;
85
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
69
86
  groupCollapsed(...data: any[]): void;
87
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
70
88
  groupEnd(): void;
89
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
71
90
  info(...data: any[]): void;
91
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
72
92
  log(...data: any[]): void;
93
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
73
94
  table(tabularData?: any, properties?: string[]): void;
95
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
74
96
  time(label?: string): void;
97
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
75
98
  timeEnd(label?: string): void;
99
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
76
100
  timeLog(label?: string, ...data: any[]): void;
77
101
  timeStamp(label?: string): void;
102
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
78
103
  trace(...data: any[]): void;
104
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
79
105
  warn(...data: any[]): void;
80
106
  }
81
107
  export declare const console: Console;
82
108
  export type BufferSource = ArrayBufferView | ArrayBuffer;
109
+ export type TypedArray =
110
+ | Int8Array
111
+ | Uint8Array
112
+ | Uint8ClampedArray
113
+ | Int16Array
114
+ | Uint16Array
115
+ | Int32Array
116
+ | Uint32Array
117
+ | Float32Array
118
+ | Float64Array
119
+ | BigInt64Array
120
+ | BigUint64Array;
83
121
  export declare namespace WebAssembly {
84
122
  class CompileError extends Error {
85
123
  constructor(message?: string);
@@ -154,7 +192,11 @@ export declare namespace WebAssembly {
154
192
  function instantiate(module: Module, imports?: Imports): Promise<Instance>;
155
193
  function validate(bytes: BufferSource): boolean;
156
194
  }
157
- /** This ServiceWorker API interface represents the global execution context of a service worker. */
195
+ /**
196
+ * This ServiceWorker API interface represents the global execution context of a service worker.
197
+ *
198
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
199
+ */
158
200
  export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
159
201
  DOMException: typeof DOMException;
160
202
  WorkerGlobalScope: typeof WorkerGlobalScope;
@@ -178,7 +220,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
178
220
  structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
179
221
  fetch(
180
222
  input: RequestInfo,
181
- init?: RequestInit<RequestInitCfProperties>
223
+ init?: RequestInit<RequestInitCfProperties>,
182
224
  ): Promise<Response>;
183
225
  self: ServiceWorkerGlobalScope;
184
226
  crypto: Crypto;
@@ -247,53 +289,68 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
247
289
  GPUColorWrite: typeof gpuGPUColorWrite;
248
290
  }
249
291
  export declare function addEventListener<
250
- Type extends keyof WorkerGlobalScopeEventMap
292
+ Type extends keyof WorkerGlobalScopeEventMap,
251
293
  >(
252
294
  type: Type,
253
295
  handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
254
- options?: EventTargetAddEventListenerOptions | boolean
296
+ options?: EventTargetAddEventListenerOptions | boolean,
255
297
  ): void;
256
298
  export declare function removeEventListener<
257
- Type extends keyof WorkerGlobalScopeEventMap
299
+ Type extends keyof WorkerGlobalScopeEventMap,
258
300
  >(
259
301
  type: Type,
260
302
  handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
261
- options?: EventTargetEventListenerOptions | boolean
303
+ options?: EventTargetEventListenerOptions | boolean,
262
304
  ): void;
263
- /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
305
+ /**
306
+ * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
307
+ *
308
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
309
+ */
264
310
  export declare function dispatchEvent(
265
- event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]
311
+ event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
266
312
  ): boolean;
313
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
267
314
  export declare function btoa(data: string): string;
315
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
268
316
  export declare function atob(data: string): string;
317
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
269
318
  export declare function setTimeout(
270
319
  callback: (...args: any[]) => void,
271
- msDelay?: number
320
+ msDelay?: number,
272
321
  ): number;
322
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
273
323
  export declare function setTimeout<Args extends any[]>(
274
324
  callback: (...args: Args) => void,
275
325
  msDelay?: number,
276
326
  ...args: Args
277
327
  ): number;
328
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
278
329
  export declare function clearTimeout(timeoutId: number | null): void;
330
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
279
331
  export declare function setInterval(
280
332
  callback: (...args: any[]) => void,
281
- msDelay?: number
333
+ msDelay?: number,
282
334
  ): number;
335
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
283
336
  export declare function setInterval<Args extends any[]>(
284
337
  callback: (...args: Args) => void,
285
338
  msDelay?: number,
286
339
  ...args: Args
287
340
  ): number;
341
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
288
342
  export declare function clearInterval(timeoutId: number | null): void;
343
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
289
344
  export declare function queueMicrotask(task: Function): void;
345
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
290
346
  export declare function structuredClone<T>(
291
347
  value: T,
292
- options?: StructuredSerializeOptions
348
+ options?: StructuredSerializeOptions,
293
349
  ): T;
350
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
294
351
  export declare function fetch(
295
352
  input: RequestInfo,
296
- init?: RequestInit<RequestInitCfProperties>
353
+ init?: RequestInit<RequestInitCfProperties>,
297
354
  ): Promise<Response>;
298
355
  export declare const self: ServiceWorkerGlobalScope;
299
356
  export declare const crypto: Crypto;
@@ -309,41 +366,41 @@ export interface ExecutionContext {
309
366
  }
310
367
  export type ExportedHandlerFetchHandler<
311
368
  Env = unknown,
312
- CfHostMetadata = unknown
369
+ CfHostMetadata = unknown,
313
370
  > = (
314
371
  request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
315
372
  env: Env,
316
- ctx: ExecutionContext
373
+ ctx: ExecutionContext,
317
374
  ) => Response | Promise<Response>;
318
375
  export type ExportedHandlerTailHandler<Env = unknown> = (
319
376
  events: TraceItem[],
320
377
  env: Env,
321
- ctx: ExecutionContext
378
+ ctx: ExecutionContext,
322
379
  ) => void | Promise<void>;
323
380
  export type ExportedHandlerTraceHandler<Env = unknown> = (
324
381
  traces: TraceItem[],
325
382
  env: Env,
326
- ctx: ExecutionContext
383
+ ctx: ExecutionContext,
327
384
  ) => void | Promise<void>;
328
385
  export type ExportedHandlerScheduledHandler<Env = unknown> = (
329
386
  controller: ScheduledController,
330
387
  env: Env,
331
- ctx: ExecutionContext
388
+ ctx: ExecutionContext,
332
389
  ) => void | Promise<void>;
333
390
  export type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
334
391
  batch: MessageBatch<Message>,
335
392
  env: Env,
336
- ctx: ExecutionContext
393
+ ctx: ExecutionContext,
337
394
  ) => void | Promise<void>;
338
395
  export type ExportedHandlerTestHandler<Env = unknown> = (
339
396
  controller: TestController,
340
397
  env: Env,
341
- ctx: ExecutionContext
398
+ ctx: ExecutionContext,
342
399
  ) => void | Promise<void>;
343
400
  export interface ExportedHandler<
344
401
  Env = unknown,
345
402
  QueueHandlerMessage = unknown,
346
- CfHostMetadata = unknown
403
+ CfHostMetadata = unknown,
347
404
  > {
348
405
  fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
349
406
  tail?: ExportedHandlerTailHandler<Env>;
@@ -357,7 +414,9 @@ export interface StructuredSerializeOptions {
357
414
  transfer?: any[];
358
415
  }
359
416
  export declare abstract class PromiseRejectionEvent extends Event {
417
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
360
418
  readonly promise: Promise<any>;
419
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
361
420
  readonly reason: any;
362
421
  }
363
422
  export declare abstract class Navigator {
@@ -369,14 +428,20 @@ export declare abstract class Navigator {
369
428
  | (ArrayBuffer | ArrayBufferView)
370
429
  | Blob
371
430
  | URLSearchParams
372
- | FormData
431
+ | FormData,
373
432
  ): boolean;
374
433
  readonly userAgent: string;
375
434
  readonly gpu: gpuGPU;
376
435
  }
377
- /** 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. */
436
+ /**
437
+ * 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.
438
+ *
439
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
440
+ */
378
441
  export interface Performance {
442
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
379
443
  readonly timeOrigin: number;
444
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
380
445
  now(): number;
381
446
  }
382
447
  export interface AlarmInvocationInfo {
@@ -388,36 +453,42 @@ export interface DurableObject {
388
453
  alarm?(): void | Promise<void>;
389
454
  webSocketMessage?(
390
455
  ws: WebSocket,
391
- message: string | ArrayBuffer
456
+ message: string | ArrayBuffer,
392
457
  ): void | Promise<void>;
393
458
  webSocketClose?(
394
459
  ws: WebSocket,
395
460
  code: number,
396
461
  reason: string,
397
- wasClean: boolean
462
+ wasClean: boolean,
398
463
  ): void | Promise<void>;
399
464
  webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
400
465
  }
401
- export interface DurableObjectStub extends Fetcher {
466
+ export type DurableObjectStub<
467
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
468
+ > = Fetcher<
469
+ T,
470
+ "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
471
+ > & {
402
472
  readonly id: DurableObjectId;
403
473
  readonly name?: string;
404
- }
474
+ };
405
475
  export interface DurableObjectId {
406
476
  toString(): string;
407
477
  equals(other: DurableObjectId): boolean;
408
478
  readonly name?: string;
409
479
  }
410
- export interface DurableObjectNamespace {
480
+ export interface DurableObjectNamespace<
481
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
482
+ > {
411
483
  newUniqueId(
412
- options?: DurableObjectNamespaceNewUniqueIdOptions
484
+ options?: DurableObjectNamespaceNewUniqueIdOptions,
413
485
  ): DurableObjectId;
414
486
  idFromName(name: string): DurableObjectId;
415
487
  idFromString(id: string): DurableObjectId;
416
- get(
417
- id: DurableObjectId,
418
- options?: DurableObjectNamespaceGetDurableObjectOptions
419
- ): DurableObjectStub;
420
- jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
488
+ get(id: DurableObjectId): DurableObjectStub<T>;
489
+ jurisdiction(
490
+ jurisdiction: DurableObjectJurisdiction,
491
+ ): DurableObjectNamespace<T>;
421
492
  }
422
493
  export type DurableObjectJurisdiction = "eu" | "fedramp";
423
494
  export interface DurableObjectNamespaceNewUniqueIdOptions {
@@ -453,23 +524,23 @@ export interface DurableObjectState {
453
524
  export interface DurableObjectTransaction {
454
525
  get<T = unknown>(
455
526
  key: string,
456
- options?: DurableObjectGetOptions
527
+ options?: DurableObjectGetOptions,
457
528
  ): Promise<T | undefined>;
458
529
  get<T = unknown>(
459
530
  keys: string[],
460
- options?: DurableObjectGetOptions
531
+ options?: DurableObjectGetOptions,
461
532
  ): Promise<Map<string, T>>;
462
533
  list<T = unknown>(
463
- options?: DurableObjectListOptions
534
+ options?: DurableObjectListOptions,
464
535
  ): Promise<Map<string, T>>;
465
536
  put<T>(
466
537
  key: string,
467
538
  value: T,
468
- options?: DurableObjectPutOptions
539
+ options?: DurableObjectPutOptions,
469
540
  ): Promise<void>;
470
541
  put<T>(
471
542
  entries: Record<string, T>,
472
- options?: DurableObjectPutOptions
543
+ options?: DurableObjectPutOptions,
473
544
  ): Promise<void>;
474
545
  delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
475
546
  delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
@@ -477,41 +548,41 @@ export interface DurableObjectTransaction {
477
548
  getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
478
549
  setAlarm(
479
550
  scheduledTime: number | Date,
480
- options?: DurableObjectSetAlarmOptions
551
+ options?: DurableObjectSetAlarmOptions,
481
552
  ): Promise<void>;
482
553
  deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
483
554
  }
484
555
  export interface DurableObjectStorage {
485
556
  get<T = unknown>(
486
557
  key: string,
487
- options?: DurableObjectGetOptions
558
+ options?: DurableObjectGetOptions,
488
559
  ): Promise<T | undefined>;
489
560
  get<T = unknown>(
490
561
  keys: string[],
491
- options?: DurableObjectGetOptions
562
+ options?: DurableObjectGetOptions,
492
563
  ): Promise<Map<string, T>>;
493
564
  list<T = unknown>(
494
- options?: DurableObjectListOptions
565
+ options?: DurableObjectListOptions,
495
566
  ): Promise<Map<string, T>>;
496
567
  put<T>(
497
568
  key: string,
498
569
  value: T,
499
- options?: DurableObjectPutOptions
570
+ options?: DurableObjectPutOptions,
500
571
  ): Promise<void>;
501
572
  put<T>(
502
573
  entries: Record<string, T>,
503
- options?: DurableObjectPutOptions
574
+ options?: DurableObjectPutOptions,
504
575
  ): Promise<void>;
505
576
  delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
506
577
  delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
507
578
  deleteAll(options?: DurableObjectPutOptions): Promise<void>;
508
579
  transaction<T>(
509
- closure: (txn: DurableObjectTransaction) => Promise<T>
580
+ closure: (txn: DurableObjectTransaction) => Promise<T>,
510
581
  ): Promise<T>;
511
582
  getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
512
583
  setAlarm(
513
584
  scheduledTime: number | Date,
514
- options?: DurableObjectSetAlarmOptions
585
+ options?: DurableObjectSetAlarmOptions,
515
586
  ): Promise<void>;
516
587
  deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
517
588
  sync(): Promise<void>;
@@ -558,22 +629,107 @@ export interface AnalyticsEngineDataPoint {
558
629
  }
559
630
  export declare class Event {
560
631
  constructor(type: string, init?: EventInit);
632
+ /**
633
+ * Returns the type of event, e.g. "click", "hashchange", or "submit".
634
+ *
635
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
636
+ */
561
637
  get type(): string;
638
+ /**
639
+ * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
640
+ *
641
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
642
+ */
562
643
  get eventPhase(): number;
644
+ /**
645
+ * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
646
+ *
647
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
648
+ */
563
649
  get composed(): boolean;
650
+ /**
651
+ * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
652
+ *
653
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
654
+ */
564
655
  get bubbles(): boolean;
656
+ /**
657
+ * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
658
+ *
659
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
660
+ */
565
661
  get cancelable(): boolean;
662
+ /**
663
+ * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
664
+ *
665
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
666
+ */
566
667
  get defaultPrevented(): boolean;
668
+ /**
669
+ * @deprecated
670
+ *
671
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
672
+ */
567
673
  get returnValue(): boolean;
674
+ /**
675
+ * Returns the object whose event listener's callback is currently being invoked.
676
+ *
677
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
678
+ */
568
679
  get currentTarget(): EventTarget | undefined;
680
+ /**
681
+ * @deprecated
682
+ *
683
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
684
+ */
569
685
  get srcElement(): EventTarget | undefined;
686
+ /**
687
+ * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
688
+ *
689
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
690
+ */
570
691
  get timeStamp(): number;
692
+ /**
693
+ * Returns true if event was dispatched by the user agent, and false otherwise.
694
+ *
695
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
696
+ */
571
697
  get isTrusted(): boolean;
698
+ /**
699
+ * @deprecated
700
+ *
701
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
702
+ */
572
703
  get cancelBubble(): boolean;
704
+ /**
705
+ * @deprecated
706
+ *
707
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
708
+ */
573
709
  set cancelBubble(value: boolean);
710
+ /**
711
+ * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
712
+ *
713
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
714
+ */
574
715
  stopImmediatePropagation(): void;
716
+ /**
717
+ * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
718
+ *
719
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
720
+ */
575
721
  preventDefault(): void;
722
+ /**
723
+ * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
724
+ *
725
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
726
+ */
576
727
  stopPropagation(): void;
728
+ /**
729
+ * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
730
+ *
731
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
732
+ */
577
733
  composedPath(): EventTarget[];
578
734
  static readonly NONE: number;
579
735
  static readonly CAPTURING_PHASE: number;
@@ -586,28 +742,55 @@ export interface EventInit {
586
742
  composed?: boolean;
587
743
  }
588
744
  export type EventListener<EventType extends Event = Event> = (
589
- event: EventType
745
+ event: EventType,
590
746
  ) => void;
591
747
  export interface EventListenerObject<EventType extends Event = Event> {
592
748
  handleEvent(event: EventType): void;
593
749
  }
594
750
  export type EventListenerOrEventListenerObject<
595
- EventType extends Event = Event
751
+ EventType extends Event = Event,
596
752
  > = EventListener<EventType> | EventListenerObject<EventType>;
597
753
  export declare class EventTarget<
598
- EventMap extends Record<string, Event> = Record<string, Event>
754
+ EventMap extends Record<string, Event> = Record<string, Event>,
599
755
  > {
600
756
  constructor();
757
+ /**
758
+ * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
759
+ *
760
+ * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
761
+ *
762
+ * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
763
+ *
764
+ * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
765
+ *
766
+ * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
767
+ *
768
+ * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
769
+ *
770
+ * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
771
+ *
772
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
773
+ */
601
774
  addEventListener<Type extends keyof EventMap>(
602
775
  type: Type,
603
776
  handler: EventListenerOrEventListenerObject<EventMap[Type]>,
604
- options?: EventTargetAddEventListenerOptions | boolean
777
+ options?: EventTargetAddEventListenerOptions | boolean,
605
778
  ): void;
779
+ /**
780
+ * Removes the event listener in target's event listener list with the same type, callback, and options.
781
+ *
782
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
783
+ */
606
784
  removeEventListener<Type extends keyof EventMap>(
607
785
  type: Type,
608
786
  handler: EventListenerOrEventListenerObject<EventMap[Type]>,
609
- options?: EventTargetEventListenerOptions | boolean
787
+ options?: EventTargetEventListenerOptions | boolean,
610
788
  ): void;
789
+ /**
790
+ * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
791
+ *
792
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
793
+ */
611
794
  dispatchEvent(event: EventMap[keyof EventMap]): boolean;
612
795
  }
613
796
  export interface EventTargetEventListenerOptions {
@@ -624,15 +807,34 @@ export interface EventTargetHandlerObject {
624
807
  }
625
808
  export declare class AbortController {
626
809
  constructor();
810
+ /**
811
+ * Returns the AbortSignal object associated with this object.
812
+ *
813
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
814
+ */
627
815
  get signal(): AbortSignal;
816
+ /**
817
+ * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
818
+ *
819
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
820
+ */
628
821
  abort(reason?: any): void;
629
822
  }
630
823
  export declare abstract class AbortSignal extends EventTarget {
824
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
631
825
  static abort(reason?: any): AbortSignal;
826
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
632
827
  static timeout(delay: number): AbortSignal;
633
828
  static any(signals: AbortSignal[]): AbortSignal;
829
+ /**
830
+ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
831
+ *
832
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
833
+ */
634
834
  get aborted(): boolean;
835
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
635
836
  get reason(): any;
837
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
636
838
  throwIfAborted(): void;
637
839
  }
638
840
  export interface Scheduler {
@@ -642,10 +844,16 @@ export interface SchedulerWaitOptions {
642
844
  signal?: AbortSignal;
643
845
  }
644
846
  export declare abstract class ExtendableEvent extends Event {
847
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
645
848
  waitUntil(promise: Promise<any>): void;
646
849
  }
647
850
  export declare class CustomEvent<T = any> extends Event {
648
851
  constructor(type: string, init?: CustomEventCustomEventInit);
852
+ /**
853
+ * Returns any custom data event was created with. Typically used for synthetic events.
854
+ *
855
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
856
+ */
649
857
  get detail(): T;
650
858
  }
651
859
  export interface CustomEventCustomEventInit {
@@ -657,13 +865,19 @@ export interface CustomEventCustomEventInit {
657
865
  export declare class Blob {
658
866
  constructor(
659
867
  bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
660
- options?: BlobOptions
868
+ options?: BlobOptions,
661
869
  );
870
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
662
871
  get size(): number;
872
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
663
873
  get type(): string;
874
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
664
875
  slice(start?: number, end?: number, type?: string): Blob;
876
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
665
877
  arrayBuffer(): Promise<ArrayBuffer>;
878
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
666
879
  text(): Promise<string>;
880
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
667
881
  stream(): ReadableStream;
668
882
  }
669
883
  export interface BlobOptions {
@@ -673,9 +887,11 @@ export declare class File extends Blob {
673
887
  constructor(
674
888
  bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
675
889
  name: string,
676
- options?: FileOptions
890
+ options?: FileOptions,
677
891
  );
892
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
678
893
  get name(): string;
894
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
679
895
  get lastModified(): number;
680
896
  }
681
897
  export interface FileOptions {
@@ -683,6 +899,7 @@ export interface FileOptions {
683
899
  lastModified?: number;
684
900
  }
685
901
  export declare abstract class CacheStorage {
902
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
686
903
  open(cacheName: string): Promise<Cache>;
687
904
  readonly default: Cache;
688
905
  }
@@ -690,7 +907,7 @@ export declare abstract class Cache {
690
907
  delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
691
908
  match(
692
909
  request: RequestInfo,
693
- options?: CacheQueryOptions
910
+ options?: CacheQueryOptions,
694
911
  ): Promise<Response | undefined>;
695
912
  put(request: RequestInfo, response: Response): Promise<void>;
696
913
  }
@@ -698,7 +915,13 @@ export interface CacheQueryOptions {
698
915
  ignoreMethod?: boolean;
699
916
  }
700
917
  export declare abstract class Crypto {
918
+ /**
919
+ * Available only in secure contexts.
920
+ *
921
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
922
+ */
701
923
  get subtle(): SubtleCrypto;
924
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
702
925
  getRandomValues<
703
926
  T extends
704
927
  | Int8Array
@@ -708,8 +931,13 @@ export declare abstract class Crypto {
708
931
  | Int32Array
709
932
  | Uint32Array
710
933
  | BigInt64Array
711
- | BigUint64Array
934
+ | BigUint64Array,
712
935
  >(buffer: T): T;
936
+ /**
937
+ * Available only in secure contexts.
938
+ *
939
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
940
+ */
713
941
  randomUUID(): string;
714
942
  DigestStream: typeof DigestStream;
715
943
  }
@@ -717,59 +945,63 @@ export declare abstract class SubtleCrypto {
717
945
  encrypt(
718
946
  algorithm: string | SubtleCryptoEncryptAlgorithm,
719
947
  key: CryptoKey,
720
- plainText: ArrayBuffer | ArrayBufferView
948
+ plainText: ArrayBuffer | ArrayBufferView,
721
949
  ): Promise<ArrayBuffer>;
722
950
  decrypt(
723
951
  algorithm: string | SubtleCryptoEncryptAlgorithm,
724
952
  key: CryptoKey,
725
- cipherText: ArrayBuffer | ArrayBufferView
953
+ cipherText: ArrayBuffer | ArrayBufferView,
726
954
  ): Promise<ArrayBuffer>;
727
955
  sign(
728
956
  algorithm: string | SubtleCryptoSignAlgorithm,
729
957
  key: CryptoKey,
730
- data: ArrayBuffer | ArrayBufferView
958
+ data: ArrayBuffer | ArrayBufferView,
731
959
  ): Promise<ArrayBuffer>;
732
960
  verify(
733
961
  algorithm: string | SubtleCryptoSignAlgorithm,
734
962
  key: CryptoKey,
735
963
  signature: ArrayBuffer | ArrayBufferView,
736
- data: ArrayBuffer | ArrayBufferView
964
+ data: ArrayBuffer | ArrayBufferView,
737
965
  ): Promise<boolean>;
738
966
  digest(
739
967
  algorithm: string | SubtleCryptoHashAlgorithm,
740
- data: ArrayBuffer | ArrayBufferView
968
+ data: ArrayBuffer | ArrayBufferView,
741
969
  ): Promise<ArrayBuffer>;
970
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
742
971
  generateKey(
743
972
  algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
744
973
  extractable: boolean,
745
- keyUsages: string[]
974
+ keyUsages: string[],
746
975
  ): Promise<CryptoKey | CryptoKeyPair>;
976
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
747
977
  deriveKey(
748
978
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
749
979
  baseKey: CryptoKey,
750
980
  derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
751
981
  extractable: boolean,
752
- keyUsages: string[]
982
+ keyUsages: string[],
753
983
  ): Promise<CryptoKey>;
754
984
  deriveBits(
755
985
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
756
986
  baseKey: CryptoKey,
757
- length: number | null
987
+ length: number | null,
758
988
  ): Promise<ArrayBuffer>;
989
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
759
990
  importKey(
760
991
  format: string,
761
992
  keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
762
993
  algorithm: string | SubtleCryptoImportKeyAlgorithm,
763
994
  extractable: boolean,
764
- keyUsages: string[]
995
+ keyUsages: string[],
765
996
  ): Promise<CryptoKey>;
766
997
  exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
767
998
  wrapKey(
768
999
  format: string,
769
1000
  key: CryptoKey,
770
1001
  wrappingKey: CryptoKey,
771
- wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm
1002
+ wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
772
1003
  ): Promise<ArrayBuffer>;
1004
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
773
1005
  unwrapKey(
774
1006
  format: string,
775
1007
  wrappedKey: ArrayBuffer | ArrayBufferView,
@@ -777,16 +1009,19 @@ export declare abstract class SubtleCrypto {
777
1009
  unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
778
1010
  unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
779
1011
  extractable: boolean,
780
- keyUsages: string[]
1012
+ keyUsages: string[],
781
1013
  ): Promise<CryptoKey>;
782
1014
  timingSafeEqual(
783
1015
  a: ArrayBuffer | ArrayBufferView,
784
- b: ArrayBuffer | ArrayBufferView
1016
+ b: ArrayBuffer | ArrayBufferView,
785
1017
  ): boolean;
786
1018
  }
787
1019
  export declare abstract class CryptoKey {
1020
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
788
1021
  readonly type: string;
1022
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
789
1023
  readonly extractable: boolean;
1024
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
790
1025
  readonly algorithm:
791
1026
  | CryptoKeyKeyAlgorithm
792
1027
  | CryptoKeyAesKeyAlgorithm
@@ -794,6 +1029,7 @@ export declare abstract class CryptoKey {
794
1029
  | CryptoKeyRsaKeyAlgorithm
795
1030
  | CryptoKeyEllipticKeyAlgorithm
796
1031
  | CryptoKeyArbitraryKeyAlgorithm;
1032
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
797
1033
  readonly usages: string[];
798
1034
  }
799
1035
  export interface CryptoKeyPair {
@@ -902,9 +1138,24 @@ export declare class DigestStream extends WritableStream<
902
1138
  }
903
1139
  export declare class TextDecoder {
904
1140
  constructor(decoder?: string, options?: TextDecoderConstructorOptions);
1141
+ /**
1142
+ * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
1143
+ *
1144
+ * ```
1145
+ * var string = "", decoder = new TextDecoder(encoding), buffer;
1146
+ * while(buffer = next_chunk()) {
1147
+ * string += decoder.decode(buffer, {stream:true});
1148
+ * }
1149
+ * string += decoder.decode(); // end-of-queue
1150
+ * ```
1151
+ *
1152
+ * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
1153
+ *
1154
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
1155
+ */
905
1156
  decode(
906
1157
  input?: ArrayBuffer | ArrayBufferView,
907
- options?: TextDecoderDecodeOptions
1158
+ options?: TextDecoderDecodeOptions,
908
1159
  ): string;
909
1160
  get encoding(): string;
910
1161
  get fatal(): boolean;
@@ -912,10 +1163,20 @@ export declare class TextDecoder {
912
1163
  }
913
1164
  export declare class TextEncoder {
914
1165
  constructor();
1166
+ /**
1167
+ * Returns the result of running UTF-8's encoder.
1168
+ *
1169
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
1170
+ */
915
1171
  encode(input?: string): Uint8Array;
1172
+ /**
1173
+ * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
1174
+ *
1175
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
1176
+ */
916
1177
  encodeInto(
917
1178
  input: string,
918
- buffer: ArrayBuffer | ArrayBufferView
1179
+ buffer: ArrayBuffer | ArrayBufferView,
919
1180
  ): TextEncoderEncodeIntoResult;
920
1181
  get encoding(): string;
921
1182
  }
@@ -940,17 +1201,20 @@ export declare class FormData {
940
1201
  has(name: string): boolean;
941
1202
  set(name: string, value: string): void;
942
1203
  set(name: string, value: Blob, filename?: string): void;
1204
+ /** Returns an array of key, value pairs for every entry in the list. */
943
1205
  entries(): IterableIterator<[key: string, value: File | string]>;
1206
+ /** Returns a list of keys in the list. */
944
1207
  keys(): IterableIterator<string>;
1208
+ /** Returns a list of values in the list. */
945
1209
  values(): IterableIterator<File | string>;
946
1210
  forEach<This = unknown>(
947
1211
  callback: (
948
1212
  this: This,
949
1213
  value: File | string,
950
1214
  key: string,
951
- parent: FormData
1215
+ parent: FormData,
952
1216
  ) => void,
953
- thisArg?: This
1217
+ thisArg?: This,
954
1218
  ): void;
955
1219
  [Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
956
1220
  }
@@ -961,7 +1225,7 @@ export declare class HTMLRewriter {
961
1225
  constructor();
962
1226
  on(
963
1227
  selector: string,
964
- handlers: HTMLRewriterElementContentHandlers
1228
+ handlers: HTMLRewriterElementContentHandlers,
965
1229
  ): HTMLRewriter;
966
1230
  onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
967
1231
  transform(response: Response): Response;
@@ -1028,7 +1292,9 @@ export interface DocumentEnd {
1028
1292
  append(content: string, options?: ContentOptions): DocumentEnd;
1029
1293
  }
1030
1294
  export declare abstract class FetchEvent extends ExtendableEvent {
1295
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1031
1296
  readonly request: Request;
1297
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1032
1298
  respondWith(promise: Response | Promise<Response>): void;
1033
1299
  passThroughOnException(): void;
1034
1300
  }
@@ -1046,10 +1312,13 @@ export declare class Headers {
1046
1312
  delete(name: string): void;
1047
1313
  forEach<This = unknown>(
1048
1314
  callback: (this: This, value: string, key: string, parent: Headers) => void,
1049
- thisArg?: This
1315
+ thisArg?: This,
1050
1316
  ): void;
1317
+ /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
1051
1318
  entries(): IterableIterator<[key: string, value: string]>;
1319
+ /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1052
1320
  keys(): IterableIterator<string>;
1321
+ /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1053
1322
  values(): IterableIterator<string>;
1054
1323
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
1055
1324
  }
@@ -1072,14 +1341,23 @@ export declare abstract class Body {
1072
1341
  }
1073
1342
  export declare class Response extends Body {
1074
1343
  constructor(body?: BodyInit | null, init?: ResponseInit);
1344
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1075
1345
  static redirect(url: string, status?: number): Response;
1346
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1076
1347
  static json(any: any, maybeInit?: ResponseInit | Response): Response;
1348
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1077
1349
  clone(): Response;
1350
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1078
1351
  get status(): number;
1352
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1079
1353
  get statusText(): string;
1354
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1080
1355
  get headers(): Headers;
1356
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1081
1357
  get ok(): boolean;
1358
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1082
1359
  get redirected(): boolean;
1360
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1083
1361
  get url(): string;
1084
1362
  get webSocket(): WebSocket | null;
1085
1363
  get cf(): any | undefined;
@@ -1094,22 +1372,58 @@ export interface ResponseInit {
1094
1372
  }
1095
1373
  export type RequestInfo<
1096
1374
  CfHostMetadata = unknown,
1097
- Cf = CfProperties<CfHostMetadata>
1375
+ Cf = CfProperties<CfHostMetadata>,
1098
1376
  > = Request<CfHostMetadata, Cf> | string | URL;
1099
1377
  export declare class Request<
1100
1378
  CfHostMetadata = unknown,
1101
- Cf = CfProperties<CfHostMetadata>
1379
+ Cf = CfProperties<CfHostMetadata>,
1102
1380
  > extends Body {
1103
1381
  constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
1382
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1104
1383
  clone(): Request<CfHostMetadata, Cf>;
1384
+ /**
1385
+ * Returns request's HTTP method, which is "GET" by default.
1386
+ *
1387
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1388
+ */
1105
1389
  get method(): string;
1390
+ /**
1391
+ * Returns the URL of request as a string.
1392
+ *
1393
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1394
+ */
1106
1395
  get url(): string;
1396
+ /**
1397
+ * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
1398
+ *
1399
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1400
+ */
1107
1401
  get headers(): Headers;
1402
+ /**
1403
+ * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
1404
+ *
1405
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1406
+ */
1108
1407
  get redirect(): string;
1109
1408
  get fetcher(): Fetcher | null;
1409
+ /**
1410
+ * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
1411
+ *
1412
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1413
+ */
1110
1414
  get signal(): AbortSignal;
1111
1415
  get cf(): Cf | undefined;
1416
+ /**
1417
+ * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
1418
+ *
1419
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1420
+ */
1112
1421
  get integrity(): string;
1422
+ /**
1423
+ * Returns a boolean indicating whether or not request can outlive the global in which it was created.
1424
+ *
1425
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1426
+ */
1113
1427
  get keepalive(): boolean;
1114
1428
  }
1115
1429
  export interface RequestInit<Cf = CfProperties> {
@@ -1128,10 +1442,18 @@ export interface RequestInit<Cf = CfProperties> {
1128
1442
  /** An AbortSignal to set request's signal. */
1129
1443
  signal?: AbortSignal | null;
1130
1444
  }
1131
- export declare abstract class Fetcher {
1445
+ export type Service<
1446
+ T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
1447
+ > = Fetcher<T>;
1448
+ export type Fetcher<
1449
+ T extends Rpc.EntrypointBranded | undefined = undefined,
1450
+ Reserved extends string = never,
1451
+ > = (T extends Rpc.EntrypointBranded
1452
+ ? Rpc.Provider<T, Reserved | "fetch" | "connect">
1453
+ : unknown) & {
1132
1454
  fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
1133
1455
  connect(address: SocketAddress | string, options?: SocketOptions): Socket;
1134
- }
1456
+ };
1135
1457
  export interface FetcherPutOptions {
1136
1458
  expiration?: number;
1137
1459
  expirationTtl?: number;
@@ -1156,74 +1478,74 @@ export type KVNamespaceListResult<Metadata, Key extends string = string> =
1156
1478
  export interface KVNamespace<Key extends string = string> {
1157
1479
  get(
1158
1480
  key: Key,
1159
- options?: Partial<KVNamespaceGetOptions<undefined>>
1481
+ options?: Partial<KVNamespaceGetOptions<undefined>>,
1160
1482
  ): Promise<string | null>;
1161
1483
  get(key: Key, type: "text"): Promise<string | null>;
1162
1484
  get<ExpectedValue = unknown>(
1163
1485
  key: Key,
1164
- type: "json"
1486
+ type: "json",
1165
1487
  ): Promise<ExpectedValue | null>;
1166
1488
  get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
1167
1489
  get(key: Key, type: "stream"): Promise<ReadableStream | null>;
1168
1490
  get(
1169
1491
  key: Key,
1170
- options?: KVNamespaceGetOptions<"text">
1492
+ options?: KVNamespaceGetOptions<"text">,
1171
1493
  ): Promise<string | null>;
1172
1494
  get<ExpectedValue = unknown>(
1173
1495
  key: Key,
1174
- options?: KVNamespaceGetOptions<"json">
1496
+ options?: KVNamespaceGetOptions<"json">,
1175
1497
  ): Promise<ExpectedValue | null>;
1176
1498
  get(
1177
1499
  key: Key,
1178
- options?: KVNamespaceGetOptions<"arrayBuffer">
1500
+ options?: KVNamespaceGetOptions<"arrayBuffer">,
1179
1501
  ): Promise<ArrayBuffer | null>;
1180
1502
  get(
1181
1503
  key: Key,
1182
- options?: KVNamespaceGetOptions<"stream">
1504
+ options?: KVNamespaceGetOptions<"stream">,
1183
1505
  ): Promise<ReadableStream | null>;
1184
1506
  list<Metadata = unknown>(
1185
- options?: KVNamespaceListOptions
1507
+ options?: KVNamespaceListOptions,
1186
1508
  ): Promise<KVNamespaceListResult<Metadata, Key>>;
1187
1509
  put(
1188
1510
  key: Key,
1189
1511
  value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
1190
- options?: KVNamespacePutOptions
1512
+ options?: KVNamespacePutOptions,
1191
1513
  ): Promise<void>;
1192
1514
  getWithMetadata<Metadata = unknown>(
1193
1515
  key: Key,
1194
- options?: Partial<KVNamespaceGetOptions<undefined>>
1516
+ options?: Partial<KVNamespaceGetOptions<undefined>>,
1195
1517
  ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1196
1518
  getWithMetadata<Metadata = unknown>(
1197
1519
  key: Key,
1198
- type: "text"
1520
+ type: "text",
1199
1521
  ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1200
1522
  getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1201
1523
  key: Key,
1202
- type: "json"
1524
+ type: "json",
1203
1525
  ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1204
1526
  getWithMetadata<Metadata = unknown>(
1205
1527
  key: Key,
1206
- type: "arrayBuffer"
1528
+ type: "arrayBuffer",
1207
1529
  ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1208
1530
  getWithMetadata<Metadata = unknown>(
1209
1531
  key: Key,
1210
- type: "stream"
1532
+ type: "stream",
1211
1533
  ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1212
1534
  getWithMetadata<Metadata = unknown>(
1213
1535
  key: Key,
1214
- options: KVNamespaceGetOptions<"text">
1536
+ options: KVNamespaceGetOptions<"text">,
1215
1537
  ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1216
1538
  getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1217
1539
  key: Key,
1218
- options: KVNamespaceGetOptions<"json">
1540
+ options: KVNamespaceGetOptions<"json">,
1219
1541
  ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1220
1542
  getWithMetadata<Metadata = unknown>(
1221
1543
  key: Key,
1222
- options: KVNamespaceGetOptions<"arrayBuffer">
1544
+ options: KVNamespaceGetOptions<"arrayBuffer">,
1223
1545
  ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1224
1546
  getWithMetadata<Metadata = unknown>(
1225
1547
  key: Key,
1226
- options: KVNamespaceGetOptions<"stream">
1548
+ options: KVNamespaceGetOptions<"stream">,
1227
1549
  ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1228
1550
  delete(key: Key): Promise<void>;
1229
1551
  }
@@ -1251,7 +1573,7 @@ export interface Queue<Body = unknown> {
1251
1573
  send(message: Body, options?: QueueSendOptions): Promise<void>;
1252
1574
  sendBatch(
1253
1575
  messages: Iterable<MessageSendRequest<Body>>,
1254
- options?: QueueSendBatchOptions
1576
+ options?: QueueSendBatchOptions,
1255
1577
  ): Promise<void>;
1256
1578
  }
1257
1579
  export interface QueueSendOptions {
@@ -1273,6 +1595,7 @@ export interface Message<Body = unknown> {
1273
1595
  readonly id: string;
1274
1596
  readonly timestamp: Date;
1275
1597
  readonly body: Body;
1598
+ readonly attempts: number;
1276
1599
  retry(options?: QueueRetryOptions): void;
1277
1600
  ack(): void;
1278
1601
  }
@@ -1309,7 +1632,7 @@ export declare abstract class R2Bucket {
1309
1632
  key: string,
1310
1633
  options: R2GetOptions & {
1311
1634
  onlyIf: R2Conditional | Headers;
1312
- }
1635
+ },
1313
1636
  ): Promise<R2ObjectBody | R2Object | null>;
1314
1637
  get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
1315
1638
  put(
@@ -1323,7 +1646,7 @@ export declare abstract class R2Bucket {
1323
1646
  | Blob,
1324
1647
  options?: R2PutOptions & {
1325
1648
  onlyIf: R2Conditional | Headers;
1326
- }
1649
+ },
1327
1650
  ): Promise<R2Object | null>;
1328
1651
  put(
1329
1652
  key: string,
@@ -1334,11 +1657,11 @@ export declare abstract class R2Bucket {
1334
1657
  | string
1335
1658
  | null
1336
1659
  | Blob,
1337
- options?: R2PutOptions
1660
+ options?: R2PutOptions,
1338
1661
  ): Promise<R2Object>;
1339
1662
  createMultipartUpload(
1340
1663
  key: string,
1341
- options?: R2MultipartOptions
1664
+ options?: R2MultipartOptions,
1342
1665
  ): Promise<R2MultipartUpload>;
1343
1666
  resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
1344
1667
  delete(keys: string | string[]): Promise<void>;
@@ -1349,7 +1672,7 @@ export interface R2MultipartUpload {
1349
1672
  readonly uploadId: string;
1350
1673
  uploadPart(
1351
1674
  partNumber: number,
1352
- value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob
1675
+ value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
1353
1676
  ): Promise<R2UploadedPart>;
1354
1677
  abort(): Promise<void>;
1355
1678
  complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
@@ -1470,7 +1793,7 @@ export interface UnderlyingSink<W = any> {
1470
1793
  start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
1471
1794
  write?: (
1472
1795
  chunk: W,
1473
- controller: WritableStreamDefaultController
1796
+ controller: WritableStreamDefaultController,
1474
1797
  ) => void | Promise<void>;
1475
1798
  abort?: (reason: any) => void | Promise<void>;
1476
1799
  close?: () => void | Promise<void>;
@@ -1485,10 +1808,10 @@ export interface UnderlyingByteSource {
1485
1808
  export interface UnderlyingSource<R = any> {
1486
1809
  type?: "" | undefined;
1487
1810
  start?: (
1488
- controller: ReadableStreamDefaultController<R>
1811
+ controller: ReadableStreamDefaultController<R>,
1489
1812
  ) => void | Promise<void>;
1490
1813
  pull?: (
1491
- controller: ReadableStreamDefaultController<R>
1814
+ controller: ReadableStreamDefaultController<R>,
1492
1815
  ) => void | Promise<void>;
1493
1816
  cancel?: (reason: any) => void | Promise<void>;
1494
1817
  expectedLength?: number | bigint;
@@ -1497,14 +1820,14 @@ export interface Transformer<I = any, O = any> {
1497
1820
  readableType?: string;
1498
1821
  writableType?: string;
1499
1822
  start?: (
1500
- controller: TransformStreamDefaultController<O>
1823
+ controller: TransformStreamDefaultController<O>,
1501
1824
  ) => void | Promise<void>;
1502
1825
  transform?: (
1503
1826
  chunk: I,
1504
- controller: TransformStreamDefaultController<O>
1827
+ controller: TransformStreamDefaultController<O>,
1505
1828
  ) => void | Promise<void>;
1506
1829
  flush?: (
1507
- controller: TransformStreamDefaultController<O>
1830
+ controller: TransformStreamDefaultController<O>,
1508
1831
  ) => void | Promise<void>;
1509
1832
  cancel?: (reason: any) => void | Promise<void>;
1510
1833
  expectedLength?: number;
@@ -1541,91 +1864,137 @@ export type ReadableStreamReadResult<R = any> =
1541
1864
  done: true;
1542
1865
  value?: undefined;
1543
1866
  };
1544
- /** 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. */
1867
+ /**
1868
+ * 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.
1869
+ *
1870
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1871
+ */
1545
1872
  export interface ReadableStream<R = any> {
1873
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
1546
1874
  get locked(): boolean;
1875
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
1547
1876
  cancel(reason?: any): Promise<void>;
1877
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1548
1878
  getReader(): ReadableStreamDefaultReader<R>;
1879
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1549
1880
  getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1881
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
1550
1882
  pipeThrough<T>(
1551
1883
  transform: ReadableWritablePair<T, R>,
1552
- options?: StreamPipeOptions
1884
+ options?: StreamPipeOptions,
1553
1885
  ): ReadableStream<T>;
1886
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
1554
1887
  pipeTo(
1555
1888
  destination: WritableStream<R>,
1556
- options?: StreamPipeOptions
1889
+ options?: StreamPipeOptions,
1557
1890
  ): Promise<void>;
1891
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
1558
1892
  tee(): [ReadableStream<R>, ReadableStream<R>];
1559
1893
  values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1560
1894
  [Symbol.asyncIterator](
1561
- options?: ReadableStreamValuesOptions
1895
+ options?: ReadableStreamValuesOptions,
1562
1896
  ): AsyncIterableIterator<R>;
1563
1897
  }
1564
1898
  export declare const ReadableStream: {
1565
1899
  prototype: ReadableStream;
1566
1900
  new (
1567
1901
  underlyingSource: UnderlyingByteSource,
1568
- strategy?: QueuingStrategy<Uint8Array>
1902
+ strategy?: QueuingStrategy<Uint8Array>,
1569
1903
  ): ReadableStream<Uint8Array>;
1570
1904
  new <R = any>(
1571
1905
  underlyingSource?: UnderlyingSource<R>,
1572
- strategy?: QueuingStrategy<R>
1906
+ strategy?: QueuingStrategy<R>,
1573
1907
  ): ReadableStream<R>;
1574
1908
  };
1575
1909
  export declare class ReadableStreamDefaultReader<R = any> {
1576
1910
  constructor(stream: ReadableStream);
1577
1911
  get closed(): Promise<void>;
1578
1912
  cancel(reason?: any): Promise<void>;
1913
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
1579
1914
  read(): Promise<ReadableStreamReadResult<R>>;
1915
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
1580
1916
  releaseLock(): void;
1581
1917
  }
1582
1918
  export declare class ReadableStreamBYOBReader {
1583
1919
  constructor(stream: ReadableStream);
1584
1920
  get closed(): Promise<void>;
1585
1921
  cancel(reason?: any): Promise<void>;
1922
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
1586
1923
  read<T extends ArrayBufferView>(
1587
- view: T
1924
+ view: T,
1588
1925
  ): Promise<ReadableStreamReadResult<T>>;
1926
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
1589
1927
  releaseLock(): void;
1590
1928
  readAtLeast<T extends ArrayBufferView>(
1591
1929
  minElements: number,
1592
- view: T
1930
+ view: T,
1593
1931
  ): Promise<ReadableStreamReadResult<T>>;
1594
1932
  }
1595
1933
  export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
1596
1934
  min?: number;
1597
1935
  }
1598
1936
  export interface ReadableStreamGetReaderOptions {
1937
+ /**
1938
+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
1939
+ *
1940
+ * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
1941
+ */
1599
1942
  mode: "byob";
1600
1943
  }
1944
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
1601
1945
  export interface ReadableStreamBYOBRequest {
1946
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
1602
1947
  readonly view: Uint8Array | null;
1948
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
1603
1949
  respond(bytesWritten: number): void;
1950
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
1604
1951
  respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
1605
1952
  readonly atLeast: number | null;
1606
1953
  }
1954
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
1607
1955
  export interface ReadableStreamDefaultController<R = any> {
1956
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
1608
1957
  readonly desiredSize: number | null;
1958
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
1609
1959
  close(): void;
1960
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
1610
1961
  enqueue(chunk?: R): void;
1962
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
1611
1963
  error(reason: any): void;
1612
1964
  }
1965
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
1613
1966
  export interface ReadableByteStreamController {
1967
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
1614
1968
  readonly byobRequest: ReadableStreamBYOBRequest | null;
1969
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
1615
1970
  readonly desiredSize: number | null;
1971
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
1616
1972
  close(): void;
1973
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
1617
1974
  enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
1975
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
1618
1976
  error(reason: any): void;
1619
1977
  }
1620
- /** 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. */
1978
+ /**
1979
+ * 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.
1980
+ *
1981
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
1982
+ */
1621
1983
  export interface WritableStreamDefaultController {
1984
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
1622
1985
  readonly signal: AbortSignal;
1986
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
1623
1987
  error(reason?: any): void;
1624
1988
  }
1989
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
1625
1990
  export interface TransformStreamDefaultController<O = any> {
1991
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
1626
1992
  get desiredSize(): number | null;
1993
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
1627
1994
  enqueue(chunk?: O): void;
1995
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
1628
1996
  error(reason: any): void;
1997
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
1629
1998
  terminate(): void;
1630
1999
  }
1631
2000
  export interface ReadableWritablePair<R = any, W = any> {
@@ -1640,36 +2009,49 @@ export interface ReadableWritablePair<R = any, W = any> {
1640
2009
  export declare class WritableStream<W = any> {
1641
2010
  constructor(
1642
2011
  underlyingSink?: UnderlyingSink,
1643
- queuingStrategy?: QueuingStrategy
2012
+ queuingStrategy?: QueuingStrategy,
1644
2013
  );
2014
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
1645
2015
  get locked(): boolean;
2016
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
1646
2017
  abort(reason?: any): Promise<void>;
2018
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
1647
2019
  close(): Promise<void>;
2020
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
1648
2021
  getWriter(): WritableStreamDefaultWriter<W>;
1649
2022
  }
1650
2023
  export declare class WritableStreamDefaultWriter<W = any> {
1651
2024
  constructor(stream: WritableStream);
2025
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
1652
2026
  get closed(): Promise<void>;
2027
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
1653
2028
  get ready(): Promise<void>;
2029
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
1654
2030
  get desiredSize(): number | null;
2031
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
1655
2032
  abort(reason?: any): Promise<void>;
2033
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
1656
2034
  close(): Promise<void>;
2035
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
1657
2036
  write(chunk?: W): Promise<void>;
2037
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
1658
2038
  releaseLock(): void;
1659
2039
  }
1660
2040
  export declare class TransformStream<I = any, O = any> {
1661
2041
  constructor(
1662
2042
  transformer?: Transformer<I, O>,
1663
2043
  writableStrategy?: QueuingStrategy<I>,
1664
- readableStrategy?: QueuingStrategy<O>
2044
+ readableStrategy?: QueuingStrategy<O>,
1665
2045
  );
2046
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
1666
2047
  get readable(): ReadableStream<O>;
2048
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
1667
2049
  get writable(): WritableStream<I>;
1668
2050
  }
1669
2051
  export declare class FixedLengthStream extends IdentityTransformStream {
1670
2052
  constructor(
1671
2053
  expectedLength: number | bigint,
1672
- queuingStrategy?: IdentityTransformStreamQueuingStrategy
2054
+ queuingStrategy?: IdentityTransformStreamQueuingStrategy,
1673
2055
  );
1674
2056
  }
1675
2057
  export declare class IdentityTransformStream extends TransformStream<
@@ -1715,12 +2097,16 @@ export declare class ByteLengthQueuingStrategy
1715
2097
  implements QueuingStrategy<ArrayBufferView>
1716
2098
  {
1717
2099
  constructor(init: QueuingStrategyInit);
2100
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
1718
2101
  get highWaterMark(): number;
2102
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
1719
2103
  get size(): (chunk?: any) => number;
1720
2104
  }
1721
2105
  export declare class CountQueuingStrategy implements QueuingStrategy {
1722
2106
  constructor(init: QueuingStrategyInit);
2107
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
1723
2108
  get highWaterMark(): number;
2109
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
1724
2110
  get size(): (chunk?: any) => number;
1725
2111
  }
1726
2112
  export interface QueuingStrategyInit {
@@ -1744,6 +2130,7 @@ export interface TraceItem {
1744
2130
  readonly event:
1745
2131
  | (
1746
2132
  | TraceItemFetchEventInfo
2133
+ | TraceItemJsRpcEventInfo
1747
2134
  | TraceItemScheduledEventInfo
1748
2135
  | TraceItemAlarmEventInfo
1749
2136
  | TraceItemQueueEventInfo
@@ -1758,6 +2145,7 @@ export interface TraceItem {
1758
2145
  readonly exceptions: TraceException[];
1759
2146
  readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
1760
2147
  readonly scriptName: string | null;
2148
+ readonly entrypoint?: string;
1761
2149
  readonly scriptVersion?: ScriptVersion;
1762
2150
  readonly dispatchNamespace?: string;
1763
2151
  readonly scriptTags?: string[];
@@ -1800,6 +2188,9 @@ export interface TraceItemFetchEventInfoRequest {
1800
2188
  export interface TraceItemFetchEventInfoResponse {
1801
2189
  readonly status: number;
1802
2190
  }
2191
+ export interface TraceItemJsRpcEventInfo {
2192
+ readonly rpcMethod: string;
2193
+ }
1803
2194
  export interface TraceItemHibernatableWebSocketEventInfo {
1804
2195
  readonly getWebSocketEvent:
1805
2196
  | TraceItemHibernatableWebSocketEventInfoMessage
@@ -1826,6 +2217,7 @@ export interface TraceException {
1826
2217
  readonly timestamp: number;
1827
2218
  readonly message: string;
1828
2219
  readonly name: string;
2220
+ readonly stack?: string;
1829
2221
  }
1830
2222
  export interface TraceDiagnosticChannelEvent {
1831
2223
  readonly timestamp: number;
@@ -1841,29 +2233,52 @@ export interface UnsafeTraceMetrics {
1841
2233
  }
1842
2234
  export declare class URL {
1843
2235
  constructor(url: string | URL, base?: string | URL);
2236
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
1844
2237
  get href(): string;
2238
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
1845
2239
  set href(value: string);
2240
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
1846
2241
  get origin(): string;
2242
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
1847
2243
  get protocol(): string;
2244
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
1848
2245
  set protocol(value: string);
2246
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
1849
2247
  get username(): string;
2248
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
1850
2249
  set username(value: string);
2250
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
1851
2251
  get password(): string;
2252
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
1852
2253
  set password(value: string);
2254
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
1853
2255
  get host(): string;
2256
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
1854
2257
  set host(value: string);
2258
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
1855
2259
  get hostname(): string;
2260
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
1856
2261
  set hostname(value: string);
2262
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
1857
2263
  get port(): string;
2264
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
1858
2265
  set port(value: string);
2266
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
1859
2267
  get pathname(): string;
2268
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
1860
2269
  set pathname(value: string);
2270
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
1861
2271
  get search(): string;
2272
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
1862
2273
  set search(value: string);
2274
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
1863
2275
  get searchParams(): URLSearchParams;
2276
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
1864
2277
  get hash(): string;
2278
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
1865
2279
  set hash(value: string);
1866
2280
  toString(): string;
2281
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
1867
2282
  toJSON(): string;
1868
2283
  }
1869
2284
  export declare class URLSearchParams {
@@ -1872,7 +2287,7 @@ export declare class URLSearchParams {
1872
2287
  | URLSearchParams
1873
2288
  | string
1874
2289
  | Record<string, string>
1875
- | [key: string, value: string][]
2290
+ | [key: string, value: string][],
1876
2291
  );
1877
2292
  get size(): number;
1878
2293
  append(name: string, value: string): void;
@@ -1882,17 +2297,20 @@ export declare class URLSearchParams {
1882
2297
  has(name: string): boolean;
1883
2298
  set(name: string, value: string): void;
1884
2299
  sort(): void;
2300
+ /** Returns an array of key, value pairs for every entry in the search params. */
1885
2301
  entries(): IterableIterator<[key: string, value: string]>;
2302
+ /** Returns a list of keys in the search params. */
1886
2303
  keys(): IterableIterator<string>;
2304
+ /** Returns a list of values in the search params. */
1887
2305
  values(): IterableIterator<string>;
1888
2306
  forEach<This = unknown>(
1889
2307
  callback: (
1890
2308
  this: This,
1891
2309
  value: string,
1892
2310
  key: string,
1893
- parent: URLSearchParams
2311
+ parent: URLSearchParams,
1894
2312
  ) => void,
1895
- thisArg?: This
2313
+ thisArg?: This,
1896
2314
  ): void;
1897
2315
  toString(): string;
1898
2316
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
@@ -1901,7 +2319,7 @@ export declare class URLPattern {
1901
2319
  constructor(
1902
2320
  input?: string | URLPatternURLPatternInit,
1903
2321
  baseURL?: string,
1904
- patternOptions?: URLPatternURLPatternOptions
2322
+ patternOptions?: URLPatternURLPatternOptions,
1905
2323
  );
1906
2324
  get protocol(): string;
1907
2325
  get username(): string;
@@ -1914,7 +2332,7 @@ export declare class URLPattern {
1914
2332
  test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean;
1915
2333
  exec(
1916
2334
  input?: string | URLPatternURLPatternInit,
1917
- baseURL?: string
2335
+ baseURL?: string,
1918
2336
  ): URLPatternURLPatternResult | null;
1919
2337
  }
1920
2338
  export interface URLPatternURLPatternInit {
@@ -1948,11 +2366,23 @@ export interface URLPatternURLPatternOptions {
1948
2366
  }
1949
2367
  export declare class CloseEvent extends Event {
1950
2368
  constructor(type: string, initializer?: CloseEventInit);
1951
- /** Returns the WebSocket connection close code provided by the server. */
2369
+ /**
2370
+ * Returns the WebSocket connection close code provided by the server.
2371
+ *
2372
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
2373
+ */
1952
2374
  readonly code: number;
1953
- /** Returns the WebSocket connection close reason provided by the server. */
2375
+ /**
2376
+ * Returns the WebSocket connection close reason provided by the server.
2377
+ *
2378
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
2379
+ */
1954
2380
  readonly reason: string;
1955
- /** Returns true if the connection closed cleanly; false otherwise. */
2381
+ /**
2382
+ * Returns true if the connection closed cleanly; false otherwise.
2383
+ *
2384
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
2385
+ */
1956
2386
  readonly wasClean: boolean;
1957
2387
  }
1958
2388
  export interface CloseEventInit {
@@ -1967,12 +2397,21 @@ export declare class MessageEvent extends Event {
1967
2397
  export interface MessageEventInit {
1968
2398
  data: ArrayBuffer | string;
1969
2399
  }
1970
- /** Events providing information related to errors in scripts or in files. */
2400
+ /**
2401
+ * Events providing information related to errors in scripts or in files.
2402
+ *
2403
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
2404
+ */
1971
2405
  export interface ErrorEvent extends Event {
2406
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1972
2407
  readonly filename: string;
2408
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1973
2409
  readonly message: string;
2410
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1974
2411
  readonly lineno: number;
2412
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1975
2413
  readonly colno: number;
2414
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1976
2415
  readonly error: any;
1977
2416
  }
1978
2417
  export type WebSocketEventMap = {
@@ -1984,7 +2423,17 @@ export type WebSocketEventMap = {
1984
2423
  export declare class WebSocket extends EventTarget<WebSocketEventMap> {
1985
2424
  constructor(url: string, protocols?: string[] | string);
1986
2425
  accept(): void;
2426
+ /**
2427
+ * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
2428
+ *
2429
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
2430
+ */
1987
2431
  send(message: (ArrayBuffer | ArrayBufferView) | string): void;
2432
+ /**
2433
+ * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
2434
+ *
2435
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
2436
+ */
1988
2437
  close(code?: number, reason?: string): void;
1989
2438
  serializeAttachment(attachment: any): void;
1990
2439
  deserializeAttachment(): any | null;
@@ -1996,9 +2445,29 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
1996
2445
  static readonly CLOSING: number;
1997
2446
  static readonly READY_STATE_CLOSED: number;
1998
2447
  static readonly CLOSED: number;
2448
+ /**
2449
+ * Returns the state of the WebSocket object's connection. It can have the values described below.
2450
+ *
2451
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2452
+ */
1999
2453
  get readyState(): number;
2454
+ /**
2455
+ * Returns the URL that was used to establish the WebSocket connection.
2456
+ *
2457
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2458
+ */
2000
2459
  get url(): string | null;
2460
+ /**
2461
+ * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
2462
+ *
2463
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2464
+ */
2001
2465
  get protocol(): string | null;
2466
+ /**
2467
+ * Returns the extensions selected by the server, if any.
2468
+ *
2469
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2470
+ */
2002
2471
  get extensions(): string | null;
2003
2472
  }
2004
2473
  export declare const WebSocketPair: {
@@ -2032,7 +2501,7 @@ export interface SocketInfo {
2032
2501
  }
2033
2502
  export interface gpuGPU {
2034
2503
  requestAdapter(
2035
- param1?: gpuGPURequestAdapterOptions
2504
+ param1?: gpuGPURequestAdapterOptions,
2036
2505
  ): Promise<gpuGPUAdapter | null>;
2037
2506
  }
2038
2507
  export declare abstract class gpuGPUAdapter {
@@ -2044,24 +2513,24 @@ export declare abstract class gpuGPUAdapter {
2044
2513
  export interface gpuGPUDevice extends EventTarget {
2045
2514
  createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
2046
2515
  createBindGroupLayout(
2047
- descriptor: gpuGPUBindGroupLayoutDescriptor
2516
+ descriptor: gpuGPUBindGroupLayoutDescriptor,
2048
2517
  ): gpuGPUBindGroupLayout;
2049
2518
  createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
2050
2519
  createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
2051
2520
  createShaderModule(
2052
- descriptor: gpuGPUShaderModuleDescriptor
2521
+ descriptor: gpuGPUShaderModuleDescriptor,
2053
2522
  ): gpuGPUShaderModule;
2054
2523
  createPipelineLayout(
2055
- descriptor: gpuGPUPipelineLayoutDescriptor
2524
+ descriptor: gpuGPUPipelineLayoutDescriptor,
2056
2525
  ): gpuGPUPipelineLayout;
2057
2526
  createComputePipeline(
2058
- descriptor: gpuGPUComputePipelineDescriptor
2527
+ descriptor: gpuGPUComputePipelineDescriptor,
2059
2528
  ): gpuGPUComputePipeline;
2060
2529
  createRenderPipeline(
2061
- descriptor: gpuGPURenderPipelineDescriptor
2530
+ descriptor: gpuGPURenderPipelineDescriptor,
2062
2531
  ): gpuGPURenderPipeline;
2063
2532
  createCommandEncoder(
2064
- descriptor?: gpuGPUCommandEncoderDescriptor
2533
+ descriptor?: gpuGPUCommandEncoderDescriptor,
2065
2534
  ): gpuGPUCommandEncoder;
2066
2535
  createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
2067
2536
  destroy(): void;
@@ -2107,7 +2576,7 @@ export interface gpuGPUBuffer {
2107
2576
  mapAsync(
2108
2577
  offset: number,
2109
2578
  size?: number | bigint,
2110
- param3?: number | bigint
2579
+ param3?: number | bigint,
2111
2580
  ): Promise<void>;
2112
2581
  get size(): number | bigint;
2113
2582
  get usage(): number;
@@ -2206,38 +2675,38 @@ export interface gpuGPUProgrammableStage {
2206
2675
  export interface gpuGPUCommandEncoder {
2207
2676
  get label(): string;
2208
2677
  beginComputePass(
2209
- descriptor?: gpuGPUComputePassDescriptor
2678
+ descriptor?: gpuGPUComputePassDescriptor,
2210
2679
  ): gpuGPUComputePassEncoder;
2211
2680
  beginRenderPass(
2212
- descriptor: gpuGPURenderPassDescriptor
2681
+ descriptor: gpuGPURenderPassDescriptor,
2213
2682
  ): gpuGPURenderPassEncoder;
2214
2683
  copyBufferToBuffer(
2215
2684
  source: gpuGPUBuffer,
2216
2685
  sourceOffset: number | bigint,
2217
2686
  destination: gpuGPUBuffer,
2218
2687
  destinationOffset: number | bigint,
2219
- size: number | bigint
2688
+ size: number | bigint,
2220
2689
  ): void;
2221
2690
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2222
2691
  copyTextureToBuffer(
2223
2692
  source: gpuGPUImageCopyTexture,
2224
2693
  destination: gpuGPUImageCopyBuffer,
2225
- copySize: Iterable<number> | gpuGPUExtent3DDict
2694
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2226
2695
  ): void;
2227
2696
  copyBufferToTexture(
2228
2697
  source: gpuGPUImageCopyBuffer,
2229
2698
  destination: gpuGPUImageCopyTexture,
2230
- copySize: Iterable<number> | gpuGPUExtent3DDict
2699
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2231
2700
  ): void;
2232
2701
  copyTextureToTexture(
2233
2702
  source: gpuGPUImageCopyTexture,
2234
2703
  destination: gpuGPUImageCopyTexture,
2235
- copySize: Iterable<number> | gpuGPUExtent3DDict
2704
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2236
2705
  ): void;
2237
2706
  clearBuffer(
2238
2707
  buffer: gpuGPUBuffer,
2239
2708
  offset?: number | bigint,
2240
- size?: number | bigint
2709
+ size?: number | bigint,
2241
2710
  ): void;
2242
2711
  }
2243
2712
  export interface gpuGPUCommandEncoderDescriptor {
@@ -2248,12 +2717,12 @@ export interface gpuGPUComputePassEncoder {
2248
2717
  setBindGroup(
2249
2718
  index: number,
2250
2719
  bindGroup: gpuGPUBindGroup | null,
2251
- dynamicOffsets?: Iterable<number>
2720
+ dynamicOffsets?: Iterable<number>,
2252
2721
  ): void;
2253
2722
  dispatchWorkgroups(
2254
2723
  workgroupCountX: number,
2255
2724
  workgroupCountY?: number,
2256
- workgroupCountZ?: number
2725
+ workgroupCountZ?: number,
2257
2726
  ): void;
2258
2727
  end(): void;
2259
2728
  }
@@ -2281,7 +2750,7 @@ export interface gpuGPUQueue {
2281
2750
  bufferOffset: number | bigint,
2282
2751
  data: ArrayBuffer | ArrayBufferView,
2283
2752
  dataOffset?: number | bigint,
2284
- size?: number | bigint
2753
+ size?: number | bigint,
2285
2754
  ): void;
2286
2755
  }
2287
2756
  export declare abstract class gpuGPUMapMode {
@@ -2489,7 +2958,7 @@ export interface gpuGPURenderPassEncoder {
2489
2958
  vertexCount: number,
2490
2959
  instanceCount?: number,
2491
2960
  firstVertex?: number,
2492
- firstInstance?: number
2961
+ firstInstance?: number,
2493
2962
  ): void;
2494
2963
  end(): void;
2495
2964
  }
@@ -2987,7 +3456,7 @@ export interface IncomingRequestCfPropertiesBotManagementEnterprise
2987
3456
  };
2988
3457
  }
2989
3458
  export interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
2990
- HostMetadata
3459
+ HostMetadata,
2991
3460
  > {
2992
3461
  /**
2993
3462
  * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
@@ -3557,6 +4026,13 @@ export declare abstract class D1PreparedStatement {
3557
4026
  }): Promise<[string[], ...T[]]>;
3558
4027
  raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
3559
4028
  }
4029
+ // `Disposable` was added to TypeScript's standard lib types in version 5.2.
4030
+ // To support older TypeScript versions, define an empty `Disposable` interface.
4031
+ // Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
4032
+ // but this will ensure type checking on older versions still passes.
4033
+ // TypeScript's interface merging will ensure our empty interface is effectively
4034
+ // ignored when `Disposable` is included in the standard lib.
4035
+ export interface Disposable {}
3560
4036
  /**
3561
4037
  * An email message that can be sent from a Worker.
3562
4038
  */
@@ -3612,7 +4088,7 @@ export declare abstract class EmailEvent extends ExtendableEvent {
3612
4088
  export type EmailExportedHandler<Env = unknown> = (
3613
4089
  message: ForwardableEmailMessage,
3614
4090
  env: Env,
3615
- ctx: ExecutionContext
4091
+ ctx: ExecutionContext,
3616
4092
  ) => void | Promise<void>;
3617
4093
  export interface Hyperdrive {
3618
4094
  /**
@@ -3679,7 +4155,7 @@ export type EventContext<Env, P extends string, Data> = {
3679
4155
  export type PagesFunction<
3680
4156
  Env = unknown,
3681
4157
  Params extends string = any,
3682
- Data extends Record<string, unknown> = Record<string, unknown>
4158
+ Data extends Record<string, unknown> = Record<string, unknown>,
3683
4159
  > = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
3684
4160
  export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
3685
4161
  request: Request<unknown, IncomingRequestCfProperties<unknown>>;
@@ -3700,9 +4176,9 @@ export type PagesPluginFunction<
3700
4176
  Env = unknown,
3701
4177
  Params extends string = any,
3702
4178
  Data extends Record<string, unknown> = Record<string, unknown>,
3703
- PluginArgs = unknown
4179
+ PluginArgs = unknown,
3704
4180
  > = (
3705
- context: EventPluginContext<Env, Params, Data, PluginArgs>
4181
+ context: EventPluginContext<Env, Params, Data, PluginArgs>,
3706
4182
  ) => Response | Promise<Response>;
3707
4183
  // PubSubMessage represents an incoming PubSub message.
3708
4184
  // The message includes metadata about the broker, the client, and the payload
@@ -3738,6 +4214,155 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
3738
4214
  // Key Identifier of the JWK
3739
4215
  readonly kid: string;
3740
4216
  }
4217
+ // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
4218
+ // to referenced by `Fetcher`. This is included in the "importable" version of the types which
4219
+ // strips all `module` blocks.
4220
+ export declare namespace Rpc {
4221
+ // Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
4222
+ // TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
4223
+ // For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
4224
+ // accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
4225
+ export const __RPC_STUB_BRAND: unique symbol;
4226
+ export const __RPC_TARGET_BRAND: unique symbol;
4227
+ export const __WORKER_ENTRYPOINT_BRAND: unique symbol;
4228
+ export const __DURABLE_OBJECT_BRAND: unique symbol;
4229
+ export interface RpcTargetBranded {
4230
+ [__RPC_TARGET_BRAND]: never;
4231
+ }
4232
+ export interface WorkerEntrypointBranded {
4233
+ [__WORKER_ENTRYPOINT_BRAND]: never;
4234
+ }
4235
+ export interface DurableObjectBranded {
4236
+ [__DURABLE_OBJECT_BRAND]: never;
4237
+ }
4238
+ export type EntrypointBranded =
4239
+ | WorkerEntrypointBranded
4240
+ | DurableObjectBranded;
4241
+ // Types that can be used through `Stub`s
4242
+ export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
4243
+ // Types that can be passed over RPC
4244
+ type Serializable =
4245
+ // Structured cloneables
4246
+ | void
4247
+ | undefined
4248
+ | null
4249
+ | boolean
4250
+ | number
4251
+ | bigint
4252
+ | string
4253
+ | TypedArray
4254
+ | ArrayBuffer
4255
+ | DataView
4256
+ | Date
4257
+ | Error
4258
+ | RegExp
4259
+ // Structured cloneable composites
4260
+ | Map<Serializable, Serializable>
4261
+ | Set<Serializable>
4262
+ | ReadonlyArray<Serializable>
4263
+ | {
4264
+ [key: string | number]: Serializable;
4265
+ }
4266
+ // Special types
4267
+ | ReadableStream<Uint8Array>
4268
+ | WritableStream<Uint8Array>
4269
+ | Request
4270
+ | Response
4271
+ | Headers
4272
+ | Stub<Stubable>
4273
+ // Serialized as stubs, see `Stubify`
4274
+ | Stubable;
4275
+ // Base type for all RPC stubs, including common memory management methods.
4276
+ // `T` is used as a marker type for unwrapping `Stub`s later.
4277
+ interface StubBase<T extends Stubable> extends Disposable {
4278
+ [__RPC_STUB_BRAND]: T;
4279
+ dup(): this;
4280
+ }
4281
+ export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
4282
+ // Recursively rewrite all `Stubable` types with `Stub`s
4283
+ type Stubify<T> = T extends Stubable
4284
+ ? Stub<T>
4285
+ : T extends Map<infer K, infer V>
4286
+ ? Map<Stubify<K>, Stubify<V>>
4287
+ : T extends Set<infer V>
4288
+ ? Set<Stubify<V>>
4289
+ : T extends Array<infer V>
4290
+ ? Array<Stubify<V>>
4291
+ : T extends ReadonlyArray<infer V>
4292
+ ? ReadonlyArray<Stubify<V>>
4293
+ : T extends {
4294
+ [key: string | number]: unknown;
4295
+ }
4296
+ ? {
4297
+ [K in keyof T]: Stubify<T[K]>;
4298
+ }
4299
+ : T;
4300
+ // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
4301
+ // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
4302
+ // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
4303
+ type Unstubify<T> =
4304
+ T extends StubBase<infer V>
4305
+ ? V
4306
+ : T extends Map<infer K, infer V>
4307
+ ? Map<Unstubify<K>, Unstubify<V>>
4308
+ : T extends Set<infer V>
4309
+ ? Set<Unstubify<V>>
4310
+ : T extends Array<infer V>
4311
+ ? Array<Unstubify<V>>
4312
+ : T extends ReadonlyArray<infer V>
4313
+ ? ReadonlyArray<Unstubify<V>>
4314
+ : T extends {
4315
+ [key: string | number]: unknown;
4316
+ }
4317
+ ? {
4318
+ [K in keyof T]: Unstubify<T[K]>;
4319
+ }
4320
+ : T;
4321
+ type UnstubifyAll<A extends any[]> = {
4322
+ [I in keyof A]: Unstubify<A[I]>;
4323
+ };
4324
+ // Utility type for adding `Provider`/`Disposable`s to `object` types only.
4325
+ // Note `unknown & T` is equivalent to `T`.
4326
+ type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
4327
+ type MaybeDisposable<T> = T extends object ? Disposable : unknown;
4328
+ // Type for method return or property on an RPC interface.
4329
+ // - Stubable types are replaced by stubs.
4330
+ // - Serializable types are passed by value, with stubable types replaced by stubs
4331
+ // and a top-level `Disposer`.
4332
+ // Everything else can't be passed over PRC.
4333
+ // Technically, we use custom thenables here, but they quack like `Promise`s.
4334
+ // Intersecting with `(Maybe)Provider` allows pipelining.
4335
+ type Result<R> = R extends Stubable
4336
+ ? Promise<Stub<R>> & Provider<R>
4337
+ : R extends Serializable
4338
+ ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
4339
+ : never;
4340
+ // Type for method or property on an RPC interface.
4341
+ // For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
4342
+ // Unwrapping `Stub`s allows calling with `Stubable` arguments.
4343
+ // For properties, rewrite types to be `Result`s.
4344
+ // In each case, unwrap `Promise`s.
4345
+ type MethodOrProperty<V> = V extends (...args: infer P) => infer R
4346
+ ? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
4347
+ : Result<Awaited<V>>;
4348
+ // Type for the callable part of an `Provider` if `T` is callable.
4349
+ // This is intersected with methods/properties.
4350
+ type MaybeCallableProvider<T> = T extends (...args: any[]) => any
4351
+ ? MethodOrProperty<T>
4352
+ : unknown;
4353
+ // Base type for all other types providing RPC-like interfaces.
4354
+ // Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
4355
+ // `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
4356
+ export type Provider<
4357
+ T extends object,
4358
+ Reserved extends string = never,
4359
+ > = MaybeCallableProvider<T> & {
4360
+ [K in Exclude<
4361
+ keyof T,
4362
+ Reserved | symbol | keyof StubBase<never>
4363
+ >]: MethodOrProperty<T[K]>;
4364
+ };
4365
+ }
3741
4366
  // Copyright (c) 2022-2023 Cloudflare, Inc.
3742
4367
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
3743
4368
  // https://opensource.org/licenses/Apache-2.0
@@ -3866,7 +4491,7 @@ export declare abstract class VectorizeIndex {
3866
4491
  */
3867
4492
  public query(
3868
4493
  vector: VectorFloatArray | number[],
3869
- options: VectorizeQueryOptions
4494
+ options: VectorizeQueryOptions,
3870
4495
  ): Promise<VectorizeMatches>;
3871
4496
  /**
3872
4497
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -3893,6 +4518,16 @@ export declare abstract class VectorizeIndex {
3893
4518
  */
3894
4519
  public getByIds(ids: string[]): Promise<VectorizeVector[]>;
3895
4520
  }
4521
+ /**
4522
+ * The interface for "version_metadata" binding
4523
+ * providing metadata about the Worker Version using this binding.
4524
+ */
4525
+ export type WorkerVersionMetadata = {
4526
+ /** The ID of the Worker Version using this binding */
4527
+ id: string;
4528
+ /** The tag of the Worker Version using this binding */
4529
+ tag: string;
4530
+ };
3896
4531
  export interface DynamicDispatchLimits {
3897
4532
  /**
3898
4533
  * Limit CPU time in milliseconds.
@@ -3928,6 +4563,6 @@ export interface DispatchNamespace {
3928
4563
  args?: {
3929
4564
  [key: string]: any;
3930
4565
  },
3931
- options?: DynamicDispatchOptions
4566
+ options?: DynamicDispatchOptions,
3932
4567
  ): Fetcher;
3933
4568
  }