mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 21:13:30 +01:00
types: use mapped enums instead of overloads (#7088)
This commit is contained in:
@@ -756,7 +756,6 @@ declare const threadChannel: ThreadChannel;
|
||||
declare const newsChannel: NewsChannel;
|
||||
declare const textChannel: TextChannel;
|
||||
declare const storeChannel: StoreChannel;
|
||||
declare const categoryChannel: CategoryChannel;
|
||||
declare const voiceChannel: VoiceChannel;
|
||||
declare const guild: Guild;
|
||||
declare const user: User;
|
||||
@@ -848,6 +847,18 @@ expectType<Promise<Collection<Snowflake, ApplicationCommand>>>(guildApplicationC
|
||||
expectType<Promise<Collection<Snowflake, ApplicationCommand>>>(guildApplicationCommandManager.fetch(undefined, {}));
|
||||
expectType<Promise<ApplicationCommand>>(guildApplicationCommandManager.fetch('0'));
|
||||
|
||||
declare const categoryChannel: CategoryChannel;
|
||||
{
|
||||
expectType<Promise<VoiceChannel>>(categoryChannel.createChannel('name', { type: 'GUILD_VOICE' }));
|
||||
expectType<Promise<TextChannel>>(categoryChannel.createChannel('name', { type: 'GUILD_TEXT' }));
|
||||
expectType<Promise<NewsChannel>>(categoryChannel.createChannel('name', { type: 'GUILD_NEWS' }));
|
||||
expectDeprecated(categoryChannel.createChannel('name', { type: 'GUILD_STORE' }));
|
||||
expectType<Promise<StageChannel>>(categoryChannel.createChannel('name', { type: 'GUILD_STAGE_VOICE' }));
|
||||
expectType<Promise<TextChannel | VoiceChannel | NewsChannel | StoreChannel | StageChannel>>(
|
||||
categoryChannel.createChannel('name', {}),
|
||||
);
|
||||
}
|
||||
|
||||
declare const guildChannelManager: GuildChannelManager;
|
||||
{
|
||||
type AnyChannel = TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel | StageChannel;
|
||||
|
||||
Reference in New Issue
Block a user