import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage } from 'discord-api-types/v10'; type APIEmbedFieldName = string; type APIEmbedFieldValue = string; type APIEmbedFieldInline = boolean; import { type RestOrArray } from '../util/normalizeArray'; export type RGBTuple = [red: number, green: number, blue: number]; export interface IconData { /** * The URL of the icon */ iconURL?: string; /** * The proxy URL of the icon */ proxyIconURL?: string; } export type EmbedAuthorData = IconData & Omit; export type EmbedAuthorOptions = Omit; export type EmbedFooterData = IconData & Omit; export type EmbedFooterOptions = Omit; export interface EmbedImageData extends Omit { /** * The proxy URL for the image */ proxyURL?: string; } /** * Represents a embed in a message (image/video preview, rich embed, etc.) */ export declare class EmbedBuilder { readonly data: APIEmbed; constructor(data?: APIEmbed); /** * Appends fields to the embed * * @remarks * This method accepts either an array of fields or a variable number of field parameters. * The maximum amount of fields that can be added is 25. * @example * Using an array * ```ts * const fields: APIEmbedField[] = ...; * const embed = new EmbedBuilder() * .addFields(fields); * ``` * @example * Using rest parameters (variadic) * ```ts * const embed = new EmbedBuilder() * .addFields( * { name: 'Field 1', value: 'Value 1' }, * { name: 'Field 2', value: 'Value 2' }, * ); * ``` * @param fields - The fields to add */ addFields(...fields: RestOrArray): this; /** * Appends a field to the embed * * @remarks * This method accepts string as name and value * @example * Using an array * ```ts * const fieldName: APIEmbedFieldName = ...; * const fieldValue: APIEmbedFieldValue = ...; * const fieldInline: APIEmbedFieldInline = ...; * const embed = new EmbedBuilder() * .addField(fieldName, fieldValue); * ``` * @example * Using rest parameters (variadic) * ```ts * const embed = new EmbedBuilder() * .addField('Field Name', 'Field Value', FieldInline); * ``` * @param name - The field name to add * @param value - The field value to add * @param inline - If field is inline or not */ addField(name: APIEmbedFieldName, value: APIEmbedFieldValue, inline?: APIEmbedFieldInline): this; /** * Removes, replaces, or inserts fields in the embed. * * @remarks * This method behaves similarly * to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | Array.prototype.splice}. * The maximum amount of fields that can be added is 25. * * It's useful for modifying and adjusting order of the already-existing fields of an embed. * @example * Remove the first field * ```ts * embed.spliceFields(0, 1); * ``` * @example * Remove the first n fields * ```ts * const n = 4 * embed.spliceFields(0, n); * ``` * @example * Remove the last field * ```ts * embed.spliceFields(-1, 1); * ``` * @param index - The index to start at * @param deleteCount - The number of fields to remove * @param fields - The replacing field objects */ spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this; /** * Sets the embed's fields * * @remarks * This method is an alias for {@link EmbedBuilder.spliceFields}. More specifically, * it splices the entire array of fields, replacing them with the provided fields. * * You can set a maximum of 25 fields. * @param fields - The fields to set */ setFields(...fields: RestOrArray): this; /** * Sets the author of this embed * * @param options - The options for the author */ setAuthor(options: EmbedAuthorOptions | null): this; /** * Sets the color of this embed * * @param color - The color of the embed */ setColor(color: RGBTuple | number | null): this; /** * Sets the description of this embed * * @param description - The description */ setDescription(description: string | null): this; /** * Sets the footer of this embed * * @param options - The options for the footer */ setFooter(options: EmbedFooterOptions | null): this; /** * Sets the image of this embed * * @param url - The URL of the image */ setImage(url: string | null): this; /** * Sets the thumbnail of this embed * * @param url - The URL of the thumbnail */ setThumbnail(url: string | null): this; /** * Sets the timestamp of this embed * * @param timestamp - The timestamp or date */ setTimestamp(timestamp?: Date | number | null): this; /** * Sets the title of this embed * * @param title - The title */ setTitle(title: string | null): this; /** * Sets the URL of this embed * * @param url - The URL */ setURL(url: string | null): this; /** * Transforms the embed to a plain object */ build(): APIEmbed; /** * Transforms the embed to a plain object */ toJSON(): APIEmbed; } export {}; //# sourceMappingURL=EmbedBuilder.d.ts.map