import type { Command } from "commander";
import { type ParsedMail } from "mailparser";
import type { EmitContext } from "../commander.js";
/**
* `eml` - Parse Gmail .eml thread exports into clean chronological markdown.
*
* Gmail exports a thread as a single .eml where older messages are nested
* inside `
` blocks with attribution lines in
* `
`. This command reconstructs the full thread
* in chronological order. Falls back to plain-text quote parsing (`> `
* prefixes + "On ... wrote:") when HTML is unavailable. Uses the injected
* EmitContext so composed and standalone consumers share one code path.
*/
interface ThreadMessage {
from: string;
date: Date | null;
body: string;
}
export declare function registerEmlCommand(program: Command, emit: EmitContext): void;
export interface EmlOpts {
output?: string;
format: string;
headers?: boolean;
attachments?: boolean;
}
/**
* Extract individual messages from the parsed email.
* Strategy: use HTML body (Gmail quote structure) first, fall back to plain text.
*/
export declare function extractThread(parsed: ParsedMail): ThreadMessage[];
/**
* Render the thread as markdown.
*/
export declare function renderMarkdown(parsed: ParsedMail, messages: ThreadMessage[], opts: EmlOpts): string;
export {};
//# sourceMappingURL=eml.d.ts.map