types: extend MessageComponentInteractionCollector correctly (#5752)

This commit is contained in:
monbrey
2021-06-05 20:04:31 +10:00
committed by GitHub
parent cf224560bc
commit c6696d8399

16
typings/index.d.ts vendored
View File

@@ -1354,7 +1354,7 @@ declare module 'discord.js' {
public static resolveType(type: MessageComponentTypeResolvable): MessageComponentType;
}
export class MessageComponentInteractionCollector extends Collector<Snowflake, Interaction> {
export class MessageComponentInteractionCollector extends Collector<Snowflake, MessageComponentInteraction> {
constructor(
source: Message | TextChannel | NewsChannel | DMChannel,
filter: CollectorFilter<[MessageComponentInteraction]>,
@@ -1374,17 +1374,23 @@ declare module 'discord.js' {
public collect(interaction: Interaction): Snowflake;
public dispose(interaction: Interaction): Snowflake;
public on(event: 'collect' | 'dispose', listener: (interaction: Interaction) => Awaited<void>): this;
public on(
event: 'collect' | 'dispose',
listener: (interaction: MessageComponentInteraction) => Awaited<void>,
): this;
public on(
event: 'end',
listener: (collected: Collection<Snowflake, Interaction>, reason: string) => Awaited<void>,
listener: (collected: Collection<Snowflake, MessageComponentInteraction>, reason: string) => Awaited<void>,
): this;
public on(event: string, listener: (...args: any[]) => Awaited<void>): this;
public once(event: 'collect' | 'dispose', listener: (interaction: Interaction) => Awaited<void>): this;
public once(
event: 'collect' | 'dispose',
listener: (interaction: MessageComponentInteraction) => Awaited<void>,
): this;
public once(
event: 'end',
listener: (collected: Collection<Snowflake, Interaction>, reason: string) => Awaited<void>,
listener: (collected: Collection<Snowflake, MessageComponentInteraction>, reason: string) => Awaited<void>,
): this;
public once(event: string, listener: (...args: any[]) => Awaited<void>): this;
}