From e03565bdd8c494b6bada55c560483bf1d746b7a4 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sun, 14 Jan 2024 12:36:37 +0700 Subject: [PATCH] fix eslint + ts --- typings/index.d.ts | 155 +++++++++++++++++++++++---------------------- 1 file changed, 81 insertions(+), 74 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 75d394b..739b164 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -237,7 +237,6 @@ export class DiscordAuthWebsocket extends EventEmitter { public on(event: string, listener: (...args: any[]) => Awaitable): this; } - export interface ExternalAssets { url: string; external_asset_path: string; @@ -870,7 +869,9 @@ export class ClientUser extends User { public pronouns?: string; public premiumType: number; public setBanner(banner: BufferResolvable | Base64Resolvable | null): Promise; - public setHypeSquad(hypesquad: 0 | 1 | 2 | 3 | 'LEAVE' | 'HOUSE_BRAVERY' | 'HOUSE_BRILLIANCE' | 'HOUSE_BALANCE'): Promise; + public setHypeSquad( + hypesquad: 0 | 1 | 2 | 3 | 'LEAVE' | 'HOUSE_BRAVERY' | 'HOUSE_BRILLIANCE' | 'HOUSE_BALANCE', + ): Promise; public setAccentColor(color: ColorResolvable): Promise; public setAboutMe(bio: string | null): Promise; public createFriendInvite(): Promise; @@ -1271,7 +1272,12 @@ export class Guild extends AnonymousGuild { public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise; public toJSON(): unknown; public markAsRead(): Promise; - public setCommunity(stats: Boolean, publicUpdatesChannel?: GuildTextChannelResolvable, rulesChannel?: GuildTextChannelResolvable, reason?: string): Promise; + public setCommunity( + stats: boolean, + publicUpdatesChannel?: GuildTextChannelResolvable, + rulesChannel?: GuildTextChannelResolvable, + reason?: string, + ): Promise; public topEmojis(): Promise>; public setVanityCode(code?: string): Promise; } @@ -1296,16 +1302,16 @@ export class GuildAuditLogs { export class GuildAuditLogsEntry< TActionRaw extends GuildAuditLogsResolvable = 'ALL', TAction = TActionRaw extends keyof GuildAuditLogsIds - ? GuildAuditLogsIds[TActionRaw] - : TActionRaw extends null - ? 'ALL' - : TActionRaw, + ? GuildAuditLogsIds[TActionRaw] + : TActionRaw extends null + ? 'ALL' + : TActionRaw, TActionType extends GuildAuditLogsActionType = TAction extends keyof GuildAuditLogsTypes - ? GuildAuditLogsTypes[TAction][1] - : 'ALL', + ? GuildAuditLogsTypes[TAction][1] + : 'ALL', TTargetType extends GuildAuditLogsTarget = TAction extends keyof GuildAuditLogsTypes - ? GuildAuditLogsTypes[TAction][0] - : 'UNKNOWN', + ? GuildAuditLogsTypes[TAction][0] + : 'UNKNOWN', > { private constructor(guild: Guild, data: RawGuildAuditLogEntryData, logs?: GuildAuditLogs); public action: TAction; @@ -1562,7 +1568,7 @@ export class HTTPError extends Error { } // tslint:disable-next-line:no-empty-interface - Merge RateLimitData into RateLimitError to not have to type it again -export interface RateLimitError extends RateLimitData { } +export interface RateLimitError extends RateLimitData {} export class RateLimitError extends Error { private constructor(data: RateLimitData); public name: 'RateLimitError'; @@ -1881,8 +1887,11 @@ export class Message extends Base { public inGuild(): this is Message & this; public readonly isMessage: true; - public clickButton(button?: { X: number, Y: number } | string): Promise; - public selectMenu(menu: 0 | 1 | 2 | 3 | 4 | string, vales: Array): Promise; + public clickButton(button?: { X: number; Y: number } | string): Promise; + public selectMenu( + menu: 0 | 1 | 2 | 3 | 4 | string, + vales: (UserResolvable | RoleResolvable | ChannelResolvable | string)[], + ): Promise; public markUnread(): Promise; public markRead(): Promise; } @@ -1900,8 +1909,8 @@ export class MessageActionRow< T extends MessageActionRowComponent | ModalActionRowComponent = MessageActionRowComponent, U = T extends ModalActionRowComponent ? ModalActionRowComponentResolvable : MessageActionRowComponentResolvable, V = T extends ModalActionRowComponent - ? APIActionRowComponent - : APIActionRowComponent, + ? APIActionRowComponent + : APIActionRowComponent, > extends BaseMessageComponent { // tslint:disable-next-line:ban-ts-ignore // @ts-ignore (TS:2344, Caused by TypeScript 4.8) @@ -3684,13 +3693,13 @@ export class ApplicationCommandPermissionsManager< public remove( options: | (FetchSingleOptions & { - users: UserResolvable | UserResolvable[]; - roles?: RoleResolvable | RoleResolvable[]; - }) + users: UserResolvable | UserResolvable[]; + roles?: RoleResolvable | RoleResolvable[]; + }) | (FetchSingleOptions & { - users?: UserResolvable | UserResolvable[]; - roles: RoleResolvable | RoleResolvable[]; - }), + users?: UserResolvable | UserResolvable[]; + roles: RoleResolvable | RoleResolvable[]; + }), ): Promise; public set( options: FetchSingleOptions & { permissions: ApplicationCommandPermissionData[] }, @@ -4515,12 +4524,12 @@ export interface ApplicationCommandChannelOption extends BaseApplicationCommandO export interface ApplicationCommandAutocompleteOption extends Omit { type: - | 'STRING' - | 'NUMBER' - | 'INTEGER' - | ApplicationCommandOptionTypes.STRING - | ApplicationCommandOptionTypes.NUMBER - | ApplicationCommandOptionTypes.INTEGER; + | 'STRING' + | 'NUMBER' + | 'INTEGER' + | ApplicationCommandOptionTypes.STRING + | ApplicationCommandOptionTypes.NUMBER + | ApplicationCommandOptionTypes.INTEGER; autocomplete: true; } @@ -4792,9 +4801,9 @@ export interface AutoModerationRuleCreateOptions { reason?: string; } -export interface AutoModerationRuleEditOptions extends Partial> { } +export interface AutoModerationRuleEditOptions extends Partial> {} -export interface AutoModerationTriggerMetadataOptions extends Partial { } +export interface AutoModerationTriggerMetadataOptions extends Partial {} export interface AutoModerationActionOptions { type: AutoModerationActionType | AutoModerationActionTypes; @@ -4901,8 +4910,8 @@ export type CacheFactory = ( export type CacheWithLimitsOptions = { [K in keyof Caches]?: Caches[K][0]['prototype'] extends DataManager - ? LimitedCollectionOptions | number - : never; + ? LimitedCollectionOptions | number + : never; }; export interface CategoryCreateChannelOptions { permissionOverwrites?: OverwriteResolvable[] | Collection; @@ -5253,12 +5262,12 @@ export interface ConstantsClientApplicationAssetTypes { export type AutocompleteFocusedOption = Pick & { focused: true; type: - | 'STRING' - | 'INTEGER' - | 'NUMBER' - | ApplicationCommandOptionTypes.STRING - | ApplicationCommandOptionTypes.INTEGER - | ApplicationCommandOptionTypes.NUMBER; + | 'STRING' + | 'INTEGER' + | 'NUMBER' + | ApplicationCommandOptionTypes.STRING + | ApplicationCommandOptionTypes.INTEGER + | ApplicationCommandOptionTypes.NUMBER; value: string; }; @@ -5811,20 +5820,20 @@ export interface GuildAuditLogsEntryExtraField { MESSAGE_UNPIN: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake }; MEMBER_DISCONNECT: { count: number }; CHANNEL_OVERWRITE_CREATE: - | Role - | GuildMember - | { id: Snowflake; name: string; type: OverwriteTypes.role } - | { id: Snowflake; type: OverwriteTypes.member }; + | Role + | GuildMember + | { id: Snowflake; name: string; type: OverwriteTypes.role } + | { id: Snowflake; type: OverwriteTypes.member }; CHANNEL_OVERWRITE_UPDATE: - | Role - | GuildMember - | { id: Snowflake; name: string; type: OverwriteTypes.role } - | { id: Snowflake; type: OverwriteTypes.member }; + | Role + | GuildMember + | { id: Snowflake; name: string; type: OverwriteTypes.role } + | { id: Snowflake; type: OverwriteTypes.member }; CHANNEL_OVERWRITE_DELETE: - | Role - | GuildMember - | { id: Snowflake; name: string; type: OverwriteTypes.role } - | { id: Snowflake; type: OverwriteTypes.member }; + | Role + | GuildMember + | { id: Snowflake; name: string; type: OverwriteTypes.role } + | { id: Snowflake; type: OverwriteTypes.member }; STAGE_INSTANCE_CREATE: StageChannel | { id: Snowflake }; STAGE_INSTANCE_DELETE: StageChannel | { id: Snowflake }; STAGE_INSTANCE_UPDATE: StageChannel | { id: Snowflake }; @@ -5855,8 +5864,8 @@ export interface GuildAuditLogsEntryTargetField = T extends { withMember: true } - ? Collection> - : Collection>; + ? Collection> + : Collection>; export type GuildScheduledEventPrivacyLevel = keyof typeof GuildScheduledEventPrivacyLevels; @@ -6282,8 +6291,8 @@ export type ModalActionRowComponentResolvable = export interface MessageActionRowOptions< T extends - | MessageActionRowComponentResolvable - | ModalActionRowComponentResolvable = MessageActionRowComponentResolvable, + | MessageActionRowComponentResolvable + | ModalActionRowComponentResolvable = MessageActionRowComponentResolvable, > extends BaseMessageComponentOptions { components: T[]; } @@ -6483,9 +6492,7 @@ export interface BaseMessageSelectMenuOptions { } export interface StringMessageSelectMenuOptions extends BaseMessageSelectMenuOptions { - type?: - | 'STRING_SELECT' - | SelectMenuComponentTypes.STRING_SELECT + type?: 'STRING_SELECT' | SelectMenuComponentTypes.STRING_SELECT; options?: MessageSelectOptionData[]; } @@ -6536,8 +6543,8 @@ export type MFALevel = keyof typeof MFALevels; export interface ModalOptions { components: - | MessageActionRow[] - | MessageActionRowOptions[]; + | MessageActionRow[] + | MessageActionRowOptions[]; customId: string; title: string; } @@ -6698,19 +6705,19 @@ export type Partialize< id: Snowflake; partial: true; } & { - [K in keyof Omit]: K extends N ? null : K extends M ? T[K] | null : T[K]; - }; + [K in keyof Omit]: K extends N ? null : K extends M ? T[K] | null : T[K]; +}; export interface PartialDMChannel extends Partialize { lastMessageId: undefined; } -export interface PartialGuildMember extends Partialize { } +export interface PartialGuildMember extends Partialize {} export interface PartialMessage - extends Partialize { } + extends Partialize {} -export interface PartialMessageReaction extends Partialize { } +export interface PartialMessageReaction extends Partialize {} export interface PartialOverwriteData { id: Snowflake | number; @@ -6725,7 +6732,7 @@ export interface PartialRoleData extends RoleData { export type PartialTypes = 'USER' | 'CHANNEL' | 'GUILD_MEMBER' | 'MESSAGE' | 'REACTION' | 'GUILD_SCHEDULED_EVENT'; -export interface PartialUser extends Partialize { } +export interface PartialUser extends Partialize {} export type PresenceStatusData = ClientPresenceStatus | 'invisible'; @@ -6919,8 +6926,8 @@ export interface SweeperDefinitions { export type SweeperOptions = { [K in keyof SweeperDefinitions]?: SweeperDefinitions[K][2] extends true - ? SweepOptions | LifetimeSweepOptions - : SweepOptions; + ? SweepOptions | LifetimeSweepOptions + : SweepOptions; }; export interface LimitedCollectionOptions { @@ -7059,12 +7066,12 @@ export interface WebhookClientDataURL { export type FriendRequestOptions = | { - user: UserResolvable; - } + user: UserResolvable; + } | { - username: string; - discriminator: number | null; - }; + username: string; + discriminator: number | null; + }; export type WebhookClientOptions = Pick< ClientOptions,