mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
types: corrected shard broadcastEval (#5834)
This commit is contained in:
23
typings/index.d.ts
vendored
23
typings/index.d.ts
vendored
@@ -1637,13 +1637,12 @@ declare module 'discord.js' {
|
||||
public readonly ids: number[];
|
||||
public mode: ShardingManagerMode;
|
||||
public parentPort: any | null;
|
||||
public broadcastEval<T>(fn: (client: Client) => T): Promise<T[]>;
|
||||
public broadcastEval<T>(fn: (client: Client) => T, options: { shard: number }): Promise<T>;
|
||||
public broadcastEval<T, P>(fn: (client: Client, context: P) => T, options: { context: P }): Promise<T[]>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: undefined, context: P }?: BroadcastEvalOptions,
|
||||
): Promise<T[]>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: number, context: P }: BroadcastEvalOptions,
|
||||
options: { context: P; shard: number },
|
||||
): Promise<T>;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||
@@ -1667,13 +1666,12 @@ declare module 'discord.js' {
|
||||
public totalShards: number | 'auto';
|
||||
public shardList: number[] | 'auto';
|
||||
public broadcast(message: any): Promise<Shard[]>;
|
||||
public broadcastEval<T>(fn: (client: Client) => T): Promise<T[]>;
|
||||
public broadcastEval<T>(fn: (client: Client) => T, options: { shard: number }): Promise<T>;
|
||||
public broadcastEval<T, P>(fn: (client: Client, context: P) => T, options: { context: P }): Promise<T[]>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: undefined, context: P }?: BroadcastEvalOptions,
|
||||
): Promise<T[]>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: number, context: P }: BroadcastEvalOptions,
|
||||
options: { context: P; shard: number },
|
||||
): Promise<T>;
|
||||
public createShard(id: number): Shard;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
@@ -2565,11 +2563,6 @@ declare module 'discord.js' {
|
||||
| N
|
||||
| Readonly<BitField<T, N>>;
|
||||
|
||||
interface BroadcastEvalOptions<T = unknown> {
|
||||
shard?: number;
|
||||
context?: T;
|
||||
}
|
||||
|
||||
type BufferResolvable = Buffer | string;
|
||||
|
||||
interface ChannelCreationOverwrites {
|
||||
|
||||
Reference in New Issue
Block a user