import BaseMessage, { BaseInput, MessageTypes } from './Base'; /** * Represents a section row with a unique identifier, a title, and an optional description. * * @interface SectionRow * * @property {string} id - A unique identifier for the section row. * @property {string} title - The title of the section row. * @property {string} [description] - An optional description providing more details about the section row. */ interface SectionRow { id: string; title: string; description?: string; } /** * Represents a section of content consisting of a title and multiple rows. * * @interface Section * @property {string} title - The title of the section. * @property {SectionRow[]} rows - An array of rows contained within the section. */ interface Section { title: string; rows: SectionRow[]; } /** * Represents an input type specifically designed for interactive elements * within a messaging interface. Extends the BaseInput interface to include * interactive-specific properties such as sections and buttons. * * @interface InteractiveInput * @extends BaseInput * * @property {MessageTypes.INTERACTIVE} type * Specifies that the input type is interactive. It is a constant value * derived from the MessageTypes enumeration. * * @property {string} body * The primary content or message body associated with this input. Intended * to convey the main message to the recipient. * * @property {string} button * Represents the label or text displayed on the interactive button element. * It is crucial for triggering specific actions when interacted with by * the user. * * @property {Section[]} sections * A collection of sections within the interactive input. Each section might * contain multiple elements or options, facilitating complex interactive * scenarios or flows. * * @property {string} [header] * Optional property specifying a header or title for the interactive input. * It provides additional context or information about the interaction. * * @property {string} [footer] * Optional property for including a footer or conclusion section in the * interactive input. This can be used for disclaimers, additional remarks, * or concluding statements. */ export interface InteractiveInput extends BaseInput { type: MessageTypes.INTERACTIVE; body: string; button: string; sections: Section[]; header?: string; footer?: string; } /** * A class representing a simple text structure, optionally with a type. */ declare class SimpleText { type?: string; text: string; /** * Constructs a new instance of the class with a specified text, limited to a maximum length, * and an optional type designation. * * @param {string} text - The input text to be processed and stored within the instance. * @param {number} maxLength - The maximum allowable length of the text; if exceeded, the text will be truncated. * @param {boolean} [withType] - Optional parameter indicating if the type should be set to 'text'. */ constructor(text: string, maxLength: number, withType?: boolean); } /** * Represents an action with associated sections and a button. * * The Action class is designed to consolidate multiple sections, each containing rows, * and associate them with a button. Each section and its rows have character length limits * imposed to ensure they conform to specified constraints. */ declare class Action { button: string; sections: Section[]; /** * Constructs an instance of the class with the given sections and button text. * * @param {Section[]} sections - An array of sections where each section contains a title and an array of rows. * @param {string} button - The text for the button, limited to a specific number of characters. */ constructor(sections: Section[], button: string); } /** * Represents an interactive object commonly used in messaging applications * to structure a message with a list and associated actions. * * This class allows the creation of a structured message including a mandatory * body and action, with optional header and footer components. * * Properties: * @property {string} type - The type of interactive element, defaults to 'list'. * @property {SimpleText} [header] - Optional header text limited to 60 characters. * @property {SimpleText} body - Required body text with a limit of 4096 characters. * @property {SimpleText} [footer] - Optional footer text limited to 60 characters. * @property {Action} action - Required action component which defines behavior * and interaction options for the message. * * @constructor * @param {InteractiveInput} config - Configuration object for initializing the interactive * component which includes body, sections, button, and optionally header and footer. */ declare class Interactive { type: string; header?: SimpleText; body: SimpleText; footer?: SimpleText; action: Action; /** * Constructs an instance of the class with the specified configuration. * * @param {InteractiveInput} config - The configuration object for initializing the class instance. * @param {string} config.body - The main text content. * @param {Array} config.sections - The section data for actions. * @param {string} config.button - The button label for actions. * @param {string} [config.header] - Optional header text content. * @param {string} [config.footer] - Optional footer text content. */ constructor(config: InteractiveInput); } /** * Represents a message designed to engage users through interactive elements. * Inherits from the BaseMessage class, adding functionality specific to interactive content. * * The InteractiveMessage class focuses on creating messages that include interactive components. * It is initialized with a configuration that defines the content and behavior of the interactive elements. * * @extends BaseMessage * * @param {InteractiveInput} config - The configuration object containing parameters for interactive message creation. * * @property {Interactive} interactive - An instance of the Interactive class that represents the interactive content of the message. */ export declare class InteractiveMessage extends BaseMessage { interactive: Interactive; /** * Constructs a new instance of the class using the provided configuration. * * @param {InteractiveInput} config - The configuration object which is used to initialize the instance. */ constructor(config: InteractiveInput); } export {};