/** * Telegram Account Manager * * Manages multiple Telegram bot accounts, including: * - Account configuration storage * - Bot instance management * - Runner lifecycle * - Status tracking * - Bot username mapping */ import type { Bot, Context } from 'grammy'; import type { ChannelStatus } from '@xopcai/xopc/channels/channel-domain.js'; import type { TelegramPollingSession } from './polling-session.js'; import type { TelegramAccountConfig } from './config-types.js'; export declare class TelegramAccountManager { private accounts; private bots; private pollingSessions; private statuses; private botUsernames; private startingAccounts; registerAccount(account: TelegramAccountConfig): void; getAccount(accountId: string): TelegramAccountConfig | undefined; getAllAccounts(): TelegramAccountConfig[]; /** Clear all accounts and runtime state (used when reloading channel config). */ reset(): void; registerBot(accountId: string, bot: Bot): void; getBot(accountId: string): Bot | undefined; registerPollingSession(accountId: string, session: TelegramPollingSession): void; stopRunner(accountId: string): Promise; isStarting(accountId: string): boolean; markStarting(accountId: string): void; markStartComplete(accountId: string): void; isRunning(accountId: string): boolean; updateStatus(status: ChannelStatus): void; getStatus(accountId: string): ChannelStatus | undefined; setBotUsername(accountId: string, username: string): void; getBotUsername(accountId: string): string | undefined; /** Map the bot handling this update to a configured account id (session keys must match inbound). */ resolveAccountIdFromContext(ctx: Context): string; }