/** * IMAP provider — implements MailProvider using CompatImapClient + a caller- * supplied TransportFactory. Single source of truth for IMAP-protocol-side * code shared by desktop (Node) and Android (WebView). * * SOURCE OF TRUTH: this file is the single canonical IMAP provider for mailx. * Was previously `mailx-store-web/imap-web-provider.ts` (Android-only, with a * BridgeTransport default). Moved here without the platform-specific default * — callers inject the right transport at construction: * - Desktop: () => new NodeTcpTransport() (from @bobfrankston/node-tcp-transport) * - Android: () => new BridgeTcpTransport() (from @bobfrankston/tcp-transport) * * Includes automatic retry on broken pipe / connection errors: if an operation * fails with a connection-related error, we discard the client and retry once * with a fresh connection. */ import { type ImapClientConfig } from "@bobfrankston/iflow-direct"; import type { TransportFactory } from "@bobfrankston/tcp-transport"; import type { MailProvider, ProviderFolder, ProviderMessage, FetchOptions } from "./types.js"; export declare class ImapProvider implements MailProvider { private client; private config; private transportFactory; private specialFolders; private folderListCache; constructor(config: ImapClientConfig, transportFactory: TransportFactory); /** Discard the current client + recreate. Called after a broken-pipe error. */ private reconnect; /** Run an operation, retrying once on connection error with a fresh client. */ private withRetry; listFolders(): Promise; fetchSince(folder: string, sinceUid: number, options?: FetchOptions): Promise; fetchByDate(folder: string, since: Date, before: Date, options?: FetchOptions, onChunk?: (msgs: ProviderMessage[]) => void): Promise; fetchByUids(folder: string, uids: number[], options?: FetchOptions): Promise; fetchOne(folder: string, uid: number, options?: FetchOptions): Promise; getUids(folder: string): Promise; close(): Promise; } //# sourceMappingURL=imap.d.ts.map