import type { ImapFlow } from "imapflow"; import type { Transporter } from "nodemailer"; import type { MailProvider, ProviderCapabilities, EmailSummary, EmailMessage, EmailThread, Label, SendOptions, ReplyOptions, ForwardOptions, DraftOptions, DraftSummary, UnreadCount, ExportedMessage } from "./interface.js"; export declare class ImapProvider implements MailProvider { private imap; private smtp; private email; readonly type = "imap"; readonly capabilities: ProviderCapabilities; private specialFolderCache; constructor(imap: ImapFlow, smtp: Transporter, email: string); private findSpecialFolder; searchMessages(query: string, maxResults?: number, folder?: string): Promise; findMessageIds(query: string, folder?: string, maxResults?: number): Promise; private searchByText; /** * Scan the tail of the open mailbox and match the query against the decoded * envelope (subject, from address, from name). Capped to avoid runaway scans * on large mailboxes. Returns UIDs to match the searchByText contract. */ private clientSideEnvelopeSearch; /** Fetch the N most recent UIDs from the currently locked mailbox. */ private listRecentUids; readMessage(messageId: string): Promise; private fetchMessage; readThread(threadId: string): Promise; sendMessage(to: string[], subject: string, body: string, options?: SendOptions): Promise; replyToMessage(messageId: string, body: string, options?: ReplyOptions): Promise; forwardMessage(messageId: string, to: string[], options?: ForwardOptions): Promise; createDraft(to: string[], subject: string, body: string, options?: DraftOptions): Promise; trashMessages(messageIds: string[]): Promise; listLabels(): Promise; createLabel(name: string): Promise