From 31f7e846009ef76d49e114ec7cbcf4d4c1fc51c8 Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Fri, 30 Jan 2026 11:56:43 -0800 Subject: [PATCH] Make AbortSignal abort and timeout correctly static, add AbortSignal.any (#55371) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55371 `AbortSignal` `abort` and `timeout` are incorrectly typed as instance methods - they should be static methods. Also add the static `any()`, which returns a signal composed of other signals. MDN: - [`AbortSignal.any(signals: Iterable)`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static) - [`AbortSignal.abort(reason?: any)`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_static) - [`AbortSignal.timeout(time: number)`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static) Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D91904485 fbshipit-source-id: 0850c731cfaf1bf967582c85427acbd6bebcb5aa --- packages/react-native/flow/bom.js.flow | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-native/flow/bom.js.flow b/packages/react-native/flow/bom.js.flow index cb766878cf2..f38641c0802 100644 --- a/packages/react-native/flow/bom.js.flow +++ b/packages/react-native/flow/bom.js.flow @@ -609,12 +609,13 @@ declare class AbortController { } declare class AbortSignal extends EventTarget { - abort(reason?: $FlowFixMe): AbortSignal; + static abort(reason?: $FlowFixMe): AbortSignal; + static any(signals: Iterable): AbortSignal; +aborted: boolean; onabort: (event: Event) => unknown; +reason: $FlowFixMe; throwIfAborted(): void; - timeout(time: number): AbortSignal; + static timeout(time: number): AbortSignal; } declare function fetch(