import { BaseStructure } from './BaseStructure.js'; import { ShewenyError } from '../helpers/index.js'; import type { ShewenyClient } from '../client/Client.js'; import type { ModalSubmitInteraction } from 'discord.js'; import type { Awaitable, ModalData, CustomId } from '../typescript/index.js'; /** * Represents an Modal structure * @extends {BaseStructure} */ export declare abstract class Modal extends BaseStructure { /** * Cooldown of a button in seconds * @type {number} */ cooldown: number; /** * Custom id for one or more modals * @type {CustomId} */ customId: CustomId; /** * Constructor to build a Modal * @param {ShewenyClient} [client] Client framework * @param {CustomId} [customId] Custom id for one or more modals * @param {ModalData | undefined} [options] The options of the modal */ constructor(client: ShewenyClient, customId: CustomId, options?: ModalData); /** * This function is executed before executing the `execute` function * @param {ModalSubmitInteraction} interaction Modal interaction * @returns {any | Promise} */ before?(interaction: ModalSubmitInteraction): Awaitable; /** * Main function `execute` for the modals * @param {ModalSubmitInteraction} interaction Modal interaction * @returns {any | Promise} */ abstract execute(interaction: ModalSubmitInteraction): Awaitable; /** * Register a modal in collections * @returns {Promise} */ register(): Promise; /** * Reload a modal * @returns {Promise | ShewenyError>} */ reload(): Promise; /** * Unregister a modal from collections * @returns {boolean} */ unregister(): boolean; }