From 47151fc2a9e1dd97c383967ca90325c3b62193f6 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Fri, 17 Jul 2020 04:17:44 -0400 Subject: [PATCH] fix(typings): allow custom events (#4162) --- typings/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/typings/index.d.ts b/typings/index.d.ts index 17e251bae..758b3cff4 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -193,10 +193,19 @@ declare module 'discord.js' { public toJSON(): object; public on(event: K, listener: (...args: ClientEvents[K]) => void): this; + public on(event: Exclude, listener: (...args: any[]) => void): this; public once(event: K, listener: (...args: ClientEvents[K]) => void): this; + public once(event: Exclude, listener: (...args: any[]) => void): this; public emit(event: K, ...args: ClientEvents[K]): boolean; + public emit(event: Exclude, ...args: any[]): boolean; + + public off(event: K, listener: (...args: ClientEvents[K]) => void): this; + public off(event: Exclude, listener: (...args: any[]) => void): this; + + public removeAllListeners(event?: K): this; + public removeAllListeners(event?: Exclude): this; } export class ClientApplication extends Base {