import type Database from "better-sqlite3"; import type { PlatformAdapter } from "../im/types.js"; import { type TransportStatusCounts } from "./store.js"; import type { DeliveryOptions, InboundHandler, InboundTerminalStatus, MessageReadError, NormalizedMessage, TransportClient } from "./types.js"; type PersistentTransportOptions = { db: Database.Database; botId: string; platform: string; adapter: PlatformAdapter; storageDir: string; deliveryTimeoutMs?: number; unknownFileRetentionMs?: number; inboundRetryDelaysMs?: number[]; outboundRecoveryConcurrency?: number; }; export declare class PersistentTransport implements TransportClient { readonly managedDelivery = true; private readonly store; private readonly adapter; private readonly botId; private readonly platform; private readonly managedFileRoot; private readonly deliveryTimeoutMs; private readonly unknownFileRetentionMs; private readonly inboundRetryDelaysMs; private readonly outboundRecoveryConcurrency; private readonly log; private inboundHandler?; private readonly inboundRetryTimers; private recoveryPromise?; private stopped; constructor(options: PersistentTransportOptions); onInbound(handler: InboundHandler): void; onMessageReadError(handler: (event: MessageReadError) => void): void; start(): Promise; stop(): Promise; recover(): Promise; private performRecovery; getStatusCounts(): TransportStatusCounts; markInboundQueued(inboxId: number, claimToken: string, messageId: number): void; markInboundProcessing(inboxId: number, claimToken: string, messageId: number): void; markInboundTerminal(inboxId: number, claimToken: string, status: InboundTerminalStatus, error?: string): void; markInboundRunState(messageIds: number[], runId: string, stage: string, error?: string): void; discardInboundMessages(messageIds: number[]): void; sendText(chatId: string, text: string, options?: DeliveryOptions): Promise; sendReply(chatId: string, text: string, replyToMsgId: string, options?: DeliveryOptions): Promise; sendMarkdownCard(chatId: string, markdown: string, options?: DeliveryOptions): Promise; sendCard(chatId: string, header: string, content: string, footer?: string, replyToMsgId?: string, options?: DeliveryOptions): Promise; sendFile(chatId: string, filePath: string, fileName?: string, options?: DeliveryOptions): Promise; editMessage(msgId: string, text: string, options?: DeliveryOptions): Promise; addReaction(chatId: string, msgId: string, emoji: string, options?: DeliveryOptions): Promise; removeReaction(chatId: string, msgId: string, emoji: string, options?: DeliveryOptions): Promise; getBotOpenId(): Promise; getBotName(): Promise; getChatName(chatId: string): Promise; getChatMetadata(chatId: string): Promise; getMessageContent(msgId: string, context?: { chatPlatformId?: string; threadId?: string; }): Promise; getMessageThreadId(messageId: string, context?: { chatPlatformId?: string; }): Promise; listChatMessages(chatId: string, options?: { sinceUnixSec?: number; limit?: number; threadId?: string; }): Promise; getAppCreatorId(): Promise; private receive; private dispatchInbound; private scheduleInboundRetry; private recoverOutboundInBackground; private enqueueOutbound; private deliverPersisted; private requeueOutbound; private callAdapter; private observeLateDelivery; private copyManagedFile; private cleanupManagedFile; } export {};