-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
types: bump @types/node
version, use EventEmitter generic
#10584
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@types/node
version, use EventEmitter generic@types/node
version, use EventEmitter generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest this should be semver:major, as it will cause new compile errors for downstream projects (in the absence of skipLibCheck) if their installed @types/node version dates from prior to EventEmitter taking a type parameter.
The @types/node patch that allowed for event-mapped returns from top-level node:events
functions has had to be reverted, so whether to provide a typed solution for events.on()
and events.once()
probably still needs to be considered.
@@ -949,7 +952,7 @@ export type If<Value extends boolean, TrueResult, FalseResult = null> = Value ex | |||
? FalseResult | |||
: TrueResult | FalseResult; | |||
|
|||
export class Client<Ready extends boolean = boolean> extends BaseClient { | |||
export class Client<Ready extends boolean = boolean> extends BaseClient<ClientEvents> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a case for Client exposing its own type parameter here, for derived classes to be able to add their own mapped events?
Please describe the changes this PR makes and why it should be merged:
Bumps
@types/node
to latest version for the respective node version used in each package but@discordjs/rest
, because there's a clash on the types for globalfetch()
function that needs to be resolved.Adapts mainlib
discord.js
typings to use the EventEmitter generic instead of manual overloads for EventEmitter methods.Supersedes #10581.
Status and versioning classification: