Skip to content

Commit

Permalink
fix(Typings): use overloading to have more specific typings
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Nov 8, 2020
1 parent 6aefbb3 commit 6ff2d17
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1374,9 +1374,12 @@ declare module 'discord.js' {
public readonly ids: number[];
public mode: ShardingManagerMode;
public parentPort: any | null;
public broadcastEval(script: string, shard?: number): Promise<any> | Promise<any[]>;
public broadcastEval<T>(fn: (client: Client) => T, shard?: number): Promise<T> | Promise<T[]>;
public fetchClientValues(prop: string, shard?: number): Promise<any> | Promise<any[]>;
public broadcastEval(script: string): Promise<any[]>;
public broadcastEval(script: string, shard: number): Promise<any>;
public broadcastEval<T>(fn: (client: Client) => T): Promise<T[]>;
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 send(message: any): Promise<void>;

Expand Down Expand Up @@ -1406,9 +1409,11 @@ declare module 'discord.js' {
public token: string | null;
public totalShards: number | 'auto';
public broadcast(message: any): Promise<Shard[]>;
public broadcastEval(script: string, shard?: number): Promise<any> | Promise<any[]>;
public broadcastEval(script: string): Promise<any[]>;
public broadcastEval(script: string, shard: number): Promise<any>;
public createShard(id: number): Shard;
public fetchClientValues(prop: string, shard?: number): Promise<any> | Promise<any[]>;
public fetchClientValues(prop: string): Promise<any[]>;
public fetchClientValues(prop: string, shard: number): Promise<any>;
public respawnAll(
shardDelay?: number,
respawnDelay?: number,
Expand Down

0 comments on commit 6ff2d17

Please sign in to comment.