diff --git a/src/client/websocket/WebSocketShard.js b/src/client/websocket/WebSocketShard.js index 6e71aec3a..3577a280e 100644 --- a/src/client/websocket/WebSocketShard.js +++ b/src/client/websocket/WebSocketShard.js @@ -466,6 +466,10 @@ class WebSocketShard extends EventEmitter { // Set the status to reconnecting this.status = Status.RECONNECTING; // Finally, emit the INVALID_SESSION event + /** + * Emitted when the session has been invalidated. + * @event WebSocketShard#invalidSession + */ this.emit(ShardEvents.INVALID_SESSION); break; case Opcodes.HEARTBEAT_ACK: diff --git a/typings/index.d.ts b/typings/index.d.ts index a260d1662..d57aac09b 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2131,8 +2131,8 @@ export class SelectMenuInteraction extends } export interface ShardEventTypes { - spawn: [child: ChildProcess]; - death: [child: ChildProcess]; + spawn: [process: ChildProcess | Worker]; + death: [process: ChildProcess | Worker]; disconnect: []; ready: []; reconnecting: []; @@ -2783,6 +2783,7 @@ export interface WebSocketShardEvents { ready: []; resumed: []; invalidSession: []; + destroyed: []; close: [event: CloseEvent]; allReady: [unavailableGuilds?: Set]; } diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index 4151e31f6..322513b35 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -1,4 +1,5 @@ import type { ChildProcess } from 'child_process'; +import type { Worker } from 'worker_threads'; import type { APIInteractionGuildMember, APIMessage, @@ -1191,7 +1192,7 @@ client.on('interactionCreate', async interaction => { declare const shard: Shard; shard.on('death', process => { - expectType(process); + expectType(process); }); declare const webSocketShard: WebSocketShard;