mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types: add missing shard types (v13) (#8192)
This commit is contained in:
@@ -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:
|
||||
|
||||
5
typings/index.d.ts
vendored
5
typings/index.d.ts
vendored
@@ -2131,8 +2131,8 @@ export class SelectMenuInteraction<Cached extends CacheType = CacheType> 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<Snowflake>];
|
||||
}
|
||||
|
||||
@@ -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<ChildProcess>(process);
|
||||
expectType<ChildProcess | Worker>(process);
|
||||
});
|
||||
|
||||
declare const webSocketShard: WebSocketShard;
|
||||
|
||||
Reference in New Issue
Block a user