import { type AoiClient, type CommandData } from "aoitelegram"; import { type AoiManager } from "./AoiManager"; interface TimeoutData { id: string; time: number; datestamp: number; outData: Record; } declare class TimeoutManager { private readonly database; private readonly timeouts; private readonly registeredTimeouts; /** * Creates an instance of TimeoutManager. * @param database - The database manager instance. */ constructor(database: AoiManager); /** * Registers a timeout command description. * @param description - The command description to register. * @throws {AoijsTypeError} If the timeout ID already exists. */ registerTimeout(description: CommandData<{ id: string; }>): void; /** * Adds a new timeout to the database. * @param id - The ID of the timeout. * @param options - The timeout options including time and output data. * @returns The unique ID of the added timeout. */ addTimeout(id: string, options: { time: number; outData: Record; }): Promise; /** * Removes a timeout from the database. * @param timeoutId - The unique ID of the timeout. * @returns True if the timeout was removed, false otherwise. */ removeTimeout(timeoutId: string): Promise; /** * Restores all timeouts from the database. */ private restoreTimeouts; /** * Handles the addition of a timeout. * @param timeoutData - The data of the timeout to handle. */ private handleAddTimeout; /** * Handles the timeout event and executes the corresponding command. * @param timeoutData - The data of the timeout event. * @param telegram - The AoiClient instance. */ private handleTimeoutEvent; /** * Initializes the TimeoutManager, setting up event listeners. * @param telegram - The AoiClient instance. */ init(telegram: AoiClient): void; } export { TimeoutManager, TimeoutData };