four-stroke 0.2.2 → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
- // Generated by Wrangler by running `wrangler types` (hash: f0ebc0bbc8852abc1241a56510ca0186)
3
- // Runtime types generated with workerd@1.20260722.1 2025-09-15 disable_nodejs_fs_module,nodejs_compat
2
+ // Generated by Wrangler by running `wrangler types --env-file=/dev/null --strict-vars=false` (hash: f0ebc0bbc8852abc1241a56510ca0186)
3
+ // Runtime types generated with workerd@1.20260926.1 2025-09-15 disable_nodejs_fs_module,nodejs_compat
4
4
  interface __BaseEnv_Env {
5
5
  }
6
6
  declare namespace Cloudflare {
@@ -30,26 +30,26 @@ and limitations under the License.
30
30
  // noinspection JSUnusedGlobalSymbols
31
31
  declare var onmessage: never;
32
32
  /**
33
- * The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
33
+ * The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
34
34
  *
35
35
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
36
36
  */
37
37
  declare class DOMException extends Error {
38
38
  constructor(message?: string, name?: string);
39
39
  /**
40
- * The **`message`** read-only property of the a message or description associated with the given error name.
40
+ * The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
41
41
  *
42
42
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
43
43
  */
44
44
  readonly message: string;
45
45
  /**
46
- * The **`name`** read-only property of the one of the strings associated with an error name.
46
+ * The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
47
47
  *
48
48
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
49
49
  */
50
50
  readonly name: string;
51
51
  /**
52
- * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
52
+ * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
53
53
  * @deprecated
54
54
  *
55
55
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
@@ -107,61 +107,61 @@ interface Console {
107
107
  */
108
108
  clear(): void;
109
109
  /**
110
- * The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
110
+ * The **`console.count()`** static method logs the number of times that this particular call to count() has been called.
111
111
  *
112
112
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
113
113
  */
114
114
  count(label?: string): void;
115
115
  /**
116
- * The **`console.countReset()`** static method resets counter used with console/count_static.
116
+ * The **`console.countReset()`** static method resets counter used with console.count().
117
117
  *
118
118
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
119
119
  */
120
120
  countReset(label?: string): void;
121
121
  /**
122
- * The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
122
+ * The **`console.debug()`** static method outputs a message to the console at the "debug" log level. The message is only displayed to the user if the console is configured to display debug output. In most cases, the log level is configured within the console UI. This log level might correspond to the Debug or Verbose log level.
123
123
  *
124
124
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
125
125
  */
126
126
  debug(...data: any[]): void;
127
127
  /**
128
- * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
128
+ * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. In browser consoles, the output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
129
129
  *
130
130
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
131
131
  */
132
132
  dir(item?: any, options?: any): void;
133
133
  /**
134
- * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
134
+ * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.
135
135
  *
136
136
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
137
137
  */
138
138
  dirxml(...data: any[]): void;
139
139
  /**
140
- * The **`console.error()`** static method outputs a message to the console at the 'error' log level.
140
+ * The **`console.error()`** static method outputs a message to the console at the "error" log level. The message is only displayed to the user if the console is configured to display error output. In most cases, the log level is configured within the console UI. The message may be formatted as an error, with red colors and call stack information.
141
141
  *
142
142
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
143
143
  */
144
144
  error(...data: any[]): void;
145
145
  /**
146
- * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
146
+ * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console.groupEnd() is called.
147
147
  *
148
148
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
149
149
  */
150
150
  group(...data: any[]): void;
151
151
  /**
152
- * The **`console.groupCollapsed()`** static method creates a new inline group in the console.
152
+ * The **`console.groupCollapsed()`** static method creates a new inline group in the console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.
153
153
  *
154
154
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
155
155
  */
156
156
  groupCollapsed(...data: any[]): void;
157
157
  /**
158
- * The **`console.groupEnd()`** static method exits the current inline group in the console.
158
+ * The **`console.groupEnd()`** static method exits the current inline group in the console. See Using groups in the console in the console documentation for details and examples.
159
159
  *
160
160
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
161
161
  */
162
162
  groupEnd(): void;
163
163
  /**
164
- * The **`console.info()`** static method outputs a message to the console at the 'info' log level.
164
+ * The **`console.info()`** static method outputs a message to the console at the "info" log level. The message is only displayed to the user if the console is configured to display info output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as a small "i" icon next to it.
165
165
  *
166
166
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
167
167
  */
@@ -179,23 +179,24 @@ interface Console {
179
179
  */
180
180
  table(tabularData?: any, properties?: string[]): void;
181
181
  /**
182
- * The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
182
+ * The **`console.time()`** static method starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.
183
183
  *
184
184
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
185
185
  */
186
186
  time(label?: string): void;
187
187
  /**
188
- * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
188
+ * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console.time().
189
189
  *
190
190
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
191
191
  */
192
192
  timeEnd(label?: string): void;
193
193
  /**
194
- * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
194
+ * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console.time().
195
195
  *
196
196
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
197
197
  */
198
198
  timeLog(label?: string, ...data: any[]): void;
199
+ /* The **`console.timeStamp()`** static method adds a single marker to the browser's Performance tool (Firefox bug 1387528, Chrome). This lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. */
199
200
  timeStamp(label?: string): void;
200
201
  /**
201
202
  * The **`console.trace()`** static method outputs a stack trace to the console.
@@ -204,7 +205,7 @@ interface Console {
204
205
  */
205
206
  trace(...data: any[]): void;
206
207
  /**
207
- * The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
208
+ * The **`console.warn()`** static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon.
208
209
  *
209
210
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
210
211
  */
@@ -370,7 +371,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
370
371
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
371
372
  declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
372
373
  /**
373
- * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
374
+ * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
374
375
  *
375
376
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
376
377
  */
@@ -415,6 +416,7 @@ declare const crypto: Crypto;
415
416
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
416
417
  */
417
418
  declare const caches: CacheStorage;
419
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scheduler) */
418
420
  declare const scheduler: Scheduler;
419
421
  /**
420
422
  * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
@@ -435,12 +437,13 @@ interface ExecutionContext<Props = unknown> {
435
437
  cache?: CacheContext;
436
438
  readonly access?: CloudflareAccessContext;
437
439
  tracing: Tracing;
440
+ abort(reason?: any): void;
438
441
  }
439
442
  type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
440
443
  type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
441
444
  type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (events: TraceItem[], env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
442
445
  type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (traces: TraceItem[], env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
443
- type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (event: TailStream.TailEvent<TailStream.Onset>, env: Env, ctx: ExecutionContext<Props>) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
446
+ type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (event: TailStream.TailEvent<TailStream.Onset>, env: Env, ctx: ExecutionContext<Props>) => TailStream.TailEventHandlerType | undefined | Promise<TailStream.TailEventHandlerType | undefined>;
444
447
  type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
445
448
  type ExportedHandlerQueueHandler<Env = unknown, Message = unknown, Props = unknown> = (batch: MessageBatch<Message>, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
446
449
  type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (controller: TestController, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
@@ -551,7 +554,7 @@ interface DurableObjectState<Props = unknown> {
551
554
  setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
552
555
  getHibernatableWebSocketEventTimeout(): number | null;
553
556
  getTags(ws: WebSocket): string[];
554
- abort(reason?: string): void;
557
+ abort(reason?: string, options?: DurableObjectAbortOptions): void;
555
558
  }
556
559
  interface DurableObjectTransaction {
557
560
  get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
@@ -587,6 +590,9 @@ interface DurableObjectStorage {
587
590
  getBookmarkForTime(timestamp: number | Date): Promise<string>;
588
591
  onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
589
592
  }
593
+ interface DurableObjectAbortOptions {
594
+ retryAlarm?: boolean;
595
+ }
590
596
  interface DurableObjectListOptions {
591
597
  start?: string;
592
598
  startAfter?: string;
@@ -637,26 +643,26 @@ interface AnalyticsEngineDataPoint {
637
643
  blobs?: ((ArrayBuffer | string) | null)[];
638
644
  }
639
645
  /**
640
- * The **`Event`** interface represents an event which takes place on an `EventTarget`.
646
+ * The **`Event`** interface represents an event which takes place on an EventTarget.
641
647
  *
642
648
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
643
649
  */
644
650
  declare class Event {
645
651
  constructor(type: string, init?: EventInit);
646
652
  /**
647
- * The **`type`** read-only property of the Event interface returns a string containing the event's type.
653
+ * The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
648
654
  *
649
655
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
650
656
  */
651
657
  get type(): string;
652
658
  /**
653
- * The **`eventPhase`** read-only property of the being evaluated.
659
+ * The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated.
654
660
  *
655
661
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
656
662
  */
657
663
  get eventPhase(): number;
658
664
  /**
659
- * The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
665
+ * The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM.
660
666
  *
661
667
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
662
668
  */
@@ -693,13 +699,13 @@ declare class Event {
693
699
  */
694
700
  get currentTarget(): EventTarget | undefined;
695
701
  /**
696
- * The read-only **`target`** property of the dispatched.
702
+ * The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event.
697
703
  *
698
704
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
699
705
  */
700
706
  get target(): EventTarget | undefined;
701
707
  /**
702
- * The deprecated **`Event.srcElement`** is an alias for the Event.target property.
708
+ * The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead.
703
709
  * @deprecated
704
710
  *
705
711
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
@@ -712,45 +718,45 @@ declare class Event {
712
718
  */
713
719
  get timeStamp(): number;
714
720
  /**
715
- * The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
721
+ * The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents.
716
722
  *
717
723
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
718
724
  */
719
725
  get isTrusted(): boolean;
720
726
  /**
721
- * The **`cancelBubble`** property of the Event interface is deprecated.
727
+ * The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
722
728
  * @deprecated
723
729
  *
724
730
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
725
731
  */
726
732
  get cancelBubble(): boolean;
727
733
  /**
728
- * The **`cancelBubble`** property of the Event interface is deprecated.
734
+ * The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.
729
735
  * @deprecated
730
736
  *
731
737
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
732
738
  */
733
739
  set cancelBubble(value: boolean);
734
740
  /**
735
- * The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
741
+ * The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called.
736
742
  *
737
743
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
738
744
  */
739
745
  stopImmediatePropagation(): void;
740
746
  /**
741
- * The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
747
+ * The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken.
742
748
  *
743
749
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
744
750
  */
745
751
  preventDefault(): void;
746
752
  /**
747
- * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
753
+ * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().
748
754
  *
749
755
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
750
756
  */
751
757
  stopPropagation(): void;
752
758
  /**
753
- * The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
759
+ * The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.
754
760
  *
755
761
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
756
762
  */
@@ -771,7 +777,7 @@ interface EventListenerObject<EventType extends Event = Event> {
771
777
  }
772
778
  type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
773
779
  /**
774
- * The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
780
+ * The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface.
775
781
  *
776
782
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
777
783
  */
@@ -784,13 +790,13 @@ declare class EventTarget<EventMap extends Record<string, Event> = Record<string
784
790
  */
785
791
  addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
786
792
  /**
787
- * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
793
+ * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
788
794
  *
789
795
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
790
796
  */
791
797
  removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
792
798
  /**
793
- * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
799
+ * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
794
800
  *
795
801
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
796
802
  */
@@ -822,7 +828,7 @@ declare class AbortController {
822
828
  */
823
829
  get signal(): AbortSignal;
824
830
  /**
825
- * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
831
+ * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. This is able to abort fetch requests, the consumption of any response bodies, or streams.
826
832
  *
827
833
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
828
834
  */
@@ -835,7 +841,7 @@ declare class AbortController {
835
841
  */
836
842
  declare abstract class AbortSignal extends EventTarget {
837
843
  /**
838
- * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
844
+ * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).
839
845
  *
840
846
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
841
847
  */
@@ -847,13 +853,13 @@ declare abstract class AbortSignal extends EventTarget {
847
853
  */
848
854
  static timeout(delay: number): AbortSignal;
849
855
  /**
850
- * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
856
+ * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal.
851
857
  *
852
858
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
853
859
  */
854
860
  static any(signals: AbortSignal[]): AbortSignal;
855
861
  /**
856
- * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
862
+ * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).
857
863
  *
858
864
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
859
865
  */
@@ -869,12 +875,17 @@ declare abstract class AbortSignal extends EventTarget {
869
875
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
870
876
  set onabort(value: any | null);
871
877
  /**
872
- * The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
878
+ * The **`throwIfAborted()`** method throws the signal's abort reason if the signal has been aborted; otherwise it does nothing.
873
879
  *
874
880
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
875
881
  */
876
882
  throwIfAborted(): void;
877
883
  }
884
+ /**
885
+ * The **`Scheduler`** interface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.
886
+ *
887
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Scheduler)
888
+ */
878
889
  interface Scheduler {
879
890
  wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
880
891
  }
@@ -882,20 +893,20 @@ interface SchedulerWaitOptions {
882
893
  signal?: AbortSignal;
883
894
  }
884
895
  /**
885
- * The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
896
+ * The **`ExtendableEvent`** interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
886
897
  *
887
898
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
888
899
  */
889
900
  declare abstract class ExtendableEvent extends Event {
890
901
  /**
891
- * The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
902
+ * The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In service workers, waitUntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.
892
903
  *
893
904
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
894
905
  */
895
906
  waitUntil(promise: Promise<any>): void;
896
907
  }
897
908
  /**
898
- * The **`CustomEvent`** interface represents events initialized by an application for any purpose.
909
+ * The **`CustomEvent`** interface can be used to attach custom data to an event generated by an application.
899
910
  *
900
911
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
901
912
  */
@@ -934,7 +945,7 @@ declare class Blob {
934
945
  */
935
946
  get type(): string;
936
947
  /**
937
- * The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
948
+ * The **`slice()`** method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.
938
949
  *
939
950
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
940
951
  */
@@ -952,13 +963,13 @@ declare class Blob {
952
963
  */
953
964
  bytes(): Promise<Uint8Array>;
954
965
  /**
955
- * The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
966
+ * The **`text()`** method of the Blob interface returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.
956
967
  *
957
968
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
958
969
  */
959
970
  text(): Promise<string>;
960
971
  /**
961
- * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
972
+ * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.
962
973
  *
963
974
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
964
975
  */
@@ -975,13 +986,13 @@ interface BlobOptions {
975
986
  declare class File extends Blob {
976
987
  constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
977
988
  /**
978
- * The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
989
+ * The **`name`** read-only property of the File interface returns the name of the file represented by a File object. For security reasons, the path is excluded from this property.
979
990
  *
980
991
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
981
992
  */
982
993
  get name(): string;
983
994
  /**
984
- * The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
995
+ * The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
985
996
  *
986
997
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
987
998
  */
@@ -998,7 +1009,7 @@ interface FileOptions {
998
1009
  */
999
1010
  declare abstract class CacheStorage {
1000
1011
  /**
1001
- * The **`open()`** method of the the Cache object matching the `cacheName`.
1012
+ * The **`open()`** method of the CacheStorage interface returns a Promise that resolves to the Cache object matching the cacheName.
1002
1013
  *
1003
1014
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
1004
1015
  */
@@ -1031,14 +1042,14 @@ interface CacheQueryOptions {
1031
1042
  */
1032
1043
  declare abstract class Crypto {
1033
1044
  /**
1034
- * The **`Crypto.subtle`** read-only property returns a cryptographic operations.
1045
+ * The **`Crypto.subtle`** read-only property returns a SubtleCrypto which can then be used to perform low-level cryptographic operations.
1035
1046
  * Available only in secure contexts.
1036
1047
  *
1037
1048
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
1038
1049
  */
1039
1050
  get subtle(): SubtleCrypto;
1040
1051
  /**
1041
- * The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
1052
+ * The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).
1042
1053
  *
1043
1054
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
1044
1055
  */
@@ -1066,7 +1077,7 @@ declare abstract class SubtleCrypto {
1066
1077
  */
1067
1078
  encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
1068
1079
  /**
1069
- * The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
1080
+ * The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. It takes as arguments a key to decrypt with, some optional extra parameters, and the data to decrypt (also known as "ciphertext"). It returns a Promise which will be fulfilled with the decrypted data (also known as "plaintext").
1070
1081
  *
1071
1082
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
1072
1083
  */
@@ -1084,7 +1095,7 @@ declare abstract class SubtleCrypto {
1084
1095
  */
1085
1096
  verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
1086
1097
  /**
1087
- * The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
1098
+ * The **`digest()`** method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.
1088
1099
  *
1089
1100
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
1090
1101
  */
@@ -1102,7 +1113,7 @@ declare abstract class SubtleCrypto {
1102
1113
  */
1103
1114
  deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
1104
1115
  /**
1105
- * The **`deriveBits()`** method of the key.
1116
+ * The **`deriveBits()`** method of the SubtleCrypto interface can be used to derive an array of bits from a base key.
1106
1117
  *
1107
1118
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
1108
1119
  */
@@ -1120,13 +1131,13 @@ declare abstract class SubtleCrypto {
1120
1131
  */
1121
1132
  exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
1122
1133
  /**
1123
- * The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
1134
+ * The **`wrapKey()`** method of the SubtleCrypto interface "wraps" a key. This means that it exports the key in an external, portable format, then encrypts the exported key. Wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
1124
1135
  *
1125
1136
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
1126
1137
  */
1127
1138
  wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
1128
1139
  /**
1129
- * The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
1140
+ * The **`unwrapKey()`** method of the SubtleCrypto interface "unwraps" a key. This means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). It decrypts the key and then imports it, returning a CryptoKey object that can be used in the Web Crypto API.
1130
1141
  *
1131
1142
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
1132
1143
  */
@@ -1134,20 +1145,20 @@ declare abstract class SubtleCrypto {
1134
1145
  timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
1135
1146
  }
1136
1147
  /**
1137
- * The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
1148
+ * The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().
1138
1149
  * Available only in secure contexts.
1139
1150
  *
1140
1151
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
1141
1152
  */
1142
1153
  declare abstract class CryptoKey {
1143
1154
  /**
1144
- * The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
1155
+ * The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. It can have the following values:
1145
1156
  *
1146
1157
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
1147
1158
  */
1148
1159
  readonly type: string;
1149
1160
  /**
1150
- * The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
1161
+ * The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().
1151
1162
  *
1152
1163
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
1153
1164
  */
@@ -1264,12 +1275,15 @@ interface CryptoKeyArbitraryKeyAlgorithm {
1264
1275
  length?: number;
1265
1276
  }
1266
1277
  declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
1267
- constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1278
+ constructor(algorithm: string | SubtleCryptoHashAlgorithm, options?: DigestStreamOptions);
1268
1279
  readonly digest: Promise<ArrayBuffer>;
1269
1280
  get bytesWritten(): number | bigint;
1270
1281
  }
1282
+ interface DigestStreamOptions {
1283
+ toWellFormed?: boolean;
1284
+ }
1271
1285
  /**
1272
- * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
1286
+ * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
1273
1287
  *
1274
1288
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1275
1289
  */
@@ -1286,20 +1300,20 @@ declare class TextDecoder {
1286
1300
  get ignoreBOM(): boolean;
1287
1301
  }
1288
1302
  /**
1289
- * The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
1303
+ * The **`TextEncoder`** interface enables you to encode a JavaScript string using UTF-8.
1290
1304
  *
1291
1305
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
1292
1306
  */
1293
1307
  declare class TextEncoder {
1294
1308
  constructor();
1295
1309
  /**
1296
- * The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
1310
+ * The **`TextEncoder.encode()`** method takes a string as input, and returns a Uint8Array containing the string encoded using UTF-8.
1297
1311
  *
1298
1312
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
1299
1313
  */
1300
1314
  encode(input?: string): Uint8Array;
1301
1315
  /**
1302
- * The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
1316
+ * The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns an object indicating the progress of the encoding. This is potentially more performant than the encode() method — especially when the target buffer is a view into a Wasm heap.
1303
1317
  *
1304
1318
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
1305
1319
  */
@@ -1356,6 +1370,9 @@ declare class ErrorEvent extends Event {
1356
1370
  get error(): any;
1357
1371
  }
1358
1372
  interface ErrorEventErrorEventInit {
1373
+ bubbles?: boolean;
1374
+ cancelable?: boolean;
1375
+ composed?: boolean;
1359
1376
  message?: string;
1360
1377
  filename?: string;
1361
1378
  lineno?: number;
@@ -1368,135 +1385,139 @@ interface ErrorEventErrorEventInit {
1368
1385
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
1369
1386
  */
1370
1387
  declare class MessageEvent extends Event {
1371
- constructor(type: string, initializer: MessageEventInit);
1388
+ constructor(type: string, initializer?: MessageEventInit);
1372
1389
  /**
1373
- * The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
1390
+ * The **`data`** read-only property of the MessageEvent interface represents the data sent by the message emitter.
1374
1391
  *
1375
1392
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
1376
1393
  */
1377
1394
  readonly data: any;
1378
1395
  /**
1379
- * The **`origin`** read-only property of the origin of the message emitter.
1396
+ * The **`origin`** read-only property of the MessageEvent interface is a string representing the origin of the message emitter.
1380
1397
  *
1381
1398
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
1382
1399
  */
1383
1400
  readonly origin: string | null;
1384
1401
  /**
1385
- * The **`lastEventId`** read-only property of the unique ID for the event.
1402
+ * The **`lastEventId`** read-only property of the MessageEvent interface is a string representing a unique ID for the event.
1386
1403
  *
1387
1404
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
1388
1405
  */
1389
1406
  readonly lastEventId: string;
1390
1407
  /**
1391
- * The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
1408
+ * The **`source`** read-only property of the MessageEvent interface is a MessageEventSource (which can be a WindowProxy, MessagePort, or ServiceWorker object) representing the message emitter.
1392
1409
  *
1393
1410
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
1394
1411
  */
1395
1412
  readonly source: MessagePort | null;
1396
1413
  /**
1397
- * The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
1414
+ * The **`ports`** read-only property of the MessageEvent interface is an array of MessagePort objects containing all MessagePort objects sent with the message, in order.
1398
1415
  *
1399
1416
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
1400
1417
  */
1401
1418
  readonly ports: MessagePort[];
1402
1419
  }
1403
1420
  interface MessageEventInit {
1404
- data: ArrayBuffer | string;
1421
+ bubbles?: boolean;
1422
+ cancelable?: boolean;
1423
+ composed?: boolean;
1424
+ data?: any;
1425
+ origin?: string;
1426
+ lastEventId?: string;
1427
+ source?: (MessagePort | null);
1428
+ ports?: MessagePort[];
1405
1429
  }
1406
1430
  /**
1407
- * The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
1431
+ * The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. These events are particularly useful for telemetry and debugging purposes.
1408
1432
  *
1409
1433
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
1410
1434
  */
1411
1435
  declare abstract class PromiseRejectionEvent extends Event {
1412
1436
  /**
1413
- * The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
1437
+ * The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript Promise which was rejected. You can examine the event's PromiseRejectionEvent.reason property to learn why the promise was rejected.
1414
1438
  *
1415
1439
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
1416
1440
  */
1417
1441
  readonly promise: Promise<any>;
1418
1442
  /**
1419
- * The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
1443
+ * The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). This in theory provides information about why the promise was rejected.
1420
1444
  *
1421
1445
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
1422
1446
  */
1423
1447
  readonly reason: any;
1424
1448
  }
1425
1449
  /**
1426
- * The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
1450
+ * The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the fetch(), XMLHttpRequest.send() or navigator.sendBeacon() methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
1427
1451
  *
1428
1452
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
1429
1453
  */
1430
1454
  declare class FormData {
1431
1455
  constructor();
1432
1456
  /**
1433
- * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
1457
+ * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
1434
1458
  *
1435
1459
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
1436
1460
  */
1437
1461
  append(name: string, value: string | Blob): void;
1438
1462
  /**
1439
- * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
1463
+ * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
1440
1464
  *
1441
1465
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
1442
1466
  */
1443
1467
  append(name: string, value: string): void;
1444
1468
  /**
1445
- * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
1469
+ * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
1446
1470
  *
1447
1471
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
1448
1472
  */
1449
1473
  append(name: string, value: Blob, filename?: string): void;
1450
1474
  /**
1451
- * The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
1475
+ * The **`delete()`** method of the FormData interface deletes a key and its value(s) from a FormData object.
1452
1476
  *
1453
1477
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
1454
1478
  */
1455
1479
  delete(name: string): void;
1456
1480
  /**
1457
- * The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
1481
+ * The **`get()`** method of the FormData interface returns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use the getAll() method instead.
1458
1482
  *
1459
1483
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
1460
1484
  */
1461
1485
  get(name: string): (File | string) | null;
1462
1486
  /**
1463
- * The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
1487
+ * The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a FormData object.
1464
1488
  *
1465
1489
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
1466
1490
  */
1467
1491
  getAll(name: string): (File | string)[];
1468
1492
  /**
1469
- * The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
1493
+ * The **`has()`** method of the FormData interface returns whether a FormData object contains a certain key.
1470
1494
  *
1471
1495
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
1472
1496
  */
1473
1497
  has(name: string): boolean;
1474
1498
  /**
1475
- * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
1499
+ * The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
1476
1500
  *
1477
1501
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
1478
1502
  */
1479
1503
  set(name: string, value: string | Blob): void;
1480
1504
  /**
1481
- * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
1505
+ * The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
1482
1506
  *
1483
1507
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
1484
1508
  */
1485
1509
  set(name: string, value: string): void;
1486
1510
  /**
1487
- * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
1511
+ * The **`set()`** method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
1488
1512
  *
1489
1513
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
1490
1514
  */
1491
1515
  set(name: string, value: Blob, filename?: string): void;
1492
- /* Returns an array of key, value pairs for every entry in the list. */
1493
1516
  entries(): IterableIterator<[
1494
1517
  key: string,
1495
1518
  value: File | string
1496
1519
  ]>;
1497
- /* Returns a list of keys in the list. */
1498
1520
  keys(): IterableIterator<string>;
1499
- /* Returns a list of values in the list. */
1500
1521
  values(): IterableIterator<(File | string)>;
1501
1522
  forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
1502
1523
  [Symbol.iterator](): IterableIterator<[
@@ -1575,19 +1596,19 @@ interface DocumentEnd {
1575
1596
  append(content: string, options?: ContentOptions): DocumentEnd;
1576
1597
  }
1577
1598
  /**
1578
- * This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
1599
+ * This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.
1579
1600
  *
1580
1601
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
1581
1602
  */
1582
1603
  declare abstract class FetchEvent extends ExtendableEvent {
1583
1604
  /**
1584
- * The **`request`** read-only property of the the event handler.
1605
+ * The **`request`** read-only property of the FetchEvent interface returns the Request that triggered the event handler.
1585
1606
  *
1586
1607
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
1587
1608
  */
1588
1609
  readonly request: Request;
1589
1610
  /**
1590
- * The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
1611
+ * The **`respondWith()`** method of FetchEvent prevents the browser's default fetch handling, and allows you to provide a promise for a Response yourself.
1591
1612
  *
1592
1613
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
1593
1614
  */
@@ -1596,58 +1617,55 @@ declare abstract class FetchEvent extends ExtendableEvent {
1596
1617
  }
1597
1618
  type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
1598
1619
  /**
1599
- * The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
1620
+ * The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
1600
1621
  *
1601
1622
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
1602
1623
  */
1603
1624
  declare class Headers {
1604
1625
  constructor(init?: HeadersInit);
1605
1626
  /**
1606
- * The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
1627
+ * The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.
1607
1628
  *
1608
1629
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
1609
1630
  */
1610
1631
  get(name: string): string | null;
1611
1632
  getAll(name: string): string[];
1612
1633
  /**
1613
- * The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
1634
+ * The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. This allows Headers objects to handle having multiple Set-Cookie headers, which wasn't possible prior to its implementation.
1614
1635
  *
1615
1636
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
1616
1637
  */
1617
1638
  getSetCookie(): string[];
1618
1639
  /**
1619
- * The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
1640
+ * The **`has()`** method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.
1620
1641
  *
1621
1642
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
1622
1643
  */
1623
1644
  has(name: string): boolean;
1624
1645
  /**
1625
- * The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
1646
+ * The **`set()`** method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.
1626
1647
  *
1627
1648
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
1628
1649
  */
1629
1650
  set(name: string, value: string): void;
1630
1651
  /**
1631
- * The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
1652
+ * The **`append()`** method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.
1632
1653
  *
1633
1654
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
1634
1655
  */
1635
1656
  append(name: string, value: string): void;
1636
1657
  /**
1637
- * The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
1658
+ * The **`delete()`** method of the Headers interface deletes a header from the current Headers object.
1638
1659
  *
1639
1660
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
1640
1661
  */
1641
1662
  delete(name: string): void;
1642
1663
  forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
1643
- /* Returns an iterator allowing to go through all key/value pairs contained in this object. */
1644
1664
  entries(): IterableIterator<[
1645
1665
  key: string,
1646
1666
  value: string
1647
1667
  ]>;
1648
- /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1649
1668
  keys(): IterableIterator<string>;
1650
- /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1651
1669
  values(): IterableIterator<string>;
1652
1670
  [Symbol.iterator](): IterableIterator<[
1653
1671
  key: string,
@@ -1710,7 +1728,7 @@ interface Response extends Body {
1710
1728
  */
1711
1729
  statusText: string;
1712
1730
  /**
1713
- * The **`headers`** read-only property of the with the response.
1731
+ * The **`headers`** read-only property of the Response interface contains the Headers object associated with the response.
1714
1732
  *
1715
1733
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
1716
1734
  */
@@ -1728,7 +1746,7 @@ interface Response extends Body {
1728
1746
  */
1729
1747
  redirected: boolean;
1730
1748
  /**
1731
- * The **`url`** read-only property of the Response interface contains the URL of the response.
1749
+ * The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.
1732
1750
  *
1733
1751
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
1734
1752
  */
@@ -1736,7 +1754,7 @@ interface Response extends Body {
1736
1754
  webSocket: WebSocket | null;
1737
1755
  cf: any | undefined;
1738
1756
  /**
1739
- * The **`type`** read-only property of the Response interface contains the type of the response.
1757
+ * The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers.
1740
1758
  *
1741
1759
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
1742
1760
  */
@@ -1767,13 +1785,13 @@ declare var Request: {
1767
1785
  */
1768
1786
  interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
1769
1787
  /**
1770
- * The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
1788
+ * The **`clone()`** method of the Request interface creates a copy of the current Request object.
1771
1789
  *
1772
1790
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
1773
1791
  */
1774
1792
  clone(): Request<CfHostMetadata, Cf>;
1775
1793
  /**
1776
- * The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
1794
+ * The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.)
1777
1795
  *
1778
1796
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1779
1797
  */
@@ -1785,7 +1803,7 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
1785
1803
  */
1786
1804
  url: string;
1787
1805
  /**
1788
- * The **`headers`** read-only property of the with the request.
1806
+ * The **`headers`** read-only property of the Request interface contains the Headers object associated with the request.
1789
1807
  *
1790
1808
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1791
1809
  */
@@ -1811,13 +1829,13 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
1811
1829
  */
1812
1830
  integrity: string;
1813
1831
  /**
1814
- * The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
1832
+ * The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
1815
1833
  *
1816
1834
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1817
1835
  */
1818
1836
  keepalive: boolean;
1819
1837
  /**
1820
- * The **`cache`** read-only property of the Request interface contains the cache mode of the request.
1838
+ * The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.
1821
1839
  *
1822
1840
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1823
1841
  */
@@ -2206,7 +2224,7 @@ type ReadableStreamReadResult<R = any> = {
2206
2224
  value?: undefined;
2207
2225
  };
2208
2226
  /**
2209
- * The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
2227
+ * The **`ReadableStream`** interface of the Streams API 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.
2210
2228
  *
2211
2229
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
2212
2230
  */
@@ -2224,13 +2242,13 @@ interface ReadableStream<R = any> {
2224
2242
  */
2225
2243
  cancel(reason?: any): Promise<void>;
2226
2244
  /**
2227
- * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
2245
+ * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
2228
2246
  *
2229
2247
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
2230
2248
  */
2231
2249
  getReader(): ReadableStreamDefaultReader<R>;
2232
2250
  /**
2233
- * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
2251
+ * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released.
2234
2252
  *
2235
2253
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
2236
2254
  */
@@ -2242,13 +2260,13 @@ interface ReadableStream<R = any> {
2242
2260
  */
2243
2261
  pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
2244
2262
  /**
2245
- * The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
2263
+ * The **`pipeTo()`** method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
2246
2264
  *
2247
2265
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
2248
2266
  */
2249
2267
  pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
2250
2268
  /**
2251
- * The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
2269
+ * The **`tee()`** method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.
2252
2270
  *
2253
2271
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
2254
2272
  */
@@ -2260,7 +2278,7 @@ interface ReadableStream<R = any> {
2260
2278
  [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
2261
2279
  }
2262
2280
  /**
2263
- * The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
2281
+ * The **`ReadableStream`** interface of the Streams API 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.
2264
2282
  *
2265
2283
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
2266
2284
  */
@@ -2292,7 +2310,7 @@ declare class ReadableStreamDefaultReader<R = any> {
2292
2310
  releaseLock(): void;
2293
2311
  }
2294
2312
  /**
2295
- * The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
2313
+ * The **`ReadableStreamBYOBReader`** interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. It is used for efficient copying from underlying sources where the data is delivered as an "anonymous" sequence of bytes, such as files.
2296
2314
  *
2297
2315
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
2298
2316
  */
@@ -2301,13 +2319,13 @@ declare class ReadableStreamBYOBReader {
2301
2319
  get closed(): Promise<void>;
2302
2320
  cancel(reason?: any): Promise<void>;
2303
2321
  /**
2304
- * The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
2322
+ * The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source.
2305
2323
  *
2306
2324
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
2307
2325
  */
2308
2326
  read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
2309
2327
  /**
2310
- * The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
2328
+ * The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. After the lock is released, the reader is no longer active.
2311
2329
  *
2312
2330
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
2313
2331
  */
@@ -2326,7 +2344,7 @@ interface ReadableStreamGetReaderOptions {
2326
2344
  mode: "byob";
2327
2345
  }
2328
2346
  /**
2329
- * The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
2347
+ * The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a "pull request" for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
2330
2348
  *
2331
2349
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
2332
2350
  */
@@ -2352,13 +2370,13 @@ declare abstract class ReadableStreamBYOBRequest {
2352
2370
  get atLeast(): number | null;
2353
2371
  }
2354
2372
  /**
2355
- * The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
2373
+ * The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams.
2356
2374
  *
2357
2375
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
2358
2376
  */
2359
2377
  declare abstract class ReadableStreamDefaultController<R = any> {
2360
2378
  /**
2361
- * The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
2379
+ * The **`desiredSize`** read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.
2362
2380
  *
2363
2381
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
2364
2382
  */
@@ -2370,32 +2388,32 @@ declare abstract class ReadableStreamDefaultController<R = any> {
2370
2388
  */
2371
2389
  close(): void;
2372
2390
  /**
2373
- * The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
2391
+ * The **`enqueue()`** method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.
2374
2392
  *
2375
2393
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
2376
2394
  */
2377
2395
  enqueue(chunk?: R): void;
2378
2396
  /**
2379
- * The **`error()`** method of the with the associated stream to error.
2397
+ * The **`error()`** method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.
2380
2398
  *
2381
2399
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
2382
2400
  */
2383
2401
  error(reason: any): void;
2384
2402
  }
2385
2403
  /**
2386
- * The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
2404
+ * The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. It allows control of the state and internal queue of a ReadableStream with an underlying byte source, and enables efficient zero-copy transfer of data from the underlying source to a consumer when the stream's internal queue is empty.
2387
2405
  *
2388
2406
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
2389
2407
  */
2390
2408
  declare abstract class ReadableByteStreamController {
2391
2409
  /**
2392
- * The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
2410
+ * The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.
2393
2411
  *
2394
2412
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
2395
2413
  */
2396
2414
  get byobRequest(): ReadableStreamBYOBRequest | null;
2397
2415
  /**
2398
- * The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
2416
+ * The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its "desired size".
2399
2417
  *
2400
2418
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
2401
2419
  */
@@ -2407,7 +2425,7 @@ declare abstract class ReadableByteStreamController {
2407
2425
  */
2408
2426
  close(): void;
2409
2427
  /**
2410
- * The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
2428
+ * The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is transferred into the stream's internal queues).
2411
2429
  *
2412
2430
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
2413
2431
  */
@@ -2420,7 +2438,7 @@ declare abstract class ReadableByteStreamController {
2420
2438
  error(reason: any): void;
2421
2439
  }
2422
2440
  /**
2423
- * The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
2441
+ * The **`WritableStreamDefaultController`** interface of the Streams API 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.
2424
2442
  *
2425
2443
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
2426
2444
  */
@@ -2432,7 +2450,7 @@ declare abstract class WritableStreamDefaultController {
2432
2450
  */
2433
2451
  get signal(): AbortSignal;
2434
2452
  /**
2435
- * The **`error()`** method of the with the associated stream to error.
2453
+ * The **`error()`** method of the WritableStreamDefaultController interface causes any future interactions with the associated stream to error.
2436
2454
  *
2437
2455
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
2438
2456
  */
@@ -2457,7 +2475,7 @@ declare abstract class TransformStreamDefaultController<O = any> {
2457
2475
  */
2458
2476
  enqueue(chunk?: O): void;
2459
2477
  /**
2460
- * The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
2478
+ * The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
2461
2479
  *
2462
2480
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
2463
2481
  */
@@ -2479,14 +2497,14 @@ interface ReadableWritablePair<R = any, W = any> {
2479
2497
  writable: WritableStream<W>;
2480
2498
  }
2481
2499
  /**
2482
- * The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
2500
+ * The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
2483
2501
  *
2484
2502
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
2485
2503
  */
2486
2504
  declare class WritableStream<W = any> {
2487
2505
  constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
2488
2506
  /**
2489
- * The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
2507
+ * The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
2490
2508
  *
2491
2509
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
2492
2510
  */
@@ -2498,83 +2516,83 @@ declare class WritableStream<W = any> {
2498
2516
  */
2499
2517
  abort(reason?: any): Promise<void>;
2500
2518
  /**
2501
- * The **`close()`** method of the WritableStream interface closes the associated stream.
2519
+ * The **`close()`** method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.
2502
2520
  *
2503
2521
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
2504
2522
  */
2505
2523
  close(): Promise<void>;
2506
2524
  /**
2507
- * The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
2525
+ * The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released.
2508
2526
  *
2509
2527
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
2510
2528
  */
2511
2529
  getWriter(): WritableStreamDefaultWriter<W>;
2512
2530
  }
2513
2531
  /**
2514
- * The **`WritableStreamDefaultWriter`** interface of the Streams API is the object returned by WritableStream.getWriter() and once created locks the writer to the `WritableStream` ensuring that no other streams can write to the underlying sink.
2532
+ * The **`WritableStreamDefaultWriter`** interface of the Streams API is the object returned by WritableStream.getWriter() and once created locks the writer to the WritableStream ensuring that no other streams can write to the underlying sink.
2515
2533
  *
2516
2534
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
2517
2535
  */
2518
2536
  declare class WritableStreamDefaultWriter<W = any> {
2519
2537
  constructor(stream: WritableStream);
2520
2538
  /**
2521
- * The **`closed`** read-only property of the the stream errors or the writer's lock is released.
2539
+ * The **`closed`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that fulfills if the stream becomes closed, or rejects if the stream errors or the writer's lock is released.
2522
2540
  *
2523
2541
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
2524
2542
  */
2525
2543
  get closed(): Promise<void>;
2526
2544
  /**
2527
- * The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
2545
+ * The **`ready`** read-only property of the WritableStreamDefaultWriter interface returns a Promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
2528
2546
  *
2529
2547
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
2530
2548
  */
2531
2549
  get ready(): Promise<void>;
2532
2550
  /**
2533
- * The **`desiredSize`** read-only property of the to fill the stream's internal queue.
2551
+ * The **`desiredSize`** read-only property of the WritableStreamDefaultWriter interface returns the desired size required to fill the stream's internal queue.
2534
2552
  *
2535
2553
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
2536
2554
  */
2537
2555
  get desiredSize(): number | null;
2538
2556
  /**
2539
- * The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
2557
+ * The **`abort()`** method of the WritableStreamDefaultWriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
2540
2558
  *
2541
2559
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
2542
2560
  */
2543
2561
  abort(reason?: any): Promise<void>;
2544
2562
  /**
2545
- * The **`close()`** method of the stream.
2563
+ * The **`close()`** method of the WritableStreamDefaultWriter interface closes the associated writable stream.
2546
2564
  *
2547
2565
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
2548
2566
  */
2549
2567
  close(): Promise<void>;
2550
2568
  /**
2551
- * The **`write()`** method of the operation.
2569
+ * The **`write()`** method of the WritableStreamDefaultWriter interface writes a passed chunk of data to a WritableStream and its underlying sink, then returns a Promise that resolves to indicate the success or failure of the write operation.
2552
2570
  *
2553
2571
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
2554
2572
  */
2555
2573
  write(chunk?: W): Promise<void>;
2556
2574
  /**
2557
- * The **`releaseLock()`** method of the corresponding stream.
2575
+ * The **`releaseLock()`** method of the WritableStreamDefaultWriter interface releases the writer's lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
2558
2576
  *
2559
2577
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
2560
2578
  */
2561
2579
  releaseLock(): void;
2562
2580
  }
2563
2581
  /**
2564
- * The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
2582
+ * The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain transform stream concept.
2565
2583
  *
2566
2584
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
2567
2585
  */
2568
2586
  declare class TransformStream<I = any, O = any> {
2569
2587
  constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
2570
2588
  /**
2571
- * The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
2589
+ * The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data.
2572
2590
  *
2573
2591
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
2574
2592
  */
2575
2593
  get readable(): ReadableStream<O>;
2576
2594
  /**
2577
- * The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
2595
+ * The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream.
2578
2596
  *
2579
2597
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
2580
2598
  */
@@ -2593,7 +2611,7 @@ interface ReadableStreamValuesOptions {
2593
2611
  preventCancel?: boolean;
2594
2612
  }
2595
2613
  /**
2596
- * The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
2614
+ * The **`CompressionStream`** interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
2597
2615
  *
2598
2616
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
2599
2617
  */
@@ -2601,7 +2619,7 @@ declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBuffe
2601
2619
  constructor(format: "gzip" | "deflate" | "deflate-raw");
2602
2620
  }
2603
2621
  /**
2604
- * The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
2622
+ * The **`DecompressionStream`** interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
2605
2623
  *
2606
2624
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
2607
2625
  */
@@ -2609,7 +2627,7 @@ declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBuf
2609
2627
  constructor(format: "gzip" | "deflate" | "deflate-raw");
2610
2628
  }
2611
2629
  /**
2612
- * The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
2630
+ * The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
2613
2631
  *
2614
2632
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
2615
2633
  */
@@ -2618,7 +2636,7 @@ declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
2618
2636
  get encoding(): string;
2619
2637
  }
2620
2638
  /**
2621
- * The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
2639
+ * The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings. It is the streaming equivalent of TextDecoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
2622
2640
  *
2623
2641
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
2624
2642
  */
@@ -2767,6 +2785,12 @@ interface TraceLog {
2767
2785
  readonly timestamp: number;
2768
2786
  readonly level: string;
2769
2787
  readonly message: any;
2788
+ readonly errorInfo?: (TraceLogErrorInfo | null)[];
2789
+ }
2790
+ interface TraceLogErrorInfo {
2791
+ name: string;
2792
+ message: string;
2793
+ stack?: string;
2770
2794
  }
2771
2795
  interface TraceException {
2772
2796
  readonly timestamp: number;
@@ -2787,7 +2811,7 @@ interface UnsafeTraceMetrics {
2787
2811
  fromTrace(item: TraceItem): TraceMetrics;
2788
2812
  }
2789
2813
  /**
2790
- * The **`URL`** interface is used to parse, construct, normalize, and encode URL.
2814
+ * The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
2791
2815
  *
2792
2816
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
2793
2817
  */
@@ -2812,121 +2836,121 @@ declare class URL {
2812
2836
  */
2813
2837
  set href(value: string);
2814
2838
  /**
2815
- * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
2839
+ * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
2816
2840
  *
2817
2841
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
2818
2842
  */
2819
2843
  get protocol(): string;
2820
2844
  /**
2821
- * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
2845
+ * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
2822
2846
  *
2823
2847
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
2824
2848
  */
2825
2849
  set protocol(value: string);
2826
2850
  /**
2827
- * The **`username`** property of the URL interface is a string containing the username component of the URL.
2851
+ * The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
2828
2852
  *
2829
2853
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
2830
2854
  */
2831
2855
  get username(): string;
2832
2856
  /**
2833
- * The **`username`** property of the URL interface is a string containing the username component of the URL.
2857
+ * The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
2834
2858
  *
2835
2859
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
2836
2860
  */
2837
2861
  set username(value: string);
2838
2862
  /**
2839
- * The **`password`** property of the URL interface is a string containing the password component of the URL.
2863
+ * The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
2840
2864
  *
2841
2865
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
2842
2866
  */
2843
2867
  get password(): string;
2844
2868
  /**
2845
- * The **`password`** property of the URL interface is a string containing the password component of the URL.
2869
+ * The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
2846
2870
  *
2847
2871
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
2848
2872
  */
2849
2873
  set password(value: string);
2850
2874
  /**
2851
- * The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
2875
+ * The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
2852
2876
  *
2853
2877
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
2854
2878
  */
2855
2879
  get host(): string;
2856
2880
  /**
2857
- * The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
2881
+ * The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
2858
2882
  *
2859
2883
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
2860
2884
  */
2861
2885
  set host(value: string);
2862
2886
  /**
2863
- * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
2887
+ * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
2864
2888
  *
2865
2889
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
2866
2890
  */
2867
2891
  get hostname(): string;
2868
2892
  /**
2869
- * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
2893
+ * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
2870
2894
  *
2871
2895
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
2872
2896
  */
2873
2897
  set hostname(value: string);
2874
2898
  /**
2875
- * The **`port`** property of the URL interface is a string containing the port number of the URL.
2899
+ * The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
2876
2900
  *
2877
2901
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
2878
2902
  */
2879
2903
  get port(): string;
2880
2904
  /**
2881
- * The **`port`** property of the URL interface is a string containing the port number of the URL.
2905
+ * The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
2882
2906
  *
2883
2907
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
2884
2908
  */
2885
2909
  set port(value: string);
2886
2910
  /**
2887
- * The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
2911
+ * The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
2888
2912
  *
2889
2913
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
2890
2914
  */
2891
2915
  get pathname(): string;
2892
2916
  /**
2893
- * The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
2917
+ * The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
2894
2918
  *
2895
2919
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
2896
2920
  */
2897
2921
  set pathname(value: string);
2898
2922
  /**
2899
- * The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
2923
+ * The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
2900
2924
  *
2901
2925
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
2902
2926
  */
2903
2927
  get search(): string;
2904
2928
  /**
2905
- * The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
2929
+ * The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
2906
2930
  *
2907
2931
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
2908
2932
  */
2909
2933
  set search(value: string);
2910
2934
  /**
2911
- * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
2935
+ * The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
2912
2936
  *
2913
2937
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
2914
2938
  */
2915
2939
  get hash(): string;
2916
2940
  /**
2917
- * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
2941
+ * The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
2918
2942
  *
2919
2943
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
2920
2944
  */
2921
2945
  set hash(value: string);
2922
2946
  /**
2923
- * The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
2947
+ * The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
2924
2948
  *
2925
2949
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
2926
2950
  */
2927
2951
  get searchParams(): URLSearchParams;
2928
2952
  /**
2929
- * The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
2953
+ * The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
2930
2954
  *
2931
2955
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
2932
2956
  */
@@ -2946,13 +2970,13 @@ declare class URL {
2946
2970
  */
2947
2971
  static parse(url: string, base?: string): URL | null;
2948
2972
  /**
2949
- * The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
2973
+ * The **`createObjectURL()`** static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.
2950
2974
  *
2951
2975
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
2952
2976
  */
2953
2977
  static createObjectURL(object: File | Blob): string;
2954
2978
  /**
2955
- * The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
2979
+ * The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().
2956
2980
  *
2957
2981
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
2958
2982
  */
@@ -3002,25 +3026,22 @@ declare class URLSearchParams {
3002
3026
  */
3003
3027
  has(name: string, value?: string): boolean;
3004
3028
  /**
3005
- * The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
3029
+ * The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.
3006
3030
  *
3007
3031
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
3008
3032
  */
3009
3033
  set(name: string, value: string): void;
3010
3034
  /**
3011
- * The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
3035
+ * The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).
3012
3036
  *
3013
3037
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
3014
3038
  */
3015
3039
  sort(): void;
3016
- /* Returns an array of key, value pairs for every entry in the search params. */
3017
3040
  entries(): IterableIterator<[
3018
3041
  key: string,
3019
3042
  value: string
3020
3043
  ]>;
3021
- /* Returns a list of keys in the search params. */
3022
3044
  keys(): IterableIterator<string>;
3023
- /* Returns a list of values in the search params. */
3024
3045
  values(): IterableIterator<string>;
3025
3046
  forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
3026
3047
  /*function toString() { [native code] }*/
@@ -3030,18 +3051,78 @@ declare class URLSearchParams {
3030
3051
  value: string
3031
3052
  ]>;
3032
3053
  }
3054
+ /**
3055
+ * The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
3056
+ *
3057
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
3058
+ */
3033
3059
  declare class URLPattern {
3034
3060
  constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
3061
+ /**
3062
+ * The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
3063
+ *
3064
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
3065
+ */
3035
3066
  get protocol(): string;
3067
+ /**
3068
+ * The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
3069
+ *
3070
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
3071
+ */
3036
3072
  get username(): string;
3073
+ /**
3074
+ * The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
3075
+ *
3076
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
3077
+ */
3037
3078
  get password(): string;
3079
+ /**
3080
+ * The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
3081
+ *
3082
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
3083
+ */
3038
3084
  get hostname(): string;
3085
+ /**
3086
+ * The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
3087
+ *
3088
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
3089
+ */
3039
3090
  get port(): string;
3091
+ /**
3092
+ * The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
3093
+ *
3094
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
3095
+ */
3040
3096
  get pathname(): string;
3097
+ /**
3098
+ * The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
3099
+ *
3100
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
3101
+ */
3041
3102
  get search(): string;
3103
+ /**
3104
+ * The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
3105
+ *
3106
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
3107
+ */
3042
3108
  get hash(): string;
3109
+ /**
3110
+ * The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
3111
+ *
3112
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
3113
+ */
3043
3114
  get hasRegExpGroups(): boolean;
3115
+ /**
3116
+ * The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
3117
+ *
3118
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
3119
+ */
3044
3120
  test(input?: (string | URLPatternInit), baseURL?: string): boolean;
3121
+ /**
3122
+ * The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
3123
+ *
3124
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
3125
+ */
3045
3126
  exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
3046
3127
  }
3047
3128
  interface URLPatternInit {
@@ -3074,7 +3155,7 @@ interface URLPatternOptions {
3074
3155
  ignoreCase?: boolean;
3075
3156
  }
3076
3157
  /**
3077
- * A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
3158
+ * A **`CloseEvent`** is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
3078
3159
  *
3079
3160
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
3080
3161
  */
@@ -3093,13 +3174,16 @@ declare class CloseEvent extends Event {
3093
3174
  */
3094
3175
  readonly reason: string;
3095
3176
  /**
3096
- * The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
3177
+ * The **`wasClean`** read-only property of the CloseEvent interface returns true if the connection closed cleanly.
3097
3178
  *
3098
3179
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
3099
3180
  */
3100
3181
  readonly wasClean: boolean;
3101
3182
  }
3102
3183
  interface CloseEventInit {
3184
+ bubbles?: boolean;
3185
+ cancelable?: boolean;
3186
+ composed?: boolean;
3103
3187
  code?: number;
3104
3188
  reason?: string;
3105
3189
  wasClean?: boolean;
@@ -3111,7 +3195,7 @@ type WebSocketEventMap = {
3111
3195
  error: ErrorEvent;
3112
3196
  };
3113
3197
  /**
3114
- * The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
3198
+ * The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
3115
3199
  *
3116
3200
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
3117
3201
  */
@@ -3128,20 +3212,20 @@ declare var WebSocket: {
3128
3212
  readonly CLOSED: number;
3129
3213
  };
3130
3214
  /**
3131
- * The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
3215
+ * The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
3132
3216
  *
3133
3217
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
3134
3218
  */
3135
3219
  interface WebSocket extends EventTarget<WebSocketEventMap> {
3136
3220
  accept(options?: WebSocketAcceptOptions): void;
3137
3221
  /**
3138
- * The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
3222
+ * The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
3139
3223
  *
3140
3224
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
3141
3225
  */
3142
3226
  send(message: (ArrayBuffer | ArrayBufferView) | string): void;
3143
3227
  /**
3144
- * The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
3228
+ * The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
3145
3229
  *
3146
3230
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
3147
3231
  */
@@ -3161,13 +3245,13 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
3161
3245
  */
3162
3246
  url: string | null;
3163
3247
  /**
3164
- * The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
3248
+ * The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object, or the empty string if no connection is established.
3165
3249
  *
3166
3250
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
3167
3251
  */
3168
3252
  protocol: string | null;
3169
3253
  /**
3170
- * The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
3254
+ * The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.
3171
3255
  *
3172
3256
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
3173
3257
  */
@@ -3254,25 +3338,25 @@ interface SocketInfo {
3254
3338
  declare class EventSource extends EventTarget {
3255
3339
  constructor(url: string, init?: EventSourceEventSourceInit);
3256
3340
  /**
3257
- * The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
3341
+ * The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).
3258
3342
  *
3259
3343
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3260
3344
  */
3261
3345
  close(): void;
3262
3346
  /**
3263
- * The **`url`** read-only property of the URL of the source.
3347
+ * The **`url`** read-only property of the EventSource interface returns a string representing the URL of the source.
3264
3348
  *
3265
3349
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3266
3350
  */
3267
3351
  get url(): string;
3268
3352
  /**
3269
- * The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
3353
+ * The **`withCredentials`** read-only property of the EventSource interface returns a boolean value indicating whether the EventSource object was instantiated with CORS credentials set.
3270
3354
  *
3271
3355
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3272
3356
  */
3273
3357
  get withCredentials(): boolean;
3274
3358
  /**
3275
- * The **`readyState`** read-only property of the connection.
3359
+ * The **`readyState`** read-only property of the EventSource interface returns a number representing the state of the connection.
3276
3360
  *
3277
3361
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3278
3362
  */
@@ -3307,21 +3391,30 @@ interface ContainerExecOptions {
3307
3391
  cwd?: string;
3308
3392
  env?: Record<string, string>;
3309
3393
  user?: string;
3394
+ signal?: AbortSignal;
3395
+ pty?: boolean | ContainerExecPtyOptions;
3310
3396
  stdin?: ReadableStream | "pipe";
3311
3397
  stdout?: "pipe" | "ignore";
3312
3398
  stderr?: "pipe" | "ignore" | "combined";
3313
3399
  }
3400
+ interface ContainerExecPtyOptions {
3401
+ cols?: number;
3402
+ rows?: number;
3403
+ }
3314
3404
  interface ExecProcess {
3315
3405
  readonly stdin: WritableStream | null;
3316
3406
  readonly stdout: ReadableStream | null;
3317
3407
  readonly stderr: ReadableStream | null;
3318
3408
  readonly pid: number;
3409
+ readonly isPty: boolean;
3319
3410
  readonly exitCode: Promise<number>;
3320
3411
  output(): Promise<ExecOutput>;
3321
3412
  kill(signal?: number): void;
3413
+ resize(cols: number, rows: number): void;
3322
3414
  }
3323
3415
  interface Container {
3324
3416
  get running(): boolean;
3417
+ get images(): Record<string, string>;
3325
3418
  start(options?: ContainerStartupOptions): void;
3326
3419
  monitor(): Promise<void>;
3327
3420
  destroy(error?: any): Promise<void>;
@@ -3330,10 +3423,10 @@ interface Container {
3330
3423
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3331
3424
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3332
3425
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3333
- snapshotDirectory(options: ContainerDirectorySnapshotOptions): Promise<ContainerDirectorySnapshot>;
3334
- snapshotContainer(options: ContainerSnapshotOptions): Promise<ContainerSnapshot>;
3426
+ snapshotContainer(options?: ContainerSnapshotOptions): Promise<ContainerSnapshot>;
3335
3427
  interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3336
3428
  exec(cmd: string[], options?: ContainerExecOptions): Promise<ExecProcess>;
3429
+ inspect(): Promise<ContainerInfo | null>;
3337
3430
  }
3338
3431
  interface ContainerDirectorySnapshot {
3339
3432
  id: string;
@@ -3341,29 +3434,46 @@ interface ContainerDirectorySnapshot {
3341
3434
  dir: string;
3342
3435
  name?: string;
3343
3436
  }
3344
- interface ContainerDirectorySnapshotOptions {
3345
- dir: string;
3346
- name?: string;
3347
- }
3348
- interface ContainerDirectorySnapshotRestoreParams {
3437
+ type ContainerDirectorySnapshotRestoreParams = {
3349
3438
  snapshot: ContainerDirectorySnapshot;
3350
3439
  mountPoint?: string;
3351
- }
3440
+ } | {
3441
+ snapshot?: undefined;
3442
+ mountPoint: string;
3443
+ };
3352
3444
  interface ContainerSnapshot {
3353
3445
  id: string;
3354
3446
  size: number;
3355
3447
  name?: string;
3356
3448
  }
3449
+ interface ContainerSnapshotRestoreParams {
3450
+ id: string;
3451
+ }
3357
3452
  interface ContainerSnapshotOptions {
3358
3453
  name?: string;
3359
3454
  }
3360
- interface ContainerStartupOptions {
3455
+ type ContainerStartupOptions = {
3361
3456
  entrypoint?: string[];
3362
3457
  enableInternet: boolean;
3363
3458
  env?: Record<string, string>;
3459
+ instance?: "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | ContainerStartResources;
3364
3460
  labels?: Record<string, string>;
3365
3461
  directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3366
- containerSnapshot?: ContainerSnapshot;
3462
+ } & ({
3463
+ image: string;
3464
+ containerSnapshot?: never;
3465
+ } | {
3466
+ image?: never;
3467
+ containerSnapshot?: ContainerSnapshotRestoreParams;
3468
+ });
3469
+ interface ContainerInfo {
3470
+ labels: Record<string, string>;
3471
+ image: string;
3472
+ }
3473
+ interface ContainerStartResources {
3474
+ vcpu: number;
3475
+ memoryMib: number;
3476
+ diskMb: number;
3367
3477
  }
3368
3478
  /**
3369
3479
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -3372,19 +3482,19 @@ interface ContainerStartupOptions {
3372
3482
  */
3373
3483
  declare abstract class MessagePort extends EventTarget {
3374
3484
  /**
3375
- * The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
3485
+ * The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
3376
3486
  *
3377
3487
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
3378
3488
  */
3379
3489
  postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
3380
3490
  /**
3381
- * The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
3491
+ * The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
3382
3492
  *
3383
3493
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
3384
3494
  */
3385
3495
  close(): void;
3386
3496
  /**
3387
- * The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
3497
+ * The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
3388
3498
  *
3389
3499
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
3390
3500
  */
@@ -3400,13 +3510,13 @@ declare abstract class MessagePort extends EventTarget {
3400
3510
  declare class MessageChannel {
3401
3511
  constructor();
3402
3512
  /**
3403
- * The **`port1`** read-only property of the the port attached to the context that originated the channel.
3513
+ * The **`port1`** read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
3404
3514
  *
3405
3515
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
3406
3516
  */
3407
3517
  readonly port1: MessagePort;
3408
3518
  /**
3409
- * The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
3519
+ * The **`port2`** read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
3410
3520
  *
3411
3521
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
3412
3522
  */
@@ -3415,7 +3525,7 @@ declare class MessageChannel {
3415
3525
  interface MessagePortPostMessageOptions {
3416
3526
  transfer?: any[];
3417
3527
  }
3418
- type LoopbackForExport<T extends (new (...args: any[]) => Rpc.EntrypointBranded) | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? LoopbackServiceStub<InstanceType<T>> : T extends new (...args: any[]) => Rpc.DurableObjectBranded ? LoopbackDurableObjectClass<InstanceType<T>> : T extends ExportedHandler<any, any, any> ? LoopbackServiceStub<undefined> : undefined;
3528
+ type LoopbackForExport<T extends (new (...args: any[]) => Rpc.EntrypointBranded) | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? LoopbackServiceStub<InstanceType<T>> : T extends new (...args: any[]) => Rpc.DurableObjectBranded ? LoopbackDurableObjectClass<InstanceType<T>> : T extends new (...args: any[]) => CloudflareWorkersModule.WorkflowEntrypoint<any, infer Params> ? Workflow<Params> : T extends ExportedHandler<any, any, any> ? LoopbackServiceStub<undefined> : undefined;
3419
3529
  type LoopbackServiceStub<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T> & (T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props> ? (opts: {
3420
3530
  props?: Props;
3421
3531
  }) => Fetcher<T> : (opts: {
@@ -3466,7 +3576,7 @@ interface WorkerLoaderModule {
3466
3576
  data?: ArrayBuffer;
3467
3577
  json?: any;
3468
3578
  py?: string;
3469
- wasm?: ArrayBuffer;
3579
+ wasm?: ArrayBuffer | ArrayBufferView | WebAssembly.Module;
3470
3580
  }
3471
3581
  interface WorkerLoaderWorkerCode {
3472
3582
  compatibilityDate: string;
@@ -3474,7 +3584,7 @@ interface WorkerLoaderWorkerCode {
3474
3584
  allowExperimental?: boolean;
3475
3585
  limits?: workerdResourceLimits;
3476
3586
  mainModule: string;
3477
- modules: Record<string, WorkerLoaderModule | string>;
3587
+ modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
3478
3588
  env?: any;
3479
3589
  globalOutbound?: (Fetcher | null);
3480
3590
  tails?: Fetcher[];
@@ -3496,7 +3606,7 @@ declare abstract class Performance {
3496
3606
  /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3497
3607
  now(): number;
3498
3608
  /**
3499
- * The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
3609
+ * The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
3500
3610
  *
3501
3611
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
3502
3612
  */
@@ -3505,13 +3615,39 @@ declare abstract class Performance {
3505
3615
  interface Tracing {
3506
3616
  enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
3507
3617
  startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
3618
+ startSpan(name: string): Span;
3619
+ getActiveSpan(): Span | undefined;
3508
3620
  Span: typeof Span;
3509
3621
  }
3510
3622
  declare abstract class Span {
3511
3623
  get isTraced(): boolean;
3512
- setAttribute(key: string, value?: (boolean | number | string)): void;
3624
+ setAttribute(key: string, value: boolean | number | string): this;
3625
+ setAttributes(attributes: Record<string, boolean | number | string | undefined>): this;
3626
+ recordException(exception: string | {
3627
+ code: string | number;
3628
+ name?: string;
3629
+ message?: string;
3630
+ stack?: string;
3631
+ } | {
3632
+ code?: string | number;
3633
+ name: string;
3634
+ message?: string;
3635
+ stack?: string;
3636
+ } | {
3637
+ code?: string | number;
3638
+ name?: string;
3639
+ message: string;
3640
+ stack?: string;
3641
+ }): void;
3642
+ updateName(name: string): this;
3643
+ setStatus(status: TracingSpanStatus): this;
3513
3644
  end(): void;
3514
3645
  }
3646
+ type TracingSpanStatusCode = "unset" | "ok" | "error";
3647
+ interface TracingSpanStatus {
3648
+ code: TracingSpanStatusCode;
3649
+ message?: string;
3650
+ }
3515
3651
  /**
3516
3652
  * Represents the identity of a user authenticated via Cloudflare Access.
3517
3653
  * This matches the result of calling /cdn-cgi/access/get-identity.
@@ -4149,6 +4285,13 @@ type AiSearchListItemsParams = {
4149
4285
  source?: string;
4150
4286
  /** JSON-encoded Vectorize filter for metadata filtering. */
4151
4287
  metadata_filter?: string;
4288
+ /** Filter items by their unique ID. Returns at most one item. */
4289
+ item_id?: string;
4290
+ /**
4291
+ * Filter items by their exact key (object key / filename). Keys are unique
4292
+ * per source, so combine with `source` to disambiguate across data sources.
4293
+ */
4294
+ key?: string;
4152
4295
  };
4153
4296
  type AiSearchListItemsResponse = {
4154
4297
  result: AiSearchItemInfo[];
@@ -5017,8 +5160,13 @@ type WebSearchOptions = {
5017
5160
  search_context_size?: "low" | "medium" | "high";
5018
5161
  user_location?: WebSearchUserLocation;
5019
5162
  };
5163
+ // Source of truth for per-model reasoning types: each model's `reasoning_effort` metadata
5164
+ // in Workers AI ConfigAPI (supported efforts, aliases, defaults, and whether reasoning can
5165
+ // be turned off). The Workers AI SDK type generator (cloudflare/ai/sdk,
5166
+ // apps/worker-constellation-entry/scripts/build-types) turns it into the per-model
5167
+ // `inputs` types below; the developer docs model schemas come from the same metadata.
5020
5168
  type ChatTemplateKwargs = {
5021
- /** Whether to enable reasoning, enabled by default. */
5169
+ /** Whether to enable reasoning. Support and defaults depend on the model. */
5022
5170
  enable_thinking?: boolean;
5023
5171
  /** If false, preserves reasoning context between turns. */
5024
5172
  clear_thinking?: boolean;
@@ -5039,6 +5187,7 @@ type ChatCompletionsCommonOptions = {
5039
5187
  parallel_tool_calls?: boolean;
5040
5188
  prediction?: PredictionContent;
5041
5189
  presence_penalty?: number | null;
5190
+ /** Reasoning effort. Supported levels depend on the model. */
5042
5191
  reasoning_effort?: "low" | "medium" | "high" | null;
5043
5192
  chat_template_kwargs?: ChatTemplateKwargs;
5044
5193
  response_format?: ResponseFormat;
@@ -9054,11 +9203,59 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9054
9203
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9055
9204
  }
9056
9205
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9057
- inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9206
+ inputs: XOR<Omit<ResponsesInput, "reasoning"> & {
9207
+ reasoning?: (Omit<Reasoning, "effort"> & {
9208
+ /**
9209
+ * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.
9210
+ *
9211
+ * @default "medium"
9212
+ */
9213
+ effort?: "low" | "medium" | "high" | null;
9214
+ }) | null;
9215
+ }, Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
9216
+ /**
9217
+ * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.
9218
+ *
9219
+ * @default "medium"
9220
+ */
9221
+ reasoning_effort?: "low" | "medium" | "high" | null;
9222
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
9223
+ /**
9224
+ * Reasoning is always enabled for this model and cannot be disabled.
9225
+ *
9226
+ * @default true
9227
+ */
9228
+ enable_thinking?: true;
9229
+ };
9230
+ }>;
9058
9231
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9059
9232
  }
9060
9233
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9061
- inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9234
+ inputs: XOR<Omit<ResponsesInput, "reasoning"> & {
9235
+ reasoning?: (Omit<Reasoning, "effort"> & {
9236
+ /**
9237
+ * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.
9238
+ *
9239
+ * @default "medium"
9240
+ */
9241
+ effort?: "low" | "medium" | "high" | null;
9242
+ }) | null;
9243
+ }, Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
9244
+ /**
9245
+ * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.
9246
+ *
9247
+ * @default "medium"
9248
+ */
9249
+ reasoning_effort?: "low" | "medium" | "high" | null;
9250
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
9251
+ /**
9252
+ * Reasoning is always enabled for this model and cannot be disabled.
9253
+ *
9254
+ * @default true
9255
+ */
9256
+ enable_thinking?: true;
9257
+ };
9258
+ }>;
9062
9259
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9063
9260
  }
9064
9261
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10027,7 +10224,16 @@ declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B {
10027
10224
  postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Output;
10028
10225
  }
10029
10226
  declare abstract class Base_Ai_Cf_Zai_Org_Glm_4_7_Flash {
10030
- inputs: ChatCompletionsInput;
10227
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10228
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10229
+ /**
10230
+ * Whether to enable reasoning for this model. This model has no reasoning effort levels.
10231
+ *
10232
+ * @default true
10233
+ */
10234
+ enable_thinking?: boolean;
10235
+ };
10236
+ };
10031
10237
  postProcessedOutputs: ChatCompletionsOutput;
10032
10238
  }
10033
10239
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
@@ -10035,132 +10241,499 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10035
10241
  postProcessedOutputs: ChatCompletionsOutput;
10036
10242
  }
10037
10243
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10038
- inputs: ChatCompletionsInput;
10244
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10245
+ /**
10246
+ * Reasoning effort. Supported levels: high, none. Compatibility aliases (accepted by the API, not by these types): low maps to high; medium maps to high; max maps to high.
10247
+ *
10248
+ * @default "high"
10249
+ */
10250
+ reasoning_effort?: "high" | "none" | null;
10251
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10252
+ /**
10253
+ * Whether to enable reasoning for this model.
10254
+ *
10255
+ * @default true
10256
+ */
10257
+ enable_thinking?: boolean;
10258
+ };
10259
+ };
10039
10260
  postProcessedOutputs: ChatCompletionsOutput;
10040
10261
  }
10262
+ type Ai_Cf_Nvidia_Nemotron_3_120B_A12B_Input = Omit<ChatCompletionsInput, "model" | "max_tokens" | "metadata" | "modalities" | "chat_template_kwargs" | "store" | "reasoning_effort"> & {
10263
+ /**
10264
+ * ID of the model to use (for example, '@cf/nvidia/nemotron-3-120b-a12b').
10265
+ */
10266
+ model?: ChatCompletionsInput["model"];
10267
+ /**
10268
+ * The maximum number of tokens to generate.
10269
+ */
10270
+ max_tokens?: ChatCompletionsInput["max_tokens"];
10271
+ /**
10272
+ * Set of key-value pairs that can be attached to the object.
10273
+ */
10274
+ metadata?: ChatCompletionsInput["metadata"];
10275
+ /**
10276
+ * Output types requested from the model.
10277
+ */
10278
+ modalities?: ChatCompletionsInput["modalities"];
10279
+ /**
10280
+ * Nemotron chat-template controls for normal reasoning, low-effort reasoning, and non-reasoning responses.
10281
+ */
10282
+ chat_template_kwargs?: {
10283
+ /**
10284
+ * Whether to enable reasoning. Reasoning is enabled by default.
10285
+ */
10286
+ enable_thinking?: boolean;
10287
+ /**
10288
+ * When reasoning is enabled, use Nemotron's low-effort reasoning mode, which uses significantly fewer reasoning tokens.
10289
+ */
10290
+ low_effort?: boolean;
10291
+ /**
10292
+ * For coding agent use, Nvidia suggests setting force_nonempty_content=true
10293
+ */
10294
+ force_nonempty_content?: boolean;
10295
+ };
10296
+ /**
10297
+ * Whether to store the output for model distillation or evaluation.
10298
+ *
10299
+ * @default false
10300
+ */
10301
+ store?: ChatCompletionsInput["store"];
10302
+ };
10041
10303
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10042
- inputs: ChatCompletionsInput;
10304
+ inputs: Ai_Cf_Nvidia_Nemotron_3_120B_A12B_Input;
10043
10305
  postProcessedOutputs: ChatCompletionsOutput;
10044
10306
  }
10045
- declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10046
- inputs: ChatCompletionsInput;
10307
+ type Ai_Cf_Google_Gemma_4_26B_A4B_It_Input = Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10308
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10309
+ /**
10310
+ * Whether to enable reasoning for this model. This model has no reasoning effort levels.
10311
+ *
10312
+ * @default true
10313
+ */
10314
+ enable_thinking?: boolean;
10315
+ };
10316
+ } & {
10317
+ /**
10318
+ * @default false
10319
+ */
10320
+ skip_special_tokens?: boolean;
10321
+ };
10322
+ declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_It {
10323
+ inputs: Ai_Cf_Google_Gemma_4_26B_A4B_It_Input;
10047
10324
  postProcessedOutputs: ChatCompletionsOutput;
10048
10325
  }
10049
- interface AiModels {
10050
- "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
10051
- "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
10052
- "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
10053
- "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
10054
- "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
10055
- "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
10056
- "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
10057
- "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
10058
- "@cf/microsoft/resnet-50": BaseAiImageClassification;
10059
- "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
10060
- "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
10061
- "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
10062
- "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
10063
- "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
10064
- "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
10065
- "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
10066
- "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
10067
- "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
10068
- "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
10069
- "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
10070
- "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
10071
- "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
10072
- "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
10073
- "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
10074
- "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
10075
- "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
10076
- "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
10077
- "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
10078
- "@cf/microsoft/phi-2": BaseAiTextGeneration;
10079
- "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
10080
- "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
10081
- "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
10082
- "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
10083
- "@hf/google/gemma-7b-it": BaseAiTextGeneration;
10084
- "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
10085
- "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
10086
- "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
10087
- "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
10088
- "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
10089
- "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
10090
- "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
10091
- "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
10092
- "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
10093
- "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
10094
- "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
10095
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
10096
- "@cf/ibm-granite/granite-4.0-h-micro": BaseAiTextGeneration;
10097
- "@cf/facebook/bart-large-cnn": BaseAiSummarization;
10098
- "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
10099
- "@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
10100
- "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
10101
- "@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;
10102
- "@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;
10103
- "@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;
10104
- "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
10105
- "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
10106
- "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
10107
- "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
10108
- "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
10109
- "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
10110
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;
10111
- "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
10112
- "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
10113
- "@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct;
10114
- "@cf/qwen/qwq-32b": Base_Ai_Cf_Qwen_Qwq_32B;
10115
- "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
10116
- "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
10117
- "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
10118
- "@cf/qwen/qwen3-30b-a3b-fp8": Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8;
10119
- "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
10120
- "@cf/qwen/qwen3-embedding-0.6b": Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B;
10121
- "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
10122
- "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
10123
- "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
10124
- "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
10125
- "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
10126
- "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
10127
- "@cf/ai4bharat/indictrans2-en-indic-1B": Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B;
10128
- "@cf/aisingapore/gemma-sea-lion-v4-27b-it": Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It;
10129
- "@cf/pfnet/plamo-embedding-1b": Base_Ai_Cf_Pfnet_Plamo_Embedding_1B;
10130
- "@cf/deepgram/flux": Base_Ai_Cf_Deepgram_Flux;
10131
- "@cf/deepgram/aura-2-en": Base_Ai_Cf_Deepgram_Aura_2_En;
10132
- "@cf/deepgram/aura-2-es": Base_Ai_Cf_Deepgram_Aura_2_Es;
10133
- "@cf/black-forest-labs/flux-2-dev": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Dev;
10134
- "@cf/black-forest-labs/flux-2-klein-4b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B;
10135
- "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10136
- "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10137
- "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10138
- "@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
10139
- "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
10140
- "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
10326
+ /** @deprecated Use Base_Ai_Cf_Google_Gemma_4_26B_A4B_It. */
10327
+ declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT extends Base_Ai_Cf_Google_Gemma_4_26B_A4B_It {
10141
10328
  }
10142
- type AiOptions = {
10329
+ type Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Input = {
10143
10330
  /**
10144
- * Send requests as an asynchronous batch job, only works for supported models
10145
- * https://developers.cloudflare.com/workers-ai/features/batch-api
10146
- */
10147
- queueRequest?: boolean;
10148
- /**
10149
- * Establish websocket connections, only works for supported models
10331
+ * readable stream with audio data and content-type specified for that data
10150
10332
  */
10151
- websocket?: boolean;
10333
+ audio: {
10334
+ body: object;
10335
+ contentType: string;
10336
+ };
10337
+ } | {
10152
10338
  /**
10153
- * Tag your requests to group and view them in Cloudflare dashboard.
10154
- *
10155
- * Rules:
10156
- * Tags must only contain letters, numbers, and the symbols: : - . / @
10157
- * Each tag can have maximum 50 characters.
10158
- * Maximum 5 tags are allowed each request.
10159
- * Duplicate tags will removed.
10339
+ * base64 encoded audio data
10160
10340
  */
10161
- tags?: string[];
10162
- gateway?: GatewayOptions;
10163
- returnRawResponse?: boolean;
10341
+ audio: string;
10342
+ encoding?: "wav" | "flac" | "ogg" | "linear16";
10343
+ sample_rate?: number;
10344
+ channels?: number;
10345
+ };
10346
+ interface Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Output {
10347
+ text?: string;
10348
+ duration?: number;
10349
+ }
10350
+ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B {
10351
+ inputs: Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Input;
10352
+ postProcessedOutputs: Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Output;
10353
+ }
10354
+ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code {
10355
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10356
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10357
+ /**
10358
+ * Reasoning is always enabled for this model and cannot be disabled. This model has no reasoning effort levels.
10359
+ *
10360
+ * @default true
10361
+ */
10362
+ enable_thinking?: true;
10363
+ };
10364
+ };
10365
+ postProcessedOutputs: ChatCompletionsOutput;
10366
+ }
10367
+ declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_2 {
10368
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10369
+ /**
10370
+ * Reasoning effort. Supported levels: max, high, none. Compatibility aliases (accepted by the API, not by these types): low maps to high; medium maps to high; xhigh maps to max; minimal maps to none.
10371
+ *
10372
+ * @default "max"
10373
+ */
10374
+ reasoning_effort?: "max" | "high" | "none" | null;
10375
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10376
+ /**
10377
+ * Whether to enable reasoning for this model.
10378
+ *
10379
+ * @default true
10380
+ */
10381
+ enable_thinking?: boolean;
10382
+ };
10383
+ };
10384
+ postProcessedOutputs: ChatCompletionsOutput;
10385
+ }
10386
+ interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input {
10387
+ /**
10388
+ * Which Moondream skill to run.
10389
+ */
10390
+ task?: "query" | "caption" | "point" | "detect";
10391
+ /**
10392
+ * Input image as a public HTTPS URL or base64 data URI. Optional for `query`; required for `caption`, `point`, and `detect`.
10393
+ */
10394
+ image?: string;
10395
+ /**
10396
+ * Question for the `query` task.
10397
+ */
10398
+ question?: string;
10399
+ /**
10400
+ * Caption length for the `caption` task.
10401
+ */
10402
+ caption_length?: "short" | "normal" | "long";
10403
+ /**
10404
+ * Object phrase to locate for `point` and `detect` tasks (e.g. 'person wearing a red shirt').
10405
+ */
10406
+ target?: string;
10407
+ /**
10408
+ * Enable reasoning trace for the `query` task.
10409
+ */
10410
+ reasoning?: boolean;
10411
+ /**
10412
+ * Sampling temperature.
10413
+ */
10414
+ temperature?: number;
10415
+ /**
10416
+ * Top-p (nucleus) sampling.
10417
+ */
10418
+ top_p?: number;
10419
+ /**
10420
+ * Max tokens to generate for `query` and `caption`.
10421
+ */
10422
+ max_tokens?: number;
10423
+ /**
10424
+ * Max objects to return for `point` and `detect`.
10425
+ */
10426
+ max_objects?: number;
10427
+ /**
10428
+ * Return incremental tokens for `query` and `caption`. `point` and `detect` do not support streaming.
10429
+ */
10430
+ stream?: boolean;
10431
+ }
10432
+ interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output {
10433
+ /**
10434
+ * Reason the generation finished.
10435
+ */
10436
+ finish_reason: string;
10437
+ metrics: {
10438
+ /**
10439
+ * Number of input tokens consumed.
10440
+ */
10441
+ input_tokens: number;
10442
+ /**
10443
+ * Number of output tokens generated.
10444
+ */
10445
+ output_tokens: number;
10446
+ /**
10447
+ * Prefill time in milliseconds.
10448
+ */
10449
+ prefill_time_ms: number;
10450
+ /**
10451
+ * Decode time in milliseconds.
10452
+ */
10453
+ decode_time_ms: number;
10454
+ /**
10455
+ * Time to first token in milliseconds.
10456
+ */
10457
+ ttft_ms: number;
10458
+ };
10459
+ /**
10460
+ * Answer text for the `query` task. Null for other tasks.
10461
+ */
10462
+ answer?: string;
10463
+ /**
10464
+ * Caption text for the `caption` task. Null for other tasks.
10465
+ */
10466
+ caption?: string;
10467
+ /**
10468
+ * Located points for the `point` task. Null for other tasks.
10469
+ */
10470
+ points?: {
10471
+ /**
10472
+ * X coordinate.
10473
+ */
10474
+ x: number;
10475
+ /**
10476
+ * Y coordinate.
10477
+ */
10478
+ y: number;
10479
+ }[];
10480
+ /**
10481
+ * Detected bounding boxes for the `detect` task. Null for other tasks.
10482
+ */
10483
+ objects?: {
10484
+ /**
10485
+ * Minimum X coordinate.
10486
+ */
10487
+ x_min: number;
10488
+ /**
10489
+ * Minimum Y coordinate.
10490
+ */
10491
+ y_min: number;
10492
+ /**
10493
+ * Maximum X coordinate.
10494
+ */
10495
+ x_max: number;
10496
+ /**
10497
+ * Maximum Y coordinate.
10498
+ */
10499
+ y_max: number;
10500
+ }[];
10501
+ /**
10502
+ * Reasoning trace for the `query` task when reasoning=true. Null otherwise.
10503
+ */
10504
+ reasoning?: {
10505
+ /**
10506
+ * Reasoning text.
10507
+ */
10508
+ text: string;
10509
+ /**
10510
+ * Grounding information.
10511
+ */
10512
+ grounding?: {}[];
10513
+ };
10514
+ }
10515
+ declare abstract class Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B {
10516
+ inputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input;
10517
+ postProcessedOutputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output;
10518
+ }
10519
+ declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731 {
10520
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10521
+ /**
10522
+ * Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases (accepted by the API, not by these types): minimal maps to low; medium maps to high; xhigh maps to high.
10523
+ *
10524
+ * @default "high"
10525
+ */
10526
+ reasoning_effort?: "max" | "high" | "low" | "none" | null;
10527
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10528
+ /**
10529
+ * Whether to enable reasoning for this model.
10530
+ *
10531
+ * @default true
10532
+ */
10533
+ enable_thinking?: boolean;
10534
+ };
10535
+ };
10536
+ postProcessedOutputs: ChatCompletionsOutput;
10537
+ }
10538
+ declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813 {
10539
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10540
+ /**
10541
+ * Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases (accepted by the API, not by these types): minimal maps to low; medium maps to high; xhigh maps to high.
10542
+ *
10543
+ * @default "high"
10544
+ */
10545
+ reasoning_effort?: "max" | "high" | "low" | "none" | null;
10546
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10547
+ /**
10548
+ * Whether to enable reasoning for this model.
10549
+ *
10550
+ * @default true
10551
+ */
10552
+ enable_thinking?: boolean;
10553
+ };
10554
+ };
10555
+ postProcessedOutputs: ChatCompletionsOutput;
10556
+ }
10557
+ declare abstract class Base_Ai_Cf_Qwen_Qwen3_8_27B {
10558
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10559
+ /**
10560
+ * Reasoning effort. Supported levels: low, medium, xhigh.
10561
+ *
10562
+ * @default "xhigh"
10563
+ */
10564
+ reasoning_effort?: "low" | "medium" | "xhigh" | null;
10565
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10566
+ /**
10567
+ * Whether to enable reasoning for this model.
10568
+ *
10569
+ * @default true
10570
+ */
10571
+ enable_thinking?: boolean;
10572
+ };
10573
+ };
10574
+ postProcessedOutputs: ChatCompletionsOutput;
10575
+ }
10576
+ declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3 {
10577
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10578
+ /**
10579
+ * Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases (accepted by the API, not by these types): none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.
10580
+ *
10581
+ * @default "max"
10582
+ */
10583
+ reasoning_effort?: "max" | "high" | "low" | null;
10584
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10585
+ /**
10586
+ * Reasoning is always enabled for this model and cannot be disabled.
10587
+ *
10588
+ * @default true
10589
+ */
10590
+ enable_thinking?: true;
10591
+ };
10592
+ };
10593
+ postProcessedOutputs: ChatCompletionsOutput;
10594
+ }
10595
+ declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3_Flash {
10596
+ inputs: Omit<ChatCompletionsInput, "reasoning_effort" | "chat_template_kwargs"> & {
10597
+ /**
10598
+ * Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases (accepted by the API, not by these types): none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.
10599
+ *
10600
+ * @default "max"
10601
+ */
10602
+ reasoning_effort?: "max" | "high" | "low" | null;
10603
+ chat_template_kwargs?: Omit<ChatTemplateKwargs, "enable_thinking"> & {
10604
+ /**
10605
+ * Reasoning is always enabled for this model and cannot be disabled.
10606
+ *
10607
+ * @default true
10608
+ */
10609
+ enable_thinking?: true;
10610
+ };
10611
+ };
10612
+ postProcessedOutputs: ChatCompletionsOutput;
10613
+ }
10614
+ interface AiModels {
10615
+ "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
10616
+ "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
10617
+ "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
10618
+ "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
10619
+ "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
10620
+ "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
10621
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
10622
+ "@cf/microsoft/resnet-50": BaseAiImageClassification;
10623
+ "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
10624
+ "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
10625
+ "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
10626
+ "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
10627
+ "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
10628
+ "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
10629
+ "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
10630
+ "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
10631
+ "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
10632
+ "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
10633
+ "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
10634
+ "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
10635
+ "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
10636
+ "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
10637
+ "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
10638
+ "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
10639
+ "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
10640
+ "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
10641
+ "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
10642
+ "@cf/microsoft/phi-2": BaseAiTextGeneration;
10643
+ "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
10644
+ "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
10645
+ "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
10646
+ "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
10647
+ "@hf/google/gemma-7b-it": BaseAiTextGeneration;
10648
+ "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
10649
+ "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
10650
+ "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
10651
+ "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
10652
+ "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
10653
+ "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
10654
+ "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
10655
+ "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
10656
+ "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
10657
+ "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
10658
+ "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
10659
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
10660
+ "@cf/ibm-granite/granite-4.0-h-micro": BaseAiTextGeneration;
10661
+ "@cf/facebook/bart-large-cnn": BaseAiSummarization;
10662
+ "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
10663
+ "@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
10664
+ "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
10665
+ "@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;
10666
+ "@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;
10667
+ "@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;
10668
+ "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
10669
+ "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
10670
+ "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
10671
+ "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
10672
+ "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
10673
+ "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
10674
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;
10675
+ "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
10676
+ "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
10677
+ "@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct;
10678
+ "@cf/qwen/qwq-32b": Base_Ai_Cf_Qwen_Qwq_32B;
10679
+ "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
10680
+ "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
10681
+ "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
10682
+ "@cf/qwen/qwen3-30b-a3b-fp8": Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8;
10683
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
10684
+ "@cf/qwen/qwen3-embedding-0.6b": Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B;
10685
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
10686
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
10687
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
10688
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
10689
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
10690
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
10691
+ "@cf/ai4bharat/indictrans2-en-indic-1B": Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B;
10692
+ "@cf/aisingapore/gemma-sea-lion-v4-27b-it": Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It;
10693
+ "@cf/pfnet/plamo-embedding-1b": Base_Ai_Cf_Pfnet_Plamo_Embedding_1B;
10694
+ "@cf/deepgram/flux": Base_Ai_Cf_Deepgram_Flux;
10695
+ "@cf/deepgram/aura-2-en": Base_Ai_Cf_Deepgram_Aura_2_En;
10696
+ "@cf/deepgram/aura-2-es": Base_Ai_Cf_Deepgram_Aura_2_Es;
10697
+ "@cf/black-forest-labs/flux-2-dev": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Dev;
10698
+ "@cf/black-forest-labs/flux-2-klein-4b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B;
10699
+ "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10700
+ "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10701
+ "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10702
+ "@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
10703
+ "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
10704
+ "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_It;
10705
+ "@cf/nvidia/nemotron-speech-streaming-en-0.6b": Base_Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B;
10706
+ "@cf/moonshotai/kimi-k2.7-code": Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code;
10707
+ "@cf/zai-org/glm-5.2": Base_Ai_Cf_Zai_Org_Glm_5_2;
10708
+ "@cf/moondream/moondream3.1-9B-A2B": Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B;
10709
+ "@cf/deepseek-ai/deepseek-v4-flash-0731": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731;
10710
+ "@cf/deepseek-ai/deepseek-v4-pro-0813": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813;
10711
+ "@cf/qwen/qwen3.8-27b": Base_Ai_Cf_Qwen_Qwen3_8_27B;
10712
+ "@cf/zai-org/glm-5.3": Base_Ai_Cf_Zai_Org_Glm_5_3;
10713
+ "@cf/zai-org/glm-5.3-flash": Base_Ai_Cf_Zai_Org_Glm_5_3_Flash;
10714
+ }
10715
+ type AiOptions = {
10716
+ /**
10717
+ * Send requests as an asynchronous batch job, only works for supported models
10718
+ * https://developers.cloudflare.com/workers-ai/features/batch-api
10719
+ */
10720
+ queueRequest?: boolean;
10721
+ /**
10722
+ * Establish websocket connections, only works for supported models
10723
+ */
10724
+ websocket?: boolean;
10725
+ /**
10726
+ * Tag your requests to group and view them in Cloudflare dashboard.
10727
+ *
10728
+ * Rules:
10729
+ * Tags must only contain letters, numbers, and the symbols: : - . / @
10730
+ * Each tag can have maximum 50 characters.
10731
+ * Maximum 5 tags are allowed each request.
10732
+ * Duplicate tags will removed.
10733
+ */
10734
+ tags?: string[];
10735
+ gateway?: GatewayOptions;
10736
+ returnRawResponse?: boolean;
10164
10737
  prefix?: string;
10165
10738
  extraHeaders?: object;
10166
10739
  signal?: AbortSignal;
@@ -10200,9 +10773,22 @@ type AiModelListType = Record<string, any>;
10200
10773
  type AiAsyncBatchResponse = {
10201
10774
  request_id: string;
10202
10775
  };
10776
+ type AiWebSearchRequest = {
10777
+ /** AI Gateway configuration used for this request. */
10778
+ gatewayId: string;
10779
+ /** Search query. */
10780
+ query: string;
10781
+ /** Maximum number of results. Defaults to 10 and is capped at 20. */
10782
+ limit?: number;
10783
+ /** Optional BYOK web-search provider configured on the gateway. */
10784
+ provider?: string;
10785
+ /** Optional BYOK key alias. Defaults to `default`. */
10786
+ byokAlias?: string;
10787
+ };
10203
10788
  declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
10204
10789
  aiGatewayLogId: string | null;
10205
10790
  gateway(gatewayId: string): AiGateway;
10791
+ websearch(request: AiWebSearchRequest): Promise<Response>;
10206
10792
  /**
10207
10793
  * @deprecated Use the standalone `ai_search_namespaces` or `ai_search` Workers bindings instead.
10208
10794
  * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
@@ -10346,6 +10932,29 @@ declare abstract class AiGateway {
10346
10932
  }): Promise<Response>;
10347
10933
  getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
10348
10934
  }
10935
+ /** A parameter accepted by an Analytics SQL query. */
10936
+ type AnalyticsSQLParameter = string | number | boolean | null;
10937
+ /** An Analytics SQL query and its optional positional or named parameters. */
10938
+ interface AnalyticsSQLQuery {
10939
+ query: string;
10940
+ params?: readonly AnalyticsSQLParameter[] | Readonly<Record<string, AnalyticsSQLParameter>>;
10941
+ }
10942
+ /** Execution statistics returned by Analytics SQL. */
10943
+ interface AnalyticsSQLStatistics {
10944
+ elapsed_ms: number;
10945
+ rows_read: number;
10946
+ bytes_read: number;
10947
+ }
10948
+ /** The rows and execution statistics returned by an Analytics SQL query. */
10949
+ interface AnalyticsSQLResult<T extends Record<string, unknown> = Record<string, unknown>> {
10950
+ data: T[];
10951
+ rows: number;
10952
+ statistics: AnalyticsSQLStatistics;
10953
+ }
10954
+ /** An Analytics SQL binding. */
10955
+ interface AnalyticsSQLBinding {
10956
+ query<T extends Record<string, unknown> = Record<string, unknown>>(request: AnalyticsSQLQuery): Promise<AnalyticsSQLResult<T>>;
10957
+ }
10349
10958
  // Copyright (c) 2022-2025 Cloudflare, Inc.
10350
10959
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
10351
10960
  // https://opensource.org/licenses/Apache-2.0
@@ -10804,6 +11413,15 @@ interface BrowserRunBaseOptions {
10804
11413
  */
10805
11414
  cacheTTL?: number;
10806
11415
  }
11416
+ /**
11417
+ * Backend selection, mixed into the options of the quick actions that support it.
11418
+ * Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
11419
+ * reject an alternate backend, so they must not accept the field.
11420
+ */
11421
+ interface BrowserRunAlternateBackendOptions {
11422
+ /** Render with an alternate browser backend instead of the default one. */
11423
+ browser?: 'kitesurf';
11424
+ }
10807
11425
  /** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
10808
11426
  type BrowserRunCommonOptions = (BrowserRunBaseOptions & {
10809
11427
  /** URL to navigate to, e.g. `"https://example.com"`. */
@@ -10838,7 +11456,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
10838
11456
  scrollPage?: boolean;
10839
11457
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
10840
11458
  screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
10841
- };
11459
+ } & BrowserRunAlternateBackendOptions;
10842
11460
  type BrowserRunPDFOptions = BrowserRunCommonOptions & {
10843
11461
  /** @see https://pptr.dev/api/puppeteer.pdfoptions */
10844
11462
  pdfOptions?: {
@@ -10874,7 +11492,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
10874
11492
  /** @default 30000 */
10875
11493
  timeout?: number;
10876
11494
  };
10877
- };
11495
+ } & BrowserRunAlternateBackendOptions;
10878
11496
  type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
10879
11497
  /** CSS selectors to scrape. At least one element is required. */
10880
11498
  elements: Array<{
@@ -10887,10 +11505,29 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
10887
11505
  /** When true, exclude links pointing to external domains. @default false */
10888
11506
  excludeExternalLinks?: boolean;
10889
11507
  };
11508
+ type BrowserRunSnapshotFormat = 'content' | 'screenshot' | 'markdown' | 'accessibilityTree';
10890
11509
  type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
11510
+ /** Which representations of the page to return. At least two distinct formats
11511
+ * are required; request a single format from its dedicated action instead.
11512
+ * @default ["content","screenshot"]
11513
+ */
11514
+ formats?: BrowserRunSnapshotFormat[];
10891
11515
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
10892
11516
  screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, 'encoding'>;
10893
11517
  };
11518
+ /** Options for the `accessibilityTree` quick action. */
11519
+ type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
11520
+ /** When true, prune nodes that carry no semantic meaning, such as generic
11521
+ * containers. Defaults to true, or to false when `root` is set so that the
11522
+ * requested subtree is returned as-is.
11523
+ */
11524
+ interestingOnly?: boolean;
11525
+ /** CSS selector limiting the tree to the matching element's subtree.
11526
+ * A selector that matches nothing yields `accessibilityTree: null` with
11527
+ * HTTP 200; a malformed selector is an error.
11528
+ */
11529
+ root?: string;
11530
+ } & BrowserRunAlternateBackendOptions;
10894
11531
  interface BrowserRunJsonBaseOptions {
10895
11532
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
10896
11533
  custom_ai?: Array<{
@@ -10904,7 +11541,7 @@ interface BrowserRunJsonBaseOptions {
10904
11541
  * Options for the `json` quick action.
10905
11542
  * At least one of `prompt` or `response_format` must be provided.
10906
11543
  */
10907
- type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunJsonBaseOptions & ({
11544
+ type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions & BrowserRunJsonBaseOptions & ({
10908
11545
  /** Natural-language prompt describing what data to extract. */
10909
11546
  prompt: string;
10910
11547
  /** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
@@ -10915,14 +11552,80 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions & BrowserRunJsonBaseOptions
10915
11552
  /** Structured output schema for the AI model. @see https://developers.cloudflare.com/workers-ai/json-mode/ */
10916
11553
  response_format: AiTextGenerationResponseFormat;
10917
11554
  });
10918
- type BrowserRunContentOptions = BrowserRunCommonOptions;
10919
- type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
11555
+ type BrowserRunContentOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
11556
+ type BrowserRunMarkdownOptions = BrowserRunCommonOptions & BrowserRunAlternateBackendOptions;
11557
+ type BrowserRunRedirectHop = {
11558
+ /** URL that returned the redirect. */
11559
+ url: string;
11560
+ /** HTTP status of the redirect. */
11561
+ status: number;
11562
+ /** Redirect response headers, including `location`. */
11563
+ headers: Record<string, string>;
11564
+ };
10920
11565
  type BrowserRunResponseMeta = {
10921
11566
  /** HTTP status code of the rendered page */
10922
11567
  status: number;
10923
11568
  /** Page title */
10924
11569
  title: string;
10925
- };
11570
+ /** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
11571
+ headers?: Record<string, string>;
11572
+ /** URL that served the response, after any redirects the browser followed. */
11573
+ finalUrl?: string;
11574
+ /** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
11575
+ redirectChain?: BrowserRunRedirectHop[];
11576
+ };
11577
+ /**
11578
+ * A node in the page's accessibility tree, as exposed to assistive technology.
11579
+ * `role` is the only field always present; the rest are populated when the
11580
+ * underlying element defines them.
11581
+ * @see https://pptr.dev/api/puppeteer.serializedaxnode
11582
+ */
11583
+ interface BrowserRunSerializedAXNode {
11584
+ /** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
11585
+ role: string;
11586
+ /** The `aria-autocomplete` value. */
11587
+ autocomplete?: string;
11588
+ /** Checked state of a checkbox, radio, or menu item. */
11589
+ checked?: boolean | 'mixed';
11590
+ /** Accessible description, typically from `aria-describedby` or `title`. */
11591
+ description?: string;
11592
+ disabled?: boolean;
11593
+ expanded?: boolean;
11594
+ /** Whether the element currently holds keyboard focus. */
11595
+ focused?: boolean;
11596
+ /** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
11597
+ haspopup?: string;
11598
+ /** The `aria-invalid` value. */
11599
+ invalid?: string;
11600
+ /** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
11601
+ keyshortcuts?: string;
11602
+ /** Hierarchical level, e.g. the heading level of an `<h2>`. */
11603
+ level?: number;
11604
+ /** Whether the element is a modal dialog. */
11605
+ modal?: boolean;
11606
+ /** Whether a text input accepts multiple lines. */
11607
+ multiline?: boolean;
11608
+ /** Whether more than one option can be selected. */
11609
+ multiselectable?: boolean;
11610
+ /** Accessible name, e.g. a button's label or an image's alt text. */
11611
+ name?: string;
11612
+ orientation?: string;
11613
+ /** Pressed state of a toggle button. */
11614
+ pressed?: boolean | 'mixed';
11615
+ readonly?: boolean;
11616
+ required?: boolean;
11617
+ /** Author-supplied role description, from `aria-roledescription`. */
11618
+ roledescription?: string;
11619
+ selected?: boolean;
11620
+ /** Current value of an input or range element. */
11621
+ value?: string | number;
11622
+ valuemax?: number;
11623
+ valuemin?: number;
11624
+ /** Human-readable form of `value`, from `aria-valuetext`. */
11625
+ valuetext?: string;
11626
+ /** Child nodes. Absent for leaf nodes. */
11627
+ children?: BrowserRunSerializedAXNode[];
11628
+ }
10926
11629
  /** Success response for `content` action. */
10927
11630
  type BrowserRunContentSuccessResponse = {
10928
11631
  success: true;
@@ -10935,6 +11638,7 @@ type BrowserRunLinksSuccessResponse = {
10935
11638
  success: true;
10936
11639
  /** Extracted links */
10937
11640
  result: string[];
11641
+ meta: BrowserRunResponseMeta;
10938
11642
  };
10939
11643
  /** Success response for `scrape` action. */
10940
11644
  type BrowserRunScrapeSuccessResponse = {
@@ -10965,15 +11669,33 @@ type BrowserRunScrapeSuccessResponse = {
10965
11669
  }>;
10966
11670
  }>;
10967
11671
  }>;
11672
+ meta: BrowserRunResponseMeta;
10968
11673
  };
10969
- /** Success response for `snapshot` action. */
11674
+ /** Success response for `snapshot` action. Each field is present only when the
11675
+ * corresponding entry was requested in `formats`.
11676
+ */
10970
11677
  type BrowserRunSnapshotSuccessResponse = {
10971
11678
  success: true;
10972
11679
  result: {
10973
11680
  /** HTML content of the page. */
10974
- content: string;
11681
+ content?: string;
10975
11682
  /** Base64-encoded screenshot image. */
10976
- screenshot: string;
11683
+ screenshot?: string;
11684
+ /** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
11685
+ * page provides that metadata.
11686
+ */
11687
+ markdown?: string;
11688
+ /** Root of the page's accessibility tree. */
11689
+ accessibilityTree?: BrowserRunSerializedAXNode;
11690
+ };
11691
+ meta: BrowserRunResponseMeta;
11692
+ };
11693
+ /** Success response for `accessibilityTree` action. */
11694
+ type BrowserRunAccessibilityTreeSuccessResponse = {
11695
+ success: true;
11696
+ result: {
11697
+ /** Root of the accessibility tree, or `null` when `root` matched no element. */
11698
+ accessibilityTree: BrowserRunSerializedAXNode | null;
10977
11699
  };
10978
11700
  meta: BrowserRunResponseMeta;
10979
11701
  };
@@ -10982,12 +11704,14 @@ type BrowserRunJsonSuccessResponse = {
10982
11704
  success: true;
10983
11705
  /** JSON data extracted from the page using an AI model */
10984
11706
  result: Record<string, unknown>;
11707
+ meta: BrowserRunResponseMeta;
10985
11708
  };
10986
11709
  /** Success response for `markdown` action. */
10987
11710
  type BrowserRunMarkdownSuccessResponse = {
10988
11711
  success: true;
10989
11712
  /** Extracted markdown content */
10990
11713
  result: string;
11714
+ meta: BrowserRunResponseMeta;
10991
11715
  };
10992
11716
  /** Error response for BrowserRun actions. */
10993
11717
  type BrowserRunErrorResponse = {
@@ -11004,6 +11728,162 @@ type BrowserRunJsonErrorResponse = BrowserRunErrorResponse & {
11004
11728
  /** Raw AI response text for debugging */
11005
11729
  rawAiResponse?: string;
11006
11730
  };
11731
+ /** Session-scoped guardrails applied when acquiring a browser session. */
11732
+ type BrowserRunAcquireGuardrails = {
11733
+ /** Domains that the browser may access. An empty list denies all domains. */
11734
+ allowedDomains?: string[];
11735
+ /** Named domain sets that the browser may access. */
11736
+ allowedDomainSets?: string[];
11737
+ };
11738
+ /** Options for acquiring a new browser session. */
11739
+ type BrowserRunAcquireOptions = {
11740
+ /** Idle session lifetime in milliseconds. */
11741
+ keepAlive?: number;
11742
+ /** Record the browser session. */
11743
+ recording?: boolean;
11744
+ /** Geoegress hint as an ISO-3166 alpha-2 country code. */
11745
+ location?: string;
11746
+ /** Map hostnames to caller-provided Workers that handle outbound requests. */
11747
+ outboundByHost?: Record<string, Fetcher>;
11748
+ /** Session-scoped network guardrails. */
11749
+ guardrails?: BrowserRunAcquireGuardrails;
11750
+ /** Include the session's DevTools targets in the result. */
11751
+ targets?: boolean;
11752
+ /** Lifetime of target live-view URLs in milliseconds. */
11753
+ liveViewUrlExpiresInMs?: number;
11754
+ };
11755
+ /** Metadata returned when a browser session is acquired. */
11756
+ type BrowserRunAcquireResult = {
11757
+ sessionId: string;
11758
+ targets?: BrowserRunDevToolsTarget[];
11759
+ };
11760
+ /** Options for connecting to an already-acquired browser session. */
11761
+ type BrowserRunConnectOptions = {
11762
+ /** Connect to a specific page target instead of the browser-level CDP endpoint. */
11763
+ targetId?: string;
11764
+ };
11765
+ /** Connection capability returned by `connectSession()` and `launch()`. */
11766
+ type BrowserRunConnection = {
11767
+ sessionId: string;
11768
+ /** A session-pinned Fetcher. Use its `fetch()` method for a WebSocket upgrade. */
11769
+ webSocket: Fetcher;
11770
+ targets?: BrowserRunDevToolsTarget[];
11771
+ };
11772
+ /** The UI mode for a live-view link. */
11773
+ type BrowserRunLiveViewMode = 'devtools' | 'tab' | 'full';
11774
+ /** Connection-scoped guardrails applied to a live-view link. */
11775
+ type BrowserRunConnectionGuardrails = {
11776
+ mode: 'readonly';
11777
+ };
11778
+ /** Options for minting a live-view link. */
11779
+ type BrowserRunLiveViewOptions = {
11780
+ mode?: BrowserRunLiveViewMode;
11781
+ targetId?: string;
11782
+ expiresInMs?: number;
11783
+ guardrails?: BrowserRunConnectionGuardrails;
11784
+ };
11785
+ /** Live-view link metadata. */
11786
+ type BrowserRunLiveView = {
11787
+ webSocketDebuggerUrl: string;
11788
+ devtoolsFrontendUrl: string;
11789
+ id: string;
11790
+ options: {
11791
+ mode: BrowserRunLiveViewMode;
11792
+ guardrails?: BrowserRunConnectionGuardrails;
11793
+ };
11794
+ };
11795
+ /** Options for listing active browser sessions. */
11796
+ type BrowserRunListSessionsOptions = {
11797
+ limit?: number;
11798
+ offset?: number;
11799
+ };
11800
+ /** Options for listing session history. */
11801
+ type BrowserRunHistoryOptions = {
11802
+ limit?: number;
11803
+ offset?: number;
11804
+ };
11805
+ /** A browser session returned by the session-management methods. */
11806
+ type BrowserRunSession = {
11807
+ sessionId: string;
11808
+ startTime?: number;
11809
+ endTime?: number;
11810
+ closeReason?: number;
11811
+ closeReasonText?: string;
11812
+ connectionId?: string;
11813
+ connectionStartTime?: number;
11814
+ connectionEndTime?: number;
11815
+ lastUpdated?: number;
11816
+ webSocketDebuggerUrl?: string;
11817
+ devtoolsFrontendUrl?: string;
11818
+ };
11819
+ /** Account browser-session and browser-time limits. */
11820
+ type BrowserRunLimits = {
11821
+ activeSessions: Array<{
11822
+ id: string;
11823
+ }>;
11824
+ maxConcurrentSessions: number;
11825
+ allowedBrowserAcquisitions: number;
11826
+ timeUntilNextAllowedBrowserAcquisition: number;
11827
+ usedBrowserTimeSeconds?: number;
11828
+ };
11829
+ /** A browser target returned by the DevTools JSON methods. */
11830
+ type BrowserRunDevToolsTarget = {
11831
+ id: string;
11832
+ type: string;
11833
+ url: string;
11834
+ title?: string;
11835
+ description?: string;
11836
+ webSocketDebuggerUrl?: string;
11837
+ devtoolsFrontendUrl?: string;
11838
+ };
11839
+ /** Browser and protocol version metadata. */
11840
+ type BrowserRunDevToolsVersion = {
11841
+ Browser: string;
11842
+ 'Protocol-Version': string;
11843
+ 'User-Agent': string;
11844
+ 'V8-Version': string;
11845
+ 'WebKit-Version': string;
11846
+ webSocketDebuggerUrl: string;
11847
+ };
11848
+ /** A DevTools protocol domain. Protocol definitions may gain additional fields over time. */
11849
+ interface BrowserRunDevToolsProtocolDomain extends Record<string, unknown> {
11850
+ domain: string;
11851
+ experimental?: boolean;
11852
+ dependencies?: string[];
11853
+ types?: Array<Record<string, any>>;
11854
+ commands?: Array<Record<string, any>>;
11855
+ events?: Array<Record<string, any>>;
11856
+ }
11857
+ /** The DevTools protocol definition. Additional protocol fields may be returned by Chrome. */
11858
+ interface BrowserRunDevToolsProtocol extends Record<string, any> {
11859
+ domains: BrowserRunDevToolsProtocolDomain[];
11860
+ version?: {
11861
+ major: string;
11862
+ minor: string;
11863
+ };
11864
+ }
11865
+ /** Options shared by DevTools target-listing and target-creation methods. */
11866
+ type BrowserRunTargetOptions = {
11867
+ liveViewUrlExpiresInMs?: number;
11868
+ };
11869
+ /** Result returned by DevTools target activation and close methods. */
11870
+ type BrowserRunTargetActionResult = {
11871
+ message: string;
11872
+ };
11873
+ /** Methods exposed by the nested `devtools` binding target. */
11874
+ type BrowserRunDevtools = {
11875
+ getVersion(sessionId: string): Promise<BrowserRunDevToolsVersion>;
11876
+ getProtocol(sessionId: string): Promise<BrowserRunDevToolsProtocol>;
11877
+ listTargets(sessionId: string, options?: BrowserRunTargetOptions): Promise<BrowserRunDevToolsTarget[]>;
11878
+ getTarget(sessionId: string, targetId: string): Promise<BrowserRunDevToolsTarget>;
11879
+ newTarget(sessionId: string, url?: string, options?: BrowserRunTargetOptions): Promise<BrowserRunDevToolsTarget>;
11880
+ activateTarget(sessionId: string, targetId: string): Promise<BrowserRunTargetActionResult>;
11881
+ closeTarget(sessionId: string, targetId: string): Promise<BrowserRunTargetActionResult>;
11882
+ };
11883
+ /** Result returned when closing a browser session. */
11884
+ type BrowserRunCloseSessionResult = {
11885
+ status: 'closing' | 'closed';
11886
+ };
11007
11887
  /**
11008
11888
  * Browser Run API binding for automating headless browsers.
11009
11889
  * @see https://developers.cloudflare.com/browser-run/
@@ -11097,9 +11977,10 @@ declare abstract class BrowserRun {
11097
11977
  */
11098
11978
  quickAction(action: 'links', options: BrowserRunLinksOptions): Promise<Response>;
11099
11979
  /**
11100
- * Get both the HTML content and a base64-encoded screenshot of a web page.
11980
+ * Get several representations of a web page in one request.
11101
11981
  * @param action - Must be `'snapshot'`.
11102
- * @param options - Snapshot options including screenshot settings (encoding is always base64).
11982
+ * @param options - Snapshot options including the `formats` to return and
11983
+ * screenshot settings (encoding is always base64).
11103
11984
  * @returns A `Response` containing one of:
11104
11985
  *
11105
11986
  * **Success (HTTP 200):**
@@ -11147,6 +12028,46 @@ declare abstract class BrowserRun {
11147
12028
  * - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
11148
12029
  */
11149
12030
  quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
12031
+ /**
12032
+ * Get the accessibility tree of a web page.
12033
+ * @param action - Must be `'accessibilityTree'`.
12034
+ * @param options - Options to scope the tree to a subtree and to control
12035
+ * whether semantically uninteresting nodes are pruned.
12036
+ * @returns A `Response` containing one of:
12037
+ *
12038
+ * **Success (HTTP 200):**
12039
+ * - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
12040
+ * - `result.accessibilityTree` is `null` when `root` matched no element
12041
+ *
12042
+ * **Error:**
12043
+ * - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
12044
+ * - HTTP 422 for a malformed `root` selector
12045
+ * - HTTP 500 with code `2017` or `2018` when the tree could not be built
12046
+ *
12047
+ * **Headers:**
12048
+ * - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
12049
+ */
12050
+ quickAction(action: 'accessibilityTree', options: BrowserRunAccessibilityTreeOptions): Promise<Response>;
12051
+ /** Acquire a new browser session and return its metadata. */
12052
+ acquire(options?: BrowserRunAcquireOptions): Promise<BrowserRunAcquireResult>;
12053
+ /** Acquire a browser session and return a session-pinned WebSocket capability. */
12054
+ launch(options?: BrowserRunAcquireOptions): Promise<BrowserRunConnection>;
12055
+ /** Return a session-pinned WebSocket capability for an existing session. */
12056
+ connectSession(sessionId: string, options?: BrowserRunConnectOptions): Promise<BrowserRunConnection>;
12057
+ /** Mint an authenticated live-view link for a browser session. */
12058
+ getLiveView(sessionId: string, options?: BrowserRunLiveViewOptions): Promise<BrowserRunLiveView>;
12059
+ /** List the caller's active browser sessions. */
12060
+ listSessions(options?: BrowserRunListSessionsOptions): Promise<BrowserRunSession[]>;
12061
+ /** List recent active and closed browser sessions. */
12062
+ history(options?: BrowserRunHistoryOptions): Promise<BrowserRunSession[]>;
12063
+ /** Return the caller's browser-session and browser-time limits. */
12064
+ limits(): Promise<BrowserRunLimits>;
12065
+ /** Return details for one browser session, or `null` when it does not exist. */
12066
+ getSession(sessionId: string): Promise<BrowserRunSession | null>;
12067
+ /** Close a browser session. */
12068
+ closeSession(sessionId: string): Promise<BrowserRunCloseSessionResult>;
12069
+ /** DevTools JSON methods exposed through one nested binding target. */
12070
+ get devtools(): BrowserRunDevtools;
11150
12071
  }
11151
12072
  /**
11152
12073
  * In addition to the properties you can set in the RequestInit dict
@@ -11186,6 +12107,14 @@ interface RequestInitCfProperties extends Record<string, unknown> {
11186
12107
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
11187
12108
  */
11188
12109
  cacheTtlByStatus?: Record<string, number>;
12110
+ /**
12111
+ * Controls whether Cloudflare uses range requests when fetching the response
12112
+ * from the origin.
12113
+ *
12114
+ * - `"on"`: enable origin range requests for this request.
12115
+ * - `"off"`: disable origin range requests for this request.
12116
+ */
12117
+ originRangeRequests?: "on" | "off";
11189
12118
  /** Controls how responses with a `Vary` header are cached for this request. */
11190
12119
  vary?: RequestInitCfPropertiesVary;
11191
12120
  /**
@@ -12437,6 +13366,15 @@ interface Hyperdrive {
12437
13366
  * for your database.
12438
13367
  */
12439
13368
  readonly host: string;
13369
+ /*
13370
+ * A synthetic IPv4 address (in the reserved 240.0.0.0/4 range) that, like the
13371
+ * host field, is only valid within the context of the currently running
13372
+ * Worker and, when passed into the `connect()` function from the
13373
+ * "cloudflare:sockets" module, will connect to the Hyperdrive instance for
13374
+ * your database. This is provided for database drivers that require the host
13375
+ * to be an IP literal rather than a hostname.
13376
+ */
13377
+ readonly ip: string;
12440
13378
  /*
12441
13379
  * The port that must be paired the the host field when connecting.
12442
13380
  */
@@ -12458,6 +13396,78 @@ interface Hyperdrive {
12458
13396
  */
12459
13397
  readonly database: string;
12460
13398
  }
13399
+ /**
13400
+ * A handle to a dynamically-provisioned Hyperdrive connection, returned by
13401
+ * `HyperdriveApi.get()`.
13402
+ */
13403
+ interface HyperdriveDynamic extends Disposable {
13404
+ /**
13405
+ * The database name to use when connecting through this Hyperdrive.
13406
+ */
13407
+ readonly database: Promise<string>;
13408
+ /*
13409
+ * The randomly generated user to use when authenticating to your
13410
+ * database via Hyperdrive.
13411
+ */
13412
+ readonly user: Promise<string>;
13413
+ /*
13414
+ * The randomly generated password to use when authenticating to your
13415
+ * database via Hyperdrive.
13416
+ */
13417
+ readonly password: Promise<string>;
13418
+ /**
13419
+ * Open a TCP socket to the target database through this Hyperdrive.
13420
+ *
13421
+ */
13422
+ connect(): Promise<Socket>;
13423
+ }
13424
+ /**
13425
+ * Binding that provisions Hyperdrive connections at request time, rather than
13426
+ * from static configuration.
13427
+ */
13428
+ interface HyperdriveDynamicApi {
13429
+ /**
13430
+ * Provision a connection for the database described by `args`.
13431
+ *
13432
+ */
13433
+ get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
13434
+ /**
13435
+ * Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
13436
+ */
13437
+ getHyperdriveConnectionString(connectionString: string): Promise<string>;
13438
+ }
13439
+ /**
13440
+ * Parameters identifying the database that a dynamically-provisioned
13441
+ * Hyperdrive connection should target.
13442
+ */
13443
+ interface HyperdriveDynamicConfig {
13444
+ /**
13445
+ * Generated connection string to pass into the dynamic worker.
13446
+ *
13447
+ */
13448
+ dynamicHyperdriveConnectionString: string;
13449
+ /**
13450
+ * Connection string for the origin database Hyperdrive should connect to.
13451
+ * Contains credentials, so treat it as a secret.
13452
+ *
13453
+ * The scheme selects the database engine. PostgreSQL origins are supported.
13454
+ */
13455
+ connectionString: string;
13456
+ /**
13457
+ * Region in which to place the connection pool. See the Hyperdrive
13458
+ * documentation for the set of supported regions.
13459
+ */
13460
+ targetRegion: string;
13461
+ /**
13462
+ * Whether Hyperdrive should cache query results for this connection.
13463
+ */
13464
+ cachingEnabled?: boolean;
13465
+ /**
13466
+ * Maximum number of connections the pool may open to the origin database.
13467
+ * Defaults to 60.
13468
+ */
13469
+ maxConnections?: number;
13470
+ }
12461
13471
  // Copyright (c) 2024 Cloudflare, Inc.
12462
13472
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
12463
13473
  // https://opensource.org/licenses/Apache-2.0
@@ -12469,6 +13479,27 @@ type ImageInfoResponse = {
12469
13479
  width: number;
12470
13480
  height: number;
12471
13481
  };
13482
+ /**
13483
+ * Parameters for rasterizing text into an image.
13484
+ */
13485
+ type TextRasterize = {
13486
+ /** The text content to render */
13487
+ content: string;
13488
+ /** rasterization options for the text **/
13489
+ options: TextOptions;
13490
+ };
13491
+ type TextOptions = {
13492
+ /** Font configuration */
13493
+ font: {
13494
+ /** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
13495
+ url: string;
13496
+ };
13497
+ /** Font size in points (pt) */
13498
+ size?: number;
13499
+ /** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
13500
+ color?: string;
13501
+ };
13502
+ type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
12472
13503
  type ImageTransform = {
12473
13504
  width?: number;
12474
13505
  height?: number;
@@ -12558,6 +13589,9 @@ interface ImageUploadOptions {
12558
13589
  requireSignedURLs?: boolean;
12559
13590
  metadata?: Record<string, unknown>;
12560
13591
  creator?: string;
13592
+ /**
13593
+ * If 'base64', the input data will be decoded from base64 before processing
13594
+ */
12561
13595
  encoding?: 'base64';
12562
13596
  }
12563
13597
  interface ImageUpdateOptions {
@@ -12565,11 +13599,40 @@ interface ImageUpdateOptions {
12565
13599
  metadata?: Record<string, unknown>;
12566
13600
  creator?: string;
12567
13601
  }
13602
+ type ImageMetadataFilterOperators = {
13603
+ eq?: string | number | boolean;
13604
+ in?: string[] | number[];
13605
+ gt?: number;
13606
+ gte?: number;
13607
+ lt?: number;
13608
+ lte?: number;
13609
+ };
13610
+ type ImageMetadataFilterValue = string | number | boolean | ImageMetadataFilterOperators;
13611
+ interface ImageListFilter {
13612
+ metadata?: Record<string, ImageMetadataFilterValue>;
13613
+ }
12568
13614
  interface ImageListOptions {
12569
13615
  limit?: number;
12570
13616
  cursor?: string;
12571
13617
  sortOrder?: 'asc' | 'desc';
12572
13618
  creator?: string;
13619
+ filter?: ImageListFilter;
13620
+ }
13621
+ interface ImageSignedUrlOptions {
13622
+ variant: string;
13623
+ expiresIn?: number;
13624
+ keyName?: string;
13625
+ }
13626
+ interface ImageDirectUploadOptions {
13627
+ id?: string;
13628
+ requireSignedURLs?: boolean;
13629
+ metadata?: Record<string, unknown>;
13630
+ creator?: string;
13631
+ expiresIn?: number;
13632
+ }
13633
+ interface ImageDirectUploadResult {
13634
+ id: string;
13635
+ uploadURL: string;
12573
13636
  }
12574
13637
  interface ImageList {
12575
13638
  images: ImageMetadata[];
@@ -12587,6 +13650,13 @@ interface ImageHandle {
12587
13650
  * @returns ReadableStream of image bytes, or null if not found
12588
13651
  */
12589
13652
  bytes(): Promise<ReadableStream<Uint8Array> | null>;
13653
+ /**
13654
+ * Generate a signed delivery URL for this hosted image.
13655
+ * @param options Signing configuration
13656
+ * @returns A signed image delivery URL
13657
+ * @throws {@link ImagesError} if signing fails
13658
+ */
13659
+ signedUrl(options: ImageSignedUrlOptions): Promise<string>;
12590
13660
  /**
12591
13661
  * Update hosted image metadata
12592
13662
  * @param options Properties to update
@@ -12622,6 +13692,14 @@ interface HostedImagesBinding {
12622
13692
  * @throws {@link ImagesError} if list fails
12623
13693
  */
12624
13694
  list(options?: ImageListOptions): Promise<ImageList>;
13695
+ /**
13696
+ * Create a Direct Creator Upload link, letting an end user upload an
13697
+ * image straight to Cloudflare without exposing an API token
13698
+ * @param options Upload link configuration
13699
+ * @returns The new image ID and the upload URL to hand to the end user
13700
+ * @throws {@link ImagesError} if creation fails
13701
+ */
13702
+ createDirectUpload(options?: ImageDirectUploadOptions): Promise<ImageDirectUploadResult>;
12625
13703
  }
12626
13704
  interface ImagesBinding {
12627
13705
  /**
@@ -12636,6 +13714,13 @@ interface ImagesBinding {
12636
13714
  * @returns A transform handle
12637
13715
  */
12638
13716
  input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
13717
+ /**
13718
+ * Begin applying a series of transformations to text
13719
+ * @param content string to be rendered
13720
+ * @param options font, optional color and size to use in rendering text
13721
+ * @returns A transform handle
13722
+ */
13723
+ text(content: string, options: TextOptions): ImageTransformer;
12639
13724
  /**
12640
13725
  * Access hosted images CRUD operations
12641
13726
  */
@@ -12665,11 +13750,15 @@ interface ImageTransformer {
12665
13750
  type ImageTransformationOutputOptions = {
12666
13751
  encoding?: 'base64';
12667
13752
  };
13753
+ type ImageTransformationResponseOptions = {
13754
+ headers?: HeadersInit;
13755
+ };
12668
13756
  interface ImageTransformationResult {
12669
13757
  /**
12670
13758
  * The image as a response, ready to store in cache or return to users
13759
+ * @param options Options that apply to the returned response, e.g. additional headers
12671
13760
  */
12672
- response(): Response;
13761
+ response(options?: ImageTransformationResponseOptions): Response;
12673
13762
  /**
12674
13763
  * The content type of the returned image
12675
13764
  */
@@ -12801,13 +13890,32 @@ declare module 'cloudflare:node' {
12801
13890
  listen(...args: unknown[]): this;
12802
13891
  address(): {
12803
13892
  port?: number | null | undefined;
12804
- };
13893
+ } | null;
12805
13894
  }
12806
13895
  export function httpServerHandler(port: number): ExportedHandler;
12807
13896
  export function httpServerHandler(options: {
12808
13897
  port: number;
12809
13898
  }): ExportedHandler;
12810
13899
  export function httpServerHandler(server: NodeStyleServer): ExportedHandler;
13900
+ /**
13901
+ * Dispatches a request to the `http.Server` listening on the given port and
13902
+ * resolves with its response. The direct form of `httpServerHandler()`.
13903
+ */
13904
+ export function handleAsNodeRequest(port: number | {
13905
+ port: number;
13906
+ }, request: Request, env?: unknown, ctx?: ExecutionContext): Promise<Response>;
13907
+ /**
13908
+ * Routes inbound sockets to the `net.Server` listening on the port each
13909
+ * socket arrived on.
13910
+ */
13911
+ export function connectHandler(): ExportedHandler;
13912
+ /**
13913
+ * Dispatches an inbound socket to the `net.Server` listening on the port it
13914
+ * arrived on, resolving when the connection has closed. The direct form of
13915
+ * `connectHandler()`, for use inside a `connect()` handler, such as a
13916
+ * Durable Object's.
13917
+ */
13918
+ export function handleAsNodeConnection(socket: Socket, env?: unknown, ctx?: ExecutionContext): Promise<void>;
12811
13919
  }
12812
13920
  type Params<P extends string = any> = Record<P, string | string[]>;
12813
13921
  type EventContext<Env, P extends string, Data> = {
@@ -13086,7 +14194,7 @@ declare namespace CloudflareWorkersModule {
13086
14194
  queue?(batch: MessageBatch): void | Promise<void>;
13087
14195
  scheduled?(controller: ScheduledController): void | Promise<void>;
13088
14196
  tail?(events: TraceItem[]): void | Promise<void>;
13089
- tailStream?(event: TailStream.TailEvent<TailStream.Onset>): TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
14197
+ tailStream?(event: TailStream.TailEvent<TailStream.Onset>): TailStream.TailEventHandlerType | undefined | Promise<TailStream.TailEventHandlerType | undefined>;
13090
14198
  test?(controller: TestController): void | Promise<void>;
13091
14199
  trace?(traces: TraceItem[]): void | Promise<void>;
13092
14200
  }
@@ -13123,6 +14231,26 @@ declare namespace CloudflareWorkersModule {
13123
14231
  timeout?: WorkflowTimeoutDuration | number;
13124
14232
  sensitive?: WorkflowStepSensitivity;
13125
14233
  };
14234
+ // Internal discriminators used only for `WorkflowStep.do` overload
14235
+ // resolution. They mirror `WorkflowStepConfig` but pin `retries.delay` to a
14236
+ // single kind so the callback context can be narrowed based on the shape of
14237
+ // the config argument (rather than on an inferred type parameter, which is
14238
+ // lost when the caller supplies an explicit return-type argument). Not
14239
+ // exported: they must not widen the public type surface.
14240
+ type WorkflowStepConfigWithStaticDelay = Omit<WorkflowStepConfig, 'retries'> & {
14241
+ retries?: {
14242
+ limit: number;
14243
+ delay: WorkflowDelayDuration | number;
14244
+ backoff?: WorkflowBackoff;
14245
+ };
14246
+ };
14247
+ type WorkflowStepConfigWithDelayFunction = Omit<WorkflowStepConfig, 'retries'> & {
14248
+ retries: {
14249
+ limit: number;
14250
+ delay: WorkflowDelayFunction;
14251
+ backoff?: WorkflowBackoff;
14252
+ };
14253
+ };
13126
14254
  export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
13127
14255
  export type WorkflowCronSchedule = {
13128
14256
  /** Cron expression that triggered this event. */
@@ -13160,23 +14288,35 @@ declare namespace CloudflareWorkersModule {
13160
14288
  sensitive?: WorkflowStepSensitivity;
13161
14289
  };
13162
14290
  };
13163
- export type WorkflowRollbackContext<T = unknown> = {
13164
- ctx: WorkflowStepContext;
14291
+ // The rollback handler receives the step context, so it mirrors the same
14292
+ // delay discriminant as the step callback: when the step was configured with
14293
+ // a dynamic delay function the resolved `config.retries.delay` is omitted,
14294
+ // otherwise it is present. `Delay` is threaded from the `WorkflowStep.do`
14295
+ // overload that matched the step config.
14296
+ export type WorkflowRollbackContext<T = unknown, Delay = WorkflowDelayDuration | number> = {
14297
+ ctx: WorkflowStepContext<Delay>;
13165
14298
  error: Error;
13166
14299
  output: T | undefined;
13167
14300
  /** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
13168
14301
  stepName: string;
13169
14302
  };
13170
- export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
13171
- export type WorkflowStepRollbackOptions<T = unknown> = {
13172
- rollback: WorkflowRollbackHandler<T>;
14303
+ export type WorkflowRollbackHandler<T = unknown, Delay = WorkflowDelayDuration | number> = (ctx: WorkflowRollbackContext<T, Delay>) => Promise<void>;
14304
+ export type WorkflowStepRollbackOptions<T = unknown, Delay = WorkflowDelayDuration | number> = {
14305
+ rollback: WorkflowRollbackHandler<T, Delay>;
13173
14306
  rollbackConfig?: WorkflowStepRollbackConfig;
13174
14307
  };
13175
14308
  export abstract class WorkflowStep {
13176
14309
  do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
13177
- do<T extends Rpc.Serializable<T>, const C extends WorkflowStepConfig>(name: string, config: C, callback: (ctx: WorkflowStepContext<C['retries'] extends {
13178
- delay: infer D;
13179
- } ? D : WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
14310
+ // The config overloads discriminate on the shape of `config.retries.delay`
14311
+ // so the callback context reflects whether the resolved delay is present
14312
+ // (static delay) or omitted (dynamic delay function). Each has a single
14313
+ // type parameter, so an explicit return-type argument (`do<T>(...)`) still
14314
+ // resolves here. ORDERING IS LOAD-BEARING: the broad `WorkflowStepConfig`
14315
+ // fallback MUST remain last, otherwise it shadows the discriminating
14316
+ // overloads and narrowing is silently lost.
14317
+ do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithDelayFunction, callback: (ctx: WorkflowStepContext<WorkflowDelayFunction>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayFunction>): Promise<T>;
14318
+ do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfigWithStaticDelay, callback: (ctx: WorkflowStepContext<WorkflowDelayDuration | number>) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T, WorkflowDelayDuration | number>): Promise<T>;
14319
+ do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
13180
14320
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
13181
14321
  sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
13182
14322
  waitForEvent<T extends Rpc.Serializable<T>>(name: string, options: {
@@ -13951,11 +15091,12 @@ type MarkdownDocument = {
13951
15091
  name: string;
13952
15092
  blob: Blob;
13953
15093
  };
15094
+ type OutputFormat = 'markdown' | 'text';
13954
15095
  type ConversionResponse = {
13955
15096
  id: string;
13956
15097
  name: string;
13957
15098
  mimeType: string;
13958
- format: 'markdown';
15099
+ format: OutputFormat;
13959
15100
  tokens: number;
13960
15101
  data: string;
13961
15102
  } | {
@@ -13972,7 +15113,11 @@ type EmbeddedImageConversionOptions = ImageConversionOptions & {
13972
15113
  convert?: boolean;
13973
15114
  maxConvertedImages?: number;
13974
15115
  };
15116
+ type ConversionOutputOptions = {
15117
+ format?: OutputFormat;
15118
+ };
13975
15119
  type ConversionOptions = {
15120
+ output?: ConversionOutputOptions;
13976
15121
  html?: {
13977
15122
  images?: EmbeddedImageConversionOptions & {
13978
15123
  convertOGImage?: boolean;
@@ -14067,7 +15212,7 @@ declare namespace TailStream {
14067
15212
  interface ConnectEventInfo {
14068
15213
  readonly type: "connect";
14069
15214
  }
14070
- type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime";
15215
+ type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime" | "aborted";
14071
15216
  interface ScriptVersion {
14072
15217
  readonly id: string;
14073
15218
  readonly tag?: string;
@@ -14099,6 +15244,12 @@ declare namespace TailStream {
14099
15244
  readonly cpuTime: number;
14100
15245
  readonly wallTime: number;
14101
15246
  }
15247
+ type SpanStatusCode = "unset" | "ok" | "error";
15248
+ interface SpanStatus {
15249
+ readonly code: SpanStatusCode;
15250
+ /** A developer-facing error message, present only when code is "error". */
15251
+ readonly message?: string;
15252
+ }
14102
15253
  interface SpanOpen {
14103
15254
  readonly type: "spanOpen";
14104
15255
  readonly name: string;
@@ -14110,6 +15261,17 @@ declare namespace TailStream {
14110
15261
  readonly type: "spanClose";
14111
15262
  readonly outcome: EventOutcome;
14112
15263
  }
15264
+ type SpanUpdateInfo = {
15265
+ readonly type: "name";
15266
+ readonly name: string;
15267
+ } | {
15268
+ readonly type: "status";
15269
+ readonly status: SpanStatus;
15270
+ };
15271
+ interface SpanUpdate {
15272
+ readonly type: "spanUpdate";
15273
+ readonly info: SpanUpdateInfo;
15274
+ }
14113
15275
  interface DiagnosticChannelEvent {
14114
15276
  readonly type: "diagnosticChannel";
14115
15277
  readonly channel: string;
@@ -14117,15 +15279,27 @@ declare namespace TailStream {
14117
15279
  }
14118
15280
  interface Exception {
14119
15281
  readonly type: "exception";
15282
+ readonly code?: string | number;
15283
+ readonly name: string;
15284
+ readonly message: string;
15285
+ readonly stack?: string;
15286
+ }
15287
+ interface TailStreamErrorInfo {
14120
15288
  readonly name: string;
14121
15289
  readonly message: string;
14122
15290
  readonly stack?: string;
14123
15291
  }
14124
- interface Log {
15292
+ type Log = {
14125
15293
  readonly type: "log";
14126
15294
  readonly level: "debug" | "error" | "info" | "log" | "warn";
15295
+ readonly errorInfo?: readonly (TailStreamErrorInfo | null)[];
15296
+ } & ({
14127
15297
  readonly message: object;
14128
- }
15298
+ readonly truncated?: false;
15299
+ } | {
15300
+ readonly message: string;
15301
+ readonly truncated: true;
15302
+ });
14129
15303
  interface DroppedEventsDiagnostic {
14130
15304
  readonly diagnosticsType: "droppedEvents";
14131
15305
  readonly count: number;
@@ -14151,7 +15325,7 @@ declare namespace TailStream {
14151
15325
  readonly type: "attributes";
14152
15326
  readonly info: Attribute[];
14153
15327
  }
14154
- type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | StreamDiagnostic | Return | Attributes;
15328
+ type EventType = Onset | Outcome | SpanOpen | SpanClose | SpanUpdate | DiagnosticChannelEvent | Exception | Log | StreamDiagnostic | Return | Attributes;
14155
15329
  // Context in which this trace event lives.
14156
15330
  interface SpanContext {
14157
15331
  // Single id for the entire top-level invocation
@@ -14186,6 +15360,7 @@ declare namespace TailStream {
14186
15360
  outcome?: TailEventHandler<Outcome>;
14187
15361
  spanOpen?: TailEventHandler<SpanOpen>;
14188
15362
  spanClose?: TailEventHandler<SpanClose>;
15363
+ spanUpdate?: TailEventHandler<SpanUpdate>;
14189
15364
  diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>;
14190
15365
  exception?: TailEventHandler<Exception>;
14191
15366
  log?: TailEventHandler<Log>;
@@ -14603,10 +15778,31 @@ declare abstract class Workflow<PARAMS = unknown> {
14603
15778
  * @returns A promise that resolves with a list of handles for the created instances.
14604
15779
  */
14605
15780
  public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;
15781
+ /**
15782
+ * Delete a batch of Workflow instances and their stored state.
15783
+ * `deleteBatch` is limited to 100 instances at a time. Duplicate IDs are deleted once.
15784
+ * The result contains one entry for each input position; IDs that do not exist are returned as per-instance errors.
15785
+ * @param instanceIds IDs of the Workflow instances to delete
15786
+ * @returns A promise that resolves with the successfully deleted instances and any per-instance errors.
15787
+ */
15788
+ public deleteBatch(instanceIds: string[]): Promise<WorkflowBatchDeleteResult>;
14606
15789
  }
15790
+ type WorkflowBatchDeleteResult = {
15791
+ deleted: {
15792
+ id: string;
15793
+ }[];
15794
+ errors: {
15795
+ id: string;
15796
+ code: number;
15797
+ message: string;
15798
+ }[];
15799
+ };
14607
15800
  type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
14608
15801
  type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;
14609
15802
  type WorkflowRetentionDuration = WorkflowSleepDuration;
15803
+ /** Geographic regions supported when creating a Workflow instance.
15804
+ * Location hints are best-effort placement preferences. */
15805
+ type WorkflowInstanceLocationHint = 'wnam' | 'enam' | 'sam' | 'weur' | 'eeur' | 'apac' | 'apac-ne' | 'apac-se' | 'oc' | 'afr' | 'me';
14610
15806
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
14611
15807
  /**
14612
15808
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -14624,13 +15820,16 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
14624
15820
  successRetention?: WorkflowRetentionDuration;
14625
15821
  errorRetention?: WorkflowRetentionDuration;
14626
15822
  };
15823
+ /** A best-effort geographic placement preference for the Workflow instance.
15824
+ * See `WorkflowInstanceLocationHint` for supported regions. */
15825
+ locationHint?: WorkflowInstanceLocationHint;
14627
15826
  }
14628
15827
  type InstanceStatus = {
14629
15828
  status: 'queued' // means that instance is waiting to be started (see concurrency limits)
14630
15829
  | 'running' | 'paused' | 'errored' | 'terminated' // user terminated the instance while it was running
14631
15830
  | 'complete' | 'waiting' // instance is hibernating and waiting for sleep or event to finish
14632
15831
  | 'waitingForPause' // instance is finishing the current work to pause
14633
- | 'unknown';
15832
+ | 'rollingBack' | 'unknown';
14634
15833
  error?: {
14635
15834
  name: string;
14636
15835
  message: string;
@@ -14669,6 +15868,146 @@ interface WorkflowInstanceRestartOptions {
14669
15868
  type?: 'do' | 'sleep' | 'waitForEvent';
14670
15869
  };
14671
15870
  }
15871
+ /** An event emitted by a Workflow instance. */
15872
+ type WorkflowInstanceEvent = {
15873
+ instanceId: string;
15874
+ eventId: number;
15875
+ timestamp: number;
15876
+ } & ({
15877
+ type: 'workflow_queued';
15878
+ } | {
15879
+ type: 'workflow_started';
15880
+ params?: unknown;
15881
+ } | {
15882
+ type: 'workflow_running';
15883
+ } | {
15884
+ type: 'workflow_paused';
15885
+ } | {
15886
+ type: 'workflow_waiting_for_pause';
15887
+ } | {
15888
+ type: 'workflow_waiting';
15889
+ } | {
15890
+ type: 'workflow_completed';
15891
+ output?: unknown;
15892
+ } | {
15893
+ type: 'workflow_errored';
15894
+ error: {
15895
+ name: string;
15896
+ message: string;
15897
+ };
15898
+ } | {
15899
+ type: 'workflow_terminated';
15900
+ } | {
15901
+ type: 'step_started';
15902
+ stepName: string;
15903
+ config?: {
15904
+ retries: {
15905
+ limit: number;
15906
+ delay: WorkflowSleepDuration | '[dynamic]';
15907
+ backoff?: 'constant' | 'linear' | 'exponential';
15908
+ };
15909
+ timeout: WorkflowSleepDuration;
15910
+ sensitive?: 'output';
15911
+ };
15912
+ } | {
15913
+ type: 'step_completed';
15914
+ stepName: string;
15915
+ output?: unknown;
15916
+ } | {
15917
+ type: 'step_errored';
15918
+ stepName: string;
15919
+ } | {
15920
+ type: 'attempt_started';
15921
+ stepName: string;
15922
+ attempt: number;
15923
+ } | {
15924
+ type: 'attempt_completed';
15925
+ stepName: string;
15926
+ attempt: number;
15927
+ } | {
15928
+ type: 'attempt_errored';
15929
+ stepName: string;
15930
+ attempt: number;
15931
+ retryDelayMs?: number;
15932
+ error: {
15933
+ name: string;
15934
+ message: string;
15935
+ };
15936
+ } | {
15937
+ type: 'sleep_started';
15938
+ stepName: string;
15939
+ durationMs: number;
15940
+ } | {
15941
+ type: 'sleep_completed';
15942
+ stepName: string;
15943
+ } | {
15944
+ type: 'wait_started';
15945
+ stepName: string;
15946
+ eventType: string;
15947
+ } | {
15948
+ type: 'wait_completed';
15949
+ stepName: string;
15950
+ } | {
15951
+ type: 'wait_timed_out';
15952
+ stepName: string;
15953
+ } | {
15954
+ type: 'rollback_started';
15955
+ } | {
15956
+ type: 'rollback_step_started';
15957
+ stepName: string;
15958
+ config?: {
15959
+ retries: {
15960
+ limit: number;
15961
+ delay: WorkflowSleepDuration | '[dynamic]';
15962
+ backoff?: 'constant' | 'linear' | 'exponential';
15963
+ };
15964
+ timeout: WorkflowSleepDuration;
15965
+ sensitive?: 'output';
15966
+ };
15967
+ } | {
15968
+ type: 'rollback_step_completed';
15969
+ stepName: string;
15970
+ } | {
15971
+ type: 'rollback_step_errored';
15972
+ stepName: string;
15973
+ error: {
15974
+ name: string;
15975
+ message: string;
15976
+ };
15977
+ } | {
15978
+ type: 'rollback_attempt_started';
15979
+ stepName: string;
15980
+ attempt: number;
15981
+ } | {
15982
+ type: 'rollback_attempt_completed';
15983
+ stepName: string;
15984
+ attempt: number;
15985
+ } | {
15986
+ type: 'rollback_attempt_errored';
15987
+ stepName: string;
15988
+ attempt: number;
15989
+ retryDelayMs?: number;
15990
+ error: {
15991
+ name: string;
15992
+ message: string;
15993
+ };
15994
+ } | {
15995
+ type: 'rollback_completed';
15996
+ } | {
15997
+ type: 'rollback_errored';
15998
+ });
15999
+ type WorkflowInstanceEventType = WorkflowInstanceEvent['type'];
16000
+ /** Options available for a Workflow instance subscription. */
16001
+ type WorkflowInstanceSubscribeOptions = {
16002
+ /** The value from which to start the subscription. */
16003
+ cursor?: number;
16004
+ /** The event types to include in the subscription. */
16005
+ filter?: WorkflowInstanceEventType[];
16006
+ };
16007
+ /** A disposable subscription to a Workflow instance's events. */
16008
+ interface WorkflowInstanceSubscription extends Disposable {
16009
+ next(): Promise<IteratorResult<WorkflowInstanceEvent, void>>;
16010
+ }
14672
16011
  declare abstract class WorkflowInstance {
14673
16012
  public id: string;
14674
16013
  /**
@@ -14690,6 +16029,10 @@ declare abstract class WorkflowInstance {
14690
16029
  * @param options Options for the restart, including an optional step to restart from.
14691
16030
  */
14692
16031
  public restart(options?: WorkflowInstanceRestartOptions): Promise<void>;
16032
+ /**
16033
+ * Delete the instance and its stored state.
16034
+ */
16035
+ public delete(): Promise<void>;
14693
16036
  /**
14694
16037
  * Returns the current status of the instance.
14695
16038
  */
@@ -14701,4 +16044,8 @@ declare abstract class WorkflowInstance {
14701
16044
  type: string;
14702
16045
  payload: unknown;
14703
16046
  }): Promise<void>;
16047
+ /**
16048
+ * Subscribe to events emitted by this instance.
16049
+ */
16050
+ public subscribe(options?: WorkflowInstanceSubscribeOptions): Promise<WorkflowInstanceSubscription>;
14704
16051
  }