Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: Use readonly arrays and const type parameters in places #9641

Merged
merged 5 commits into from
Jun 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
public getChannel<T extends ChannelType = ChannelType>(
name: string,
required: true,
channelTypes?: T[],
channelTypes?: Readonly<T[]>,
Jiralite marked this conversation as resolved.
Show resolved Hide resolved
): Extract<
NonNullable<CommandInteractionOption<Cached>['channel']>,
{
Expand All @@ -1180,7 +1180,7 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
public getChannel<T extends ChannelType = ChannelType>(
name: string,
required?: boolean,
channelTypes?: T[],
channelTypes?: Readonly<T[]>,
Jiralite marked this conversation as resolved.
Show resolved Hide resolved
): Extract<
NonNullable<CommandInteractionOption<Cached>['channel']>,
{
Expand Down Expand Up @@ -4331,13 +4331,13 @@ export type ApplicationCommandData =

export interface ApplicationCommandChannelOptionData extends BaseApplicationCommandOptionsData {
type: CommandOptionChannelResolvableType;
channelTypes?: ApplicationCommandOptionAllowedChannelTypes[];
channel_types?: ApplicationCommandOptionAllowedChannelTypes[];
channelTypes?: Readonly<ApplicationCommandOptionAllowedChannelTypes[]>;
channel_types?: Readonly<ApplicationCommandOptionAllowedChannelTypes[]>;
Jiralite marked this conversation as resolved.
Show resolved Hide resolved
}

export interface ApplicationCommandChannelOption extends BaseApplicationCommandOptionsData {
type: ApplicationCommandOptionType.Channel;
channelTypes?: ApplicationCommandOptionAllowedChannelTypes[];
channelTypes?: Readonly<ApplicationCommandOptionAllowedChannelTypes[]>;
Jiralite marked this conversation as resolved.
Show resolved Hide resolved
}

export interface ApplicationCommandRoleOptionData extends BaseApplicationCommandOptionsData {
Expand Down