diff --git a/typings/index.d.ts b/typings/index.d.ts index cdbc695cd..d9301ffa6 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -55,6 +55,8 @@ declare enum StickerFormatTypes { LOTTIE = 3, } +type Awaited = T | Promise; + declare module 'discord.js' { import BaseCollection from '@discordjs/collection'; import { ChildProcess } from 'child_process'; @@ -325,25 +327,25 @@ declare module 'discord.js' { public sweepMessages(lifetime?: number): number; public toJSON(): object; - public on(event: K, listener: (...args: ClientEvents[K]) => void): this; + public on(event: K, listener: (...args: ClientEvents[K]) => Awaited): this; public on( event: Exclude, - listener: (...args: any[]) => void, + listener: (...args: any[]) => Awaited, ): this; - public once(event: K, listener: (...args: ClientEvents[K]) => void): this; + public once(event: K, listener: (...args: ClientEvents[K]) => Awaited): this; public once( event: Exclude, - listener: (...args: any[]) => void, + listener: (...args: any[]) => Awaited, ): 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: K, listener: (...args: ClientEvents[K]) => Awaited): this; public off( event: Exclude, - listener: (...args: any[]) => void, + listener: (...args: any[]) => Awaited, ): this; public removeAllListeners(event?: K): this;