import type { EmailConfig } from "./credentials.js"; import { buildMailOptions } from "./smtp.js"; /** Inputs shared by email-draft (compose new) and email-draft-edit (compose replacement). */ export interface DraftComposeParams { to: string; subject?: string; body: string; html?: string; cc?: string[]; bcc?: string[]; attachments?: string[]; /** When set, compose a threaded draft-reply to this Message-ID. */ messageId?: string; } export interface ComposedDraft { raw: Buffer; resolvedSubject: string; /** The parent Message-ID when threaded, else null. */ threadedParentId: string | null; /** * The draft's own Message-ID, stamped into `raw`. This is the stable identity * an edit uses to re-locate the draft after Gmail renumbers its UID. */ draftMessageId: string; attachments: Array<{ filename: string; path: string; }>; } /** * Compile the shared mail options into raw RFC822 bytes via nodemailer's own composer. * * MimeNode strips the Bcc header at build time by default (correct for SMTP, * where the envelope carries BCC). A stored draft has no envelope — the bytes * are the only recipient carrier — so keep the header. Property-only switch: * the constructor option form is ignored by MailComposer. */ export declare function composeRaw(options: ReturnType): Promise; /** * Shared draft compose used by both email-draft and email-draft-edit: resolves * attachment paths, resolves threading when a parent messageId is supplied, and * compiles the MIME bytes. * * Threaded (messageId set): resolves the parent via IMAP; a missing parent * throws verbatim and nothing is composed. In-Reply-To/References carry the * parent Message-ID and the subject is a Re:-prefixed copy of the parent's, * exactly like email-reply — so the subject argument is ignored on this path. * * Standalone (messageId unset): the subject argument is required. */ export declare function composeDraft(config: EmailConfig, password: string, accountId: string, params: DraftComposeParams): Promise; //# sourceMappingURL=compose.d.ts.map