@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
  }
@@ -1308,7 +1631,7 @@ export declare abstract class R2Bucket {
1308
1631
  key: string,
1309
1632
  options: R2GetOptions & {
1310
1633
  onlyIf: R2Conditional | Headers;
1311
- }
1634
+ },
1312
1635
  ): Promise<R2ObjectBody | R2Object | null>;
1313
1636
  get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
1314
1637
  put(
@@ -1322,7 +1645,7 @@ export declare abstract class R2Bucket {
1322
1645
  | Blob,
1323
1646
  options?: R2PutOptions & {
1324
1647
  onlyIf: R2Conditional | Headers;
1325
- }
1648
+ },
1326
1649
  ): Promise<R2Object | null>;
1327
1650
  put(
1328
1651
  key: string,
@@ -1333,11 +1656,11 @@ export declare abstract class R2Bucket {
1333
1656
  | string
1334
1657
  | null
1335
1658
  | Blob,
1336
- options?: R2PutOptions
1659
+ options?: R2PutOptions,
1337
1660
  ): Promise<R2Object>;
1338
1661
  createMultipartUpload(
1339
1662
  key: string,
1340
- options?: R2MultipartOptions
1663
+ options?: R2MultipartOptions,
1341
1664
  ): Promise<R2MultipartUpload>;
1342
1665
  resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
1343
1666
  delete(keys: string | string[]): Promise<void>;
@@ -1348,7 +1671,7 @@ export interface R2MultipartUpload {
1348
1671
  readonly uploadId: string;
1349
1672
  uploadPart(
1350
1673
  partNumber: number,
1351
- value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob
1674
+ value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
1352
1675
  ): Promise<R2UploadedPart>;
1353
1676
  abort(): Promise<void>;
1354
1677
  complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
@@ -1469,7 +1792,7 @@ export interface UnderlyingSink<W = any> {
1469
1792
  start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
1470
1793
  write?: (
1471
1794
  chunk: W,
1472
- controller: WritableStreamDefaultController
1795
+ controller: WritableStreamDefaultController,
1473
1796
  ) => void | Promise<void>;
1474
1797
  abort?: (reason: any) => void | Promise<void>;
1475
1798
  close?: () => void | Promise<void>;
@@ -1484,10 +1807,10 @@ export interface UnderlyingByteSource {
1484
1807
  export interface UnderlyingSource<R = any> {
1485
1808
  type?: "" | undefined;
1486
1809
  start?: (
1487
- controller: ReadableStreamDefaultController<R>
1810
+ controller: ReadableStreamDefaultController<R>,
1488
1811
  ) => void | Promise<void>;
1489
1812
  pull?: (
1490
- controller: ReadableStreamDefaultController<R>
1813
+ controller: ReadableStreamDefaultController<R>,
1491
1814
  ) => void | Promise<void>;
1492
1815
  cancel?: (reason: any) => void | Promise<void>;
1493
1816
  expectedLength?: number | bigint;
@@ -1496,14 +1819,14 @@ export interface Transformer<I = any, O = any> {
1496
1819
  readableType?: string;
1497
1820
  writableType?: string;
1498
1821
  start?: (
1499
- controller: TransformStreamDefaultController<O>
1822
+ controller: TransformStreamDefaultController<O>,
1500
1823
  ) => void | Promise<void>;
1501
1824
  transform?: (
1502
1825
  chunk: I,
1503
- controller: TransformStreamDefaultController<O>
1826
+ controller: TransformStreamDefaultController<O>,
1504
1827
  ) => void | Promise<void>;
1505
1828
  flush?: (
1506
- controller: TransformStreamDefaultController<O>
1829
+ controller: TransformStreamDefaultController<O>,
1507
1830
  ) => void | Promise<void>;
1508
1831
  cancel?: (reason: any) => void | Promise<void>;
1509
1832
  expectedLength?: number;
@@ -1540,91 +1863,137 @@ export type ReadableStreamReadResult<R = any> =
1540
1863
  done: true;
1541
1864
  value?: undefined;
1542
1865
  };
1543
- /** 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. */
1866
+ /**
1867
+ * 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.
1868
+ *
1869
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1870
+ */
1544
1871
  export interface ReadableStream<R = any> {
1872
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
1545
1873
  get locked(): boolean;
1874
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
1546
1875
  cancel(reason?: any): Promise<void>;
1876
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1547
1877
  getReader(): ReadableStreamDefaultReader<R>;
1878
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1548
1879
  getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1880
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
1549
1881
  pipeThrough<T>(
1550
1882
  transform: ReadableWritablePair<T, R>,
1551
- options?: StreamPipeOptions
1883
+ options?: StreamPipeOptions,
1552
1884
  ): ReadableStream<T>;
1885
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
1553
1886
  pipeTo(
1554
1887
  destination: WritableStream<R>,
1555
- options?: StreamPipeOptions
1888
+ options?: StreamPipeOptions,
1556
1889
  ): Promise<void>;
1890
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
1557
1891
  tee(): [ReadableStream<R>, ReadableStream<R>];
1558
1892
  values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1559
1893
  [Symbol.asyncIterator](
1560
- options?: ReadableStreamValuesOptions
1894
+ options?: ReadableStreamValuesOptions,
1561
1895
  ): AsyncIterableIterator<R>;
1562
1896
  }
1563
1897
  export declare const ReadableStream: {
1564
1898
  prototype: ReadableStream;
1565
1899
  new (
1566
1900
  underlyingSource: UnderlyingByteSource,
1567
- strategy?: QueuingStrategy<Uint8Array>
1901
+ strategy?: QueuingStrategy<Uint8Array>,
1568
1902
  ): ReadableStream<Uint8Array>;
1569
1903
  new <R = any>(
1570
1904
  underlyingSource?: UnderlyingSource<R>,
1571
- strategy?: QueuingStrategy<R>
1905
+ strategy?: QueuingStrategy<R>,
1572
1906
  ): ReadableStream<R>;
1573
1907
  };
1574
1908
  export declare class ReadableStreamDefaultReader<R = any> {
1575
1909
  constructor(stream: ReadableStream);
1576
1910
  get closed(): Promise<void>;
1577
1911
  cancel(reason?: any): Promise<void>;
1912
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
1578
1913
  read(): Promise<ReadableStreamReadResult<R>>;
1914
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
1579
1915
  releaseLock(): void;
1580
1916
  }
1581
1917
  export declare class ReadableStreamBYOBReader {
1582
1918
  constructor(stream: ReadableStream);
1583
1919
  get closed(): Promise<void>;
1584
1920
  cancel(reason?: any): Promise<void>;
1921
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
1585
1922
  read<T extends ArrayBufferView>(
1586
- view: T
1923
+ view: T,
1587
1924
  ): Promise<ReadableStreamReadResult<T>>;
1925
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
1588
1926
  releaseLock(): void;
1589
1927
  readAtLeast<T extends ArrayBufferView>(
1590
1928
  minElements: number,
1591
- view: T
1929
+ view: T,
1592
1930
  ): Promise<ReadableStreamReadResult<T>>;
1593
1931
  }
1594
1932
  export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
1595
1933
  min?: number;
1596
1934
  }
1597
1935
  export interface ReadableStreamGetReaderOptions {
1936
+ /**
1937
+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
1938
+ *
1939
+ * 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.
1940
+ */
1598
1941
  mode: "byob";
1599
1942
  }
1943
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
1600
1944
  export interface ReadableStreamBYOBRequest {
1945
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
1601
1946
  readonly view: Uint8Array | null;
1947
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
1602
1948
  respond(bytesWritten: number): void;
1949
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
1603
1950
  respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
1604
1951
  readonly atLeast: number | null;
1605
1952
  }
1953
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
1606
1954
  export interface ReadableStreamDefaultController<R = any> {
1955
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
1607
1956
  readonly desiredSize: number | null;
1957
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
1608
1958
  close(): void;
1959
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
1609
1960
  enqueue(chunk?: R): void;
1961
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
1610
1962
  error(reason: any): void;
1611
1963
  }
1964
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
1612
1965
  export interface ReadableByteStreamController {
1966
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
1613
1967
  readonly byobRequest: ReadableStreamBYOBRequest | null;
1968
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
1614
1969
  readonly desiredSize: number | null;
1970
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
1615
1971
  close(): void;
1972
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
1616
1973
  enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
1974
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
1617
1975
  error(reason: any): void;
1618
1976
  }
1619
- /** 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. */
1977
+ /**
1978
+ * 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.
1979
+ *
1980
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
1981
+ */
1620
1982
  export interface WritableStreamDefaultController {
1983
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
1621
1984
  readonly signal: AbortSignal;
1985
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
1622
1986
  error(reason?: any): void;
1623
1987
  }
1988
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
1624
1989
  export interface TransformStreamDefaultController<O = any> {
1990
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
1625
1991
  get desiredSize(): number | null;
1992
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
1626
1993
  enqueue(chunk?: O): void;
1994
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
1627
1995
  error(reason: any): void;
1996
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
1628
1997
  terminate(): void;
1629
1998
  }
1630
1999
  export interface ReadableWritablePair<R = any, W = any> {
@@ -1639,36 +2008,49 @@ export interface ReadableWritablePair<R = any, W = any> {
1639
2008
  export declare class WritableStream<W = any> {
1640
2009
  constructor(
1641
2010
  underlyingSink?: UnderlyingSink,
1642
- queuingStrategy?: QueuingStrategy
2011
+ queuingStrategy?: QueuingStrategy,
1643
2012
  );
2013
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
1644
2014
  get locked(): boolean;
2015
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
1645
2016
  abort(reason?: any): Promise<void>;
2017
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
1646
2018
  close(): Promise<void>;
2019
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
1647
2020
  getWriter(): WritableStreamDefaultWriter<W>;
1648
2021
  }
1649
2022
  export declare class WritableStreamDefaultWriter<W = any> {
1650
2023
  constructor(stream: WritableStream);
2024
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
1651
2025
  get closed(): Promise<void>;
2026
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
1652
2027
  get ready(): Promise<void>;
2028
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
1653
2029
  get desiredSize(): number | null;
2030
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
1654
2031
  abort(reason?: any): Promise<void>;
2032
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
1655
2033
  close(): Promise<void>;
2034
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
1656
2035
  write(chunk?: W): Promise<void>;
2036
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
1657
2037
  releaseLock(): void;
1658
2038
  }
1659
2039
  export declare class TransformStream<I = any, O = any> {
1660
2040
  constructor(
1661
2041
  transformer?: Transformer<I, O>,
1662
2042
  writableStrategy?: QueuingStrategy<I>,
1663
- readableStrategy?: QueuingStrategy<O>
2043
+ readableStrategy?: QueuingStrategy<O>,
1664
2044
  );
2045
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
1665
2046
  get readable(): ReadableStream<O>;
2047
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
1666
2048
  get writable(): WritableStream<I>;
1667
2049
  }
1668
2050
  export declare class FixedLengthStream extends IdentityTransformStream {
1669
2051
  constructor(
1670
2052
  expectedLength: number | bigint,
1671
- queuingStrategy?: IdentityTransformStreamQueuingStrategy
2053
+ queuingStrategy?: IdentityTransformStreamQueuingStrategy,
1672
2054
  );
1673
2055
  }
1674
2056
  export declare class IdentityTransformStream extends TransformStream<
@@ -1714,12 +2096,16 @@ export declare class ByteLengthQueuingStrategy
1714
2096
  implements QueuingStrategy<ArrayBufferView>
1715
2097
  {
1716
2098
  constructor(init: QueuingStrategyInit);
2099
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
1717
2100
  get highWaterMark(): number;
2101
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
1718
2102
  get size(): (chunk?: any) => number;
1719
2103
  }
1720
2104
  export declare class CountQueuingStrategy implements QueuingStrategy {
1721
2105
  constructor(init: QueuingStrategyInit);
2106
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
1722
2107
  get highWaterMark(): number;
2108
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
1723
2109
  get size(): (chunk?: any) => number;
1724
2110
  }
1725
2111
  export interface QueuingStrategyInit {
@@ -1743,6 +2129,7 @@ export interface TraceItem {
1743
2129
  readonly event:
1744
2130
  | (
1745
2131
  | TraceItemFetchEventInfo
2132
+ | TraceItemJsRpcEventInfo
1746
2133
  | TraceItemScheduledEventInfo
1747
2134
  | TraceItemAlarmEventInfo
1748
2135
  | TraceItemQueueEventInfo
@@ -1757,6 +2144,7 @@ export interface TraceItem {
1757
2144
  readonly exceptions: TraceException[];
1758
2145
  readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
1759
2146
  readonly scriptName: string | null;
2147
+ readonly entrypoint?: string;
1760
2148
  readonly scriptVersion?: ScriptVersion;
1761
2149
  readonly dispatchNamespace?: string;
1762
2150
  readonly scriptTags?: string[];
@@ -1799,6 +2187,9 @@ export interface TraceItemFetchEventInfoRequest {
1799
2187
  export interface TraceItemFetchEventInfoResponse {
1800
2188
  readonly status: number;
1801
2189
  }
2190
+ export interface TraceItemJsRpcEventInfo {
2191
+ readonly rpcMethod: string;
2192
+ }
1802
2193
  export interface TraceItemHibernatableWebSocketEventInfo {
1803
2194
  readonly getWebSocketEvent:
1804
2195
  | TraceItemHibernatableWebSocketEventInfoMessage
@@ -1825,6 +2216,7 @@ export interface TraceException {
1825
2216
  readonly timestamp: number;
1826
2217
  readonly message: string;
1827
2218
  readonly name: string;
2219
+ readonly stack?: string;
1828
2220
  }
1829
2221
  export interface TraceDiagnosticChannelEvent {
1830
2222
  readonly timestamp: number;
@@ -1840,29 +2232,52 @@ export interface UnsafeTraceMetrics {
1840
2232
  }
1841
2233
  export declare class URL {
1842
2234
  constructor(url: string | URL, base?: string | URL);
2235
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
1843
2236
  get href(): string;
2237
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
1844
2238
  set href(value: string);
2239
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
1845
2240
  get origin(): string;
2241
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
1846
2242
  get protocol(): string;
2243
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
1847
2244
  set protocol(value: string);
2245
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
1848
2246
  get username(): string;
2247
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
1849
2248
  set username(value: string);
2249
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
1850
2250
  get password(): string;
2251
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
1851
2252
  set password(value: string);
2253
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
1852
2254
  get host(): string;
2255
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
1853
2256
  set host(value: string);
2257
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
1854
2258
  get hostname(): string;
2259
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
1855
2260
  set hostname(value: string);
2261
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
1856
2262
  get port(): string;
2263
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
1857
2264
  set port(value: string);
2265
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
1858
2266
  get pathname(): string;
2267
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
1859
2268
  set pathname(value: string);
2269
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
1860
2270
  get search(): string;
2271
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
1861
2272
  set search(value: string);
2273
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
1862
2274
  get searchParams(): URLSearchParams;
2275
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
1863
2276
  get hash(): string;
2277
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
1864
2278
  set hash(value: string);
1865
2279
  toString(): string;
2280
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
1866
2281
  toJSON(): string;
1867
2282
  }
1868
2283
  export declare class URLSearchParams {
@@ -1871,7 +2286,7 @@ export declare class URLSearchParams {
1871
2286
  | URLSearchParams
1872
2287
  | string
1873
2288
  | Record<string, string>
1874
- | [key: string, value: string][]
2289
+ | [key: string, value: string][],
1875
2290
  );
1876
2291
  get size(): number;
1877
2292
  append(name: string, value: string): void;
@@ -1881,17 +2296,20 @@ export declare class URLSearchParams {
1881
2296
  has(name: string): boolean;
1882
2297
  set(name: string, value: string): void;
1883
2298
  sort(): void;
2299
+ /** Returns an array of key, value pairs for every entry in the search params. */
1884
2300
  entries(): IterableIterator<[key: string, value: string]>;
2301
+ /** Returns a list of keys in the search params. */
1885
2302
  keys(): IterableIterator<string>;
2303
+ /** Returns a list of values in the search params. */
1886
2304
  values(): IterableIterator<string>;
1887
2305
  forEach<This = unknown>(
1888
2306
  callback: (
1889
2307
  this: This,
1890
2308
  value: string,
1891
2309
  key: string,
1892
- parent: URLSearchParams
2310
+ parent: URLSearchParams,
1893
2311
  ) => void,
1894
- thisArg?: This
2312
+ thisArg?: This,
1895
2313
  ): void;
1896
2314
  toString(): string;
1897
2315
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
@@ -1900,7 +2318,7 @@ export declare class URLPattern {
1900
2318
  constructor(
1901
2319
  input?: string | URLPatternURLPatternInit,
1902
2320
  baseURL?: string,
1903
- patternOptions?: URLPatternURLPatternOptions
2321
+ patternOptions?: URLPatternURLPatternOptions,
1904
2322
  );
1905
2323
  get protocol(): string;
1906
2324
  get username(): string;
@@ -1913,7 +2331,7 @@ export declare class URLPattern {
1913
2331
  test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean;
1914
2332
  exec(
1915
2333
  input?: string | URLPatternURLPatternInit,
1916
- baseURL?: string
2334
+ baseURL?: string,
1917
2335
  ): URLPatternURLPatternResult | null;
1918
2336
  }
1919
2337
  export interface URLPatternURLPatternInit {
@@ -1947,11 +2365,23 @@ export interface URLPatternURLPatternOptions {
1947
2365
  }
1948
2366
  export declare class CloseEvent extends Event {
1949
2367
  constructor(type: string, initializer?: CloseEventInit);
1950
- /** Returns the WebSocket connection close code provided by the server. */
2368
+ /**
2369
+ * Returns the WebSocket connection close code provided by the server.
2370
+ *
2371
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
2372
+ */
1951
2373
  readonly code: number;
1952
- /** Returns the WebSocket connection close reason provided by the server. */
2374
+ /**
2375
+ * Returns the WebSocket connection close reason provided by the server.
2376
+ *
2377
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
2378
+ */
1953
2379
  readonly reason: string;
1954
- /** Returns true if the connection closed cleanly; false otherwise. */
2380
+ /**
2381
+ * Returns true if the connection closed cleanly; false otherwise.
2382
+ *
2383
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
2384
+ */
1955
2385
  readonly wasClean: boolean;
1956
2386
  }
1957
2387
  export interface CloseEventInit {
@@ -1966,12 +2396,21 @@ export declare class MessageEvent extends Event {
1966
2396
  export interface MessageEventInit {
1967
2397
  data: ArrayBuffer | string;
1968
2398
  }
1969
- /** Events providing information related to errors in scripts or in files. */
2399
+ /**
2400
+ * Events providing information related to errors in scripts or in files.
2401
+ *
2402
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
2403
+ */
1970
2404
  export interface ErrorEvent extends Event {
2405
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1971
2406
  readonly filename: string;
2407
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1972
2408
  readonly message: string;
2409
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1973
2410
  readonly lineno: number;
2411
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1974
2412
  readonly colno: number;
2413
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1975
2414
  readonly error: any;
1976
2415
  }
1977
2416
  export type WebSocketEventMap = {
@@ -1983,7 +2422,17 @@ export type WebSocketEventMap = {
1983
2422
  export declare class WebSocket extends EventTarget<WebSocketEventMap> {
1984
2423
  constructor(url: string, protocols?: string[] | string);
1985
2424
  accept(): void;
2425
+ /**
2426
+ * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
2427
+ *
2428
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
2429
+ */
1986
2430
  send(message: (ArrayBuffer | ArrayBufferView) | string): void;
2431
+ /**
2432
+ * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
2433
+ *
2434
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
2435
+ */
1987
2436
  close(code?: number, reason?: string): void;
1988
2437
  serializeAttachment(attachment: any): void;
1989
2438
  deserializeAttachment(): any | null;
@@ -1995,9 +2444,29 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
1995
2444
  static readonly CLOSING: number;
1996
2445
  static readonly READY_STATE_CLOSED: number;
1997
2446
  static readonly CLOSED: number;
2447
+ /**
2448
+ * Returns the state of the WebSocket object's connection. It can have the values described below.
2449
+ *
2450
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2451
+ */
1998
2452
  get readyState(): number;
2453
+ /**
2454
+ * Returns the URL that was used to establish the WebSocket connection.
2455
+ *
2456
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2457
+ */
1999
2458
  get url(): string | null;
2459
+ /**
2460
+ * 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.
2461
+ *
2462
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2463
+ */
2000
2464
  get protocol(): string | null;
2465
+ /**
2466
+ * Returns the extensions selected by the server, if any.
2467
+ *
2468
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2469
+ */
2001
2470
  get extensions(): string | null;
2002
2471
  }
2003
2472
  export declare const WebSocketPair: {
@@ -2031,7 +2500,7 @@ export interface SocketInfo {
2031
2500
  }
2032
2501
  export interface gpuGPU {
2033
2502
  requestAdapter(
2034
- param1?: gpuGPURequestAdapterOptions
2503
+ param1?: gpuGPURequestAdapterOptions,
2035
2504
  ): Promise<gpuGPUAdapter | null>;
2036
2505
  }
2037
2506
  export declare abstract class gpuGPUAdapter {
@@ -2043,24 +2512,24 @@ export declare abstract class gpuGPUAdapter {
2043
2512
  export interface gpuGPUDevice extends EventTarget {
2044
2513
  createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
2045
2514
  createBindGroupLayout(
2046
- descriptor: gpuGPUBindGroupLayoutDescriptor
2515
+ descriptor: gpuGPUBindGroupLayoutDescriptor,
2047
2516
  ): gpuGPUBindGroupLayout;
2048
2517
  createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
2049
2518
  createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
2050
2519
  createShaderModule(
2051
- descriptor: gpuGPUShaderModuleDescriptor
2520
+ descriptor: gpuGPUShaderModuleDescriptor,
2052
2521
  ): gpuGPUShaderModule;
2053
2522
  createPipelineLayout(
2054
- descriptor: gpuGPUPipelineLayoutDescriptor
2523
+ descriptor: gpuGPUPipelineLayoutDescriptor,
2055
2524
  ): gpuGPUPipelineLayout;
2056
2525
  createComputePipeline(
2057
- descriptor: gpuGPUComputePipelineDescriptor
2526
+ descriptor: gpuGPUComputePipelineDescriptor,
2058
2527
  ): gpuGPUComputePipeline;
2059
2528
  createRenderPipeline(
2060
- descriptor: gpuGPURenderPipelineDescriptor
2529
+ descriptor: gpuGPURenderPipelineDescriptor,
2061
2530
  ): gpuGPURenderPipeline;
2062
2531
  createCommandEncoder(
2063
- descriptor?: gpuGPUCommandEncoderDescriptor
2532
+ descriptor?: gpuGPUCommandEncoderDescriptor,
2064
2533
  ): gpuGPUCommandEncoder;
2065
2534
  createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
2066
2535
  destroy(): void;
@@ -2106,7 +2575,7 @@ export interface gpuGPUBuffer {
2106
2575
  mapAsync(
2107
2576
  offset: number,
2108
2577
  size?: number | bigint,
2109
- param3?: number | bigint
2578
+ param3?: number | bigint,
2110
2579
  ): Promise<void>;
2111
2580
  get size(): number | bigint;
2112
2581
  get usage(): number;
@@ -2205,38 +2674,38 @@ export interface gpuGPUProgrammableStage {
2205
2674
  export interface gpuGPUCommandEncoder {
2206
2675
  get label(): string;
2207
2676
  beginComputePass(
2208
- descriptor?: gpuGPUComputePassDescriptor
2677
+ descriptor?: gpuGPUComputePassDescriptor,
2209
2678
  ): gpuGPUComputePassEncoder;
2210
2679
  beginRenderPass(
2211
- descriptor: gpuGPURenderPassDescriptor
2680
+ descriptor: gpuGPURenderPassDescriptor,
2212
2681
  ): gpuGPURenderPassEncoder;
2213
2682
  copyBufferToBuffer(
2214
2683
  source: gpuGPUBuffer,
2215
2684
  sourceOffset: number | bigint,
2216
2685
  destination: gpuGPUBuffer,
2217
2686
  destinationOffset: number | bigint,
2218
- size: number | bigint
2687
+ size: number | bigint,
2219
2688
  ): void;
2220
2689
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2221
2690
  copyTextureToBuffer(
2222
2691
  source: gpuGPUImageCopyTexture,
2223
2692
  destination: gpuGPUImageCopyBuffer,
2224
- copySize: Iterable<number> | gpuGPUExtent3DDict
2693
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2225
2694
  ): void;
2226
2695
  copyBufferToTexture(
2227
2696
  source: gpuGPUImageCopyBuffer,
2228
2697
  destination: gpuGPUImageCopyTexture,
2229
- copySize: Iterable<number> | gpuGPUExtent3DDict
2698
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2230
2699
  ): void;
2231
2700
  copyTextureToTexture(
2232
2701
  source: gpuGPUImageCopyTexture,
2233
2702
  destination: gpuGPUImageCopyTexture,
2234
- copySize: Iterable<number> | gpuGPUExtent3DDict
2703
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2235
2704
  ): void;
2236
2705
  clearBuffer(
2237
2706
  buffer: gpuGPUBuffer,
2238
2707
  offset?: number | bigint,
2239
- size?: number | bigint
2708
+ size?: number | bigint,
2240
2709
  ): void;
2241
2710
  }
2242
2711
  export interface gpuGPUCommandEncoderDescriptor {
@@ -2247,12 +2716,12 @@ export interface gpuGPUComputePassEncoder {
2247
2716
  setBindGroup(
2248
2717
  index: number,
2249
2718
  bindGroup: gpuGPUBindGroup | null,
2250
- dynamicOffsets?: Iterable<number>
2719
+ dynamicOffsets?: Iterable<number>,
2251
2720
  ): void;
2252
2721
  dispatchWorkgroups(
2253
2722
  workgroupCountX: number,
2254
2723
  workgroupCountY?: number,
2255
- workgroupCountZ?: number
2724
+ workgroupCountZ?: number,
2256
2725
  ): void;
2257
2726
  end(): void;
2258
2727
  }
@@ -2280,7 +2749,7 @@ export interface gpuGPUQueue {
2280
2749
  bufferOffset: number | bigint,
2281
2750
  data: ArrayBuffer | ArrayBufferView,
2282
2751
  dataOffset?: number | bigint,
2283
- size?: number | bigint
2752
+ size?: number | bigint,
2284
2753
  ): void;
2285
2754
  }
2286
2755
  export declare abstract class gpuGPUMapMode {
@@ -2488,7 +2957,7 @@ export interface gpuGPURenderPassEncoder {
2488
2957
  vertexCount: number,
2489
2958
  instanceCount?: number,
2490
2959
  firstVertex?: number,
2491
- firstInstance?: number
2960
+ firstInstance?: number,
2492
2961
  ): void;
2493
2962
  end(): void;
2494
2963
  }
@@ -2986,7 +3455,7 @@ export interface IncomingRequestCfPropertiesBotManagementEnterprise
2986
3455
  };
2987
3456
  }
2988
3457
  export interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
2989
- HostMetadata
3458
+ HostMetadata,
2990
3459
  > {
2991
3460
  /**
2992
3461
  * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
@@ -3556,6 +4025,13 @@ export declare abstract class D1PreparedStatement {
3556
4025
  }): Promise<[string[], ...T[]]>;
3557
4026
  raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
3558
4027
  }
4028
+ // `Disposable` was added to TypeScript's standard lib types in version 5.2.
4029
+ // To support older TypeScript versions, define an empty `Disposable` interface.
4030
+ // Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
4031
+ // but this will ensure type checking on older versions still passes.
4032
+ // TypeScript's interface merging will ensure our empty interface is effectively
4033
+ // ignored when `Disposable` is included in the standard lib.
4034
+ export interface Disposable {}
3559
4035
  /**
3560
4036
  * An email message that can be sent from a Worker.
3561
4037
  */
@@ -3611,7 +4087,7 @@ export declare abstract class EmailEvent extends ExtendableEvent {
3611
4087
  export type EmailExportedHandler<Env = unknown> = (
3612
4088
  message: ForwardableEmailMessage,
3613
4089
  env: Env,
3614
- ctx: ExecutionContext
4090
+ ctx: ExecutionContext,
3615
4091
  ) => void | Promise<void>;
3616
4092
  export interface Hyperdrive {
3617
4093
  /**
@@ -3678,7 +4154,7 @@ export type EventContext<Env, P extends string, Data> = {
3678
4154
  export type PagesFunction<
3679
4155
  Env = unknown,
3680
4156
  Params extends string = any,
3681
- Data extends Record<string, unknown> = Record<string, unknown>
4157
+ Data extends Record<string, unknown> = Record<string, unknown>,
3682
4158
  > = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
3683
4159
  export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
3684
4160
  request: Request<unknown, IncomingRequestCfProperties<unknown>>;
@@ -3699,9 +4175,9 @@ export type PagesPluginFunction<
3699
4175
  Env = unknown,
3700
4176
  Params extends string = any,
3701
4177
  Data extends Record<string, unknown> = Record<string, unknown>,
3702
- PluginArgs = unknown
4178
+ PluginArgs = unknown,
3703
4179
  > = (
3704
- context: EventPluginContext<Env, Params, Data, PluginArgs>
4180
+ context: EventPluginContext<Env, Params, Data, PluginArgs>,
3705
4181
  ) => Response | Promise<Response>;
3706
4182
  // PubSubMessage represents an incoming PubSub message.
3707
4183
  // The message includes metadata about the broker, the client, and the payload
@@ -3737,6 +4213,155 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
3737
4213
  // Key Identifier of the JWK
3738
4214
  readonly kid: string;
3739
4215
  }
4216
+ // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
4217
+ // to referenced by `Fetcher`. This is included in the "importable" version of the types which
4218
+ // strips all `module` blocks.
4219
+ export declare namespace Rpc {
4220
+ // Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
4221
+ // TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
4222
+ // For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
4223
+ // accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
4224
+ export const __RPC_STUB_BRAND: unique symbol;
4225
+ export const __RPC_TARGET_BRAND: unique symbol;
4226
+ export const __WORKER_ENTRYPOINT_BRAND: unique symbol;
4227
+ export const __DURABLE_OBJECT_BRAND: unique symbol;
4228
+ export interface RpcTargetBranded {
4229
+ [__RPC_TARGET_BRAND]: never;
4230
+ }
4231
+ export interface WorkerEntrypointBranded {
4232
+ [__WORKER_ENTRYPOINT_BRAND]: never;
4233
+ }
4234
+ export interface DurableObjectBranded {
4235
+ [__DURABLE_OBJECT_BRAND]: never;
4236
+ }
4237
+ export type EntrypointBranded =
4238
+ | WorkerEntrypointBranded
4239
+ | DurableObjectBranded;
4240
+ // Types that can be used through `Stub`s
4241
+ export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
4242
+ // Types that can be passed over RPC
4243
+ type Serializable =
4244
+ // Structured cloneables
4245
+ | void
4246
+ | undefined
4247
+ | null
4248
+ | boolean
4249
+ | number
4250
+ | bigint
4251
+ | string
4252
+ | TypedArray
4253
+ | ArrayBuffer
4254
+ | DataView
4255
+ | Date
4256
+ | Error
4257
+ | RegExp
4258
+ // Structured cloneable composites
4259
+ | Map<Serializable, Serializable>
4260
+ | Set<Serializable>
4261
+ | ReadonlyArray<Serializable>
4262
+ | {
4263
+ [key: string | number]: Serializable;
4264
+ }
4265
+ // Special types
4266
+ | ReadableStream<Uint8Array>
4267
+ | WritableStream<Uint8Array>
4268
+ | Request
4269
+ | Response
4270
+ | Headers
4271
+ | Stub<Stubable>
4272
+ // Serialized as stubs, see `Stubify`
4273
+ | Stubable;
4274
+ // Base type for all RPC stubs, including common memory management methods.
4275
+ // `T` is used as a marker type for unwrapping `Stub`s later.
4276
+ interface StubBase<T extends Stubable> extends Disposable {
4277
+ [__RPC_STUB_BRAND]: T;
4278
+ dup(): this;
4279
+ }
4280
+ export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
4281
+ // Recursively rewrite all `Stubable` types with `Stub`s
4282
+ type Stubify<T> = T extends Stubable
4283
+ ? Stub<T>
4284
+ : T extends Map<infer K, infer V>
4285
+ ? Map<Stubify<K>, Stubify<V>>
4286
+ : T extends Set<infer V>
4287
+ ? Set<Stubify<V>>
4288
+ : T extends Array<infer V>
4289
+ ? Array<Stubify<V>>
4290
+ : T extends ReadonlyArray<infer V>
4291
+ ? ReadonlyArray<Stubify<V>>
4292
+ : T extends {
4293
+ [key: string | number]: unknown;
4294
+ }
4295
+ ? {
4296
+ [K in keyof T]: Stubify<T[K]>;
4297
+ }
4298
+ : T;
4299
+ // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
4300
+ // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
4301
+ // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
4302
+ type Unstubify<T> =
4303
+ T extends StubBase<infer V>
4304
+ ? V
4305
+ : T extends Map<infer K, infer V>
4306
+ ? Map<Unstubify<K>, Unstubify<V>>
4307
+ : T extends Set<infer V>
4308
+ ? Set<Unstubify<V>>
4309
+ : T extends Array<infer V>
4310
+ ? Array<Unstubify<V>>
4311
+ : T extends ReadonlyArray<infer V>
4312
+ ? ReadonlyArray<Unstubify<V>>
4313
+ : T extends {
4314
+ [key: string | number]: unknown;
4315
+ }
4316
+ ? {
4317
+ [K in keyof T]: Unstubify<T[K]>;
4318
+ }
4319
+ : T;
4320
+ type UnstubifyAll<A extends any[]> = {
4321
+ [I in keyof A]: Unstubify<A[I]>;
4322
+ };
4323
+ // Utility type for adding `Provider`/`Disposable`s to `object` types only.
4324
+ // Note `unknown & T` is equivalent to `T`.
4325
+ type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
4326
+ type MaybeDisposable<T> = T extends object ? Disposable : unknown;
4327
+ // Type for method return or property on an RPC interface.
4328
+ // - Stubable types are replaced by stubs.
4329
+ // - Serializable types are passed by value, with stubable types replaced by stubs
4330
+ // and a top-level `Disposer`.
4331
+ // Everything else can't be passed over PRC.
4332
+ // Technically, we use custom thenables here, but they quack like `Promise`s.
4333
+ // Intersecting with `(Maybe)Provider` allows pipelining.
4334
+ type Result<R> = R extends Stubable
4335
+ ? Promise<Stub<R>> & Provider<R>
4336
+ : R extends Serializable
4337
+ ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
4338
+ : never;
4339
+ // Type for method or property on an RPC interface.
4340
+ // For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
4341
+ // Unwrapping `Stub`s allows calling with `Stubable` arguments.
4342
+ // For properties, rewrite types to be `Result`s.
4343
+ // In each case, unwrap `Promise`s.
4344
+ type MethodOrProperty<V> = V extends (...args: infer P) => infer R
4345
+ ? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
4346
+ : Result<Awaited<V>>;
4347
+ // Type for the callable part of an `Provider` if `T` is callable.
4348
+ // This is intersected with methods/properties.
4349
+ type MaybeCallableProvider<T> = T extends (...args: any[]) => any
4350
+ ? MethodOrProperty<T>
4351
+ : unknown;
4352
+ // Base type for all other types providing RPC-like interfaces.
4353
+ // Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
4354
+ // `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
4355
+ export type Provider<
4356
+ T extends object,
4357
+ Reserved extends string = never,
4358
+ > = MaybeCallableProvider<T> & {
4359
+ [K in Exclude<
4360
+ keyof T,
4361
+ Reserved | symbol | keyof StubBase<never>
4362
+ >]: MethodOrProperty<T[K]>;
4363
+ };
4364
+ }
3740
4365
  // Copyright (c) 2022-2023 Cloudflare, Inc.
3741
4366
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
3742
4367
  // https://opensource.org/licenses/Apache-2.0
@@ -3865,7 +4490,7 @@ export declare abstract class VectorizeIndex {
3865
4490
  */
3866
4491
  public query(
3867
4492
  vector: VectorFloatArray | number[],
3868
- options: VectorizeQueryOptions
4493
+ options: VectorizeQueryOptions,
3869
4494
  ): Promise<VectorizeMatches>;
3870
4495
  /**
3871
4496
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -3892,6 +4517,16 @@ export declare abstract class VectorizeIndex {
3892
4517
  */
3893
4518
  public getByIds(ids: string[]): Promise<VectorizeVector[]>;
3894
4519
  }
4520
+ /**
4521
+ * The interface for "version_metadata" binding
4522
+ * providing metadata about the Worker Version using this binding.
4523
+ */
4524
+ export type WorkerVersionMetadata = {
4525
+ /** The ID of the Worker Version using this binding */
4526
+ id: string;
4527
+ /** The tag of the Worker Version using this binding */
4528
+ tag: string;
4529
+ };
3895
4530
  export interface DynamicDispatchLimits {
3896
4531
  /**
3897
4532
  * Limit CPU time in milliseconds.
@@ -3927,6 +4562,6 @@ export interface DispatchNamespace {
3927
4562
  args?: {
3928
4563
  [key: string]: any;
3929
4564
  },
3930
- options?: DynamicDispatchOptions
4565
+ options?: DynamicDispatchOptions,
3931
4566
  ): Fetcher;
3932
4567
  }