@discordjs/builders 2.0.0-dev.1794009739-5bb74922a → 2.0.0-dev.1794830522-2b3dbd432
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Assertions.d.ts +45 -0
- package/dist/Assertions.d.ts.map +1 -0
- package/dist/Assertions.js +12 -0
- package/dist/Assertions.js.map +1 -0
- package/dist/components/ActionRow.d.ts +172 -0
- package/dist/components/ActionRow.d.ts.map +1 -0
- package/dist/components/ActionRow.js +245 -0
- package/dist/components/ActionRow.js.map +1 -0
- package/dist/components/Assertions.d.ts +162 -0
- package/dist/components/Assertions.d.ts.map +1 -0
- package/dist/components/Assertions.js +162 -0
- package/dist/components/Assertions.js.map +1 -0
- package/dist/components/Component.d.ts +35 -0
- package/dist/components/Component.d.ts.map +1 -0
- package/dist/components/Component.js +24 -0
- package/dist/components/Component.js.map +1 -0
- package/dist/components/Components.d.ts +144 -0
- package/dist/components/Components.d.ts.map +1 -0
- package/dist/components/Components.js +96 -0
- package/dist/components/Components.js.map +1 -0
- package/dist/components/button/Button.d.ts +22 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/Button.js +26 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button/CustomIdButton.d.ts +49 -0
- package/dist/components/button/CustomIdButton.d.ts.map +1 -0
- package/dist/components/button/CustomIdButton.js +61 -0
- package/dist/components/button/CustomIdButton.js.map +1 -0
- package/dist/components/button/LinkButton.d.ts +25 -0
- package/dist/components/button/LinkButton.d.ts.map +1 -0
- package/dist/components/button/LinkButton.js +30 -0
- package/dist/components/button/LinkButton.js.map +1 -0
- package/dist/components/button/PremiumButton.d.ts +17 -0
- package/dist/components/button/PremiumButton.d.ts.map +1 -0
- package/dist/components/button/PremiumButton.js +23 -0
- package/dist/components/button/PremiumButton.js.map +1 -0
- package/dist/components/button/mixins/EmojiOrLabelButtonMixin.d.ts +33 -0
- package/dist/components/button/mixins/EmojiOrLabelButtonMixin.d.ts.map +1 -0
- package/dist/components/button/mixins/EmojiOrLabelButtonMixin.js +38 -0
- package/dist/components/button/mixins/EmojiOrLabelButtonMixin.js.map +1 -0
- package/dist/components/fileUpload/Assertions.d.ts +16 -0
- package/dist/components/fileUpload/Assertions.d.ts.map +1 -0
- package/dist/components/fileUpload/Assertions.js +13 -0
- package/dist/components/fileUpload/Assertions.js.map +1 -0
- package/dist/components/fileUpload/FileUpload.d.ts +98 -0
- package/dist/components/fileUpload/FileUpload.d.ts.map +1 -0
- package/dist/components/fileUpload/FileUpload.js +135 -0
- package/dist/components/fileUpload/FileUpload.js.map +1 -0
- package/dist/components/label/Assertions.d.ts +100 -0
- package/dist/components/label/Assertions.d.ts.map +1 -0
- package/dist/components/label/Assertions.js +22 -0
- package/dist/components/label/Assertions.js.map +1 -0
- package/dist/components/label/Label.d.ts +106 -0
- package/dist/components/label/Label.d.ts.map +1 -0
- package/dist/components/label/Label.js +155 -0
- package/dist/components/label/Label.js.map +1 -0
- package/dist/components/selectMenu/BaseSelectMenu.d.ts +56 -0
- package/dist/components/selectMenu/BaseSelectMenu.d.ts.map +1 -0
- package/dist/components/selectMenu/BaseSelectMenu.js +71 -0
- package/dist/components/selectMenu/BaseSelectMenu.js.map +1 -0
- package/dist/components/selectMenu/ChannelSelectMenu.d.ts +62 -0
- package/dist/components/selectMenu/ChannelSelectMenu.d.ts.map +1 -0
- package/dist/components/selectMenu/ChannelSelectMenu.js +96 -0
- package/dist/components/selectMenu/ChannelSelectMenu.js.map +1 -0
- package/dist/components/selectMenu/MentionableSelectMenu.d.ts +61 -0
- package/dist/components/selectMenu/MentionableSelectMenu.d.ts.map +1 -0
- package/dist/components/selectMenu/MentionableSelectMenu.js +95 -0
- package/dist/components/selectMenu/MentionableSelectMenu.js.map +1 -0
- package/dist/components/selectMenu/RoleSelectMenu.d.ts +49 -0
- package/dist/components/selectMenu/RoleSelectMenu.d.ts.map +1 -0
- package/dist/components/selectMenu/RoleSelectMenu.js +73 -0
- package/dist/components/selectMenu/RoleSelectMenu.js.map +1 -0
- package/dist/components/selectMenu/StringSelectMenu.d.ts +95 -0
- package/dist/components/selectMenu/StringSelectMenu.d.ts.map +1 -0
- package/dist/components/selectMenu/StringSelectMenu.js +125 -0
- package/dist/components/selectMenu/StringSelectMenu.js.map +1 -0
- package/dist/components/selectMenu/StringSelectMenuOption.d.ts +74 -0
- package/dist/components/selectMenu/StringSelectMenuOption.d.ts.map +1 -0
- package/dist/components/selectMenu/StringSelectMenuOption.js +101 -0
- package/dist/components/selectMenu/StringSelectMenuOption.js.map +1 -0
- package/dist/components/selectMenu/UserSelectMenu.d.ts +49 -0
- package/dist/components/selectMenu/UserSelectMenu.d.ts.map +1 -0
- package/dist/components/selectMenu/UserSelectMenu.js +73 -0
- package/dist/components/selectMenu/UserSelectMenu.js.map +1 -0
- package/dist/components/textInput/Assertions.d.ts +14 -0
- package/dist/components/textInput/Assertions.d.ts.map +1 -0
- package/dist/components/textInput/Assertions.js +15 -0
- package/dist/components/textInput/Assertions.js.map +1 -0
- package/dist/components/textInput/TextInput.d.ts +98 -0
- package/dist/components/textInput/TextInput.d.ts.map +1 -0
- package/dist/components/textInput/TextInput.js +140 -0
- package/dist/components/textInput/TextInput.js.map +1 -0
- package/dist/components/v2/Assertions.d.ts +248 -0
- package/dist/components/v2/Assertions.d.ts.map +1 -0
- package/dist/components/v2/Assertions.js +68 -0
- package/dist/components/v2/Assertions.js.map +1 -0
- package/dist/components/v2/Container.d.ts +118 -0
- package/dist/components/v2/Container.d.ts.map +1 -0
- package/dist/components/v2/Container.js +180 -0
- package/dist/components/v2/Container.js.map +1 -0
- package/dist/components/v2/File.d.ts +54 -0
- package/dist/components/v2/File.d.ts.map +1 -0
- package/dist/components/v2/File.js +74 -0
- package/dist/components/v2/File.js.map +1 -0
- package/dist/components/v2/MediaGallery.d.ts +74 -0
- package/dist/components/v2/MediaGallery.d.ts.map +1 -0
- package/dist/components/v2/MediaGallery.js +102 -0
- package/dist/components/v2/MediaGallery.js.map +1 -0
- package/dist/components/v2/MediaGalleryItem.d.ts +58 -0
- package/dist/components/v2/MediaGalleryItem.d.ts.map +1 -0
- package/dist/components/v2/MediaGalleryItem.js +76 -0
- package/dist/components/v2/MediaGalleryItem.js.map +1 -0
- package/dist/components/v2/Section.d.ts +132 -0
- package/dist/components/v2/Section.d.ts.map +1 -0
- package/dist/components/v2/Section.js +180 -0
- package/dist/components/v2/Section.js.map +1 -0
- package/dist/components/v2/Separator.d.ts +54 -0
- package/dist/components/v2/Separator.d.ts.map +1 -0
- package/dist/components/v2/Separator.js +75 -0
- package/dist/components/v2/Separator.js.map +1 -0
- package/dist/components/v2/TextDisplay.d.ts +43 -0
- package/dist/components/v2/TextDisplay.d.ts.map +1 -0
- package/dist/components/v2/TextDisplay.js +58 -0
- package/dist/components/v2/TextDisplay.js.map +1 -0
- package/dist/components/v2/Thumbnail.d.ts +64 -0
- package/dist/components/v2/Thumbnail.d.ts.map +1 -0
- package/dist/components/v2/Thumbnail.js +90 -0
- package/dist/components/v2/Thumbnail.js.map +1 -0
- package/dist/index.d.ts +84 -11270
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -6245
- package/dist/index.js.map +1 -1
- package/dist/interactions/commands/Command.d.ts +56 -0
- package/dist/interactions/commands/Command.d.ts.map +1 -0
- package/dist/interactions/commands/Command.js +53 -0
- package/dist/interactions/commands/Command.js.map +1 -0
- package/dist/interactions/commands/SharedName.d.ts +42 -0
- package/dist/interactions/commands/SharedName.d.ts.map +1 -0
- package/dist/interactions/commands/SharedName.js +56 -0
- package/dist/interactions/commands/SharedName.js.map +1 -0
- package/dist/interactions/commands/SharedNameAndDescription.d.ts +44 -0
- package/dist/interactions/commands/SharedNameAndDescription.d.ts.map +1 -0
- package/dist/interactions/commands/SharedNameAndDescription.js +57 -0
- package/dist/interactions/commands/SharedNameAndDescription.js.map +1 -0
- package/dist/{index.d.mts → interactions/commands/chatInput/Assertions.d.ts} +2655 -8540
- package/dist/interactions/commands/chatInput/Assertions.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/Assertions.js +152 -0
- package/dist/interactions/commands/chatInput/Assertions.js.map +1 -0
- package/dist/interactions/commands/chatInput/ChatInputCommand.d.ts +22 -0
- package/dist/interactions/commands/chatInput/ChatInputCommand.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/ChatInputCommand.js +32 -0
- package/dist/interactions/commands/chatInput/ChatInputCommand.js.map +1 -0
- package/dist/interactions/commands/chatInput/ChatInputCommandSubcommands.d.ts +60 -0
- package/dist/interactions/commands/chatInput/ChatInputCommandSubcommands.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/ChatInputCommandSubcommands.js +78 -0
- package/dist/interactions/commands/chatInput/ChatInputCommandSubcommands.js.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.d.ts +33 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.js +38 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.js.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionChannelTypesMixin.d.ts +27 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionChannelTypesMixin.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionChannelTypesMixin.js +41 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionChannelTypesMixin.js.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithAutocompleteMixin.d.ts +20 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithAutocompleteMixin.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithAutocompleteMixin.js +15 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithAutocompleteMixin.js.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithChoicesMixin.d.ts +29 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithChoicesMixin.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithChoicesMixin.js +29 -0
- package/dist/interactions/commands/chatInput/mixins/ApplicationCommandOptionWithChoicesMixin.js.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/SharedChatInputCommandOptions.d.ts +117 -0
- package/dist/interactions/commands/chatInput/mixins/SharedChatInputCommandOptions.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/SharedChatInputCommandOptions.js +140 -0
- package/dist/interactions/commands/chatInput/mixins/SharedChatInputCommandOptions.js.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/SharedSubcommands.d.ts +27 -0
- package/dist/interactions/commands/chatInput/mixins/SharedSubcommands.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/mixins/SharedSubcommands.js +33 -0
- package/dist/interactions/commands/chatInput/mixins/SharedSubcommands.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/ApplicationCommandOptionBase.d.ts +42 -0
- package/dist/interactions/commands/chatInput/options/ApplicationCommandOptionBase.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/ApplicationCommandOptionBase.js +42 -0
- package/dist/interactions/commands/chatInput/options/ApplicationCommandOptionBase.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/attachment.d.ts +122 -0
- package/dist/interactions/commands/chatInput/options/attachment.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/attachment.js +52 -0
- package/dist/interactions/commands/chatInput/options/attachment.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/boolean.d.ts +89 -0
- package/dist/interactions/commands/chatInput/options/boolean.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/boolean.js +19 -0
- package/dist/interactions/commands/chatInput/options/boolean.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/channel.d.ts +96 -0
- package/dist/interactions/commands/chatInput/options/channel.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/channel.js +24 -0
- package/dist/interactions/commands/chatInput/options/channel.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/integer.d.ts +146 -0
- package/dist/interactions/commands/chatInput/options/integer.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/integer.js +28 -0
- package/dist/interactions/commands/chatInput/options/integer.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/mentionable.d.ts +89 -0
- package/dist/interactions/commands/chatInput/options/mentionable.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/mentionable.js +19 -0
- package/dist/interactions/commands/chatInput/options/mentionable.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/number.d.ts +146 -0
- package/dist/interactions/commands/chatInput/options/number.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/number.js +28 -0
- package/dist/interactions/commands/chatInput/options/number.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/role.d.ts +89 -0
- package/dist/interactions/commands/chatInput/options/role.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/role.js +19 -0
- package/dist/interactions/commands/chatInput/options/role.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/string.d.ts +171 -0
- package/dist/interactions/commands/chatInput/options/string.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/string.js +58 -0
- package/dist/interactions/commands/chatInput/options/string.js.map +1 -0
- package/dist/interactions/commands/chatInput/options/user.d.ts +89 -0
- package/dist/interactions/commands/chatInput/options/user.d.ts.map +1 -0
- package/dist/interactions/commands/chatInput/options/user.js +19 -0
- package/dist/interactions/commands/chatInput/options/user.js.map +1 -0
- package/dist/interactions/commands/contextMenu/Assertions.d.ts +87 -0
- package/dist/interactions/commands/contextMenu/Assertions.d.ts.map +1 -0
- package/dist/interactions/commands/contextMenu/Assertions.js +27 -0
- package/dist/interactions/commands/contextMenu/Assertions.js.map +1 -0
- package/dist/interactions/commands/contextMenu/ContextMenuCommand.d.ts +34 -0
- package/dist/interactions/commands/contextMenu/ContextMenuCommand.d.ts.map +1 -0
- package/dist/interactions/commands/contextMenu/ContextMenuCommand.js +27 -0
- package/dist/interactions/commands/contextMenu/ContextMenuCommand.js.map +1 -0
- package/dist/interactions/commands/contextMenu/MessageCommand.d.ts +12 -0
- package/dist/interactions/commands/contextMenu/MessageCommand.d.ts.map +1 -0
- package/dist/interactions/commands/contextMenu/MessageCommand.js +18 -0
- package/dist/interactions/commands/contextMenu/MessageCommand.js.map +1 -0
- package/dist/interactions/commands/contextMenu/UserCommand.d.ts +12 -0
- package/dist/interactions/commands/contextMenu/UserCommand.d.ts.map +1 -0
- package/dist/interactions/commands/contextMenu/UserCommand.js +18 -0
- package/dist/interactions/commands/contextMenu/UserCommand.js.map +1 -0
- package/dist/interactions/modals/Assertions.d.ts +113 -0
- package/dist/interactions/modals/Assertions.d.ts.map +1 -0
- package/dist/interactions/modals/Assertions.js +26 -0
- package/dist/interactions/modals/Assertions.js.map +1 -0
- package/dist/interactions/modals/Modal.d.ts +92 -0
- package/dist/interactions/modals/Modal.d.ts.map +1 -0
- package/dist/interactions/modals/Modal.js +124 -0
- package/dist/interactions/modals/Modal.js.map +1 -0
- package/dist/messages/AllowedMentions.d.ts +133 -0
- package/dist/messages/AllowedMentions.d.ts.map +1 -0
- package/dist/messages/AllowedMentions.js +176 -0
- package/dist/messages/AllowedMentions.js.map +1 -0
- package/dist/messages/Assertions.d.ts +295 -0
- package/dist/messages/Assertions.d.ts.map +1 -0
- package/dist/messages/Assertions.js +139 -0
- package/dist/messages/Assertions.js.map +1 -0
- package/dist/messages/Attachment.d.ts +125 -0
- package/dist/messages/Attachment.d.ts.map +1 -0
- package/dist/messages/Attachment.js +185 -0
- package/dist/messages/Attachment.js.map +1 -0
- package/dist/messages/Message.d.ts +389 -0
- package/dist/messages/Message.d.ts.map +1 -0
- package/dist/messages/Message.js +560 -0
- package/dist/messages/Message.js.map +1 -0
- package/dist/messages/MessageReference.d.ts +68 -0
- package/dist/messages/MessageReference.d.ts.map +1 -0
- package/dist/messages/MessageReference.js +98 -0
- package/dist/messages/MessageReference.js.map +1 -0
- package/dist/messages/SharedClientTheme.d.ts +61 -0
- package/dist/messages/SharedClientTheme.d.ts.map +1 -0
- package/dist/messages/SharedClientTheme.js +82 -0
- package/dist/messages/SharedClientTheme.js.map +1 -0
- package/dist/messages/embed/Assertions.d.ts +43 -0
- package/dist/messages/embed/Assertions.d.ts.map +1 -0
- package/dist/messages/embed/Assertions.js +43 -0
- package/dist/messages/embed/Assertions.js.map +1 -0
- package/dist/messages/embed/Embed.d.ts +210 -0
- package/dist/messages/embed/Embed.d.ts.map +1 -0
- package/dist/messages/embed/Embed.js +296 -0
- package/dist/messages/embed/Embed.js.map +1 -0
- package/dist/messages/embed/EmbedAuthor.d.ts +52 -0
- package/dist/messages/embed/EmbedAuthor.d.ts.map +1 -0
- package/dist/messages/embed/EmbedAuthor.js +73 -0
- package/dist/messages/embed/EmbedAuthor.js.map +1 -0
- package/dist/messages/embed/EmbedField.d.ts +44 -0
- package/dist/messages/embed/EmbedField.d.ts.map +1 -0
- package/dist/messages/embed/EmbedField.js +59 -0
- package/dist/messages/embed/EmbedField.js.map +1 -0
- package/dist/messages/embed/EmbedFooter.d.ts +42 -0
- package/dist/messages/embed/EmbedFooter.d.ts.map +1 -0
- package/dist/messages/embed/EmbedFooter.js +57 -0
- package/dist/messages/embed/EmbedFooter.js.map +1 -0
- package/dist/messages/poll/Assertions.d.ts +42 -0
- package/dist/messages/poll/Assertions.d.ts.map +1 -0
- package/dist/messages/poll/Assertions.js +17 -0
- package/dist/messages/poll/Assertions.js.map +1 -0
- package/dist/messages/poll/Poll.d.ts +147 -0
- package/dist/messages/poll/Poll.d.ts.map +1 -0
- package/dist/messages/poll/Poll.js +196 -0
- package/dist/messages/poll/Poll.js.map +1 -0
- package/dist/messages/poll/PollAnswer.d.ts +42 -0
- package/dist/messages/poll/PollAnswer.d.ts.map +1 -0
- package/dist/messages/poll/PollAnswer.js +61 -0
- package/dist/messages/poll/PollAnswer.js.map +1 -0
- package/dist/messages/poll/PollAnswerMedia.d.ts +22 -0
- package/dist/messages/poll/PollAnswerMedia.d.ts.map +1 -0
- package/dist/messages/poll/PollAnswerMedia.js +33 -0
- package/dist/messages/poll/PollAnswerMedia.js.map +1 -0
- package/dist/messages/poll/PollMedia.d.ts +33 -0
- package/dist/messages/poll/PollMedia.d.ts.map +1 -0
- package/dist/messages/poll/PollMedia.js +29 -0
- package/dist/messages/poll/PollMedia.js.map +1 -0
- package/dist/messages/poll/PollQuestion.d.ts +12 -0
- package/dist/messages/poll/PollQuestion.d.ts.map +1 -0
- package/dist/messages/poll/PollQuestion.js +17 -0
- package/dist/messages/poll/PollQuestion.js.map +1 -0
- package/dist/util/ValidationError.d.ts +15 -0
- package/dist/util/ValidationError.d.ts.map +1 -0
- package/dist/util/ValidationError.js +19 -0
- package/dist/util/ValidationError.js.map +1 -0
- package/dist/util/normalizeArray.d.ts +16 -0
- package/dist/util/normalizeArray.d.ts.map +1 -0
- package/dist/util/normalizeArray.js +12 -0
- package/dist/util/normalizeArray.js.map +1 -0
- package/dist/util/resolveBuilder.d.ts +14 -0
- package/dist/util/resolveBuilder.d.ts.map +1 -0
- package/dist/util/resolveBuilder.js +30 -0
- package/dist/util/resolveBuilder.js.map +1 -0
- package/dist/util/validation.d.ts +30 -0
- package/dist/util/validation.d.ts.map +1 -0
- package/dist/util/validation.js +46 -0
- package/dist/util/validation.js.map +1 -0
- package/package.json +7 -15
- package/dist/index.mjs +0 -6118
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const idPredicate: z.ZodOptional<z.ZodInt>;
|
|
3
|
+
export declare const customIdPredicate: z.ZodString;
|
|
4
|
+
export declare const snowflakePredicate: z.ZodString;
|
|
5
|
+
export declare const fileUploadTypesPredicate: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
6
|
+
audio: "audio";
|
|
7
|
+
image: "image";
|
|
8
|
+
video: "video";
|
|
9
|
+
}>, z.ZodString]>>;
|
|
10
|
+
export declare const memberPermissionsPredicate: z.ZodCoercedBigInt<unknown>;
|
|
11
|
+
export declare const localeMapPredicate: z.ZodObject<{
|
|
12
|
+
bg: z.ZodOptional<z.ZodString>;
|
|
13
|
+
cs: z.ZodOptional<z.ZodString>;
|
|
14
|
+
da: z.ZodOptional<z.ZodString>;
|
|
15
|
+
de: z.ZodOptional<z.ZodString>;
|
|
16
|
+
el: z.ZodOptional<z.ZodString>;
|
|
17
|
+
"en-GB": z.ZodOptional<z.ZodString>;
|
|
18
|
+
"en-US": z.ZodOptional<z.ZodString>;
|
|
19
|
+
"es-419": z.ZodOptional<z.ZodString>;
|
|
20
|
+
"es-ES": z.ZodOptional<z.ZodString>;
|
|
21
|
+
fi: z.ZodOptional<z.ZodString>;
|
|
22
|
+
fr: z.ZodOptional<z.ZodString>;
|
|
23
|
+
hi: z.ZodOptional<z.ZodString>;
|
|
24
|
+
hr: z.ZodOptional<z.ZodString>;
|
|
25
|
+
hu: z.ZodOptional<z.ZodString>;
|
|
26
|
+
id: z.ZodOptional<z.ZodString>;
|
|
27
|
+
it: z.ZodOptional<z.ZodString>;
|
|
28
|
+
ja: z.ZodOptional<z.ZodString>;
|
|
29
|
+
ko: z.ZodOptional<z.ZodString>;
|
|
30
|
+
lt: z.ZodOptional<z.ZodString>;
|
|
31
|
+
nl: z.ZodOptional<z.ZodString>;
|
|
32
|
+
no: z.ZodOptional<z.ZodString>;
|
|
33
|
+
pl: z.ZodOptional<z.ZodString>;
|
|
34
|
+
"pt-BR": z.ZodOptional<z.ZodString>;
|
|
35
|
+
ro: z.ZodOptional<z.ZodString>;
|
|
36
|
+
ru: z.ZodOptional<z.ZodString>;
|
|
37
|
+
"sv-SE": z.ZodOptional<z.ZodString>;
|
|
38
|
+
th: z.ZodOptional<z.ZodString>;
|
|
39
|
+
tr: z.ZodOptional<z.ZodString>;
|
|
40
|
+
uk: z.ZodOptional<z.ZodString>;
|
|
41
|
+
vi: z.ZodOptional<z.ZodString>;
|
|
42
|
+
"zh-CN": z.ZodOptional<z.ZodString>;
|
|
43
|
+
"zh-TW": z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
//# sourceMappingURL=Assertions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assertions.d.ts","sourceRoot":"","sources":["../src/Assertions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW,yBAA+C,CAAC;AACxE,eAAO,MAAM,iBAAiB,aAA6B,CAAC;AAC5D,eAAO,MAAM,kBAAkB,aAAuC,CAAC;AAEvE,eAAO,MAAM,wBAAwB;;;;kBAG5B,CAAC;AAEV,eAAO,MAAM,0BAA0B,6BAAoB,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK9B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Locale } from 'discord-api-types/v10';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const idPredicate = z.int().min(0).max(2_147_483_647).optional();
|
|
4
|
+
export const customIdPredicate = z.string().min(1).max(100);
|
|
5
|
+
export const snowflakePredicate = z.string().regex(/^(?:0|[1-9]\d*)$/);
|
|
6
|
+
export const fileUploadTypesPredicate = z
|
|
7
|
+
.union([z.enum(['audio', 'image', 'video']), z.string().min(2).startsWith('.')])
|
|
8
|
+
.array()
|
|
9
|
+
.max(10);
|
|
10
|
+
export const memberPermissionsPredicate = z.coerce.bigint();
|
|
11
|
+
export const localeMapPredicate = z.strictObject(Object.fromEntries(Object.values(Locale).map((loc) => [loc, z.string().optional()])));
|
|
12
|
+
//# sourceMappingURL=Assertions.js.map
|
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0 +1,172 @@
|
|
|
1
|
+
import type { APITextInputComponent, APIActionRowComponent, APIComponentInActionRow, APIChannelSelectComponent, APIMentionableSelectComponent, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APIButtonComponentWithCustomId, APIButtonComponentWithSKUId, APIButtonComponentWithURL } from 'discord-api-types/v10';
|
|
2
|
+
import { type RestOrArray } from '../util/normalizeArray.js';
|
|
3
|
+
import { DangerButtonBuilder, PrimaryButtonBuilder, SecondaryButtonBuilder, SuccessButtonBuilder } from './button/CustomIdButton.js';
|
|
4
|
+
import { LinkButtonBuilder } from './button/LinkButton.js';
|
|
5
|
+
import { PremiumButtonBuilder } from './button/PremiumButton.js';
|
|
6
|
+
import { ComponentBuilder } from './Component.js';
|
|
7
|
+
import type { AnyActionRowComponentBuilder } from './Components.js';
|
|
8
|
+
import { ChannelSelectMenuBuilder } from './selectMenu/ChannelSelectMenu.js';
|
|
9
|
+
import { MentionableSelectMenuBuilder } from './selectMenu/MentionableSelectMenu.js';
|
|
10
|
+
import { RoleSelectMenuBuilder } from './selectMenu/RoleSelectMenu.js';
|
|
11
|
+
import { StringSelectMenuBuilder } from './selectMenu/StringSelectMenu.js';
|
|
12
|
+
import { UserSelectMenuBuilder } from './selectMenu/UserSelectMenu.js';
|
|
13
|
+
import { TextInputBuilder } from './textInput/TextInput.js';
|
|
14
|
+
export interface ActionRowBuilderData extends Partial<Omit<APIActionRowComponent<APIComponentInActionRow>, 'components'>> {
|
|
15
|
+
components: AnyActionRowComponentBuilder[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A builder that creates API-compatible JSON data for action rows.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<APIComponentInActionRow>> {
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
protected readonly data: ActionRowBuilderData;
|
|
25
|
+
/**
|
|
26
|
+
* The components within this action row.
|
|
27
|
+
*/
|
|
28
|
+
get components(): readonly AnyActionRowComponentBuilder[];
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new action row.
|
|
31
|
+
*
|
|
32
|
+
* @param data - The API data to create this action row with
|
|
33
|
+
* @example
|
|
34
|
+
* Creating an action row from an API data object:
|
|
35
|
+
* ```ts
|
|
36
|
+
* const actionRow = new ActionRowBuilder({
|
|
37
|
+
* components: [
|
|
38
|
+
* {
|
|
39
|
+
* custom_id: "custom id",
|
|
40
|
+
* label: "Type something",
|
|
41
|
+
* style: TextInputStyle.Short,
|
|
42
|
+
* type: ComponentType.TextInput,
|
|
43
|
+
* },
|
|
44
|
+
* ],
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
* @example
|
|
48
|
+
* Creating an action row using setters and API data:
|
|
49
|
+
* ```ts
|
|
50
|
+
* const actionRow = new ActionRowBuilder({
|
|
51
|
+
* components: [
|
|
52
|
+
* {
|
|
53
|
+
* custom_id: "custom id",
|
|
54
|
+
* label: "Click me",
|
|
55
|
+
* style: ButtonStyle.Primary,
|
|
56
|
+
* type: ComponentType.Button,
|
|
57
|
+
* },
|
|
58
|
+
* ],
|
|
59
|
+
* })
|
|
60
|
+
* .addComponents(button2, button3);
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
constructor(data?: Partial<APIActionRowComponent<APIComponentInActionRow>>);
|
|
64
|
+
/**
|
|
65
|
+
* Adds primary button components to this action row.
|
|
66
|
+
*
|
|
67
|
+
* @param input - The buttons to add
|
|
68
|
+
*/
|
|
69
|
+
addPrimaryButtonComponents(...input: RestOrArray<APIButtonComponentWithCustomId | PrimaryButtonBuilder | ((builder: PrimaryButtonBuilder) => PrimaryButtonBuilder)>): this;
|
|
70
|
+
/**
|
|
71
|
+
* Adds secondary button components to this action row.
|
|
72
|
+
*
|
|
73
|
+
* @param input - The buttons to add
|
|
74
|
+
*/
|
|
75
|
+
addSecondaryButtonComponents(...input: RestOrArray<APIButtonComponentWithCustomId | SecondaryButtonBuilder | ((builder: SecondaryButtonBuilder) => SecondaryButtonBuilder)>): this;
|
|
76
|
+
/**
|
|
77
|
+
* Adds success button components to this action row.
|
|
78
|
+
*
|
|
79
|
+
* @param input - The buttons to add
|
|
80
|
+
*/
|
|
81
|
+
addSuccessButtonComponents(...input: RestOrArray<APIButtonComponentWithCustomId | SuccessButtonBuilder | ((builder: SuccessButtonBuilder) => SuccessButtonBuilder)>): this;
|
|
82
|
+
/**
|
|
83
|
+
* Adds danger button components to this action row.
|
|
84
|
+
*/
|
|
85
|
+
addDangerButtonComponents(...input: RestOrArray<APIButtonComponentWithCustomId | DangerButtonBuilder | ((builder: DangerButtonBuilder) => DangerButtonBuilder)>): this;
|
|
86
|
+
/**
|
|
87
|
+
* Generically add any type of component to this action row, only takes in an instance of a component builder.
|
|
88
|
+
*/
|
|
89
|
+
addComponents(...input: RestOrArray<AnyActionRowComponentBuilder>): this;
|
|
90
|
+
/**
|
|
91
|
+
* Adds SKU id button components to this action row.
|
|
92
|
+
*
|
|
93
|
+
* @param input - The buttons to add
|
|
94
|
+
*/
|
|
95
|
+
addPremiumButtonComponents(...input: RestOrArray<APIButtonComponentWithSKUId | PremiumButtonBuilder | ((builder: PremiumButtonBuilder) => PremiumButtonBuilder)>): this;
|
|
96
|
+
/**
|
|
97
|
+
* Adds URL button components to this action row.
|
|
98
|
+
*
|
|
99
|
+
* @param input - The buttons to add
|
|
100
|
+
*/
|
|
101
|
+
addLinkButtonComponents(...input: RestOrArray<APIButtonComponentWithURL | LinkButtonBuilder | ((builder: LinkButtonBuilder) => LinkButtonBuilder)>): this;
|
|
102
|
+
/**
|
|
103
|
+
* Adds a channel select menu component to this action row.
|
|
104
|
+
*
|
|
105
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
106
|
+
*/
|
|
107
|
+
addChannelSelectMenuComponent(input: APIChannelSelectComponent | ChannelSelectMenuBuilder | ((builder: ChannelSelectMenuBuilder) => ChannelSelectMenuBuilder)): this;
|
|
108
|
+
/**
|
|
109
|
+
* Adds a mentionable select menu component to this action row.
|
|
110
|
+
*
|
|
111
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
112
|
+
*/
|
|
113
|
+
addMentionableSelectMenuComponent(input: APIMentionableSelectComponent | MentionableSelectMenuBuilder | ((builder: MentionableSelectMenuBuilder) => MentionableSelectMenuBuilder)): this;
|
|
114
|
+
/**
|
|
115
|
+
* Adds a role select menu component to this action row.
|
|
116
|
+
*
|
|
117
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
118
|
+
*/
|
|
119
|
+
addRoleSelectMenuComponent(input: APIRoleSelectComponent | RoleSelectMenuBuilder | ((builder: RoleSelectMenuBuilder) => RoleSelectMenuBuilder)): this;
|
|
120
|
+
/**
|
|
121
|
+
* Adds a string select menu component to this action row.
|
|
122
|
+
*
|
|
123
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
124
|
+
*/
|
|
125
|
+
addStringSelectMenuComponent(input: APIStringSelectComponent | StringSelectMenuBuilder | ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder)): this;
|
|
126
|
+
/**
|
|
127
|
+
* Adds a user select menu component to this action row.
|
|
128
|
+
*
|
|
129
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
130
|
+
*/
|
|
131
|
+
addUserSelectMenuComponent(input: APIUserSelectComponent | UserSelectMenuBuilder | ((builder: UserSelectMenuBuilder) => UserSelectMenuBuilder)): this;
|
|
132
|
+
/**
|
|
133
|
+
* Adds a text input component to this action row.
|
|
134
|
+
*
|
|
135
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
136
|
+
*/
|
|
137
|
+
addTextInputComponent(input: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder)): this;
|
|
138
|
+
/**
|
|
139
|
+
* Removes, replaces, or inserts components for this action row.
|
|
140
|
+
*
|
|
141
|
+
* @remarks
|
|
142
|
+
* This method behaves similarly
|
|
143
|
+
* to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
|
|
144
|
+
*
|
|
145
|
+
* It's useful for modifying and adjusting order of the already-existing components of an action row.
|
|
146
|
+
* @example
|
|
147
|
+
* Remove the first component:
|
|
148
|
+
* ```ts
|
|
149
|
+
* actionRow.spliceComponents(0, 1);
|
|
150
|
+
* ```
|
|
151
|
+
* @example
|
|
152
|
+
* Remove the first n components:
|
|
153
|
+
* ```ts
|
|
154
|
+
* const n = 4;
|
|
155
|
+
* actionRow.spliceComponents(0, n);
|
|
156
|
+
* ```
|
|
157
|
+
* @example
|
|
158
|
+
* Remove the last component:
|
|
159
|
+
* ```ts
|
|
160
|
+
* actionRow.spliceComponents(-1, 1);
|
|
161
|
+
* ```
|
|
162
|
+
* @param index - The index to start at
|
|
163
|
+
* @param deleteCount - The number of components to remove
|
|
164
|
+
* @param components - The replacing component objects
|
|
165
|
+
*/
|
|
166
|
+
spliceComponents(index: number, deleteCount: number, ...components: AnyActionRowComponentBuilder[]): this;
|
|
167
|
+
/**
|
|
168
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
169
|
+
*/
|
|
170
|
+
toJSON(validationOverride?: boolean): APIActionRowComponent<APIComponentInActionRow>;
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=ActionRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionRow.d.ts","sourceRoot":"","sources":["../../src/components/ActionRow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAI7E,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,E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AAI,CAGN;IAED;;;;OAIG;IACI,0BAA0B,CAChC,KAAK,EAAE,sBAAsB,GAAG,qBAAqB,GAAG,CAAC,CAAC,OAAO,EAAE,qBAAqB,KAAK,qBAAqB,CAAC,GACjH,IAAI,CAGN;IAED;;;;OAIG;IACI,4BAA4B,CAClC,KAAK,EACF,wBAAwB,GACxB,uBAAuB,GACvB,CAAC,CAAC,OAAO,EAAE,uBAAuB,KAAK,uBAAuB,CAAC,GAChE,IAAI,CAGN;IAED;;;;OAIG;IACI,0BAA0B,CAChC,KAAK,EAAE,sBAAsB,GAAG,qBAAqB,GAAG,CAAC,CAAC,OAAO,EAAE,qBAAqB,KAAK,qBAAqB,CAAC,GACjH,IAAI,CAGN;IAED;;;;OAIG;IACI,qBAAqB,CAC3B,KAAK,EAAE,qBAAqB,GAAG,gBAAgB,GAAG,CAAC,CAAC,OAAO,EAAE,gBAAgB,KAAK,gBAAgB,CAAC,GACjG,IAAI,CAGN;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,4BAA4B,EAAE,GAAG,IAAI,CAG/G;IAED;;OAEG;IACa,MAAM,CAAC,kBAAkB,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAAC,uBAAuB,CAAC,CAWnG;CACD"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { ComponentType } from 'discord-api-types/v10';
|
|
2
|
+
import { normalizeArray } from '../util/normalizeArray.js';
|
|
3
|
+
import { resolveBuilder } from '../util/resolveBuilder.js';
|
|
4
|
+
import { validate } from '../util/validation.js';
|
|
5
|
+
import { actionRowPredicate } from './Assertions.js';
|
|
6
|
+
import { DangerButtonBuilder, PrimaryButtonBuilder, SecondaryButtonBuilder, SuccessButtonBuilder, } from './button/CustomIdButton.js';
|
|
7
|
+
import { LinkButtonBuilder } from './button/LinkButton.js';
|
|
8
|
+
import { PremiumButtonBuilder } from './button/PremiumButton.js';
|
|
9
|
+
import { ComponentBuilder } from './Component.js';
|
|
10
|
+
import { createComponentBuilder } from './Components.js';
|
|
11
|
+
import { ChannelSelectMenuBuilder } from './selectMenu/ChannelSelectMenu.js';
|
|
12
|
+
import { MentionableSelectMenuBuilder } from './selectMenu/MentionableSelectMenu.js';
|
|
13
|
+
import { RoleSelectMenuBuilder } from './selectMenu/RoleSelectMenu.js';
|
|
14
|
+
import { StringSelectMenuBuilder } from './selectMenu/StringSelectMenu.js';
|
|
15
|
+
import { UserSelectMenuBuilder } from './selectMenu/UserSelectMenu.js';
|
|
16
|
+
import { TextInputBuilder } from './textInput/TextInput.js';
|
|
17
|
+
/**
|
|
18
|
+
* A builder that creates API-compatible JSON data for action rows.
|
|
19
|
+
*/
|
|
20
|
+
export class ActionRowBuilder extends ComponentBuilder {
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
data;
|
|
25
|
+
/**
|
|
26
|
+
* The components within this action row.
|
|
27
|
+
*/
|
|
28
|
+
get components() {
|
|
29
|
+
return this.data.components;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new action row.
|
|
33
|
+
*
|
|
34
|
+
* @param data - The API data to create this action row with
|
|
35
|
+
* @example
|
|
36
|
+
* Creating an action row from an API data object:
|
|
37
|
+
* ```ts
|
|
38
|
+
* const actionRow = new ActionRowBuilder({
|
|
39
|
+
* components: [
|
|
40
|
+
* {
|
|
41
|
+
* custom_id: "custom id",
|
|
42
|
+
* label: "Type something",
|
|
43
|
+
* style: TextInputStyle.Short,
|
|
44
|
+
* type: ComponentType.TextInput,
|
|
45
|
+
* },
|
|
46
|
+
* ],
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
* @example
|
|
50
|
+
* Creating an action row using setters and API data:
|
|
51
|
+
* ```ts
|
|
52
|
+
* const actionRow = new ActionRowBuilder({
|
|
53
|
+
* components: [
|
|
54
|
+
* {
|
|
55
|
+
* custom_id: "custom id",
|
|
56
|
+
* label: "Click me",
|
|
57
|
+
* style: ButtonStyle.Primary,
|
|
58
|
+
* type: ComponentType.Button,
|
|
59
|
+
* },
|
|
60
|
+
* ],
|
|
61
|
+
* })
|
|
62
|
+
* .addComponents(button2, button3);
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
constructor(data = {}) {
|
|
66
|
+
super();
|
|
67
|
+
const { components = [], ...rest } = data;
|
|
68
|
+
this.data = {
|
|
69
|
+
...structuredClone(rest),
|
|
70
|
+
components: components.map((component) => createComponentBuilder(component)),
|
|
71
|
+
type: ComponentType.ActionRow,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Adds primary button components to this action row.
|
|
76
|
+
*
|
|
77
|
+
* @param input - The buttons to add
|
|
78
|
+
*/
|
|
79
|
+
addPrimaryButtonComponents(...input) {
|
|
80
|
+
const normalized = normalizeArray(input);
|
|
81
|
+
const resolved = normalized.map((component) => resolveBuilder(component, PrimaryButtonBuilder));
|
|
82
|
+
this.data.components.push(...resolved);
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Adds secondary button components to this action row.
|
|
87
|
+
*
|
|
88
|
+
* @param input - The buttons to add
|
|
89
|
+
*/
|
|
90
|
+
addSecondaryButtonComponents(...input) {
|
|
91
|
+
const normalized = normalizeArray(input);
|
|
92
|
+
const resolved = normalized.map((component) => resolveBuilder(component, SecondaryButtonBuilder));
|
|
93
|
+
this.data.components.push(...resolved);
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Adds success button components to this action row.
|
|
98
|
+
*
|
|
99
|
+
* @param input - The buttons to add
|
|
100
|
+
*/
|
|
101
|
+
addSuccessButtonComponents(...input) {
|
|
102
|
+
const normalized = normalizeArray(input);
|
|
103
|
+
const resolved = normalized.map((component) => resolveBuilder(component, SuccessButtonBuilder));
|
|
104
|
+
this.data.components.push(...resolved);
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Adds danger button components to this action row.
|
|
109
|
+
*/
|
|
110
|
+
addDangerButtonComponents(...input) {
|
|
111
|
+
const normalized = normalizeArray(input);
|
|
112
|
+
const resolved = normalized.map((component) => resolveBuilder(component, DangerButtonBuilder));
|
|
113
|
+
this.data.components.push(...resolved);
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Generically add any type of component to this action row, only takes in an instance of a component builder.
|
|
118
|
+
*/
|
|
119
|
+
addComponents(...input) {
|
|
120
|
+
const normalized = normalizeArray(input);
|
|
121
|
+
this.data.components.push(...normalized);
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Adds SKU id button components to this action row.
|
|
126
|
+
*
|
|
127
|
+
* @param input - The buttons to add
|
|
128
|
+
*/
|
|
129
|
+
addPremiumButtonComponents(...input) {
|
|
130
|
+
const normalized = normalizeArray(input);
|
|
131
|
+
const resolved = normalized.map((component) => resolveBuilder(component, PremiumButtonBuilder));
|
|
132
|
+
this.data.components.push(...resolved);
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Adds URL button components to this action row.
|
|
137
|
+
*
|
|
138
|
+
* @param input - The buttons to add
|
|
139
|
+
*/
|
|
140
|
+
addLinkButtonComponents(...input) {
|
|
141
|
+
const normalized = normalizeArray(input);
|
|
142
|
+
const resolved = normalized.map((component) => resolveBuilder(component, LinkButtonBuilder));
|
|
143
|
+
this.data.components.push(...resolved);
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Adds a channel select menu component to this action row.
|
|
148
|
+
*
|
|
149
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
150
|
+
*/
|
|
151
|
+
addChannelSelectMenuComponent(input) {
|
|
152
|
+
this.data.components.push(resolveBuilder(input, ChannelSelectMenuBuilder));
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Adds a mentionable select menu component to this action row.
|
|
157
|
+
*
|
|
158
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
159
|
+
*/
|
|
160
|
+
addMentionableSelectMenuComponent(input) {
|
|
161
|
+
this.data.components.push(resolveBuilder(input, MentionableSelectMenuBuilder));
|
|
162
|
+
return this;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Adds a role select menu component to this action row.
|
|
166
|
+
*
|
|
167
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
168
|
+
*/
|
|
169
|
+
addRoleSelectMenuComponent(input) {
|
|
170
|
+
this.data.components.push(resolveBuilder(input, RoleSelectMenuBuilder));
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Adds a string select menu component to this action row.
|
|
175
|
+
*
|
|
176
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
177
|
+
*/
|
|
178
|
+
addStringSelectMenuComponent(input) {
|
|
179
|
+
this.data.components.push(resolveBuilder(input, StringSelectMenuBuilder));
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Adds a user select menu component to this action row.
|
|
184
|
+
*
|
|
185
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
186
|
+
*/
|
|
187
|
+
addUserSelectMenuComponent(input) {
|
|
188
|
+
this.data.components.push(resolveBuilder(input, UserSelectMenuBuilder));
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Adds a text input component to this action row.
|
|
193
|
+
*
|
|
194
|
+
* @param input - A function that returns a component builder or an already built builder
|
|
195
|
+
*/
|
|
196
|
+
addTextInputComponent(input) {
|
|
197
|
+
this.data.components.push(resolveBuilder(input, TextInputBuilder));
|
|
198
|
+
return this;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Removes, replaces, or inserts components for this action row.
|
|
202
|
+
*
|
|
203
|
+
* @remarks
|
|
204
|
+
* This method behaves similarly
|
|
205
|
+
* to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
|
|
206
|
+
*
|
|
207
|
+
* It's useful for modifying and adjusting order of the already-existing components of an action row.
|
|
208
|
+
* @example
|
|
209
|
+
* Remove the first component:
|
|
210
|
+
* ```ts
|
|
211
|
+
* actionRow.spliceComponents(0, 1);
|
|
212
|
+
* ```
|
|
213
|
+
* @example
|
|
214
|
+
* Remove the first n components:
|
|
215
|
+
* ```ts
|
|
216
|
+
* const n = 4;
|
|
217
|
+
* actionRow.spliceComponents(0, n);
|
|
218
|
+
* ```
|
|
219
|
+
* @example
|
|
220
|
+
* Remove the last component:
|
|
221
|
+
* ```ts
|
|
222
|
+
* actionRow.spliceComponents(-1, 1);
|
|
223
|
+
* ```
|
|
224
|
+
* @param index - The index to start at
|
|
225
|
+
* @param deleteCount - The number of components to remove
|
|
226
|
+
* @param components - The replacing component objects
|
|
227
|
+
*/
|
|
228
|
+
spliceComponents(index, deleteCount, ...components) {
|
|
229
|
+
this.data.components.splice(index, deleteCount, ...components);
|
|
230
|
+
return this;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* {@inheritDoc ComponentBuilder.toJSON}
|
|
234
|
+
*/
|
|
235
|
+
toJSON(validationOverride) {
|
|
236
|
+
const { components, ...rest } = this.data;
|
|
237
|
+
const data = {
|
|
238
|
+
...structuredClone(rest),
|
|
239
|
+
components: components.map((component) => component.toJSON(validationOverride)),
|
|
240
|
+
};
|
|
241
|
+
validate(actionRowPredicate, data, validationOverride);
|
|
242
|
+
return data;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=ActionRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionRow.js","sourceRoot":"","sources":["../../src/components/ActionRow.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE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,UAA0C;QACxG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACa,MAAM,CAAC,kBAA4B;QAClD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAE1C,MAAM,IAAI,GAAG;YACZ,GAAG,eAAe,CAAC,IAAI,CAAC;YACxB,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;SAC/E,CAAC;QAEF,QAAQ,CAAC,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAEvD,OAAO,IAAsD,CAAC;IAC/D,CAAC;CACD"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { ButtonStyle, ChannelType, ComponentType, SelectMenuDefaultValueType } from 'discord-api-types/v10';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const emojiPredicate: z.ZodObject<{
|
|
4
|
+
id: z.ZodOptional<z.ZodString>;
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<ComponentType.Button>;
|
|
10
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
style: z.ZodLiteral<ButtonStyle.Link>;
|
|
12
|
+
url: z.ZodURL;
|
|
13
|
+
emoji: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
name: z.ZodOptional<z.ZodString>;
|
|
16
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, z.core.$strict>>;
|
|
18
|
+
label: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<ComponentType.Button>;
|
|
21
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
custom_id: z.ZodString;
|
|
23
|
+
emoji: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
id: z.ZodOptional<z.ZodString>;
|
|
25
|
+
name: z.ZodOptional<z.ZodString>;
|
|
26
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, z.core.$strict>>;
|
|
28
|
+
label: z.ZodOptional<z.ZodString>;
|
|
29
|
+
style: z.ZodLiteral<ButtonStyle.Primary>;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<ComponentType.Button>;
|
|
32
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
custom_id: z.ZodString;
|
|
34
|
+
emoji: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
id: z.ZodOptional<z.ZodString>;
|
|
36
|
+
name: z.ZodOptional<z.ZodString>;
|
|
37
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
}, z.core.$strict>>;
|
|
39
|
+
label: z.ZodOptional<z.ZodString>;
|
|
40
|
+
style: z.ZodLiteral<ButtonStyle.Secondary>;
|
|
41
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
42
|
+
type: z.ZodLiteral<ComponentType.Button>;
|
|
43
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
custom_id: z.ZodString;
|
|
45
|
+
emoji: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
id: z.ZodOptional<z.ZodString>;
|
|
47
|
+
name: z.ZodOptional<z.ZodString>;
|
|
48
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
label: z.ZodOptional<z.ZodString>;
|
|
51
|
+
style: z.ZodLiteral<ButtonStyle.Success>;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<ComponentType.Button>;
|
|
54
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
custom_id: z.ZodString;
|
|
56
|
+
emoji: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
name: z.ZodOptional<z.ZodString>;
|
|
59
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
label: z.ZodOptional<z.ZodString>;
|
|
62
|
+
style: z.ZodLiteral<ButtonStyle.Danger>;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<ComponentType.Button>;
|
|
65
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
style: z.ZodLiteral<ButtonStyle.Premium>;
|
|
67
|
+
sku_id: z.ZodString;
|
|
68
|
+
}, z.core.$strict>], "style">;
|
|
69
|
+
export declare const selectMenuChannelPredicate: z.ZodObject<{
|
|
70
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
71
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
72
|
+
min_values: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
max_values: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
custom_id: z.ZodString;
|
|
75
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
type: z.ZodLiteral<ComponentType.ChannelSelect>;
|
|
77
|
+
channel_types: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof ChannelType>>>;
|
|
78
|
+
default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
type: z.ZodLiteral<SelectMenuDefaultValueType.Channel>;
|
|
81
|
+
}, z.core.$strip>>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export declare const selectMenuMentionablePredicate: z.ZodObject<{
|
|
84
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
85
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
86
|
+
min_values: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
max_values: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
custom_id: z.ZodString;
|
|
89
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
type: z.ZodLiteral<ComponentType.MentionableSelect>;
|
|
91
|
+
default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
type: z.ZodLiteral<SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User>;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export declare const selectMenuRolePredicate: z.ZodObject<{
|
|
97
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
98
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
99
|
+
min_values: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
max_values: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
custom_id: z.ZodString;
|
|
102
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
type: z.ZodLiteral<ComponentType.RoleSelect>;
|
|
104
|
+
default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
type: z.ZodLiteral<SelectMenuDefaultValueType.Role>;
|
|
107
|
+
}, z.core.$strip>>>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
export declare const selectMenuStringOptionPredicate: z.ZodObject<{
|
|
110
|
+
label: z.ZodString;
|
|
111
|
+
value: z.ZodString;
|
|
112
|
+
description: z.ZodOptional<z.ZodString>;
|
|
113
|
+
emoji: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
id: z.ZodOptional<z.ZodString>;
|
|
115
|
+
name: z.ZodOptional<z.ZodString>;
|
|
116
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
}, z.core.$strict>>;
|
|
118
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export declare const selectMenuStringPredicate: z.ZodObject<{
|
|
121
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
122
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
123
|
+
min_values: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
max_values: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
custom_id: z.ZodString;
|
|
126
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
type: z.ZodLiteral<ComponentType.StringSelect>;
|
|
128
|
+
options: z.ZodArray<z.ZodObject<{
|
|
129
|
+
label: z.ZodString;
|
|
130
|
+
value: z.ZodString;
|
|
131
|
+
description: z.ZodOptional<z.ZodString>;
|
|
132
|
+
emoji: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
id: z.ZodOptional<z.ZodString>;
|
|
134
|
+
name: z.ZodOptional<z.ZodString>;
|
|
135
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
}, z.core.$strict>>;
|
|
137
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
export declare const selectMenuUserPredicate: z.ZodObject<{
|
|
141
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
142
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
143
|
+
min_values: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
max_values: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
custom_id: z.ZodString;
|
|
146
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
type: z.ZodLiteral<ComponentType.UserSelect>;
|
|
148
|
+
default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
type: z.ZodLiteral<SelectMenuDefaultValueType.User>;
|
|
151
|
+
}, z.core.$strip>>>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
export declare const actionRowPredicate: z.ZodObject<{
|
|
154
|
+
id: z.ZodOptional<z.ZodInt>;
|
|
155
|
+
type: z.ZodLiteral<ComponentType.ActionRow>;
|
|
156
|
+
components: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
157
|
+
type: z.ZodLiteral<ComponentType.Button>;
|
|
158
|
+
}, z.core.$strip>>, z.ZodArray<z.ZodObject<{
|
|
159
|
+
type: z.ZodLiteral<ComponentType.StringSelect | ComponentType.TextInput | ComponentType.UserSelect | ComponentType.RoleSelect | ComponentType.MentionableSelect | ComponentType.ChannelSelect>;
|
|
160
|
+
}, z.core.$strip>>]>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
//# sourceMappingURL=Assertions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assertions.d.ts","sourceRoot":"","sources":["../../src/components/Assertions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;;kBAQxB,CAAC;AAwCJ,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAO1B,CAAC;AAWH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;iBAQrC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;iBAUzC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAOlC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;iBAM1C,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBAsCnC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAOlC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;iBAuB7B,CAAC"}
|