import * as Discord from "discord.js"; /** * Builder for creating file components in Discord messages * File components must be used alone in an action row * * IMPORTANT: File URLs must use the `attachment://` protocol. * Use the `createAttachmentUrl()` helper to ensure correct URL format. */ export declare class V2FileBuilder extends Discord.ComponentBuilder { private file; private spoiler?; constructor(); /** * Sets the file data for this component * @param file - The file data with url in `attachment://` format * @throws {Error} If the file URL doesn't use the attachment:// protocol */ setFile(file: Discord.APIUnfurledMediaItem): this; /** * Sets whether the file should be marked as a spoiler * @param spoiler - Whether to mark as spoiler */ setSpoiler(spoiler: boolean): this; /** * Get the API-compatible JSON data for this component */ toJSON(): Discord.APIFileComponent; } /** * Creates a properly formatted attachment URL for Discord file components * @param filename - The name of the file to reference * @returns A properly formatted attachment URL */ export declare function createAttachmentUrl(filename: string): string; /** * Helper function to create a file component * @param file - The file data (must use attachment:// protocol) * @param options - Optional configuration * @returns A new file component builder instance * * @example * ```typescript * // Correct usage with attachment protocol * const fileComponent = makeFile( * { url: createAttachmentUrl('avatar.png') }, * { id: 123, spoiler: false } * ); * * // When sending the message, provide the actual file: * channel.send({ * files: [ * { attachment: './path/to/avatar.png', name: 'avatar.png' } * ], * components: [new Discord.ActionRowBuilder().addComponents(fileComponent)] * }); * ``` */ export declare function makeFile(file: Discord.APIUnfurledMediaItem, options?: { id?: number; spoiler?: boolean; }): V2FileBuilder;