From cd37e22b1045e8a228ac97dd3fca18928f5f2bb2 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sun, 7 May 2023 10:27:01 +0700 Subject: [PATCH] fix(Constants): Ordering and missing information djs v13 #9500 --- src/util/Constants.js | 13 ++- typings/enums.d.ts | 5 - typings/index.d.ts | 219 ++++++++++++++++++++---------------------- 3 files changed, 113 insertions(+), 124 deletions(-) diff --git a/src/util/Constants.js b/src/util/Constants.js index 2b71a64..0f824dd 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -1855,14 +1855,15 @@ function createEnum(keys) { * @property {Object} ApplicationCommandTypes * The type of an {@link ApplicationCommand} object. * @property {Object} ApplicationRoleConnectionMetadataTypes - * @property {Object} AutoModerationRuleTriggerTypes Characterizes the type - * of content which can trigger the rule. + * The type of an {@link ApplicationRoleConnectionMetadata} object. * @property {Object} AutoModerationActionTypes * A type of an action which executes whenever a rule is triggered. + * @property {Object} AutoModerationRuleEventTypes Indicates in what event context + * a rule should be checked. * @property {Object} AutoModerationRuleKeywordPresetTypes * The internally pre-defined wordsetswhich will be searched for in content - * @property {Object} AutoModerationRuleEventTypes Indicates in what event context - * a rule should be checked. + * @property {Object} AutoModerationRuleTriggerTypes Characterizes the type + * of content which can trigger the rule. * @property {Object} ChannelTypes All available channel types. * @property {ClientApplicationAssetTypes} ClientApplicationAssetTypes The types of an {@link ApplicationAsset} object. * @property {Object} Colors An object with regularly used colors. @@ -1883,9 +1884,11 @@ function createEnum(keys) { * @property {Object} InteractionResponseTypes The type of an interaction response. * @property {Object} InteractionTypes The type of an {@link Interaction} object. * @property {InviteScope[]} InviteScopes The scopes of an invite. + * @property {number} MaxBulkDeletableMessageAge Max bulk deletable message age (Unavailable to selfbots) * @property {Object} MembershipStates The value set for a team members membership state. * @property {Object} MessageButtonStyles The style of a message button. * @property {Object} MessageComponentTypes The type of a message component. + * @property {MessageType[]} MessageTypes The type of a {@link Message} object. * @property {Object} SelectMenuComponentTypes The type of any select menu. * @property {Object} MFALevels The required MFA level for a guild. * @property {Object} NSFWLevels NSFW level of a guild. @@ -1902,7 +1905,7 @@ function createEnum(keys) { * @property {SweeperKey[]} SweeperKeys The name of an item to be swept in Sweepers. * @property {SystemMessageType[]} SystemMessageTypes The types of messages that are `System`. * @property {Object} TextInputStyles The style of a text input component. - * @property {number} MaxBulkDeletableMessageAge Max bulk deletable message age + * @property {ThreadChannelTypes[]} ThreadChannelTypes The type of a {@link ThreadChannel} object. * @property {string} UserAgent The user agent used for requests. * @property {Object} VerificationLevels * The value set for the verification levels for a guild. diff --git a/typings/enums.d.ts b/typings/enums.d.ts index 756a7d6..dd30437 100644 --- a/typings/enums.d.ts +++ b/typings/enums.d.ts @@ -269,11 +269,6 @@ export const enum SelectMenuComponentTypes { CHANNEL_SELECT = 8, } -export const enum ModalComponentTypes { - ACTION_ROW = 1, - TEXT_INPUT = 4, -} - export const enum MFALevels { NONE = 0, ELEVATED = 1, diff --git a/typings/index.d.ts b/typings/index.d.ts index 281843c..e47b86d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -87,7 +87,6 @@ import { MessageButtonStyles, MessageComponentTypes, MessageTypes, - ModalComponentTypes, MFALevels, NitroType as NitroTypes, HypeSquadType as HypeSquadTypes, @@ -3622,148 +3621,140 @@ export type EnumHolder = { [P in keyof T]: T[P] }; export type ExcludeEnum = Exclude; export const Constants: { - Package: { - name: string; - version: string; - description: string; - license: string; - main: string; - types: string; - homepage: string; - keywords: string[]; - bugs: { url: string }; - repository: { type: string; url: string }; - scripts: Record; - engines: Record; - dependencies: Record; - devDependencies: Record; - [key: string]: unknown; - }; - MaxBulkDeletableMessageAge: 1_209_600_000; - UserAgent: string; + ActivityTypes: EnumHolder; + APIErrors: APIErrors; + ApplicationCommandOptionTypes: EnumHolder; + ApplicationCommandPermissionTypes: EnumHolder; + ApplicationCommandTypes: EnumHolder; + ApplicationRoleConnectionMetadataTypes: EnumHolder; + AutoModerationActionTypes: EnumHolder; + AutoModerationRuleEventTypes: EnumHolder; + AutoModerationRuleKeywordPresetTypes: EnumHolder; + AutoModerationRuleTriggerTypes: EnumHolder; + ChannelTypes: EnumHolder; + ClientApplicationAssetTypes: ConstantsClientApplicationAssetTypes; + Colors: ConstantsColors; + DefaultMessageNotificationLevels: EnumHolder; Endpoints: { - botGateway: string; - invite: (root: string, code: string, eventId?: Snowflake) => string; - scheduledEvent: (root: string, guildId: Snowflake, eventId: Snowflake) => string; - CDN: (root: string) => { - Emoji: (emojiId: Snowflake, format: DynamicImageFormat) => string; - Asset: (name: string) => string; - DefaultAvatar: (discriminator: number) => string; - Avatar: ( + CDN(root: string): { + AppAsset( + appId: Snowflake, + hash: string, + { format, size }: { format: AllowedImageFormat; size: AllowedImageSize }, + ): string; + AppIcon( + appId: Snowflake, + hash: string, + { format, size }: { format: AllowedImageFormat; size: AllowedImageSize }, + ): string; + Asset(name: string): string; + Avatar( userId: Snowflake, hash: string, format: DynamicImageFormat, size: AllowedImageSize, dynamic: boolean, - ) => string; - AvatarDecoration: (userId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string; - Banner: ( - id: Snowflake, - hash: string, - format: DynamicImageFormat, - size: AllowedImageSize, - dynamic: boolean, - ) => string; - GuildMemberAvatar: ( + ): string; + Banner(id: Snowflake, hash: string, format: DynamicImageFormat, size: AllowedImageSize, dynamic: boolean): string; + DefaultAvatar(discriminator: number): string; + DiscoverySplash(guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string; + Emoji(emojiId: Snowflake, format: DynamicImageFormat): string; + GDMIcon(channelId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string; + GuildMemberAvatar( guildId: Snowflake, memberId: Snowflake, hash: string, format?: DynamicImageFormat, size?: AllowedImageSize, dynamic?: boolean, - ) => string; - Icon: ( + ): string; + Icon( guildId: Snowflake, hash: string, format: DynamicImageFormat, size: AllowedImageSize, dynamic: boolean, - ) => string; - AppIcon: ( - appId: Snowflake, - hash: string, - { format, size }: { format: AllowedImageFormat; size: AllowedImageSize }, - ) => string; - AppAsset: ( - appId: Snowflake, - hash: string, - { format, size }: { format: AllowedImageFormat; size: AllowedImageSize }, - ) => string; - StickerPackBanner: (bannerId: Snowflake, format: AllowedImageFormat, size: AllowedImageSize) => string; - GDMIcon: (channelId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string; - Splash: (guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string; - DiscoverySplash: (guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string; - TeamIcon: ( + ): string; + RoleIcon(roleId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string; + Splash(guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string; + Sticker(stickerId: Snowflake, stickerFormat: StickerFormatType): string; + StickerPackBanner(bannerId: Snowflake, format: AllowedImageFormat, size: AllowedImageSize): string; + TeamIcon( teamId: Snowflake, hash: string, { format, size }: { format: AllowedImageFormat; size: AllowedImageSize }, - ) => string; - Sticker: (stickerId: Snowflake, stickerFormat: StickerFormatType) => string; - RoleIcon: (roleId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string; + ): string; }; - }; - WSCodes: { - 1000: 'WS_CLOSE_REQUESTED'; - 1011: 'INTERNAL_ERROR'; - 4004: 'TOKEN_INVALID'; - 4010: 'SHARDING_INVALID'; - 4011: 'SHARDING_REQUIRED'; - 4013: 'INVALID_INTENTS'; - 4014: 'DISALLOWED_INTENTS'; + botGateway: string; + invite(root: string, code: string, eventId?: Snowflake): string; + scheduledEvent(root: string, guildId: Snowflake, eventId: Snowflake): string; }; Events: ConstantsEvents; - ShardEvents: ConstantsShardEvents; + ExplicitContentFilterLevels: EnumHolder; + GuildScheduledEventEntityTypes: EnumHolder; + GuildScheduledEventPrivacyLevels: EnumHolder; + GuildScheduledEventStatuses: EnumHolder; + IntegrationExpireBehaviors: IntegrationExpireBehaviors[]; + InteractionResponseTypes: EnumHolder; + InteractionTypes: EnumHolder; + InviteScopes: InviteScope[]; + MaxBulkDeletableMessageAge: 1_209_600_000; + MembershipStates: EnumHolder; + MessageButtonStyles: EnumHolder; + MessageComponentTypes: EnumHolder; + MessageTypes: MessageType[]; + MFALevels: EnumHolder; + NSFWLevels: EnumHolder; + Opcodes: ConstantsOpcodes; + OverwriteTypes: EnumHolder; + Package: { + [key: string]: unknown; + bugs: { url: string }; + dependencies: Record; + description: string; + devDependencies: Record; + engines: Record; + homepage: string; + keywords: string[]; + license: string; + main: string; + name: string; + repository: { type: string; url: string }; + scripts: Record; + types: string; + version: string; + }; PartialTypes: { [K in PartialTypes]: K; }; + PremiumTiers: EnumHolder; + PrivacyLevels: EnumHolder; + ShardEvents: ConstantsShardEvents; + Status: ConstantsStatus; + StickerFormatTypes: EnumHolder; + StickerTypes: EnumHolder; + SweeperKeys: SweeperKey[]; + SystemMessageTypes: SystemMessageType[]; + TextBasedChannelTypes: TextBasedChannelTypes[]; + TextInputStyles: EnumHolder; + ThreadChannelTypes: ThreadChannelTypes[]; + UserAgent: string; + VerificationLevels: EnumHolder; + VideoQualityModes: EnumHolder; + VoiceBasedChannelTypes: VoiceBasedChannelTypes[]; + WebhookTypes: EnumHolder; + WSCodes: { + 1_000: 'WS_CLOSE_REQUESTED'; + 1_011: 'INTERNAL_ERROR'; + 4_004: 'TOKEN_INVALID'; + 4_010: 'SHARDING_INVALID'; + 4_011: 'SHARDING_REQUIRED'; + 4_013: 'INVALID_INTENTS'; + 4_014: 'DISALLOWED_INTENTS'; + }; WSEvents: { [K in WSEventType]: K; }; - Colors: ConstantsColors; - Status: ConstantsStatus; - Opcodes: ConstantsOpcodes; - APIErrors: APIErrors; - ChannelTypes: EnumHolder; - ThreadChannelTypes: ThreadChannelTypes[]; - TextBasedChannelTypes: TextBasedChannelTypes[]; - VoiceBasedChannelTypes: VoiceBasedChannelTypes[]; - ClientApplicationAssetTypes: ConstantsClientApplicationAssetTypes; - IntegrationExpireBehaviors: IntegrationExpireBehaviors[]; - InviteScopes: InviteScope[]; - MessageTypes: MessageType[]; - SystemMessageTypes: SystemMessageType[]; - ActivityTypes: EnumHolder; - StickerTypes: EnumHolder; - StickerFormatTypes: EnumHolder; - OverwriteTypes: EnumHolder; - ExplicitContentFilterLevels: EnumHolder; - DefaultMessageNotificationLevels: EnumHolder; - VerificationLevels: EnumHolder; - MembershipStates: EnumHolder; - AutoModerationRuleTriggerTypes: EnumHolder; - AutoModerationRuleKeywordPresetTypes: EnumHolder; - AutoModerationActionTypes: EnumHolder; - AutoModerationRuleEventTypes: EnumHolder; - ApplicationCommandOptionTypes: EnumHolder; - ApplicationCommandPermissionTypes: EnumHolder; - InteractionTypes: EnumHolder; - InteractionResponseTypes: EnumHolder; - MessageComponentTypes: EnumHolder; - SelectMenuComponentTypes: EnumHolder; - MessageButtonStyles: EnumHolder; - ModalComponentTypes: EnumHolder; - TextInputStyles: EnumHolder; - MFALevels: EnumHolder; - NSFWLevels: EnumHolder; - PrivacyLevels: EnumHolder; - WebhookTypes: EnumHolder; - PremiumTiers: EnumHolder; - ApplicationCommandTypes: EnumHolder; - GuildScheduledEventEntityTypes: EnumHolder; - GuildScheduledEventStatuses: EnumHolder; - GuildScheduledEventPrivacyLevels: EnumHolder; - VideoQualityModes: EnumHolder; - SweeperKeys: SweeperKey[]; // Add defaultUA: string; captchaServices: captchaServices[];