export interface MimeHeader { name: string; value: string; } export interface MimePart { contentType: string; headers: MimeHeader[]; filename: string | undefined; bytes: Uint8Array; parts: MimePart[]; } /** * Parse an RFC 822 / MIME document (`.eml`, `.mhtml`) or an mbox of such * documents into a part tree. Transfer encodings are decoded; charset is not. */ export declare function parseMime(bytes: Uint8Array): MimePart; /** Preorder walk including `root`. */ export declare function walkMimeParts(root: MimePart): MimePart[]; /** First `text/html` leaf that is not an attachment (honors `start=`). */ export declare function mimeTextHtml(root: MimePart): MimePart | undefined; /** First `text/plain` leaf that is not an attachment. */ export declare function mimeTextPlain(root: MimePart): MimePart | undefined; /** * Leaf parts that are not the chosen text bodies. Includes `attachment` * disposition, related resources, and unnamed non-text leaves. */ export declare function mimeAttachments(root: MimePart): MimePart[]; /** Last header of `name` (case-insensitive). */ export declare function mimeHeader(part: MimePart, name: string): string | undefined;