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

types: add types to EventEmitter static methods #7986

Merged

Conversation

suneettipirneni
Copy link
Member

@suneettipirneni suneettipirneni commented Jun 1, 2022

Please describe the changes this PR makes and why it should be merged:

Previously the following code:

import { once } from 'node:events';

await client.login(process.env.DISCORD_TOKEN);
const [readyClient] = await once(client, 'ready');

Would improperly type readyClient as any

With this PR the types are properly provided so it resolves to Client<true>

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@suneettipirneni suneettipirneni force-pushed the types/event-emitter-static-types branch from 68d2a04 to 69a3440 Compare June 1, 2022 05:11
@suneettipirneni suneettipirneni force-pushed the types/event-emitter-static-types branch from 643abb7 to 055f4b5 Compare June 1, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants