import * as discord_js from 'discord.js';
import { GatewayIntentBits, Partials, ChannelType, Guild, CommandInteractionOption, Client, ApplicationCommand, GuildEmoji, GuildMember, GuildTextBasedChannel, Message, Role, WebhookClientOptions, WebhookClient, WebhookClientData, ComponentEmojiResolvable, ButtonBuilder, ActionRowBuilder, LinkButtonComponentData, Attachment, AttachmentBuilder, MessageActionRowComponentBuilder, TextDisplayBuilder, SeparatorBuilder, FileBuilder, SectionBuilder, MediaGalleryBuilder, ContainerBuilder, ContainerComponentBuilder as ContainerComponentBuilder$1, ColorResolvable, ComponentType, ContainerComponentData, ContainerComponent, APIUnfurledMediaItem, MediaGalleryItemData, TextInputBuilder, TextInputComponentData, TextInputStyle, LabelBuilder, LabelBuilderData, ComponentInLabelData, ModalBuilder, Collection, ModalData, LabelComponentData, TextDisplayComponentData, AnyComponentBuilder, ThumbnailComponentData, ThumbnailBuilder, ButtonComponentData, FileUploadBuilder, CheckboxComponentData, CheckboxBuilder, CheckboxGroupComponentData, CheckboxGroupBuilder, RadioGroupComponentData, RadioGroupBuilder, TopLevelComponent, MessageActionRowComponent, ThumbnailComponent, MediaGalleryComponent, ButtonComponent, StringSelectMenuComponent, UserSelectMenuComponent, RoleSelectMenuComponent, MentionableSelectMenuComponent, ChannelSelectMenuComponent, SectionComponent, SeparatorComponent, FileComponent, TextDisplayComponent, EmbedAssetData, User, ClientUser, ImageURLOptions, EmbedFooterData, APIEmbed, Embed, EmbedData, EmbedBuilder, AttachmentData, MediaGalleryItemBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, ChannelSelectMenuBuilder, MentionableSelectMenuBuilder } from 'discord.js';
export * from '@magicyan/core';

declare const chars: {
    invisible: string;
};

declare const CustomItents: {
    Messages: GatewayIntentBits[];
    Guild: GatewayIntentBits[];
    Other: GatewayIntentBits[];
    All: GatewayIntentBits[];
};
declare const CustomPartials: {
    All: Partials[];
};

/**
 * Embed limits
 * @see https://discordjs.guide/popular-topics/embeds.html#embed-limits
 */
declare enum EmbedLimit {
    AuthorName = 256,
    Title = 256,
    Description = 4096,
    Fields = 25,
    FieldName = 256,
    FieldValue = 1024,
    FooterText = 2048,
    URL = 2048
}

/**
 * Predefined separator spacing variants for quick use.
 */
declare const Separator: Readonly<{
    /**
     * Default separator with small spacing and visible divider.
     * Equivalent to: `createSeparator()`
     */
    readonly Default: discord_js.SeparatorBuilder;
    /**
     * Separator with large spacing and visible divider.
     * Equivalent to: `createSeparator(true)`
     */
    readonly Large: discord_js.SeparatorBuilder;
    /**
     * Separator with large spacing and no visible divider.
     * Equivalent to: `createSeparator(true, false)`
     */
    readonly LargeHidden: discord_js.SeparatorBuilder;
    /**
     * Separator with small spacing and no visible divider.
     * Equivalent to: `createSeparator(false, false)`
     */
    readonly Hidden: discord_js.SeparatorBuilder;
}>;

type GuildChannelType = Exclude<ChannelType, ChannelType.DM>;
type FindChannelFilter<T extends GuildChannelType> = (channel: GetChannelType<T>) => boolean;
type GetChannelType<Type extends GuildChannelType> = Extract<NonNullable<CommandInteractionOption<"cached">["channel"]>, {
    type: Type extends ChannelType.PublicThread | ChannelType.AnnouncementThread ? ChannelType.PublicThread | ChannelType.AnnouncementThread : Type;
}>;
declare function findChannel<Type extends GuildChannelType = ChannelType.GuildText>(guild: Guild, type?: Type): {
    byId(id: string): GetChannelType<Type> | undefined;
    byName(name: string, and?: FindChannelFilter<Type>): GetChannelType<Type> | undefined;
    byFilter(filter: FindChannelFilter<Type>): GetChannelType<Type> | undefined;
    inCategoryId(id: string): {
        byId(id: string): GetChannelType<Type> | undefined;
        byName(name: string, and?: FindChannelFilter<Type>): GetChannelType<Type> | undefined;
        byFilter(filter: FindChannelFilter<Type>): GetChannelType<Type> | undefined;
    };
    inCategoryName(name: string): {
        byId(id: string): GetChannelType<Type> | undefined;
        byName(name: string, and?: FindChannelFilter<Type>): GetChannelType<Type> | undefined;
        byFilter(filter: FindChannelFilter<Type>): GetChannelType<Type> | undefined;
    };
};
interface ChannelUrlInfo {
    channelId?: string;
    guildId?: string;
}
declare function getChannelUrlInfo(url: string): ChannelUrlInfo;

type FindCommandFilter = (command: ApplicationCommand) => boolean;
declare function findCommand(guildOrClient: Guild | Client<true>): {
    byName(name: string, and?: FindCommandFilter): ApplicationCommand<{
        guild: discord_js.GuildResolvable;
    }> | undefined;
    byId(id: string): ApplicationCommand<{
        guild: discord_js.GuildResolvable;
    }> | undefined;
    byFilter(filter: FindCommandFilter): ApplicationCommand<{
        guild: discord_js.GuildResolvable;
    }> | undefined;
};
interface CommandMentionData {
    id: string;
    name: string;
}
declare function commandMention(command: CommandMentionData, group?: string, subcommand?: string): string;
declare function commandMention(command: CommandMentionData, subcommand?: string): string;

type FindEmojiFilter = (emoji: GuildEmoji) => boolean;
declare function findEmoji(guildOrClient: Guild | Client): {
    byName(name: string, animated?: boolean, and?: FindEmojiFilter): GuildEmoji | undefined;
    byId(id: string, animated?: boolean): GuildEmoji | undefined;
    byFilter(filter: FindEmojiFilter): GuildEmoji | undefined;
};

type FindMemberFilter = (member: GuildMember) => boolean;
declare function findMember(guild: Guild): {
    byGlobalName(globalName: string, and?: FindMemberFilter): GuildMember | undefined;
    byNickname(nickname: string, and?: FindMemberFilter): GuildMember | undefined;
    byUsername(username: string, and?: FindMemberFilter): GuildMember | undefined;
    byDisplayName(displayName: string, and?: FindMemberFilter): GuildMember | undefined;
    byId(id: string): GuildMember | undefined;
    byFilter(filter: FindMemberFilter): GuildMember | undefined;
};

type FindMessageFilter = (role: Message<true>) => boolean;
declare function findMessage(channel: GuildTextBasedChannel): {
    all(limit?: number): Promise<Message<boolean>[]>;
    byId(id: string): Message<true> | undefined;
    byContent(): {
        equals(content: string, ignoreCase?: boolean): Message<true> | undefined;
        include(content: string, ignoreCase?: boolean): Message<true> | undefined;
    };
    byFilter(filter: FindMessageFilter): Message<true> | undefined;
};
type MessageURLInfo = {
    channelId: string;
    guildId: string;
    messageId: string;
} | {
    messageId?: undefined;
    channelId?: string;
    guildId?: string;
};
declare function getMessageURLInfo(url: string): MessageURLInfo;
declare function fetchMessageFromURL(guild: Guild, url: string): Promise<Message<true> | null>;
declare function fetchMessageFromURL(client: Client | Client, url: string): Promise<Message | null>;

declare function setMobileStatus(): void;

/**
 *
 * @param mention Discord mentionable string
 * @returns mentionable id or null
 *
 * ```ts
 * const user = "<@264620632644255745>";
 * const channel = "<#1068689068256403457>";
 * const role = "<@&929925182796226632>";
 *
 * extractMentionId(user) // 264620632644255745
 * extractMentionId(channel) // 1068689068256403457
 * extractMentionId(role) // 929925182796226632
 * ```
 */
declare function extractMentionId(mention: string): string | null;

type FindRoleFilter = (role: Role) => boolean;
/**
 *
 * @param guild Discord guild
 *
 * ```ts
 * const memberRole = findRole(guild).byName("Member");
 * const adminRole = findRole(guild).byHexColor("#ff5454");
 * const leaderRole = findRole(guild).byId("537818031728885771");
 * ```
 */
declare function findRole(guild: Guild): {
    byColor(color: number, and?: FindRoleFilter): Role | undefined;
    byHexColor(hexColor: string, and?: FindRoleFilter): Role | undefined;
    byName(name: string, and?: FindRoleFilter): Role | undefined;
    byId(id: string): Role | undefined;
    byFilter(filter: FindRoleFilter): Role | undefined;
};

declare function createWebhookClient(url: string, options?: WebhookClientOptions): WebhookClient | null;
declare function createWebhookClient(data: WebhookClientData, options?: WebhookClientOptions): WebhookClient | null;

interface CreateLinkButtonData extends Omit<LinkButtonComponentData, "style" | "type"> {
}
declare function createLinkButton(link: string, label?: string, emoji?: ComponentEmojiResolvable): ButtonBuilder;
declare function createLinkButton(data: CreateLinkButtonData): ButtonBuilder;
/**
 * Wraps buttons into multiple {@link ActionRowBuilder} instances with a maximum number of buttons per row.
 *
 * This function takes a list of {@link ButtonBuilder} instances (or arrays of them) and groups them into
 * multiple `ActionRowBuilder<ButtonBuilder>` objects, ensuring that each row contains no more than the specified
 * number of buttons.
 *
 * @param maxItemsPerRow - The maximum number of buttons to include in each row.
 * @param buttons - A variadic list of {@link ButtonBuilder} instances or arrays of them to be wrapped.
 *
 * @returns An array of {@link ActionRowBuilder} instances, each containing up to `maxItemsPerRow` buttons.
 *
 * @example
 * const button1 = new ButtonBuilder({ customId: "a", label: "A", style: ButtonStyle.Success });
 * const button2 = new ButtonBuilder({ customId: "b", label: "B", style: ButtonStyle.Primary });
 * const button3 = new ButtonBuilder({ customId: "c", label: "C", style: ButtonStyle.Danger });
 *
 * const rows = wrapButtons(2, button1, button2, button3);
 * // Result: Two rows, the first with [button1, button2], the second with [button3]
 */
declare function wrapButtons(maxItemsPerRow: number, ...buttons: (ButtonBuilder | ButtonBuilder[])[]): ActionRowBuilder<ButtonBuilder>[];

type MagicComponentData = string | Attachment | AttachmentBuilder | MessageActionRowComponentBuilder;
type ComponentBuildersData = TextDisplayBuilder | SeparatorBuilder | FileBuilder | SectionBuilder | MediaGalleryBuilder | ActionRowBuilder<MessageActionRowComponentBuilder>;
type ComponentData = ComponentBuildersData | MagicComponentData | null | undefined | boolean;
type CreateComponentData = ComponentData | ContainerBuilder;
type ContainerComponentBuilder = Exclude<ContainerComponentBuilder$1, ActionRowBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>;
type CreateComponentsReturn<IsContainer> = IsContainer extends true ? ContainerComponentBuilder[] : (ContainerComponentBuilder | ContainerBuilder)[];
type CreateComponentsData<IsContainer> = IsContainer extends true ? ComponentData : ComponentData | ContainerBuilder;
declare function createComponents<IsContainer extends boolean = false, Data extends CreateComponentsData<IsContainer>[] = CreateComponentsData<IsContainer>[]>(...data: (Data | Data[])): CreateComponentsReturn<IsContainer>;

type ContainerColor = (string & {}) | ColorResolvable;
type ContainerInComponentType = ComponentType.TextDisplay | ComponentType.ActionRow | ComponentType.Section | ComponentType.Separator | ComponentType.MediaGallery | ComponentType.File;
type ContainerType = ContainerBuilder | ContainerPlusBuilder | ContainerComponent;
type InteractionWithMessage = {
    message: Message;
};
interface ContainerData extends Omit<ContainerComponentData, "accentColor" | "type" | "components"> {
    accentColor?: ContainerColor | null;
    components?: ComponentData[];
    from?: ContainerType | Message | InteractionWithMessage;
    fromIndex?: number;
}
declare class ContainerPlusBuilder extends ContainerBuilder {
    constructor(data?: ContainerData);
    /**
     * Sets the accent color of the container.
     *
     * If a color is provided, it resolves and sets the accent color accordingly.
     * If no color or `null` is provided, it clears the accent color.
     *
     * @param color - The color to set as the accent color, or `null` to clear it.
     * @returns The current instance for chaining.
     *
     * @example
     * container.setColor("#ff0000"); // Sets the accent color to red.
     * container.setColor(null);      // Clears the accent color.
     */
    setColor(color?: ContainerColor | null): this;
    /**
     * Replaces or removes a component at the specified index in the container.
     *
     * If `data` is provided, it replaces the component at the given index with the new component(s).
     * If `null` is provided, it removes the component at that index.
     *
     * @param index - The index of the component to replace or remove.
     * @param data - The new component data to set, or `null` to remove the component.
     * @returns The current instance for chaining.
     *
     * @example
     * container.setComponent(0, new ButtonBuilder({ label: "Click" }));
     * container.setComponent(1, null); // Removes the component at index 1.
     */
    setComponent(index: number, data: ComponentData | null): this;
    insertComponent(data: ComponentData): this;
    insertComponent(index: number, data?: ComponentData): this;
    private _spliceComponents;
    /**
     * Retrieves a component from the container at the specified index, optionally filtering by component type.
     *
     * When the `type` is specified, it filters components by that type and returns the one at the given index.
     * If `type` is omitted, it returns the component at the index without filtering.
     *
     * @param index - The index of the component to retrieve.
     * @param type - (Optional) The type of component to filter by.
     * @returns The component builder if found; otherwise `undefined`.
     *
     * @example
     * const button = container.componentAt(0, ComponentType.ActionRow);
     * const firstComponent = container.componentAt(0);
     */
    componentAt(index: number): ContainerComponentBuilder$1 | undefined;
    componentAt(index: number, type: ComponentType.TextDisplay): TextDisplayBuilder | undefined;
    componentAt(index: number, type: ComponentType.ActionRow): ActionRowBuilder | undefined;
    componentAt(index: number, type: ComponentType.Separator): SeparatorBuilder | undefined;
    componentAt(index: number, type: ComponentType.MediaGallery): MediaGalleryBuilder | undefined;
    componentAt(index: number, type: ComponentType.File): FileBuilder | undefined;
    get buttonComponents(): ButtonBuilder[];
    get sectionComponents(): SectionBuilder[];
    get selectMenuComponents(): AnySelectMenuBuilder[];
    get textDisplayComponents(): TextDisplayBuilder[];
    get actionRowComponents(): (ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<AnySelectMenuBuilder>)[];
    get mediaGalleryComponents(): MediaGalleryBuilder[];
    get fileComponents(): FileBuilder[];
    get separatorComponents(): SeparatorBuilder[];
}
/**
 * Creates one or multiple {@link ContainerPlusBuilder} components with optional accent color and child components.
 *
 * This function supports two main usage patterns:
 * 1. Passing a `ContainerData` object with optional `array` flag:
 *    - If `array` is `true` and `from` is a message, returns an array of containers extracted from the message components.
 *    - If `array` is `true` without a message `from`, returns an array with one container.
 *    - Otherwise, returns a single container.
 * 2. Passing an accent color (string, number, or RGB tuple) directly, followed by one or more components.
 *
 * The container can include various types of components such as:
 * - `string` (converted to {@link TextDisplayBuilder})
 * - {@link TextDisplayBuilder}
 * - {@link ActionRowBuilder}
 * - {@link ButtonBuilder}
 * - {@link SectionBuilder}
 * - {@link MediaGalleryBuilder}
 * - {@link FileBuilder}
 * - {@link SeparatorBuilder}
 * - Discord attachments (treated as media galleries)
 *
 * @param data - A `ContainerData` object (with optional `array` and `from` properties) or a color value.
 * @param items - When `data` is a color, this is the list of components to include in the container.
 *
 * @returns Either a single {@link ContainerPlusBuilder} or an array of them, depending on the `array` flag and `from` property.
 *
 * @example
 * // Create a single container with accent color and components
 * const container = createContainer({
 *   accentColor: "#ff5733",
 *   components: ["Welcome!"]
 * });
 *
 * @example
 * // Create multiple containers extracted from a message
 * const containers = createContainer({
 *   array: true,
 *   from: message
 * });
 *
 * @example
 * // Create container by passing color and components separately
 * const container = createContainer("Blue",
 *   new TextDisplayBuilder().setText("Notice"),
 *   new SeparatorBuilder()
 * );
 */
declare function createContainer(data: ContainerData & {
    array?: boolean;
}): ContainerPlusBuilder;
declare function createContainer(data: ContainerData & {
    array?: true;
}): ContainerPlusBuilder[];
declare function createContainer(data: ColorResolvable | string, ...components: (ComponentData | ComponentData[])[]): ContainerPlusBuilder;

type FileSource = string | Attachment | AttachmentBuilder;
interface CreateFileOptions extends Omit<APIUnfurledMediaItem, "url"> {
    spoiler?: boolean;
}
/**
 * Creates a {@link FileBuilder} from an {@link AttachmentBuilder} or an attachment reference string.
 *
 * If the `source` is an {@link AttachmentBuilder}, it automatically prefixes the file name with `"attachment://"`.
 * If the `source` is a string, it must already be a valid attachment reference in the format `"attachment://filename.ext"`.
 *
 * You can optionally provide file metadata through the `options` parameter, such as dimensions
 * or whether the file should be marked as a spoiler.
 *
 * @param source - The source of the file. Must be an {@link AttachmentBuilder} or an attachment reference string.
 * @param options - Optional metadata for the file, such as `width`, `height`, `spoiler`, and `size`.
 *
 * @returns A {@link FileBuilder} ready to be used inside a message component.
 *
 * @example
 * // Creating a file from an AttachmentBuilder
 * const attachment = new AttachmentBuilder("path/to/image.png");
 * const file = createFile(attachment);
 *
 * @example
 * // Creating a file from an attachment reference string
 * const file = createFile("attachment://image.png");
 *
 * @example
 * // Creating a file with additional options like marking it as a spoiler
 * const file = createFile("attachment://secret.png", { spoiler: true });
 */
declare function createFile(source: FileSource, options?: CreateFileOptions): FileBuilder;

type MediaGallerySource = MediaGalleryItemData | Attachment | AttachmentBuilder | string | null | undefined | boolean;
/**
 * Creates a {@link MediaGalleryBuilder} instance with a collection of media items, which can be images, attachments, or URLs.
 *
 * This function allows you to add multiple media items to a gallery, where each item can be a URL,
 * an {@link Attachment}, or an {@link AttachmentBuilder}. It processes each item and adds it to the gallery,
 * converting it into the appropriate format for rendering.
 *
 * **Parameters:**
 * - `items`: An array of media items to be added to the gallery. Each item can be:
 *   - A {@link MediaGalleryItemData} object, which includes media information such as URLs.
 *   - A string URL pointing to an external resource (e.g., an image URL).
 *   - An {@link Attachment} or {@link AttachmentBuilder}, which are Discord attachments.
 *
 * @param items - The media items to be added to the gallery. Each item is processed and converted into a format suitable for the gallery.
 *
 * @returns A {@link MediaGalleryBuilder} instance populated with the specified media items.
 *
 * @example
 * // Creating a media gallery with URLs and an attachment
 * const gallery = createMediaGallery(
 *   "https://example.com/image1.png",
 *   new AttachmentBuilder("image2.png", { name: "image2.png" }),
 *   { media: { url: "https://example.com/image3.png" } }
 * );
 *
 * @example
 * // Creating a media gallery with only attachments
 * const gallery = createMediaGallery(
 *   new AttachmentBuilder("file1.png", { name: "file1.png" }),
 *   new AttachmentBuilder("file2.png", { name: "file2.png" })
 * );
 *
 * @example
 * // Creating a media gallery with mixed media types (URL and attachment)
 * const gallery = createMediaGallery(
 *   "https://example.com/image1.png",
 *   new AttachmentBuilder("image2.png", { name: "image2.png" })
 * );
 *
 */
declare function createMediaGallery(...items: (MediaGallerySource | MediaGallerySource[])[]): MediaGalleryBuilder;

type CreateInputData = Partial<Omit<TextInputComponentData, "type" | "label">>;
declare function createTextInput(data: CreateInputData): TextInputBuilder;
/**
 * @deprecated Use {@link createTextInput} instead.
 */
declare function createModalInput(data: Omit<TextInputComponentData, "type" | "style"> & {
    style?: TextInputStyle;
}): ActionRowBuilder<TextInputBuilder>;

interface CreateLabelData extends Omit<LabelBuilderData, "type" | "component"> {
    component?: LabelBuilderData["component"] | ComponentInLabelData;
}
/**
 * Creates a label component using an object configuration.
 *
 * This overload is useful when you already have your label data
 * structured in an object. Each field maps directly to the
 * {@link LabelBuilderData} properties (except `type`).
 *
 * The `component` field can be either raw data or a JSON-encodable builder.
 *
 * @param data - The configuration object containing label properties.
 * @returns A new {@link LabelBuilder} instance configured with the provided data.
 *
 * @example
 * ```ts
 * const label = createLabel({
 *   label: "Username",
 *   description: "Enter your username",
 *   component: textInput
 * });
 * ```
 */
declare function createLabel(data: CreateLabelData): LabelBuilder;
/**
 * Creates a label component with label, description and optional component.
 *
 * Use this overload when you want to explicitly define the label text,
 * description and optionally attach a component.
 *
 * @param label - The main label text.
 * @param description - Additional descriptive text for the label.
 * @param component - Optional component associated with the label.
 * @param id - Optional numeric identifier for the component.
 * @returns A new {@link LabelBuilder} instance configured with the provided values.
 *
 * @example
 * ```ts
 * const label = createLabel(
 *   "Username",
 *   "Enter your username",
 *   textInput,
 *   1
 * );
 * ```
 */
declare function createLabel(label: string, description?: string, component?: CreateLabelData["component"], id?: number): LabelBuilder;
/**
 * Creates a label component with a label and optional component.
 *
 * Use this overload when you don't need a description and want
 * a simpler way to attach a component.
 *
 * @param label - The main label text.
 * @param component - Optional component associated with the label.
 * @param id - Optional numeric identifier for the component.
 * @returns A new {@link LabelBuilder} instance configured with the provided values.
 *
 * @example
 * ```ts
 * const label = createLabel("Username", textInput, 1);
 * ```
 */
declare function createLabel(label: string, component?: CreateLabelData["component"], id?: number): LabelBuilder;

type ModalComponents = LabelBuilder | TextDisplayBuilder | string | null | boolean | undefined;
type ResolveModalData = {
    fields: {
        fields: Collection<string, ModalData>;
    };
} | {
    fields: Collection<string, ModalData>;
} | Collection<string, ModalData>;
type ModalFieldsRecord = Record<string, string | string[] | boolean | null>;
/**
 * Converts modal submitted fields into a plain record object, mapping each component `customId` to its value.
 *
 * This function supports multiple modal submission data shapes coming from Discord.js,
 * automatically extracting and normalizing values from:
 * - Text input fields (`ComponentType.TextInput`) → string
 * - Select menus & other multi-value components → string[]
 * - File upload fields (`ComponentType.FileUpload`) → string[] of attachment URLs
 *
 * Optionally, a parser callback may be provided to transform the resulting record before returning it.
 *
 * @template T The expected return type after optional parsing.
 * @param {ResolveModalData} data - The modal submission data, usually from an interaction.
 * @param {(record: ModalFieldsRecord) => T} [parse] - Optional transform function applied to the resulting record.
 * @returns {ModalFieldsRecord | T} The processed fields as a record, or the parser result if provided.
 *
 * @example
 * ```ts
 * const fields = modalFieldsToRecord(interaction.fields);
 * console.log(fields.username); // "JohnDoe"
 * ```
 *
 * @example With parsing
 * ```ts
 * const result = modalFieldsToRecord(interaction.fields, fields => ({
 *   name: fields.username.trim(),
 *   age: Number.parseInt(fields.age),
 * }));
 * ```
 */
declare function modalFieldsToRecord<const T = ModalFieldsRecord>(data: ResolveModalData): T;
declare function modalFieldsToRecord<const T = ModalFieldsRecord>(data: ResolveModalData, parse: (record: ModalFieldsRecord) => T): T;
type ModalFields = (LabelComponentData | TextDisplayComponentData)[];
declare function createModalFields(...components: ModalComponents[]): ModalFields;
interface CreateModalOptions {
    customId: string;
    title: string;
    components: ModalComponents[];
}
declare function createModal(data: Partial<CreateModalOptions>): ModalBuilder;
declare function createModal(customId: string): ModalBuilder;
declare function createModal(customId: string, title: string): ModalBuilder;
declare function createModal(customId: string, title: string, ...components: ModalComponents[]): ModalBuilder;

type NullableValues = null | undefined | boolean;
/**
 * Creates an {@link ActionRowBuilder} containing one or more UI components.
 *
 * This function accepts individual components or arrays of components, flattens them,
 * and returns an action row builder suitable for use in Discord messages.
 * It's designed to support any component builder type that extends {@link AnyComponentBuilder}.
 *
 * ---
 * While this function supports any valid message component (such as buttons, select menus, etc.),
 * the examples below demonstrate common use cases using {@link ButtonBuilder} and {@link StringSelectMenuBuilder}.
 *
 * @typeParam Component - A type extending {@link AnyComponentBuilder}, such as a button or select menu builder.
 *
 * @param components - A variadic list of component instances or arrays of component instances to include in the row.
 *
 * @returns An {@link ActionRowBuilder} instance containing all provided components.
 *
 * @example
 * // Create a row with two buttons
 * const row = createRow(
 *     new ButtonBuilder({ customId: "a", label: "A", style: ButtonStyle.Success }),
 *     new ButtonBuilder({ customId: "b", label: "B", style: ButtonStyle.Primary }),
 *     new ButtonBuilder({ customId: "c", label: "C", style: ButtonStyle.Danger })
 * );
 *
 * @example
 * // Create a row with a string select menu
 * const row = createRow(
 *     new StringSelectMenuBuilder({
 *         customId: "choose",
 *         placeholder: "Make a selection",
 *         options: [
 *             { label: "Option 1", value: "opt1" },
 *             { label: "Option 2", value: "opt2" },
 *             { label: "Option 3", value: "opt3" },
 *         ]
 *     })
 * );
 */
declare function createRow<Component extends AnyComponentBuilder>(...components: (NullableValues | Component | Component[])[]): ActionRowBuilder<Component>;

type ThumbnailData = Partial<Omit<ThumbnailComponentData, "type">> | Attachment | AttachmentBuilder | string;
/**
 * Creates a {@link ThumbnailBuilder} from a URL, an attachment, or partial thumbnail data.
 *
 * This function helps create a thumbnail component for a container.
 * It supports different input formats, such as a direct URL string,
 * an {@link AttachmentBuilder}, an {@link Attachment}, or a partial {@link ThumbnailComponentData}.
 *
 * **Important:**
 * - If providing a string, it must either be a valid URL or a reference to an attachment using the `attachment://filename.ext` format.
 *
 * @param data - The thumbnail source: a URL, an attachment builder, an attachment, or partial thumbnail data.
 *
 * @returns A {@link ThumbnailBuilder} instance populated with the provided data.
 *
 * @example
 * // Creating a thumbnail from a URL
 * const thumbnail = createThumbnail("https://example.com/image.png");
 *
 * @example
 * // Creating a thumbnail from partial data
 * const thumbnail = createThumbnail({
 *   media: { url: "attachment://image.png" },
 *   spoiler: true
 * });
 */
declare function createThumbnail(data: ThumbnailData, id?: number): ThumbnailBuilder;

type SectionThumbnailAccessory = ThumbnailBuilder | ThumbnailData;
type SectionButtonAccessory = ButtonBuilder | Partial<ButtonComponentData>;
type SectionAccessory = SectionThumbnailAccessory | SectionButtonAccessory;
type SectionAccessoryData = {
    accessory: SectionAccessory;
    button?: never;
    thumbnail?: never;
} | {
    button: SectionButtonAccessory;
    thumbnail?: never;
    accessory?: never;
} | {
    thumbnail: SectionThumbnailAccessory;
    button?: never;
    accessory?: never;
};
type SectionData = SectionAccessoryData & {
    content: string | string[];
};
/**
 * Creates a {@link SectionBuilder} component with customizable text content and a single visual accessory.
 *
 * This function allows you to generate a section with content (as a string or an array of strings)
 * and optionally include a single accessory, which can be a button or a thumbnail.
 * You can provide the accessory in multiple forms: a builder instance, a plain data object, or a URL string (for thumbnails).
 *
 * ---
 * ### Overloads:
 *
 * 1. `createSection(content, accessory)`
 *    Pass content as a string and an accessory separately.
 *
 * 2. `createSection({ content, accessory | button | thumbnail })`
 *    Pass an object with full configuration, using only one of the accessory types.
 *
 * ---
 *
 * @param content - The main content of the section. Only used in overload 1.
 * @param accessory - A {@link ButtonBuilder}, {@link ThumbnailBuilder}, or raw data used to build the accessory. Only used in overload 1.
 *
 * @param data - An object in overload 2 containing:
 * - `content`: A string or array of strings for display.
 * - `accessory`: (optional) A single accessory, either a button or thumbnail.
 * - `button`: (optional) A {@link ButtonBuilder} or partial button data. Mutually exclusive with `thumbnail` and `accessory`.
 * - `thumbnail`: (optional) A {@link ThumbnailBuilder}, {@link ThumbnailData}, or image URL. Mutually exclusive with `button` and `accessory`.
 *
 * @returns A configured {@link SectionBuilder} instance with the provided content and accessory.
 *
 * @example
 * // Overload 1: Using content and accessory separately
 * const section = createSection(
 *    "Hello World",
 *    new ButtonBuilder({ customId: "click", label: "Click", style: ButtonStyle.Success })
 * );
 *
 * @example
 * // Overload 2: Using content and thumbnail URL via `thumbnail`
 * const section = createSection({
 *   content: "Here's an image section",
 *   thumbnail: "https://example.com/image.png"
 * });
 *
 * @example
 * // Overload 2: Using content and button via `accessory`
 * const section = createSection({
 *   content: "Button section",
 *   accessory: new ButtonBuilder({ customId: "id", label: "Press", style: ButtonStyle.Primary });
 * });
 */
declare function createSection(content: string, accessory: SectionAccessory): SectionBuilder;
declare function createSection(data: SectionData): SectionBuilder;

interface SeparatorData {
    divider?: boolean;
    large?: boolean;
}
/**
 * Creates a {@link SeparatorBuilder} component with configurable visibility and spacing.
 *
 * This function generates a separator component that can be customized for:
 * - Visibility (`divider`: whether the visual divider line is shown).
 * - Spacing (`large`: whether to use large or small spacing).
 *
 * It accepts parameters in two formats:
 *
 * **1. As an object:**
 * @param data - An optional object with the following properties:
 * - `divider` (boolean, optional): Whether the divider is visible. Defaults to `true`.
 * - `large` (boolean, optional): Whether to use large spacing. Defaults to `false`.
 *
 * **2. As positional arguments:**
 * @param large - Whether to use large spacing. Defaults to `false`.
 * @param divider - Whether the divider is visible. Defaults to `true`.
 *
 * @returns A {@link SeparatorBuilder} instance with the specified configuration.
 *
 * @example
 * // Using object syntax with default options
 * const separator = createSeparator();
 *
 * @example
 * // Using object syntax to disable the divider and enable large spacing
 * const separator = createSeparator({ divider: false, large: true });
 *
 * @example
 * // Using positional arguments: large spacing, visible divider
 * const separator = createSeparator(true, true);
 *
 * @example
 * // Using positional arguments: small spacing, hidden divider
 * const separator = createSeparator(false, false);
 */
declare function createSeparator(large?: boolean, divider?: boolean): SeparatorBuilder;
declare function createSeparator(data?: SeparatorData): SeparatorBuilder;

/**
 * Creates a {@link TextDisplayBuilder} with the given content and optional ID.
 *
 * This function simplifies the creation of text display components for a container,
 * allowing you to set the text content and optionally assign a custom ID.
 *
 * @param content - The text content to display.
 * @param id - An optional numeric ID for the text component.
 *
 * @returns A new {@link TextDisplayBuilder} instance containing the provided content and ID.
 *
 * @example
 * // Creating a simple text display component
 * const textDisplay = createTextDisplay("Hello World!");
 *
 * @example
 * // Creating a text display component with a custom ID
 * const textDisplay = createTextDisplay("Welcome!", 123);
 */
declare function createTextDisplay(content: string, id?: number): TextDisplayBuilder;

type ThumbAreaThumbnail = SectionThumbnailAccessory | null | undefined;
type ThumbAreaData = {
    content: string;
    thumbnail?: ThumbAreaThumbnail;
};
/**
 * Creates either a {@link SectionBuilder} or a {@link TextDisplayBuilder} based on the presence of a thumbnail.
 *
 * If a thumbnail is provided, this function will return a {@link SectionBuilder} with the content and thumbnail.
 * Otherwise, it will return a {@link TextDisplayBuilder} with only the provided content.
 *
 * ---
 * **Overloads:**
 * - Provide `content` and optional `thumbnail` as separate parameters.
 * - Provide a single object with `content` and optional `thumbnail` properties.
 *
 * @param content - The text content to be displayed.
 * @param thumbnail - (Optional) A thumbnail to include. If provided, a section will be created; otherwise, a simple text display.
 *
 * @param data - An object containing `content` and optional `thumbnail` properties.
 *
 * @returns A {@link SectionBuilder} if a thumbnail is provided, otherwise a {@link TextDisplayBuilder}.
 *
 * @example
 * // Using positional parameters with a thumbnail
 * const thumbSection = createThumbArea("Welcome!", "https://example.com/image.png");
 *
 * @example
 * // Using an object without a thumbnail
 * const textOnly = createThumbArea({ content: "Just text here" });
 *
 * @example
 * // Using an object with a thumbnail
 * const thumbSection = createThumbArea({
 *   content: "Check this out!",
 *   thumbnail: "https://example.com/image.png"
 * });
 */
declare function createThumbArea(content: string, thumbnail?: ThumbAreaThumbnail): SectionBuilder | TextDisplayBuilder;
declare function createThumbArea(data: ThumbAreaData): SectionBuilder | TextDisplayBuilder;

interface FileUploadData {
    customId?: string;
    minValues?: number;
    maxValues?: number;
    required?: boolean;
    id?: number;
}
/**
 * Creates a file upload component using an object configuration.
 *
 * This overload is useful when you already have your file upload settings grouped in an object.
 * Each field corresponds directly to the {@link APIFileUploadComponent} properties.
 *
 * @param data - The configuration object containing the upload settings.
 * @returns A new {@link FileUploadBuilder} instance configured with the provided data.
 *
 * @example
 * ```ts
 * const upload = createFileUpload({
 *   customId: "images",
 *   required: true,
 *   maxValues: 5,
 *   minValues: 1
 * });
 * ```
 */
declare function createFileUpload(data: FileUploadData): FileUploadBuilder;
/**
 * Creates a file upload component using explicit parameters.
 *
 * Use this overload when you want to control the required flag and the upload limits separately.
 *
 * @param customId - The custom identifier for the file upload component.
 * @param required - Whether the file upload is required before submitting.
 * @param maxValues - The maximum number of files that can be uploaded.
 * @param minValues - The minimum number of files required to upload.
 * @returns A new {@link FileUploadBuilder} instance configured with the provided values.
 *
 * @example
 * ```ts
 * const upload = createFileUpload("files", true, 5, 1);
 * ```
 */
declare function createFileUpload(customId: string, required?: boolean, maxValues?: number, minValues?: number): FileUploadBuilder;
/**
 * Creates a file upload component specifying only numeric limits.
 *
 * Use this overload when you only need to define upload limits,
 * and the `required` flag should remain optional.
 *
 * @param customId - The custom identifier for the file upload component.
 * @param maxValues - The maximum number of files that can be uploaded.
 * @param minValues - The minimum number of files required to upload.
 * @returns A new {@link FileUploadBuilder} instance configured with the provided values.
 *
 * @example
 * ```ts
 * const upload = createFileUpload("images", 10, 2);
 * ```
 */
declare function createFileUpload(customId: string, maxValues?: number, minValues?: number): FileUploadBuilder;

type CreateCheckboxData = Omit<CheckboxComponentData, "type">;
/**
 * Creates a checkbox component using an object configuration.
 *
 * This overload is useful when you already have your checkbox data
 * structured in an object. Each field maps directly to the
 * {@link CheckboxComponentData} properties (except `type`).
 *
 * @param data - The configuration object containing checkbox properties.
 * @returns A new {@link CheckboxBuilder} instance configured with the provided data.
 *
 * @example
 * ```ts
 * const checkbox = createCheckbox({
 *   customId: "accept_terms",
 *   default: true
 * });
 * ```
 */
declare function createCheckbox(data: CreateCheckboxData): CheckboxBuilder;
/**
 * Creates a checkbox component using explicit parameters.
 *
 * Use this overload when you want a simpler and more direct way
 * to define the checkbox without creating an object.
 *
 * @param customId - The custom identifier for the checkbox component.
 * @param defaultValue - Whether the checkbox should be checked by default.
 * @param id - Optional numeric identifier for the component.
 * @returns A new {@link CheckboxBuilder} instance configured with the provided values.
 *
 * @example
 * ```ts
 * const checkbox = createCheckbox("accept_terms", true, 1);
 * ```
 */
declare function createCheckbox(customId: string, defaultValue?: boolean, id?: number): CheckboxBuilder;
type CreateCheckboxGroupData = Omit<CheckboxGroupComponentData, "type">;
/**
 * Creates a checkbox group component using an object configuration.
 *
 * This function is used to group multiple checkboxes together.
 * Each field corresponds to the {@link CheckboxGroupComponentData} properties
 * (except `type`), and the options are automatically applied.
 *
 * @param data - The configuration object containing the group settings and options.
 * @returns A new {@link CheckboxGroupBuilder} instance configured with the provided data.
 *
 * @example
 * ```ts
 * const group = createCheckboxGroup({
 *   customId: "preferences",
 *   minValues: 1,
 *   maxValues: 3,
 *   options: [
 *     { label: "Option A", value: "a" },
 *     { label: "Option B", value: "b" }
 *   ]
 * });
 * ```
 */
declare function createCheckboxGroup(data: CreateCheckboxGroupData): CheckboxGroupBuilder;

type CreateRadioGroup = Omit<RadioGroupComponentData, "type">;
/**
 * Creates a radio group component using an object configuration.
 *
 * This function is used to define a group of mutually exclusive options,
 * where only one option can be selected at a time.
 * Each field maps directly to the {@link RadioGroupComponentData} properties
 * (except `type`), and the options are automatically applied.
 *
 * @param data - The configuration object containing the group settings and options.
 * @returns A new {@link RadioGroupBuilder} instance configured with the provided data.
 *
 * @example
 * ```ts
 * const group = createRadioGroup({
 *   customId: "plan",
 *   options: [
 *     { label: "Free", value: "free" },
 *     { label: "Pro", value: "pro" }
 *   ]
 * });
 * ```
 */
declare function createRadioGroup(data: CreateRadioGroup): RadioGroupBuilder;

type MessageComponentWithId = TopLevelComponent | MessageActionRowComponent | ThumbnailComponent | MediaGalleryComponent;
type MessageComponentSource = MessageComponentWithId[] | {
    components: MessageComponentWithId[];
} | {
    message: {
        components: MessageComponentWithId[];
    };
};

/**
 * Recursively traverses a message component tree and returns a flat array
 * containing all components found in the structure.
 *
 * Supports component sources as a direct component array, an object with
 * a `components` property, or an object containing `message.components`.
 *
 * Nested components inside containers and action rows are traversed
 * recursively. For section components, the accessory component and any
 * nested components are also included in the result.
 *
 * @param source The source containing the message components to flatten.
 * @returns A flat array containing all components found in traversal order.
 */
declare function flattenMessageComponents(source: MessageComponentSource): MessageComponentWithId[];

/**
 * Finds a component by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number): MessageComponentWithId | null;
/**
 * Finds a {@link ButtonComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.Button): ButtonComponent | null;
/**
 * Finds a {@link StringSelectMenuComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.StringSelect): StringSelectMenuComponent | null;
/**
 * Finds a {@link UserSelectMenuComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.UserSelect): UserSelectMenuComponent | null;
/**
 * Finds a {@link RoleSelectMenuComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.RoleSelect): RoleSelectMenuComponent | null;
/**
 * Finds a {@link MentionableSelectMenuComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.MentionableSelect): MentionableSelectMenuComponent | null;
/**
 * Finds a {@link ChannelSelectMenuComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.ChannelSelect): ChannelSelectMenuComponent | null;
/**
 * Finds a {@link ContainerComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.Container): ContainerComponent | null;
/**
 * Finds a {@link SectionComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.Section): SectionComponent | null;
/**
 * Finds a {@link MediaGalleryComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.MediaGallery): MediaGalleryComponent | null;
/**
 * Finds a {@link ThumbnailComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.Thumbnail): ThumbnailComponent | null;
/**
 * Finds a {@link SeparatorComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.Separator): SeparatorComponent | null;
/**
 * Finds a {@link FileComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.File): FileComponent | null;
/**
 * Finds a {@link TextDisplayComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.TextDisplay): TextDisplayComponent | null;
/**
 * Finds a {@link MessageActionRowComponent} by its identifier.
 */
declare function findMessageComponentById(source: MessageComponentSource, id: number, type: ComponentType.ActionRow): MessageActionRowComponent | null;

type EmbedPlusAssetData = string | Attachment | AttachmentBuilder | EmbedAssetData | undefined | null;
type EmbedAssetOptions = Omit<EmbedAssetData, "url">;
declare function createEmbedAsset(source: EmbedPlusAssetData, options?: EmbedAssetOptions): EmbedAssetData | undefined;

type IdentityProperty = "username" | "displayName" | "id" | "globalName" | "nickname";
interface MemberAuthor {
    type: GuildMember;
    property?: IdentityProperty;
}
interface UserAuthor {
    type: User | ClientUser;
    property?: Exclude<IdentityProperty, "nickname">;
}
interface GuildAuthor {
    type: Guild;
    property?: "name" | "id";
}
type AuthorOption = MemberAuthor | UserAuthor | GuildAuthor;
type AuthorType = Guild | GuildMember | User | ClientUser;
type CreateEmbedAuthorOptions<T extends AuthorType> = {
    iconURL?: string;
    url?: string | null;
    prefix?: string;
    suffix?: string;
} & ImageURLOptions & Omit<Extract<AuthorOption, {
    type: T;
}>, "type">;
declare function createEmbedAuthor<T extends AuthorType>(type: T, options?: CreateEmbedAuthorOptions<T>): {
    name: string;
    url: string | undefined;
    iconURL: string | undefined;
};

type EmbedPlusFieldData = {
    name: string;
    value: string;
    inline?: boolean;
};
type FieldPredicate = (field: EmbedPlusFieldData, index: number, obj: EmbedPlusFieldData[]) => boolean;
declare class EmbedPlusFields {
    private embed;
    private set fields(value);
    private get fields();
    constructor(embed: EmbedPlusBuilder);
    [Symbol.iterator](): {
        next(): IteratorResult<EmbedPlusFieldData>;
    };
    get length(): number;
    get record(): Record<string, string | undefined>;
    /**
     * Get a filed by index
     * @param name Field name
     */
    get(name: string): EmbedPlusFieldData | undefined;
    /**
     * Get a field by name
     * @param index Field index
     */
    get(index: number): EmbedPlusFieldData | undefined;
    find(predicate: FieldPredicate): EmbedPlusFieldData | undefined;
    push(...fields: Partial<EmbedPlusFieldData>[]): this;
    set(...fields: Partial<EmbedPlusFieldData>[]): this;
    insert(index: number, ...fields: Partial<EmbedPlusFieldData>[]): void;
    map<U>(callback: (value: EmbedPlusFieldData, index: number, array: EmbedPlusFieldData[]) => U): U[];
    update(predicate: string | number | FieldPredicate, field: Partial<EmbedPlusFieldData>): boolean;
    delete(predicate: string | number | FieldPredicate): boolean;
    /**
     * Remove all fields
     */
    clear(): this;
    toArray(): EmbedPlusFieldData[];
    private getPredicateIndex;
    private fieldFormat;
}

type EmbedPlusFooterData = {
    text?: string | null;
    iconURL?: string | null;
};
declare function createEmbedFooter(options: string | EmbedPlusFooterData): EmbedFooterData | undefined;

type EmbedPlusBuilderReturn<B> = undefined extends B ? EmbedPlusBuilder : false extends B ? EmbedPlusBuilder : EmbedPlusBuilder[];
type EmbedPlusColorData = string & {} | ColorResolvable | null;
type EmbedPlusAuthorData = {
    name: string;
    url?: string;
    iconURL?: string;
};
type MaybeString = string | null | undefined;
interface EmbedPlusData {
    title?: string | null;
    color?: EmbedPlusColorData | null;
    description?: MaybeString | MaybeString[];
    url?: string | null | {
        toString(): string;
    };
    thumbnail?: EmbedPlusAssetData;
    image?: EmbedPlusAssetData;
    fields?: Partial<EmbedPlusFieldData>[] | null;
    timestamp?: string | number | Date | null | boolean;
    footer?: EmbedPlusFooterData | string;
    author?: EmbedPlusAuthorData;
}
type AnyEmbedData = APIEmbed | Embed | EmbedData;
interface MessageWithEmbeds {
    embeds: Array<Embed>;
}
interface InteractionWithEmbeds {
    message: MessageWithEmbeds;
}
interface EmbedPlusOptions extends EmbedPlusData {
    extends?: EmbedPlusData | AnyEmbedData | EmbedBuilder;
    mergeFields?: boolean;
}
declare class EmbedPlusBuilder extends EmbedBuilder {
    fields: EmbedPlusFields;
    constructor(data: EmbedPlusOptions);
    update(data: EmbedPlusData): this;
    has(property: keyof EmbedPlusData): boolean;
    toArray(): EmbedPlusBuilder[];
    toString(space?: number): string;
    toAttachment(data?: AttachmentData, space?: number): AttachmentBuilder;
    setColor(color: ColorResolvable | null): this;
    setAsset(asset: "thumbnail" | "image", source: EmbedPlusAssetData): this;
    setElementImageURL(element: "thumbnail" | "image" | "author" | "footer", url: string | null): this;
}
type EmbedPlusProperty<P extends keyof EmbedPlusData> = EmbedPlusData[P];
interface CreateEmbedOptions<B extends boolean> extends EmbedPlusOptions {
    array?: B;
    from?: InteractionWithEmbeds | MessageWithEmbeds;
    fromIndex?: number;
}
declare function createEmbed<B extends boolean>(options: CreateEmbedOptions<B>): EmbedPlusBuilderReturn<B>;

type ImageFileExtention = "png" | "jpg" | "gif" | "webp";
type ImageElementProperty = "author" | "thumbnail" | "image" | "footer";
interface CreateEmbedFilesOptions {
    ignore?: ImageElementProperty[];
    extentions?: Partial<Record<ImageElementProperty, ImageFileExtention>>;
    names?: Partial<Record<ImageElementProperty, string>>;
}
/**
 * Turns any embed image url into an attachment and returns an attachment array
 */
declare function createEmbedFiles(embed: EmbedBuilder, options?: CreateEmbedFilesOptions): AttachmentBuilder[];

/**
 * Checks whether the given value is an {@link Attachment} or an {@link AttachmentBuilder}.
 *
 * This function returns `true` if the value is an instance of either class,
 * or if it structurally matches by constructor name (useful across module boundaries).
 *
 * @param value - The value to check.
 * @returns `true` if the value is an attachment or attachment builder, otherwise `false`.
 *
 * @example
 * import { Attachment, AttachmentBuilder } from "discord.js";
 *
 * function handle(input: Attachment | AttachmentBuilder | unknown) {
 *   if (isAttachment(input)) {
 *     console.log("Attachment name:", input.name);
 *   }
 * }
 */
declare function isAttachment(value: unknown): value is Attachment | AttachmentBuilder;

/**
 * Checks whether the given value is a {@link ButtonBuilder}.
 *
 * This function returns `true` if the value is an instance of `ButtonBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `ButtonBuilder`, otherwise `false`.
 *
 * @example
 * import { ButtonBuilder } from "discord.js";
 *
 * function handle(input: ButtonBuilder | unknown) {
 *   if (isButtonBuilder(input)) {
 *     input.setLabel("Click me!");
 *   }
 * }
 */
declare function isButtonBuilder(value: unknown): value is ButtonBuilder;

/**
 * Checks whether the given value is a {@link ContainerBuilder}.
 *
 * This function returns `true` if the value is an instance of `ContainerBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `ContainerBuilder`, otherwise `false`.
 *
 * @example
 * import { ContainerBuilder } from "discord.js";
 *
 * function handle(input: ContainerBuilder | unknown) {
 *   if (isContainerBuilder(input)) {
 *     input.setAccentColor(0x2ecc71);
 *   }
 * }
 */
declare function isContainerBuilder(value: unknown): value is ContainerBuilder;

/**
 * Checks whether the given value is a {@link MediaGalleryBuilder}.
 *
 * This function returns `true` if the value is an instance of `MediaGalleryBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `MediaGalleryBuilder`, otherwise `false`.
 *
 * @example
 * import type { MediaGalleryBuilder } from "discord.js";
 *
 * function handle(input: MediaGalleryBuilder | unknown) {
 *   if (isMediaGalleryBuilder(input)) {
 *     input.addItems({ media: { url: "https://example.com/image.png" } });
 *   }
 * }
 */
declare function isMediaGalleryBuilder(value: unknown): value is MediaGalleryBuilder;
/**
 * Checks whether the given value is a {@link MediaGalleryItemBuilder}.
 *
 * This function returns `true` if the value is an instance of `MediaGalleryItemBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `MediaGalleryItemBuilder`, otherwise `false`.
 *
 * @example
 * import type { MediaGalleryItemBuilder } from "discord.js";
 *
 * function handle(input: MediaGalleryItemBuilder | unknown) {
 *   if (isMediaGalleryItemBuilder(input)) {
 *     input.setURL("https://example.com/image.png");
 *   }
 * }
 */
declare function isMediaGalleryItemBuilder(value: unknown): value is MediaGalleryItemBuilder;

/**
 * Checks whether the given value is a {@link ModalBuilder}.
 *
 * This function returns `true` if the value is an instance of `ModalBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `ModalBuilder`, otherwise `false`.
 *
 * @example
 * import type { ModalBuilder } from "discord.js";
 *
 * function handle(input: ModalBuilder | unknown) {
 *   if (isModalBuilder(input)) {
 *     input.setTitle("User Feedback");
 *   }
 * }
 */
declare function isModalBuilder(value: unknown): value is ModalBuilder;

type AnySelectMenuBuilder = StringSelectMenuBuilder | UserSelectMenuBuilder | RoleSelectMenuBuilder | ChannelSelectMenuBuilder | MentionableSelectMenuBuilder;
declare function isStringSelectMenuBuilder(value: unknown): value is StringSelectMenuBuilder;
declare function isUserSelectMenuBuilder(value: unknown): value is UserSelectMenuBuilder;
declare function isRoleSelectMenuBuilder(value: unknown): value is RoleSelectMenuBuilder;
declare function isChannelSelectMenuBuilder(value: unknown): value is ChannelSelectMenuBuilder;
declare function isMentionableSelectMenuBuilder(value: unknown): value is MentionableSelectMenuBuilder;
declare function isAnySelectMenuBuilder(value: unknown): value is AnySelectMenuBuilder;

/**
 * Checks whether the given value is an {@link ActionRowBuilder}, optionally filtered by component type.
 *
 * This function returns `true` if the value is an `ActionRowBuilder` instance or structurally matches one.
 * You can optionally specify a component type to check whether the row contains components of that type.
 *
 * @param value - The value to check.
 * @param withComponents - (Optional) Filter by component type: `"selects"`, `"buttons"`, or `"inputs"`.
 * @returns `true` if the value is an `ActionRowBuilder`, and optionally contains components of the specified type.
 *
 * @example
 * import type { ActionRowBuilder, ButtonBuilder } from "discord.js";
 *
 * function handle(input: unknown) {
 *   if (isActionRowBuilder(input, "buttons")) {
 *     console.log("Action row with buttons:", input.components.length);
 *   }
 * }
 *
 * @example
 * import type { AnySelectMenuBuilder } from "discord.js";
 *
 * function handleSelectRow(row: unknown) {
 *   if (isActionRowBuilder(row, "selects")) {
 *     console.log("Row contains select menus.");
 *   }
 * }
 */
declare function isActionRowBuilder(value: unknown): value is ActionRowBuilder;
declare function isActionRowBuilder(value: unknown, withComponents: "selects"): value is ActionRowBuilder<AnySelectMenuBuilder>;
declare function isActionRowBuilder(value: unknown, withComponents: "buttons"): value is ActionRowBuilder<ButtonBuilder>;

/**
 * Checks whether the given value is a {@link SectionBuilder}.
 *
 * This function returns `true` if the value is an instance of `SectionBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `SectionBuilder`, otherwise `false`.
 *
 * @example
 * import type { SectionBuilder } from "discord.js";
 *
 * function handle(input: SectionBuilder | unknown) {
 *   if (isSectionBuilder(input)) {
 *     console.log("SectionBuilder accessory:", input.accessory);
 *   }
 * }
 */
declare function isSectionBuilder(value: unknown): value is SectionBuilder;

/**
 * Checks whether the given value is a {@link FileBuilder}.
 *
 * This function returns `true` if the value is an instance of `FileBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `FileBuilder`, otherwise `false`.
 *
 * @example
 * import type { FileBuilder } from "discord.js";
 *
 * function handle(input: FileBuilder | unknown) {
 *   if (FileBuilder(input)) {
 *     input.setURL("https://example.com/image.png");
 *   }
 * }
 */
declare function isFileBuilder(value: unknown): value is FileBuilder;

/**
 * Checks whether the given value is a {@link SeparatorBuilder}.
 *
 * This function returns `true` if the value is an instance of `SeparatorBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `SeparatorBuilder`, otherwise `false`.
 *
 * @example
 * import { SeparatorBuilder } from "discord.js";
 *
 * function handle(input: SeparatorBuilder | unknown) {
 *   if (isSeparatorBuilder(input)) {
 *     console.log("SeparatorBuilder detected");
 *     input.setDivider(false);
 *   }
 * }
 */
declare function isSeparatorBuilder(value: unknown): value is SeparatorBuilder;

/**
 * Checks whether the given value is a {@link TextDisplayBuilder}.
 *
 * This function returns `true` if the value is an instance of `TextDisplayBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `TextDisplayBuilder`, otherwise `false`.
 *
 * @example
 * import type { TextDisplayBuilder } from "discord.js";
 *
 * function handle(input: TextDisplayBuilder | unknown) {
 *   if (isTextDisplayBuilder(input)) {
 *     console.log("TextDisplayBuilder content:", input.data.content);
 *   }
 * }
 */
declare function isTextDisplayBuilder(value: unknown): value is TextDisplayBuilder;

/**
 * Checks whether the given value is a {@link TextInputBuilder}.
 *
 * This function returns `true` if the value is an instance of `TextInputBuilder`,
 * or if it structurally matches by constructor name.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `TextInputBuilder`, otherwise `false`.
 *
 * @example
 * import { TextInputBuilder } from "discord.js";
 *
 * function handle(input: TextInputBuilder | unknown) {
 *   if (isTextInputBuilder(input)) {
 *     console.log("TextInputBuilder value:", input.data.value);
 *   }
 * }
 */
declare function isTextInputBuilder(value: unknown): value is TextInputBuilder;

/**
 * Checks whether the given value is a {@link Message}.
 *
 * This function returns `true` if the value is an instance of `Message`
 * or if it structurally resembles a `Message` object.
 *
 * @param value - The value to check.
 * @returns `true` if the value is a `Message`, otherwise `false`.
 *
 * @example
 * import type { Message, Interaction } from "discord.js";
 *
 * function handle(input: Message | Interaction | unknown) {
 *   if (isMessage(input)) {
 *     console.log("This is a message with ID:", input.id);
 *   }
 * }
 */
declare function isMessage(value: unknown): value is Message;

export { ContainerPlusBuilder, CustomItents, CustomPartials, EmbedLimit, EmbedPlusBuilder, Separator, chars, commandMention, createCheckbox, createCheckboxGroup, createComponents, createContainer, createEmbed, createEmbedAsset, createEmbedAuthor, createEmbedFiles, createEmbedFooter, createFile, createFileUpload, createLabel, createLinkButton, createMediaGallery, createModal, createModalFields, createModalInput, createRadioGroup, createRow, createSection, createSeparator, createTextDisplay, createTextInput, createThumbArea, createThumbnail, createWebhookClient, extractMentionId, fetchMessageFromURL, findChannel, findCommand, findEmoji, findMember, findMessage, findMessageComponentById, findRole, flattenMessageComponents, getChannelUrlInfo, getMessageURLInfo, isActionRowBuilder, isAnySelectMenuBuilder, isAttachment, isButtonBuilder, isChannelSelectMenuBuilder, isContainerBuilder, isFileBuilder, isMediaGalleryBuilder, isMediaGalleryItemBuilder, isMentionableSelectMenuBuilder, isMessage, isModalBuilder, isRoleSelectMenuBuilder, isSectionBuilder, isSeparatorBuilder, isStringSelectMenuBuilder, isTextDisplayBuilder, isTextInputBuilder, isUserSelectMenuBuilder, modalFieldsToRecord, setMobileStatus, wrapButtons };
export type { AnyEmbedData, AnySelectMenuBuilder, ComponentBuildersData, ComponentData, ContainerColor, ContainerComponentBuilder, ContainerData, ContainerInComponentType, CreateCheckboxData, CreateCheckboxGroupData, CreateComponentData, CreateModalOptions, CreateRadioGroup, EmbedPlusAssetData, EmbedPlusAuthorData, EmbedPlusColorData, EmbedPlusData, EmbedPlusFooterData, EmbedPlusProperty, FileUploadData, MagicComponentData, MediaGallerySource, SectionAccessory, SectionAccessoryData, SectionButtonAccessory, SectionData, SectionThumbnailAccessory, SeparatorData, ThumbAreaData, ThumbAreaThumbnail, ThumbnailData };
