mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
types: don't use readonly arrays in interfaces (#4794)
This reverts some of the changes in f451be05 so that this works:
```ts
const embed: MessageEmbedOptions = {
fields: [{
// fixed stuff
}],
};
if (/* condition */) {
embed.fields.push({
// conditional stuff
});
}
```
See https://github.com/discordjs/discord.js/pull/4692#issuecomment-687252066.
This commit is contained in:
22
typings/index.d.ts
vendored
22
typings/index.d.ts
vendored
@@ -2198,11 +2198,11 @@ declare module 'discord.js' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface AwaitMessagesOptions extends MessageCollectorOptions {
|
interface AwaitMessagesOptions extends MessageCollectorOptions {
|
||||||
errors?: readonly string[];
|
errors?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AwaitReactionsOptions extends ReactionCollectorOptions {
|
interface AwaitReactionsOptions extends ReactionCollectorOptions {
|
||||||
errors?: readonly string[];
|
errors?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BanOptions {
|
interface BanOptions {
|
||||||
@@ -2474,7 +2474,7 @@ declare module 'discord.js' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface FetchMembersOptions {
|
interface FetchMembersOptions {
|
||||||
user?: UserResolvable | readonly UserResolvable[];
|
user?: UserResolvable | UserResolvable[];
|
||||||
query?: string;
|
query?: string;
|
||||||
limit?: number;
|
limit?: number;
|
||||||
withPresences?: boolean;
|
withPresences?: boolean;
|
||||||
@@ -2557,7 +2557,7 @@ declare module 'discord.js' {
|
|||||||
type GuildChannelResolvable = Snowflake | GuildChannel;
|
type GuildChannelResolvable = Snowflake | GuildChannel;
|
||||||
|
|
||||||
interface GuildCreateChannelOptions {
|
interface GuildCreateChannelOptions {
|
||||||
permissionOverwrites?: readonly OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
|
permissionOverwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
|
||||||
topic?: string;
|
topic?: string;
|
||||||
type?: Exclude<
|
type?: Exclude<
|
||||||
keyof typeof ChannelType | ChannelType,
|
keyof typeof ChannelType | ChannelType,
|
||||||
@@ -2602,13 +2602,13 @@ declare module 'discord.js' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface GuildEmojiCreateOptions {
|
interface GuildEmojiCreateOptions {
|
||||||
roles?: Collection<Snowflake, Role> | readonly RoleResolvable[];
|
roles?: Collection<Snowflake, Role> | RoleResolvable[];
|
||||||
reason?: string;
|
reason?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface GuildEmojiEditData {
|
interface GuildEmojiEditData {
|
||||||
name?: string;
|
name?: string;
|
||||||
roles?: Collection<Snowflake, Role> | readonly RoleResolvable[];
|
roles?: Collection<Snowflake, Role> | RoleResolvable[];
|
||||||
}
|
}
|
||||||
|
|
||||||
type GuildFeatures =
|
type GuildFeatures =
|
||||||
@@ -2762,8 +2762,8 @@ declare module 'discord.js' {
|
|||||||
url?: string;
|
url?: string;
|
||||||
timestamp?: Date | number;
|
timestamp?: Date | number;
|
||||||
color?: ColorResolvable;
|
color?: ColorResolvable;
|
||||||
fields?: readonly EmbedFieldData[];
|
fields?: EmbedFieldData[];
|
||||||
files?: readonly (MessageAttachment | string | FileOptions)[];
|
files?: (MessageAttachment | string | FileOptions)[];
|
||||||
author?: Partial<MessageEmbedAuthor> & { icon_url?: string; proxy_icon_url?: string };
|
author?: Partial<MessageEmbedAuthor> & { icon_url?: string; proxy_icon_url?: string };
|
||||||
thumbnail?: Partial<MessageEmbedThumbnail> & { proxy_url?: string };
|
thumbnail?: Partial<MessageEmbedThumbnail> & { proxy_url?: string };
|
||||||
image?: Partial<MessageEmbedImage> & { proxy_url?: string };
|
image?: Partial<MessageEmbedImage> & { proxy_url?: string };
|
||||||
@@ -2813,7 +2813,7 @@ declare module 'discord.js' {
|
|||||||
embed?: MessageEmbed | MessageEmbedOptions;
|
embed?: MessageEmbed | MessageEmbedOptions;
|
||||||
disableMentions?: 'none' | 'all' | 'everyone';
|
disableMentions?: 'none' | 'all' | 'everyone';
|
||||||
allowedMentions?: MessageMentionOptions;
|
allowedMentions?: MessageMentionOptions;
|
||||||
files?: readonly (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
||||||
code?: string | boolean;
|
code?: string | boolean;
|
||||||
split?: boolean | SplitOptions;
|
split?: boolean | SplitOptions;
|
||||||
reply?: UserResolvable;
|
reply?: UserResolvable;
|
||||||
@@ -3166,10 +3166,10 @@ declare module 'discord.js' {
|
|||||||
avatarURL?: string;
|
avatarURL?: string;
|
||||||
tts?: boolean;
|
tts?: boolean;
|
||||||
nonce?: string;
|
nonce?: string;
|
||||||
embeds?: readonly (MessageEmbed | object)[];
|
embeds?: (MessageEmbed | object)[];
|
||||||
disableMentions?: 'none' | 'all' | 'everyone';
|
disableMentions?: 'none' | 'all' | 'everyone';
|
||||||
allowedMentions?: MessageMentionOptions;
|
allowedMentions?: MessageMentionOptions;
|
||||||
files?: readonly (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
||||||
code?: string | boolean;
|
code?: string | boolean;
|
||||||
split?: boolean | SplitOptions;
|
split?: boolean | SplitOptions;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user