types(*): make hex color types compatible with ColorResolvable (#5973)

* types(*): make hex color types compatible with ColorResolvable

* types(*): create HexColorString type

* types(HexColorString): move to a less awkward place
This commit is contained in:
Rodry
2021-06-30 14:32:14 +01:00
committed by GitHub
parent 64f093f9c4
commit 788d58e5a3

12
typings/index.d.ts vendored
View File

@@ -1076,7 +1076,7 @@ declare module 'discord.js' {
public readonly bannable: boolean; public readonly bannable: boolean;
public deleted: boolean; public deleted: boolean;
public readonly displayColor: number; public readonly displayColor: number;
public readonly displayHexColor: string; public readonly displayHexColor: HexColorString;
public readonly displayName: string; public readonly displayName: string;
public guild: Guild; public guild: Guild;
public readonly id: Snowflake; public readonly id: Snowflake;
@@ -1502,7 +1502,7 @@ declare module 'discord.js' {
public description: string | null; public description: string | null;
public fields: EmbedField[]; public fields: EmbedField[];
public footer: MessageEmbedFooter | null; public footer: MessageEmbedFooter | null;
public readonly hexColor: string | null; public readonly hexColor: HexColorString | null;
public image: MessageEmbedImage | null; public image: MessageEmbedImage | null;
public readonly length: number; public readonly length: number;
public provider: MessageEmbedProvider | null; public provider: MessageEmbedProvider | null;
@@ -1739,7 +1739,7 @@ declare module 'discord.js' {
public deleted: boolean; public deleted: boolean;
public readonly editable: boolean; public readonly editable: boolean;
public guild: Guild; public guild: Guild;
public readonly hexColor: string; public readonly hexColor: HexColorString;
public hoist: boolean; public hoist: boolean;
public id: Snowflake; public id: Snowflake;
public managed: boolean; public managed: boolean;
@@ -3220,7 +3220,7 @@ declare module 'discord.js' {
| 'RANDOM' | 'RANDOM'
| [number, number, number] | [number, number, number]
| number | number
| `#${string}`; | HexColorString;
interface CommandInteractionOption { interface CommandInteractionOption {
name: string; name: string;
@@ -3607,6 +3607,8 @@ declare module 'discord.js' {
type GuildTemplateResolvable = string; type GuildTemplateResolvable = string;
type HexColorString = `#${string}`;
interface HTTPAttachmentData { interface HTTPAttachmentData {
attachment: string | Buffer | Stream; attachment: string | Buffer | Stream;
name: string; name: string;
@@ -4112,7 +4114,7 @@ declare module 'discord.js' {
> { > {
readonly bannable: boolean; readonly bannable: boolean;
readonly displayColor: number; readonly displayColor: number;
readonly displayHexColor: string; readonly displayHexColor: HexColorString;
readonly displayName: string; readonly displayName: string;
guild: Guild; guild: Guild;
readonly manageable: boolean; readonly manageable: boolean;