Skip to content

Support AbortSignal.timeout()Β #48003

Description

Suggestion

Add support for whatwg/dom#1032 to the AbortSignal types.

πŸ” Search Terms

AbortSignal, abort signal, timeout

βœ… Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

πŸ“ƒ Motivating Example

The implementation in NodeJS nodejs/node#40899

πŸ’» Use Cases

Activity

  1. huytd commented on Mar 31, 2022

    @huytd
    Contributor

    I think it is the same issue as #48444, looks like AbortSignal.timeout hasn't made it to the major browsers yet.

    Here are the implementation tickets from the browsers:

    cc Orta Therox (@orta) Kagami Sascha Rosylight (@saschanaz)

  2. malobre commented on Jun 17, 2022

    @malobre

    This feature has now shipped in (at least) Chrome, Firefox & Safari: https://chromestatus.com/feature/5768400507764736.

  3. blake-regalia commented on Sep 18, 2022

    @blake-regalia

    This is now supported by all major browsers across the board. It's time to add the type.

  4. saschanaz commented on Sep 18, 2022

    @saschanaz
    Contributor

    The type has been there for a while in https://github.com/microsoft/TypeScript-DOM-lib-generator/, the remaining work is to fetch that lib here.

    If you are in hurry, you can try https://www.npmjs.com/package/@types/web instead of waiting for a new TS release.

  5. ianschmitz commented on May 10, 2023

    @ianschmitz

    This is in the latest TypeScript. It appears to have been introduced in 4.9.5. See example: https://www.typescriptlang.org/play?ts=4.9.5#code/IIIw9gTgLgyglgcwHYEMA2A6KcC2BTMAVygAoBWABioEog

    I think this ticket can be closed as completed.

  6. jakebailey commented on Jul 9, 2023

    @jakebailey
    Member

    Done in #50884.

  7. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions