From eb9b36637e1487638084375aca25134d8d72d1a6 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Mon, 18 Dec 2023 22:23:54 +0000 Subject: [PATCH] refactor: dynamic test --- packages/discord.js/typings/index.test-d.ts | 25 ++++++++------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index 08dc9b7cd6a68..44b53da819846 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -186,6 +186,7 @@ import { Emoji, PartialEmoji, Awaitable, + Channel, DirectoryChannel, } from '.'; import { expectAssignable, expectNotAssignable, expectNotType, expectType } from 'tsd'; @@ -2283,22 +2284,12 @@ declare const anyComponentsActionRowComp: ActionRow; expectType(ActionRowBuilder.from(anyComponentsActionRowData)); expectType(ActionRowBuilder.from(anyComponentsActionRowComp)); -declare const partialGroupDMChannel: PartialGroupDMChannel; -declare const stageChannel: StageChannel; -declare const directoryChannel: DirectoryChannel; -declare const mediaChannel: MediaChannel; - -expectType(textChannel.toString()); -expectType(dmChannel.toString()); -expectType(voiceChannel.toString()); -expectType(partialGroupDMChannel.toString()); -expectType(categoryChannel.toString()); -expectType(newsChannel.toString()); -expectType(threadChannel.toString()); -expectType(stageChannel.toString()); -expectType(directoryChannel.toString()); -expectType(forumChannel.toString()); -expectType(mediaChannel.toString()); +type UserMentionChannels = DMChannel | PartialDMChannel; +declare const channelMentionChannels: Exclude; +declare const userMentionChannels: UserMentionChannels; + +expectType(channelMentionChannels.toString()); +expectType(userMentionChannels.toString()); expectType(user.toString()); expectType(guildMember.toString()); @@ -2320,7 +2311,9 @@ expectType>(interactionWebhook.send('content')); expectType>(interactionWebhook.editMessage(snowflake, 'content')); expectType>(interactionWebhook.fetchMessage(snowflake)); +declare const partialGroupDMChannel: PartialGroupDMChannel; declare const categoryChannel: CategoryChannel; +declare const stageChannel: StageChannel; declare const forumChannel: ForumChannel; await forumChannel.edit({