mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 02:40:08 +00:00
refactor: improved channel types (#1397)
This commit is contained in:
committed by
GitHub
parent
51b2d4e1c9
commit
790b4deb0f
4
deno/payloads/v10/channel.ts
generated
4
deno/payloads/v10/channel.ts
generated
@@ -110,7 +110,7 @@ export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T>
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
export interface APIGuildChannel<T extends GuildChannelType = GuildChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -163,7 +163,7 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
parent_id?: null;
|
||||
}
|
||||
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
export interface APIVoiceChannelBase<T extends GuildChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
APITextBasedChannel<T>,
|
||||
|
||||
4
deno/payloads/v9/channel.ts
generated
4
deno/payloads/v9/channel.ts
generated
@@ -110,7 +110,7 @@ export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T>
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
export interface APIGuildChannel<T extends GuildChannelType = GuildChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -163,7 +163,7 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
parent_id?: null;
|
||||
}
|
||||
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
export interface APIVoiceChannelBase<T extends GuildChannelType = GuildChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
APITextBasedChannel<T>,
|
||||
|
||||
3
deno/rest/v10/guild.ts
generated
3
deno/rest/v10/guild.ts
generated
@@ -28,6 +28,7 @@ import type {
|
||||
APIGuildOnboardingPromptOption,
|
||||
APIRoleColors,
|
||||
APIIncidentsData,
|
||||
APIGuildChannel,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type {
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
@@ -357,7 +358,7 @@ export type RESTDeleteAPIGuildResult = never;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
||||
*/
|
||||
export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
export type RESTGetAPIGuildChannelsResult = APIGuildChannel[];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
||||
|
||||
3
deno/rest/v9/guild.ts
generated
3
deno/rest/v9/guild.ts
generated
@@ -28,6 +28,7 @@ import type {
|
||||
APIGuildOnboardingPromptOption,
|
||||
APIRoleColors,
|
||||
APIIncidentsData,
|
||||
APIGuildChannel,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type {
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
@@ -357,7 +358,7 @@ export type RESTDeleteAPIGuildResult = never;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
||||
*/
|
||||
export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
export type RESTGetAPIGuildChannelsResult = APIGuildChannel[];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
||||
|
||||
@@ -110,7 +110,7 @@ export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T>
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
export interface APIGuildChannel<T extends GuildChannelType = GuildChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -163,7 +163,7 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
parent_id?: null;
|
||||
}
|
||||
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
export interface APIVoiceChannelBase<T extends GuildChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
APITextBasedChannel<T>,
|
||||
|
||||
@@ -110,7 +110,7 @@ export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T>
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
export interface APIGuildChannel<T extends GuildChannelType = GuildChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -163,7 +163,7 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
parent_id?: null;
|
||||
}
|
||||
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
export interface APIVoiceChannelBase<T extends GuildChannelType = GuildChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
APITextBasedChannel<T>,
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {
|
||||
APIGuildOnboardingPromptOption,
|
||||
APIRoleColors,
|
||||
APIIncidentsData,
|
||||
APIGuildChannel,
|
||||
} from '../../payloads/v10/index';
|
||||
import type {
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
@@ -357,7 +358,7 @@ export type RESTDeleteAPIGuildResult = never;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
||||
*/
|
||||
export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
export type RESTGetAPIGuildChannelsResult = APIGuildChannel[];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {
|
||||
APIGuildOnboardingPromptOption,
|
||||
APIRoleColors,
|
||||
APIIncidentsData,
|
||||
APIGuildChannel,
|
||||
} from '../../payloads/v9/index';
|
||||
import type {
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
@@ -357,7 +358,7 @@ export type RESTDeleteAPIGuildResult = never;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
||||
*/
|
||||
export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
export type RESTGetAPIGuildChannelsResult = APIGuildChannel[];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type {
|
||||
ChannelType,
|
||||
GuildChannelType,
|
||||
APIPartialChannel,
|
||||
APIGroupDMChannel,
|
||||
APIDMChannel,
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
} from '../../v10';
|
||||
import { expectAssignable, expectNotAssignable } from '../__utils__/type-assertions';
|
||||
|
||||
type AnyGuildChannel = APIGuildChannel<ChannelType>;
|
||||
type AnyGuildChannel = APIGuildChannel<GuildChannelType>;
|
||||
|
||||
declare const partialChannel: APIPartialChannel;
|
||||
declare const dmChannel: APIDMChannel;
|
||||
|
||||
Reference in New Issue
Block a user