@discordjs/builders 2.0.0-dev.1761134503-697556fd1 → 2.0.0-djs-file-upload.1761302390-5ae769c9e

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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as discord_api_types_v10 from 'discord-api-types/v10';
2
- import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
2
+ import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APIFileUploadComponent, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
3
3
  import { JSONEncodable } from '@discordjs/util';
4
4
  import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
5
5
  import * as zod from 'zod';
@@ -172,6 +172,85 @@ declare class PremiumButtonBuilder extends BaseButtonBuilder<APIButtonComponentW
172
172
  setSKUId(skuId: Snowflake): this;
173
173
  }
174
174
 
175
+ /**
176
+ * A builder that creates API-compatible JSON data for file uploads.
177
+ */
178
+ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent> {
179
+ /**
180
+ * @internal
181
+ */
182
+ protected readonly data: Partial<APIFileUploadComponent>;
183
+ /**
184
+ * Creates a new file upload.
185
+ *
186
+ * @param data - The API data to create this file upload with
187
+ * @example
188
+ * Creating a file upload from an API data object:
189
+ * ```ts
190
+ * const fileUpload = new FileUploadBuilder({
191
+ * custom_id: "file_upload",
192
+ * min_values: 2,
193
+ * max_values: 5,
194
+ * });
195
+ * ```
196
+ * @example
197
+ * Creating a file upload using setters and API data:
198
+ * ```ts
199
+ * const fileUpload = new FileUploadBuilder({
200
+ * custom_id: "file_upload",
201
+ * min_values: 2,
202
+ * max_values: 5,
203
+ * }).setRequired();
204
+ * ```
205
+ */
206
+ constructor(data?: Partial<APIFileUploadComponent>);
207
+ /**
208
+ * Sets the custom id for this file upload.
209
+ *
210
+ * @param customId - The custom id to use
211
+ */
212
+ setCustomId(customId: string): this;
213
+ /**
214
+ * Sets the minimum number of file uploads required.
215
+ *
216
+ * @param minValues - The minimum values that must be uploaded
217
+ */
218
+ setMinValues(minValues: number): this;
219
+ /**
220
+ * Clears the minimum values.
221
+ */
222
+ clearMinValues(): this;
223
+ /**
224
+ * Sets the maximum number of file uploads required.
225
+ *
226
+ * @param maxValues - The maximum values that must be uploaded
227
+ */
228
+ setMaxValues(maxValues: number): this;
229
+ /**
230
+ * Clears the maximum values.
231
+ */
232
+ clearMaxValues(): this;
233
+ /**
234
+ * Sets whether this file upload is required.
235
+ *
236
+ * @param required - Whether this file upload is required
237
+ */
238
+ setRequired(required?: boolean): this;
239
+ /**
240
+ * {@inheritDoc ComponentBuilder.toJSON}
241
+ */
242
+ toJSON(validationOverride?: boolean): APIFileUploadComponent;
243
+ }
244
+
245
+ declare const fileUploadPredicate: z.ZodObject<{
246
+ type: z.ZodLiteral<ComponentType.FileUpload>;
247
+ id: z.ZodOptional<z.ZodInt>;
248
+ custom_id: z.ZodString;
249
+ min_values: z.ZodOptional<z.ZodInt>;
250
+ max_values: z.ZodOptional<z.ZodInt>;
251
+ required: z.ZodOptional<z.ZodBoolean>;
252
+ }, z.core.$strip>;
253
+
175
254
  /**
176
255
  * Normalizes data that is a rest parameter or an array into an array with a depth of 1.
177
256
  *
@@ -710,7 +789,7 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> {
710
789
  }
711
790
 
712
791
  interface LabelBuilderData extends Partial<Omit<APILabelComponent, 'component'>> {
713
- component?: ChannelSelectMenuBuilder | MentionableSelectMenuBuilder | RoleSelectMenuBuilder | StringSelectMenuBuilder | TextInputBuilder | UserSelectMenuBuilder;
792
+ component?: ChannelSelectMenuBuilder | FileUploadBuilder | MentionableSelectMenuBuilder | RoleSelectMenuBuilder | StringSelectMenuBuilder | TextInputBuilder | UserSelectMenuBuilder;
714
793
  }
715
794
  /**
716
795
  * A builder that creates API-compatible JSON data for labels.
@@ -794,6 +873,12 @@ declare class LabelBuilder extends ComponentBuilder<APILabelComponent> {
794
873
  * @param input - A function that returns a component builder or an already built builder
795
874
  */
796
875
  setTextInputComponent(input: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder)): this;
876
+ /**
877
+ * Sets a file upload component to this label.
878
+ *
879
+ * @param input - A function that returns a component builder or an already built builder
880
+ */
881
+ setFileUploadComponent(input: APIFileUploadComponent | FileUploadBuilder | ((builder: FileUploadBuilder) => FileUploadBuilder)): this;
797
882
  /**
798
883
  * {@inheritDoc ComponentBuilder.toJSON}
799
884
  */
@@ -883,6 +968,13 @@ declare const labelPredicate: z.ZodObject<{
883
968
  id: z.ZodString;
884
969
  type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
885
970
  }, z.core.$strip>>>;
971
+ }, z.core.$strip>, z.ZodObject<{
972
+ type: z.ZodLiteral<ComponentType.FileUpload>;
973
+ id: z.ZodOptional<z.ZodInt>;
974
+ custom_id: z.ZodString;
975
+ min_values: z.ZodOptional<z.ZodInt>;
976
+ max_values: z.ZodOptional<z.ZodInt>;
977
+ required: z.ZodOptional<z.ZodBoolean>;
886
978
  }, z.core.$strip>]>;
887
979
  }, z.core.$strip>;
888
980
 
@@ -1474,7 +1566,7 @@ type MessageComponentBuilder = MessageActionRowComponentBuilder | MessageTopLeve
1474
1566
  /**
1475
1567
  * The builders that may be used for modals.
1476
1568
  */
1477
- type ModalComponentBuilder = ActionRowBuilder | LabelBuilder | ModalActionRowComponentBuilder;
1569
+ type ModalComponentBuilder = ActionRowBuilder | FileUploadBuilder | LabelBuilder | ModalActionRowComponentBuilder;
1478
1570
  /**
1479
1571
  * Any button builder
1480
1572
  */
@@ -1494,7 +1586,7 @@ type AnyActionRowComponentBuilder = MessageActionRowComponentBuilder | ModalActi
1494
1586
  /**
1495
1587
  * Any modal component builder.
1496
1588
  */
1497
- type AnyModalComponentBuilder = LabelBuilder | TextDisplayBuilder;
1589
+ type AnyModalComponentBuilder = FileUploadBuilder | LabelBuilder | TextDisplayBuilder;
1498
1590
  /**
1499
1591
  * Components here are mapped to their respective builder.
1500
1592
  */
@@ -1563,6 +1655,10 @@ interface MappedComponentTypes {
1563
1655
  * The label component type is associated with a {@link LabelBuilder}.
1564
1656
  */
1565
1657
  [ComponentType.Label]: LabelBuilder;
1658
+ /**
1659
+ * The file upload component type is associated with a {@link FileUploadBuilder}.
1660
+ */
1661
+ [ComponentType.FileUpload]: FileUploadBuilder;
1566
1662
  }
1567
1663
  /**
1568
1664
  * Factory for creating components from API data.
@@ -2995,6 +3091,13 @@ declare const modalPredicate: z.ZodObject<{
2995
3091
  id: z.ZodString;
2996
3092
  type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
2997
3093
  }, z.core.$strip>>>;
3094
+ }, z.core.$strip>, z.ZodObject<{
3095
+ type: z.ZodLiteral<ComponentType.FileUpload>;
3096
+ id: z.ZodOptional<z.ZodInt>;
3097
+ custom_id: z.ZodString;
3098
+ min_values: z.ZodOptional<z.ZodInt>;
3099
+ max_values: z.ZodOptional<z.ZodInt>;
3100
+ required: z.ZodOptional<z.ZodBoolean>;
2998
3101
  }, z.core.$strip>]>;
2999
3102
  }, z.core.$strip>, z.ZodObject<{
3000
3103
  type: z.ZodLiteral<ComponentType.TextDisplay>;
@@ -4575,4 +4678,4 @@ declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.Zod
4575
4678
  */
4576
4679
  declare const version: string;
4577
4680
 
4578
- export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };
4681
+ export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, FileUploadBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, fileUploadPredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as discord_api_types_v10 from 'discord-api-types/v10';
2
- import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
2
+ import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APIFileUploadComponent, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
3
3
  import { JSONEncodable } from '@discordjs/util';
4
4
  import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
5
5
  import * as zod from 'zod';
@@ -172,6 +172,85 @@ declare class PremiumButtonBuilder extends BaseButtonBuilder<APIButtonComponentW
172
172
  setSKUId(skuId: Snowflake): this;
173
173
  }
174
174
 
175
+ /**
176
+ * A builder that creates API-compatible JSON data for file uploads.
177
+ */
178
+ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent> {
179
+ /**
180
+ * @internal
181
+ */
182
+ protected readonly data: Partial<APIFileUploadComponent>;
183
+ /**
184
+ * Creates a new file upload.
185
+ *
186
+ * @param data - The API data to create this file upload with
187
+ * @example
188
+ * Creating a file upload from an API data object:
189
+ * ```ts
190
+ * const fileUpload = new FileUploadBuilder({
191
+ * custom_id: "file_upload",
192
+ * min_values: 2,
193
+ * max_values: 5,
194
+ * });
195
+ * ```
196
+ * @example
197
+ * Creating a file upload using setters and API data:
198
+ * ```ts
199
+ * const fileUpload = new FileUploadBuilder({
200
+ * custom_id: "file_upload",
201
+ * min_values: 2,
202
+ * max_values: 5,
203
+ * }).setRequired();
204
+ * ```
205
+ */
206
+ constructor(data?: Partial<APIFileUploadComponent>);
207
+ /**
208
+ * Sets the custom id for this file upload.
209
+ *
210
+ * @param customId - The custom id to use
211
+ */
212
+ setCustomId(customId: string): this;
213
+ /**
214
+ * Sets the minimum number of file uploads required.
215
+ *
216
+ * @param minValues - The minimum values that must be uploaded
217
+ */
218
+ setMinValues(minValues: number): this;
219
+ /**
220
+ * Clears the minimum values.
221
+ */
222
+ clearMinValues(): this;
223
+ /**
224
+ * Sets the maximum number of file uploads required.
225
+ *
226
+ * @param maxValues - The maximum values that must be uploaded
227
+ */
228
+ setMaxValues(maxValues: number): this;
229
+ /**
230
+ * Clears the maximum values.
231
+ */
232
+ clearMaxValues(): this;
233
+ /**
234
+ * Sets whether this file upload is required.
235
+ *
236
+ * @param required - Whether this file upload is required
237
+ */
238
+ setRequired(required?: boolean): this;
239
+ /**
240
+ * {@inheritDoc ComponentBuilder.toJSON}
241
+ */
242
+ toJSON(validationOverride?: boolean): APIFileUploadComponent;
243
+ }
244
+
245
+ declare const fileUploadPredicate: z.ZodObject<{
246
+ type: z.ZodLiteral<ComponentType.FileUpload>;
247
+ id: z.ZodOptional<z.ZodInt>;
248
+ custom_id: z.ZodString;
249
+ min_values: z.ZodOptional<z.ZodInt>;
250
+ max_values: z.ZodOptional<z.ZodInt>;
251
+ required: z.ZodOptional<z.ZodBoolean>;
252
+ }, z.core.$strip>;
253
+
175
254
  /**
176
255
  * Normalizes data that is a rest parameter or an array into an array with a depth of 1.
177
256
  *
@@ -710,7 +789,7 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> {
710
789
  }
711
790
 
712
791
  interface LabelBuilderData extends Partial<Omit<APILabelComponent, 'component'>> {
713
- component?: ChannelSelectMenuBuilder | MentionableSelectMenuBuilder | RoleSelectMenuBuilder | StringSelectMenuBuilder | TextInputBuilder | UserSelectMenuBuilder;
792
+ component?: ChannelSelectMenuBuilder | FileUploadBuilder | MentionableSelectMenuBuilder | RoleSelectMenuBuilder | StringSelectMenuBuilder | TextInputBuilder | UserSelectMenuBuilder;
714
793
  }
715
794
  /**
716
795
  * A builder that creates API-compatible JSON data for labels.
@@ -794,6 +873,12 @@ declare class LabelBuilder extends ComponentBuilder<APILabelComponent> {
794
873
  * @param input - A function that returns a component builder or an already built builder
795
874
  */
796
875
  setTextInputComponent(input: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder)): this;
876
+ /**
877
+ * Sets a file upload component to this label.
878
+ *
879
+ * @param input - A function that returns a component builder or an already built builder
880
+ */
881
+ setFileUploadComponent(input: APIFileUploadComponent | FileUploadBuilder | ((builder: FileUploadBuilder) => FileUploadBuilder)): this;
797
882
  /**
798
883
  * {@inheritDoc ComponentBuilder.toJSON}
799
884
  */
@@ -883,6 +968,13 @@ declare const labelPredicate: z.ZodObject<{
883
968
  id: z.ZodString;
884
969
  type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
885
970
  }, z.core.$strip>>>;
971
+ }, z.core.$strip>, z.ZodObject<{
972
+ type: z.ZodLiteral<ComponentType.FileUpload>;
973
+ id: z.ZodOptional<z.ZodInt>;
974
+ custom_id: z.ZodString;
975
+ min_values: z.ZodOptional<z.ZodInt>;
976
+ max_values: z.ZodOptional<z.ZodInt>;
977
+ required: z.ZodOptional<z.ZodBoolean>;
886
978
  }, z.core.$strip>]>;
887
979
  }, z.core.$strip>;
888
980
 
@@ -1474,7 +1566,7 @@ type MessageComponentBuilder = MessageActionRowComponentBuilder | MessageTopLeve
1474
1566
  /**
1475
1567
  * The builders that may be used for modals.
1476
1568
  */
1477
- type ModalComponentBuilder = ActionRowBuilder | LabelBuilder | ModalActionRowComponentBuilder;
1569
+ type ModalComponentBuilder = ActionRowBuilder | FileUploadBuilder | LabelBuilder | ModalActionRowComponentBuilder;
1478
1570
  /**
1479
1571
  * Any button builder
1480
1572
  */
@@ -1494,7 +1586,7 @@ type AnyActionRowComponentBuilder = MessageActionRowComponentBuilder | ModalActi
1494
1586
  /**
1495
1587
  * Any modal component builder.
1496
1588
  */
1497
- type AnyModalComponentBuilder = LabelBuilder | TextDisplayBuilder;
1589
+ type AnyModalComponentBuilder = FileUploadBuilder | LabelBuilder | TextDisplayBuilder;
1498
1590
  /**
1499
1591
  * Components here are mapped to their respective builder.
1500
1592
  */
@@ -1563,6 +1655,10 @@ interface MappedComponentTypes {
1563
1655
  * The label component type is associated with a {@link LabelBuilder}.
1564
1656
  */
1565
1657
  [ComponentType.Label]: LabelBuilder;
1658
+ /**
1659
+ * The file upload component type is associated with a {@link FileUploadBuilder}.
1660
+ */
1661
+ [ComponentType.FileUpload]: FileUploadBuilder;
1566
1662
  }
1567
1663
  /**
1568
1664
  * Factory for creating components from API data.
@@ -2995,6 +3091,13 @@ declare const modalPredicate: z.ZodObject<{
2995
3091
  id: z.ZodString;
2996
3092
  type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
2997
3093
  }, z.core.$strip>>>;
3094
+ }, z.core.$strip>, z.ZodObject<{
3095
+ type: z.ZodLiteral<ComponentType.FileUpload>;
3096
+ id: z.ZodOptional<z.ZodInt>;
3097
+ custom_id: z.ZodString;
3098
+ min_values: z.ZodOptional<z.ZodInt>;
3099
+ max_values: z.ZodOptional<z.ZodInt>;
3100
+ required: z.ZodOptional<z.ZodBoolean>;
2998
3101
  }, z.core.$strip>]>;
2999
3102
  }, z.core.$strip>, z.ZodObject<{
3000
3103
  type: z.ZodLiteral<ComponentType.TextDisplay>;
@@ -4575,4 +4678,4 @@ declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.Zod
4575
4678
  */
4576
4679
  declare const version: string;
4577
4680
 
4578
- export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };
4681
+ export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, FileUploadBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, fileUploadPredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };