import { type APIButtonComponent, type APIMessageComponent, type APIMessageTopLevelComponent, type JSONEncodable } from "discord.js"; /** * The sequence of mapping components from priority to sub components * * How it is received: * `action row` -> `sub components` * * How it is mapped: * `sub components` -> `action row` * * @param callback - You can `return` the `modified component` or `delete it with null`. * @returns A new modified array (the original structure will not be modified) * * @example * ```ts * mapButtons(components, (component, index) => { * // Delete a component * if (component.style !== ButtonStyle.Link) return null; * // filter components * if (component.label !== "example") return component * // Modify component * component.label = "modified" * // Return modified component * return component; * }); */ export declare function mapButtons(components: (APIMessageComponent | JSONEncodable)[], callback: (button: U, buttonIndex: number) => U | JSONEncodable | null): JSONEncodable[]; export declare function mapButtons(components: (APIMessageComponent | JSONEncodable)[], callback: (button: U, buttonIndex: number) => U | JSONEncodable | null): JSONEncodable[];