mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
refactor(Sharding): use options objects (#5510)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
14
typings/index.d.ts
vendored
14
typings/index.d.ts
vendored
@@ -1368,9 +1368,9 @@ declare module 'discord.js' {
|
||||
public eval<T>(fn: (client: Client) => T): Promise<T[]>;
|
||||
public fetchClientValue(prop: string): Promise<any>;
|
||||
public kill(): void;
|
||||
public respawn(delay?: number, spawnTimeout?: number): Promise<ChildProcess>;
|
||||
public respawn(options?: { delay?: number, timeout?: number }): Promise<ChildProcess>;
|
||||
public send(message: any): Promise<Shard>;
|
||||
public spawn(spawnTimeout?: number): Promise<ChildProcess>;
|
||||
public spawn(timeout?: number): Promise<ChildProcess>;
|
||||
|
||||
public on(event: 'spawn' | 'death', listener: (child: ChildProcess) => void): this;
|
||||
public on(event: 'disconnect' | 'ready' | 'reconnecting', listener: () => void): this;
|
||||
@@ -1401,7 +1401,7 @@ declare module 'discord.js' {
|
||||
public broadcastEval<T>(fn: (client: Client) => T, shard: number): Promise<T>;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||
public respawnAll(shardDelay?: number, respawnDelay?: number, spawnTimeout?: number): Promise<void>;
|
||||
public respawnAll(options?: { shardDelay?: number, respawnDelay?: number, timeout?: number }): Promise<void>;
|
||||
public send(message: any): Promise<void>;
|
||||
|
||||
public static singleton(client: Client, mode: ShardingManagerMode): ShardClientUtil;
|
||||
@@ -1437,12 +1437,12 @@ declare module 'discord.js' {
|
||||
public createShard(id: number): Shard;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||
public respawnAll(
|
||||
public respawnAll(options?: {
|
||||
shardDelay?: number,
|
||||
respawnDelay?: number,
|
||||
spawnTimeout?: number,
|
||||
): Promise<Collection<number, Shard>>;
|
||||
public spawn(amount?: number | 'auto', delay?: number, spawnTimeout?: number): Promise<Collection<number, Shard>>;
|
||||
timeout?: number,
|
||||
}): Promise<Collection<number, Shard>>;
|
||||
public spawn(options?: { amount?: number | 'auto', delay?: number, timeout?: number }): Promise<Collection<number, Shard>>;
|
||||
|
||||
public on(event: 'shardCreate', listener: (shard: Shard) => void): this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user