Skip to content

Commit

Permalink
types: Correct EventEmitter.on (static) return type (#8524)
Browse files Browse the repository at this point in the history
types: Correct EventEmitter.on (static) return type

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
InkoHX and kodiakhq[bot] committed Aug 20, 2022
1 parent 7a3d18d commit 16bbc8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/discord.js/typings/index.d.ts
Expand Up @@ -192,7 +192,10 @@ declare module 'node:events' {
class EventEmitter {
// Add type overloads for client events.
public static once<K extends keyof ClientEvents>(eventEmitter: Client, eventName: K): Promise<ClientEvents[K]>;
public static on<K extends keyof ClientEvents>(eventEmitter: Client, eventName: K): AsyncIterator<ClientEvents[K]>;
public static on<K extends keyof ClientEvents>(
eventEmitter: Client,
eventName: K,
): AsyncIterableIterator<ClientEvents[K]>;
}
}

Expand Down

0 comments on commit 16bbc8a

Please sign in to comment.