import { FileContent } from 'eris'; import type { AnyContext } from '../contexts/AnyContext'; import type { AgnosticMessageContent } from '../interfaces/AgnosticMessageContent'; import type { ComponentsManager } from './ComponentsManager'; import type { AnyComponentContext } from './contexts/AnyComponentContext'; import type { Button } from './helpers/Button'; import type { Select } from './helpers/Select'; export declare type AnyComponent = Button | Select; export declare type ContentTransformer = (content?: AgnosticMessageContent) => Promise; export declare class ComponentOperation { protected readonly ctx: AnyContext; protected readonly cm: ComponentsManager; protected isClosing: boolean; protected _content: AgnosticMessageContent; protected _merge: AgnosticMessageContent; transformer: ContentTransformer; protected _files: Array; protected _rows: Array>; readonly maxRowCount = 5; timeoutSeconds: number; private timeout; private messageId; protected resolve: (value?: T) => void; protected reject: (reason?: any) => void; constructor(ctx: AnyContext); content(content: string | AgnosticMessageContent): this; contentTranslated(key: string, repl?: Record, backup?: string): Promise; files(files: Array): this; clearRows(): this; setRows(rows: Array>): this; setRow(n: number, row: Array): this; addRows(rows: Array>): this; addRow(row: Array): this; /** * A helper function to help build more complex/dynamic operations * Some examples would be a button that re-renders itself etc */ update(): Promise; draw(): Promise; /** * Merge & build the final message content object */ build(): Promise; /** * Actually "writes/makes visible" the state of this operation to the user. * When overriding this function take care that you always super.render(); */ render(): Promise; protected handleInteraction(ctx: AnyComponentContext): Promise; protected refreshTimeout(): void; protected handleTimeout(): Promise; /** * Promise won't resolve until the ComponentMessage is closed * Can be used to block further execution */ start(): Promise; close(reason?: unknown): Promise; cleanup(): Promise; }