/** * Stage 1: MIME parsing. * * Built on @zone-eu/mailsplit rather than a full parser, because mailsplit is the only local option * that walks the tree non-destructively: it emits raw header bytes and raw body chunks in document * order, byte for byte, and gives every node an IMAP style part number. That is what makes the * traceability requirement satisfiable. postal-mime and mailparser both collapse the tree into a * single html/text pair and discard byte spans. * * Byte offsets are not exposed as a field by mailsplit, so this module reconstructs them by * accumulating chunk lengths in emission order. mailsplit's own round trip test asserts that the * concatenation of all chunks equals the input, which is what makes the running sum exact. * * Nothing in here throws for malformed input. Problems are recorded as warnings and the walk * continues, because a corpus run must never stop on one bad message. */ import { type MimePart, type ParseOptions, type ParsedMessage } from './model'; /** Compact structural signature such as "m/alternative(P,H)", used for corpus statistics. */ export declare function structureSignature(parts: readonly MimePart[], partsById: ReadonlyMap, rootId: string): string; /** * Parse a raw RFC 5322 message into the normalised internal representation. * * Never rejects on malformed input. The only rejection path is an internal stream error, and even * that is converted into a parsed message carrying a `mime_parse_error` warning. */ export declare function parseMessage(raw: Buffer, options?: ParseOptions): Promise; //# sourceMappingURL=parse.d.ts.map