import { Message, MessageEmbed } from 'discord.js'; declare type MenuEmbedSettings = { /** * Maximum number of fields/options per page */ maxPerPage?: number; /** * Miliseconds until reactions are no longer accepted on * paginated embeds */ paginationTimeout?: number; /** * Allow multiple options to be selected (comma-separated) */ multiSelect?: boolean; }; declare type MenuEmbedOption = { /** * Name of the option */ name: string; /** * Description of the option */ description?: string; }; export declare class MenuEmbed { embed: MessageEmbed; options: Array; /** * The current page */ page: number; /** * If defined, enable pagination and handle errors when * the menu fails to set up pagination (when message * edits or reactions fail) */ paginationErrorHandler?: (error: Error, message: Message) => void; paginationTimeout: number; maxPerPage: number; multiSelect: boolean; constructor(embed?: MessageEmbed, settings?: MenuEmbedSettings); /** * Get array of numbers of a range, separated by "-" * * @param string */ static getMultiSelectOptionRange(string: string): number[]; /** * Get comma-separated values for multi-select. * * @param string Input string */ static getMultiSelectOptions(string: string): number[]; /** * Enable pagination by defining an error handler for * when the menu fails to set up pages (when message * edits or reactions fail) * * @param errorHandler Error handler */ enablePagination(errorHandler: (error: Error, message: Message) => void): this; /** * Add an auto-numbered field * * @param name Name of option * @param description Description of optino * @param number Optionally override the numbering */ addOption(name: string, description?: string, number?: number): this; /** * Enable multi selection for this menu */ enableMultiSelect(): this; /** * Disable multi selection for this menu */ disableMultiSelect(): this; /** * Return the number of options this embed has */ numberOfOptions(): number; /** * Returns whether a number is out of range for the * options of this menu * * @param number Option number */ isValidOption(number: number): boolean; /** * Returns if a message content correctly identifies * an option of this menu * * @param content Message content */ isValidSelection(content: string): boolean; /** * Check if the current page is the last page */ isOnLastPage(): boolean; /** * Check if the current page is the first page */ isOnFirstPage(): boolean; /** * Increment the page and update the message if the * current page is not the last */ nextPage(message: Message): Promise; /** * Decrement the page and update the message if the * current page is not the first */ prevPage(message: Message): Promise; /** * Edit a message to show the current page * * @param message Message to update */ setMessage(message: Message): Promise; /** * If this menu should enable pagination */ canPaginate(): boolean; /** * Sets up pagination on a message * * @param message Channel to send to */ setUpPagination(message: Message): Promise; /** * Collect reactions for pagination for this menu * * @param message Message to collect reactions on */ createReactionCollector(message: Message): void; /** * Get the options of a page * * @param page */ getOptionsOfPage(page: number): Array; /** * Get the embed that corresponds to a page number * * @param page */ getEmbedOfPage(page: number): MessageEmbed; /** * Check if the number of fields spans across multiple pages */ spansMultiplePages(): boolean; } export {};