@@ -558,8 +558,51 @@ extension type AbortController._(JSObject _) implements JSObject {
558558/// API documentation sourced from
559559/// [MDN Web Docs] (https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal).
560560extension type AbortSignal ._(JSObject _) implements EventTarget , JSObject {
561+ /// The **`AbortSignal.abort()` ** static method returns an [AbortSignal] that
562+ /// is already set as aborted (and which does not trigger an
563+ /// [AbortSignal.abort_event] event).
564+ ///
565+ /// This is shorthand for the following code:
566+ ///
567+ /// ```js
568+ /// const controller = new AbortController();
569+ /// controller.abort();
570+ /// return controller.signal;
571+ /// ```
572+ ///
573+ /// This could, for example, be passed to a fetch method in order to run its
574+ /// abort logic (i.e. it may be that code is organized such that the abort
575+ /// logic should be run even if the intended fetch operation has not been
576+ /// started).
577+ ///
578+ /// > **Note:** The method is similar in purpose to `Promise.reject` .
561579 external static AbortSignal abort ([JSAny ? reason]);
580+
581+ /// The **`AbortSignal.timeout()` ** static method returns an [AbortSignal]
582+ /// that will automatically abort after a specified time.
583+ ///
584+ /// The signal aborts with a `TimeoutError` [DOMException] on timeout, or with
585+ /// `AbortError` [DOMException] due to pressing a browser stop button (or some
586+ /// other inbuilt "stop" operation).
587+ /// This allows UIs to differentiate timeout errors, which typically require
588+ /// user notification, from user-triggered aborts that do not.
589+ ///
590+ /// The timeout is based on active rather than elapsed time, and will
591+ /// effectively be paused if the code is running in a suspended worker, or
592+ /// while the document is in a back-forward cache
593+ /// ("[bfcache] (https://web.dev/articles/bfcache)").
594+ ///
595+ /// To combine multiple signals, you can use [AbortSignal.any_static] , for
596+ /// example, to directly abort a download using either a timeout signal or by
597+ /// calling [AbortController.abort] .
562598 external static AbortSignal timeout (int milliseconds);
599+
600+ /// The **`AbortSignal.any()` ** static method takes an iterable of abort
601+ /// signals and returns an [AbortSignal] . The returned abort signal is aborted
602+ /// when any of the input iterable abort signals are aborted. The
603+ /// [AbortSignal.reason] will be set to the reason of the first signal that is
604+ /// aborted. If any of the given abort signals are already aborted then so
605+ /// will be the returned [AbortSignal] .
563606 external static AbortSignal any (JSArray <AbortSignal > signals);
564607
565608 /// The **`throwIfAborted()` ** method throws the signal's abort
0 commit comments