From 405b487dc3475ea077dcd3f6734a5a01321021dd Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com> Date: Sat, 29 Aug 2020 18:54:39 +0200 Subject: [PATCH] fix(Typing): change NodeJS.Timer into NodeJS.Timeout (#4755) --- src/client/websocket/WebSocketShard.js | 4 ++-- typings/index.d.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/client/websocket/WebSocketShard.js b/src/client/websocket/WebSocketShard.js index b48579d9d..2da290a5c 100644 --- a/src/client/websocket/WebSocketShard.js +++ b/src/client/websocket/WebSocketShard.js @@ -121,7 +121,7 @@ class WebSocketShard extends EventEmitter { /** * The HELLO timeout * @name WebSocketShard#helloTimeout - * @type {?NodeJS.Timer} + * @type {?NodeJS.Timeout} * @private */ Object.defineProperty(this, 'helloTimeout', { value: undefined, writable: true }); @@ -145,7 +145,7 @@ class WebSocketShard extends EventEmitter { /** * The ready timeout * @name WebSocketShard#readyTimeout - * @type {?NodeJS.Timer} + * @type {?NodeJS.Timeout} * @private */ Object.defineProperty(this, 'readyTimeout', { value: undefined, writable: true }); diff --git a/typings/index.d.ts b/typings/index.d.ts index b1d13952d..2e3c3931f 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -103,8 +103,8 @@ declare module 'discord.js' { export class BaseClient extends EventEmitter { constructor(options?: ClientOptions); - private _timeouts: Set; - private _intervals: Set; + private _timeouts: Set; + private _intervals: Set; private _immediates: Set; private readonly api: object; private rest: object; @@ -112,12 +112,12 @@ declare module 'discord.js' { private incrementMaxListeners(): void; public options: ClientOptions; - public clearInterval(interval: NodeJS.Timer): void; - public clearTimeout(timeout: NodeJS.Timer): void; + public clearInterval(interval: NodeJS.Timeout): void; + public clearTimeout(timeout: NodeJS.Timeout): void; public clearImmediate(timeout: NodeJS.Immediate): void; public destroy(): void; - public setInterval(fn: (...args: any[]) => void, delay: number, ...args: any[]): NodeJS.Timer; - public setTimeout(fn: (...args: any[]) => void, delay: number, ...args: any[]): NodeJS.Timer; + public setInterval(fn: (...args: any[]) => void, delay: number, ...args: any[]): NodeJS.Timeout; + public setTimeout(fn: (...args: any[]) => void, delay: number, ...args: any[]): NodeJS.Timeout; public setImmediate(fn: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; public toJSON(...props: { [key: string]: boolean | string }[]): object; } @@ -274,8 +274,8 @@ declare module 'discord.js' { export abstract class Collector extends EventEmitter { constructor(client: Client, filter: CollectorFilter, options?: CollectorOptions); - private _timeout: NodeJS.Timer | null; - private _idletimeout: NodeJS.Timer | null; + private _timeout: NodeJS.Timeout | null; + private _idletimeout: NodeJS.Timeout | null; public readonly client: Client; public collected: Collection;