mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +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 readonly ids: number[];
|
||||||
public mode: ShardingManagerMode;
|
public mode: ShardingManagerMode;
|
||||||
public parentPort: any | null;
|
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>(
|
public broadcastEval<T, P>(
|
||||||
fn: (client: Client, context: P) => T,
|
fn: (client: Client, context: P) => T,
|
||||||
{ shard: undefined, context: P }?: BroadcastEvalOptions,
|
options: { context: P; shard: number },
|
||||||
): Promise<T[]>;
|
|
||||||
public broadcastEval<T, P>(
|
|
||||||
fn: (client: Client, context: P) => T,
|
|
||||||
{ shard: number, context: P }: BroadcastEvalOptions,
|
|
||||||
): Promise<T>;
|
): Promise<T>;
|
||||||
public fetchClientValues(prop: string): Promise<any[]>;
|
public fetchClientValues(prop: string): Promise<any[]>;
|
||||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||||
@@ -1667,13 +1666,12 @@ declare module 'discord.js' {
|
|||||||
public totalShards: number | 'auto';
|
public totalShards: number | 'auto';
|
||||||
public shardList: number[] | 'auto';
|
public shardList: number[] | 'auto';
|
||||||
public broadcast(message: any): Promise<Shard[]>;
|
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>(
|
public broadcastEval<T, P>(
|
||||||
fn: (client: Client, context: P) => T,
|
fn: (client: Client, context: P) => T,
|
||||||
{ shard: undefined, context: P }?: BroadcastEvalOptions,
|
options: { context: P; shard: number },
|
||||||
): Promise<T[]>;
|
|
||||||
public broadcastEval<T, P>(
|
|
||||||
fn: (client: Client, context: P) => T,
|
|
||||||
{ shard: number, context: P }: BroadcastEvalOptions,
|
|
||||||
): Promise<T>;
|
): Promise<T>;
|
||||||
public createShard(id: number): Shard;
|
public createShard(id: number): Shard;
|
||||||
public fetchClientValues(prop: string): Promise<any[]>;
|
public fetchClientValues(prop: string): Promise<any[]>;
|
||||||
@@ -2565,11 +2563,6 @@ declare module 'discord.js' {
|
|||||||
| N
|
| N
|
||||||
| Readonly<BitField<T, N>>;
|
| Readonly<BitField<T, N>>;
|
||||||
|
|
||||||
interface BroadcastEvalOptions<T = unknown> {
|
|
||||||
shard?: number;
|
|
||||||
context?: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
type BufferResolvable = Buffer | string;
|
type BufferResolvable = Buffer | string;
|
||||||
|
|
||||||
interface ChannelCreationOverwrites {
|
interface ChannelCreationOverwrites {
|
||||||
|
|||||||
Reference in New Issue
Block a user