mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
types: make CacheType generic more accurate for return values (#7868)
This commit is contained in:
28
packages/discord.js/typings/index.d.ts
vendored
28
packages/discord.js/typings/index.d.ts
vendored
@@ -1793,19 +1793,25 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
|||||||
public deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
public deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
public deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse>;
|
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public deleteReply(): Promise<void>;
|
public deleteReply(): Promise<void>;
|
||||||
public editReply(options: string | MessagePayload | WebhookEditMessageOptions): Promise<GuildCacheMessage<Cached>>;
|
public editReply(options: string | MessagePayload | WebhookEditMessageOptions): Promise<GuildCacheMessage<Cached>>;
|
||||||
public fetchReply(): Promise<GuildCacheMessage<Cached>>;
|
public fetchReply(): Promise<GuildCacheMessage<Cached>>;
|
||||||
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
||||||
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
public reply(options: string | MessagePayload | InteractionReplyOptions): Promise<InteractionResponse>;
|
public reply(
|
||||||
|
options: string | MessagePayload | InteractionReplyOptions,
|
||||||
|
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
public update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
public update(options: string | MessagePayload | InteractionUpdateOptions): Promise<InteractionResponse>;
|
public update(
|
||||||
|
options: string | MessagePayload | InteractionUpdateOptions,
|
||||||
|
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public showModal(
|
public showModal(
|
||||||
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
public awaitModalSubmit(options: AwaitModalSubmitOptions<ModalSubmitInteraction>): Promise<ModalSubmitInteraction>;
|
public awaitModalSubmit(
|
||||||
|
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
||||||
|
): Promise<ModalSubmitInteraction<Cached>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MessageContextMenuCommandInteraction<
|
export class MessageContextMenuCommandInteraction<
|
||||||
@@ -1906,9 +1912,11 @@ export interface ModalMessageModalSubmitInteraction<Cached extends CacheType = C
|
|||||||
extends ModalSubmitInteraction<Cached> {
|
extends ModalSubmitInteraction<Cached> {
|
||||||
message: GuildCacheMessage<Cached>;
|
message: GuildCacheMessage<Cached>;
|
||||||
update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
update(options: string | MessagePayload | InteractionUpdateOptions): Promise<InteractionResponse>;
|
update(
|
||||||
|
options: string | MessagePayload | InteractionUpdateOptions,
|
||||||
|
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse>;
|
deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>;
|
inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>;
|
||||||
inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>;
|
inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>;
|
||||||
inRawGuild(): this is ModalMessageModalSubmitInteraction<'raw'>;
|
inRawGuild(): this is ModalMessageModalSubmitInteraction<'raw'>;
|
||||||
@@ -1925,11 +1933,13 @@ export class ModalSubmitInteraction<Cached extends CacheType = CacheType> extend
|
|||||||
public replied: boolean;
|
public replied: boolean;
|
||||||
public readonly webhook: InteractionWebhook;
|
public readonly webhook: InteractionWebhook;
|
||||||
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
public reply(options: string | MessagePayload | InteractionReplyOptions): Promise<InteractionResponse>;
|
public reply(
|
||||||
|
options: string | MessagePayload | InteractionReplyOptions,
|
||||||
|
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public deleteReply(): Promise<void>;
|
public deleteReply(): Promise<void>;
|
||||||
public editReply(options: string | MessagePayload | WebhookEditMessageOptions): Promise<GuildCacheMessage<Cached>>;
|
public editReply(options: string | MessagePayload | WebhookEditMessageOptions): Promise<GuildCacheMessage<Cached>>;
|
||||||
public deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
public deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
||||||
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionResponse>;
|
public deferReply(options?: InteractionDeferReplyOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public fetchReply(): Promise<GuildCacheMessage<Cached>>;
|
public fetchReply(): Promise<GuildCacheMessage<Cached>>;
|
||||||
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
||||||
public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>;
|
public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>;
|
||||||
@@ -4681,7 +4691,7 @@ export interface InteractionCollectorOptions<T extends Interaction, Cached exten
|
|||||||
maxComponents?: number;
|
maxComponents?: number;
|
||||||
maxUsers?: number;
|
maxUsers?: number;
|
||||||
message?: CacheTypeReducer<Cached, Message, APIMessage>;
|
message?: CacheTypeReducer<Cached, Message, APIMessage>;
|
||||||
interactionResponse?: InteractionResponse;
|
interactionResponse?: InteractionResponse<BooleanCache<Cached>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InteractionDeferReplyOptions {
|
export interface InteractionDeferReplyOptions {
|
||||||
|
|||||||
Reference in New Issue
Block a user