Skip to content

[Web API type definition issue] AbortSignal.any should expect an Iterable<AbortSignal>, not an AbortSignal[] #2574

Open

Description

@Cipscis

Summary

The argument type defined for AbortSignal.any is stricter than in its specification

Expected vs. Actual Behavior

Expected:

The static method AbortSignal.any is defined as expecting an argument of type AbortSignal[]. This prevents narrower types such as readonly AbortSignal[] or Iterable<AbortSignal> from being passed.

Actual:

AbortSignal.any is able to accept Iterable<AbortSignal>, and should have its type defined as such.

Passing non-Array iterables to AbortSignal.abort works as expected in browsers (testing in Chromium and Firefox).

The AbortSignal spec WebIDL definition says this argument is of type sequence<AbortSignal>

Playground Link

https://www.typescriptlang.org/play/?ts=6.0.3#code/MYewdgzgLgBKZQE4gDYoKaIIIwLwzHQHcYsAjERKAYXCVQ0QAoBKAbgCh5o47k1MAITwFipClVoJ+jVpw4AzAK5hgUAJbgAVDADm6KOUpQAyut1gAhiggBJKJktkMrGAG8OHAJABPdehQAE15pBkwsADoIcysUTl9-IJD6AURBKJjrTgBfT25YaItrESMqMyKUCMswHyZ9QwlTTJt7R2d0VnYOAHpumAA9ABUfAAd0E2BEdRHYTGREABoYMiVYMBAYRBUNAFt0GDnKT16YWh2ydUJgwtiYIkoAawgYS2f0AA8xtXRAgC4ucAQVDoCIoEC6Jg3axVRo-LonfoKawQdAA0KpSJOYxyNFAjCg8GQ5ow4xwzgIpBKdBAA

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

From MDN:

The AbortSignal.any() static method takes an iterable of abort signals and returns an AbortSignal.

Activity

  1. Cipscis commented on Oct 21, 2026

    @Cipscis
    Author

    I'd be happy to make a PR to resolve this myself, but it's my first time contributing here so I'm still trying to find my way around. I'm unsure if this is something that should be fixed in inputfiles/addedTypes.jsonc or upstream, and if the fix is best done upstream I'm not sure where to start.

    I mentioned in the issue description what the WebIDL definition says in the AbortSignal spec, but I'm not sure if this is "the upstream IDL" mentioned in this repo's readme or it's referring to some other place.

    If anyone is able to point me in the right direction, I'd appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions