Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[node] add AbortSignal.any() #65782

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atlowChemi
Copy link
Contributor

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: nodejs/node@b1828b325e
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.

@atlowChemi
Copy link
Contributor Author

Hi @eps1lon @peterblazejewicz 🙂
I have the UT failing for me, I assume it is because the types are not yet added to lib.dom.d.ts?
What can be done in this case?

Comment on lines +54 to +63
// @ts-expect-error
AbortSignal.any();
// @ts-expect-error
AbortSignal.any(null);
// @ts-expect-error
AbortSignal.any(undefined);
// @ts-expect-error
AbortSignal.any([] as number[]);
AbortSignal.any([]); // $ExpectType AbortSignal
AbortSignal.any([new AbortController().signal]); // $ExpectType AbortSignal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ghost
Copy link

ghost commented Feb 23, 2024

@jakebailey this can be closed

@jakebailey
Copy link
Member

Why? I don't see this function in the current package.

@ghost
Copy link

ghost commented Feb 23, 2024

Why? I don't see this function in the current package.

My bad, I saw something else. Should I create a PR to supersede this?

@jakebailey
Copy link
Member

I don't really know anything about this PR, so I have no clue.

* @since v20.3.0
* @param signals The `AbortSignal`s of which to compose a new `AbortSignal`.
*/
any(signals: AbortSignal[]): AbortSignal;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
any(signals: AbortSignal[]): AbortSignal;
any(signals: readonly AbortSignal[]): AbortSignal;

@Resetand
Copy link

Any updates?

@atlowChemi
Copy link
Contributor Author

Any updates?

@Resetand unfortunately the dom.generated.d.ts was last updated 3 months ago, without the any function...
I'll have a look at this PR later today again to see if there is anything I can do

@atlowChemi
Copy link
Contributor Author

Opened an issue on TypeScript repo: microsoft/TypeScript#58026

@atlowChemi atlowChemi force-pushed the add-abortSignal-any branch from 53f3412 to feaf0ff Compare May 13, 2024 16:32
@benasher44
Copy link
Contributor

With TS 5.5 out, I think this can be revived?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Author Action
Development

Successfully merging this pull request may close these issues.

5 participants