types: Correct EventEmitter.on (static) return type (#8524)

types: Correct EventEmitter.on (static) return type

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
InkoHX
2022-08-21 03:45:56 +09:00
committed by GitHub
parent 7a3d18dd6d
commit 16bbc8aa20

View File

@@ -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]>;
}
}