fix(Constants): Ordering and missing information

djs v13 #9500
This commit is contained in:
Elysia 2023-05-07 10:27:01 +07:00
parent d4207a03af
commit cd37e22b10
3 changed files with 113 additions and 124 deletions

View File

@ -1855,14 +1855,15 @@ function createEnum(keys) {
* @property {Object<ApplicationCommandType, number>} ApplicationCommandTypes * @property {Object<ApplicationCommandType, number>} ApplicationCommandTypes
* The type of an {@link ApplicationCommand} object. * The type of an {@link ApplicationCommand} object.
* @property {Object<ApplicationRoleConnectionMetadataType, number>} ApplicationRoleConnectionMetadataTypes * @property {Object<ApplicationRoleConnectionMetadataType, number>} ApplicationRoleConnectionMetadataTypes
* @property {Object<AutoModerationRuleTriggerType, number>} AutoModerationRuleTriggerTypes Characterizes the type * The type of an {@link ApplicationRoleConnectionMetadata} object.
* of content which can trigger the rule.
* @property {Object<AutoModerationActionType, number>} AutoModerationActionTypes * @property {Object<AutoModerationActionType, number>} AutoModerationActionTypes
* A type of an action which executes whenever a rule is triggered. * A type of an action which executes whenever a rule is triggered.
* @property {Object<AutoModerationRuleEventType, number>} AutoModerationRuleEventTypes Indicates in what event context
* a rule should be checked.
* @property {Object<AutoModerationRuleKeywordPresetType, number>} AutoModerationRuleKeywordPresetTypes * @property {Object<AutoModerationRuleKeywordPresetType, number>} AutoModerationRuleKeywordPresetTypes
* The internally pre-defined wordsetswhich will be searched for in content * The internally pre-defined wordsetswhich will be searched for in content
* @property {Object<AutoModerationRuleEventType, number>} AutoModerationRuleEventTypes Indicates in what event context * @property {Object<AutoModerationRuleTriggerType, number>} AutoModerationRuleTriggerTypes Characterizes the type
* a rule should be checked. * of content which can trigger the rule.
* @property {Object<ChannelType, number>} ChannelTypes All available channel types. * @property {Object<ChannelType, number>} ChannelTypes All available channel types.
* @property {ClientApplicationAssetTypes} ClientApplicationAssetTypes The types of an {@link ApplicationAsset} object. * @property {ClientApplicationAssetTypes} ClientApplicationAssetTypes The types of an {@link ApplicationAsset} object.
* @property {Object<Color, number>} Colors An object with regularly used colors. * @property {Object<Color, number>} Colors An object with regularly used colors.
@ -1883,9 +1884,11 @@ function createEnum(keys) {
* @property {Object<InteractionResponseType, number>} InteractionResponseTypes The type of an interaction response. * @property {Object<InteractionResponseType, number>} InteractionResponseTypes The type of an interaction response.
* @property {Object<InteractionType, number>} InteractionTypes The type of an {@link Interaction} object. * @property {Object<InteractionType, number>} InteractionTypes The type of an {@link Interaction} object.
* @property {InviteScope[]} InviteScopes The scopes of an invite. * @property {InviteScope[]} InviteScopes The scopes of an invite.
* @property {number} MaxBulkDeletableMessageAge Max bulk deletable message age (Unavailable to selfbots)
* @property {Object<MembershipState, number>} MembershipStates The value set for a team members membership state. * @property {Object<MembershipState, number>} MembershipStates The value set for a team members membership state.
* @property {Object<MessageButtonStyle, number>} MessageButtonStyles The style of a message button. * @property {Object<MessageButtonStyle, number>} MessageButtonStyles The style of a message button.
* @property {Object<MessageComponentType, number>} MessageComponentTypes The type of a message component. * @property {Object<MessageComponentType, number>} MessageComponentTypes The type of a message component.
* @property {MessageType[]} MessageTypes The type of a {@link Message} object.
* @property {Object<SelectMenuComponentType, number>} SelectMenuComponentTypes The type of any select menu. * @property {Object<SelectMenuComponentType, number>} SelectMenuComponentTypes The type of any select menu.
* @property {Object<MFALevel, number>} MFALevels The required MFA level for a guild. * @property {Object<MFALevel, number>} MFALevels The required MFA level for a guild.
* @property {Object<NSFWLevel, number>} NSFWLevels NSFW level of a guild. * @property {Object<NSFWLevel, number>} 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 {SweeperKey[]} SweeperKeys The name of an item to be swept in Sweepers.
* @property {SystemMessageType[]} SystemMessageTypes The types of messages that are `System`. * @property {SystemMessageType[]} SystemMessageTypes The types of messages that are `System`.
* @property {Object<TextInputStyle, number>} TextInputStyles The style of a text input component. * @property {Object<TextInputStyle, number>} 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 {string} UserAgent The user agent used for requests.
* @property {Object<VerificationLevel, number>} VerificationLevels * @property {Object<VerificationLevel, number>} VerificationLevels
* The value set for the verification levels for a guild. * The value set for the verification levels for a guild.

5
typings/enums.d.ts vendored
View File

@ -269,11 +269,6 @@ export const enum SelectMenuComponentTypes {
CHANNEL_SELECT = 8, CHANNEL_SELECT = 8,
} }
export const enum ModalComponentTypes {
ACTION_ROW = 1,
TEXT_INPUT = 4,
}
export const enum MFALevels { export const enum MFALevels {
NONE = 0, NONE = 0,
ELEVATED = 1, ELEVATED = 1,

219
typings/index.d.ts vendored
View File

@ -87,7 +87,6 @@ import {
MessageButtonStyles, MessageButtonStyles,
MessageComponentTypes, MessageComponentTypes,
MessageTypes, MessageTypes,
ModalComponentTypes,
MFALevels, MFALevels,
NitroType as NitroTypes, NitroType as NitroTypes,
HypeSquadType as HypeSquadTypes, HypeSquadType as HypeSquadTypes,
@ -3622,148 +3621,140 @@ export type EnumHolder<T> = { [P in keyof T]: T[P] };
export type ExcludeEnum<T, K extends keyof T> = Exclude<keyof T | T[keyof T], K | T[K]>; export type ExcludeEnum<T, K extends keyof T> = Exclude<keyof T | T[keyof T], K | T[K]>;
export const Constants: { export const Constants: {
Package: { ActivityTypes: EnumHolder<typeof ActivityTypes>;
name: string; APIErrors: APIErrors;
version: string; ApplicationCommandOptionTypes: EnumHolder<typeof ApplicationCommandOptionTypes>;
description: string; ApplicationCommandPermissionTypes: EnumHolder<typeof ApplicationCommandPermissionTypes>;
license: string; ApplicationCommandTypes: EnumHolder<typeof ApplicationCommandTypes>;
main: string; ApplicationRoleConnectionMetadataTypes: EnumHolder<typeof ApplicationRoleConnectionMetadataTypes>;
types: string; AutoModerationActionTypes: EnumHolder<typeof AutoModerationActionTypes>;
homepage: string; AutoModerationRuleEventTypes: EnumHolder<typeof AutoModerationRuleEventTypes>;
keywords: string[]; AutoModerationRuleKeywordPresetTypes: EnumHolder<typeof AutoModerationRuleKeywordPresetTypes>;
bugs: { url: string }; AutoModerationRuleTriggerTypes: EnumHolder<typeof AutoModerationRuleTriggerTypes>;
repository: { type: string; url: string }; ChannelTypes: EnumHolder<typeof ChannelTypes>;
scripts: Record<string, string>; ClientApplicationAssetTypes: ConstantsClientApplicationAssetTypes;
engines: Record<string, string>; Colors: ConstantsColors;
dependencies: Record<string, string>; DefaultMessageNotificationLevels: EnumHolder<typeof DefaultMessageNotificationLevels>;
devDependencies: Record<string, string>;
[key: string]: unknown;
};
MaxBulkDeletableMessageAge: 1_209_600_000;
UserAgent: string;
Endpoints: { Endpoints: {
botGateway: string; CDN(root: string): {
invite: (root: string, code: string, eventId?: Snowflake) => string; AppAsset(
scheduledEvent: (root: string, guildId: Snowflake, eventId: Snowflake) => string; appId: Snowflake,
CDN: (root: string) => { hash: string,
Emoji: (emojiId: Snowflake, format: DynamicImageFormat) => string; { format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
Asset: (name: string) => string; ): string;
DefaultAvatar: (discriminator: number) => string; AppIcon(
Avatar: ( appId: Snowflake,
hash: string,
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
): string;
Asset(name: string): string;
Avatar(
userId: Snowflake, userId: Snowflake,
hash: string, hash: string,
format: DynamicImageFormat, format: DynamicImageFormat,
size: AllowedImageSize, size: AllowedImageSize,
dynamic: boolean, dynamic: boolean,
) => string; ): string;
AvatarDecoration: (userId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string; Banner(id: Snowflake, hash: string, format: DynamicImageFormat, size: AllowedImageSize, dynamic: boolean): string;
Banner: ( DefaultAvatar(discriminator: number): string;
id: Snowflake, DiscoverySplash(guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string;
hash: string, Emoji(emojiId: Snowflake, format: DynamicImageFormat): string;
format: DynamicImageFormat, GDMIcon(channelId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string;
size: AllowedImageSize, GuildMemberAvatar(
dynamic: boolean,
) => string;
GuildMemberAvatar: (
guildId: Snowflake, guildId: Snowflake,
memberId: Snowflake, memberId: Snowflake,
hash: string, hash: string,
format?: DynamicImageFormat, format?: DynamicImageFormat,
size?: AllowedImageSize, size?: AllowedImageSize,
dynamic?: boolean, dynamic?: boolean,
) => string; ): string;
Icon: ( Icon(
guildId: Snowflake, guildId: Snowflake,
hash: string, hash: string,
format: DynamicImageFormat, format: DynamicImageFormat,
size: AllowedImageSize, size: AllowedImageSize,
dynamic: boolean, dynamic: boolean,
) => string; ): string;
AppIcon: ( RoleIcon(roleId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string;
appId: Snowflake, Splash(guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize): string;
hash: string, Sticker(stickerId: Snowflake, stickerFormat: StickerFormatType): string;
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize }, StickerPackBanner(bannerId: Snowflake, format: AllowedImageFormat, size: AllowedImageSize): string;
) => string; TeamIcon(
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: (
teamId: Snowflake, teamId: Snowflake,
hash: string, hash: string,
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize }, { format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
) => string; ): string;
Sticker: (stickerId: Snowflake, stickerFormat: StickerFormatType) => string;
RoleIcon: (roleId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
}; };
}; botGateway: string;
WSCodes: { invite(root: string, code: string, eventId?: Snowflake): string;
1000: 'WS_CLOSE_REQUESTED'; scheduledEvent(root: string, guildId: Snowflake, eventId: Snowflake): string;
1011: 'INTERNAL_ERROR';
4004: 'TOKEN_INVALID';
4010: 'SHARDING_INVALID';
4011: 'SHARDING_REQUIRED';
4013: 'INVALID_INTENTS';
4014: 'DISALLOWED_INTENTS';
}; };
Events: ConstantsEvents; Events: ConstantsEvents;
ShardEvents: ConstantsShardEvents; ExplicitContentFilterLevels: EnumHolder<typeof ExplicitContentFilterLevels>;
GuildScheduledEventEntityTypes: EnumHolder<typeof GuildScheduledEventEntityTypes>;
GuildScheduledEventPrivacyLevels: EnumHolder<typeof GuildScheduledEventPrivacyLevels>;
GuildScheduledEventStatuses: EnumHolder<typeof GuildScheduledEventStatuses>;
IntegrationExpireBehaviors: IntegrationExpireBehaviors[];
InteractionResponseTypes: EnumHolder<typeof InteractionResponseTypes>;
InteractionTypes: EnumHolder<typeof InteractionTypes>;
InviteScopes: InviteScope[];
MaxBulkDeletableMessageAge: 1_209_600_000;
MembershipStates: EnumHolder<typeof MembershipStates>;
MessageButtonStyles: EnumHolder<typeof MessageButtonStyles>;
MessageComponentTypes: EnumHolder<typeof MessageComponentTypes>;
MessageTypes: MessageType[];
MFALevels: EnumHolder<typeof MFALevels>;
NSFWLevels: EnumHolder<typeof NSFWLevels>;
Opcodes: ConstantsOpcodes;
OverwriteTypes: EnumHolder<typeof OverwriteTypes>;
Package: {
[key: string]: unknown;
bugs: { url: string };
dependencies: Record<string, string>;
description: string;
devDependencies: Record<string, string>;
engines: Record<string, string>;
homepage: string;
keywords: string[];
license: string;
main: string;
name: string;
repository: { type: string; url: string };
scripts: Record<string, string>;
types: string;
version: string;
};
PartialTypes: { PartialTypes: {
[K in PartialTypes]: K; [K in PartialTypes]: K;
}; };
PremiumTiers: EnumHolder<typeof PremiumTiers>;
PrivacyLevels: EnumHolder<typeof PrivacyLevels>;
ShardEvents: ConstantsShardEvents;
Status: ConstantsStatus;
StickerFormatTypes: EnumHolder<typeof StickerFormatTypes>;
StickerTypes: EnumHolder<typeof StickerTypes>;
SweeperKeys: SweeperKey[];
SystemMessageTypes: SystemMessageType[];
TextBasedChannelTypes: TextBasedChannelTypes[];
TextInputStyles: EnumHolder<typeof TextInputStyles>;
ThreadChannelTypes: ThreadChannelTypes[];
UserAgent: string;
VerificationLevels: EnumHolder<typeof VerificationLevels>;
VideoQualityModes: EnumHolder<typeof VideoQualityModes>;
VoiceBasedChannelTypes: VoiceBasedChannelTypes[];
WebhookTypes: EnumHolder<typeof WebhookTypes>;
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: { WSEvents: {
[K in WSEventType]: K; [K in WSEventType]: K;
}; };
Colors: ConstantsColors;
Status: ConstantsStatus;
Opcodes: ConstantsOpcodes;
APIErrors: APIErrors;
ChannelTypes: EnumHolder<typeof ChannelTypes>;
ThreadChannelTypes: ThreadChannelTypes[];
TextBasedChannelTypes: TextBasedChannelTypes[];
VoiceBasedChannelTypes: VoiceBasedChannelTypes[];
ClientApplicationAssetTypes: ConstantsClientApplicationAssetTypes;
IntegrationExpireBehaviors: IntegrationExpireBehaviors[];
InviteScopes: InviteScope[];
MessageTypes: MessageType[];
SystemMessageTypes: SystemMessageType[];
ActivityTypes: EnumHolder<typeof ActivityTypes>;
StickerTypes: EnumHolder<typeof StickerTypes>;
StickerFormatTypes: EnumHolder<typeof StickerFormatTypes>;
OverwriteTypes: EnumHolder<typeof OverwriteTypes>;
ExplicitContentFilterLevels: EnumHolder<typeof ExplicitContentFilterLevels>;
DefaultMessageNotificationLevels: EnumHolder<typeof DefaultMessageNotificationLevels>;
VerificationLevels: EnumHolder<typeof VerificationLevels>;
MembershipStates: EnumHolder<typeof MembershipStates>;
AutoModerationRuleTriggerTypes: EnumHolder<typeof AutoModerationRuleTriggerTypes>;
AutoModerationRuleKeywordPresetTypes: EnumHolder<typeof AutoModerationRuleKeywordPresetTypes>;
AutoModerationActionTypes: EnumHolder<typeof AutoModerationActionTypes>;
AutoModerationRuleEventTypes: EnumHolder<typeof AutoModerationRuleEventTypes>;
ApplicationCommandOptionTypes: EnumHolder<typeof ApplicationCommandOptionTypes>;
ApplicationCommandPermissionTypes: EnumHolder<typeof ApplicationCommandPermissionTypes>;
InteractionTypes: EnumHolder<typeof InteractionTypes>;
InteractionResponseTypes: EnumHolder<typeof InteractionResponseTypes>;
MessageComponentTypes: EnumHolder<typeof MessageComponentTypes>;
SelectMenuComponentTypes: EnumHolder<typeof SelectMenuComponentTypes>;
MessageButtonStyles: EnumHolder<typeof MessageButtonStyles>;
ModalComponentTypes: EnumHolder<typeof ModalComponentTypes>;
TextInputStyles: EnumHolder<typeof TextInputStyles>;
MFALevels: EnumHolder<typeof MFALevels>;
NSFWLevels: EnumHolder<typeof NSFWLevels>;
PrivacyLevels: EnumHolder<typeof PrivacyLevels>;
WebhookTypes: EnumHolder<typeof WebhookTypes>;
PremiumTiers: EnumHolder<typeof PremiumTiers>;
ApplicationCommandTypes: EnumHolder<typeof ApplicationCommandTypes>;
GuildScheduledEventEntityTypes: EnumHolder<typeof GuildScheduledEventEntityTypes>;
GuildScheduledEventStatuses: EnumHolder<typeof GuildScheduledEventStatuses>;
GuildScheduledEventPrivacyLevels: EnumHolder<typeof GuildScheduledEventPrivacyLevels>;
VideoQualityModes: EnumHolder<typeof VideoQualityModes>;
SweeperKeys: SweeperKey[];
// Add // Add
defaultUA: string; defaultUA: string;
captchaServices: captchaServices[]; captchaServices: captchaServices[];