/** * Public library API. * * `extract()` is the whole product surface: raw message in, classified segments out, with every * segment traceable to a MIME part and a source range, and nothing ever discarded. */ import { type ParseOptions } from './mime/model'; import { type ConfidenceConfig } from './classify/confidence'; import { type HistoryDocument } from './match/history'; import { type ExtractionResult, type Reason } from './types'; export * from './types'; export { parseMessage } from './mime/parse'; export type { ParsedMessage, MimePart } from './mime/model'; export type { Block, BlockFeatures, BlockKind, Evidence } from './segment/types'; export { DEFAULT_CONFIDENCE, validateConfidenceConfig, type ConfidenceConfig } from './classify/confidence'; export { validateParseOptions, DEFAULT_PARSE_OPTIONS } from './mime/model'; export { buildHistoryDocument, matchBlocks, type HistoryDocument, type BlockMatch } from './match/history'; export { corpusThreadResolver, folderThreadResolver, type ThreadResolver } from './corpus/thread-index'; export { analyze, resolveHistory, senderTokensFrom, type BodySection, type MessageContent, type AnalyzeOptions, type AnalyzeResult } from './analyze'; export { planBody, reportableExclusions, type BodyPlan, type ExclusionReason, type PlannedSection, type SectionRole } from './mime/select'; export { loadPatterns, patternSource, PatternAssetError, type PatternSource } from './detect/patterns'; export { canonicalisePlainText } from './canonical/text'; export interface ExtractOptions { parse?: ParseOptions; confidence?: Partial; /** * Earlier messages in the thread, most recent first. Optional: extraction works without any * history, and history only ever adds evidence. */ history?: readonly string[]; /** Pre-built history documents, for callers that resolve threads themselves. */ historyDocuments?: readonly HistoryDocument[]; /** Keep block level diagnostics on the result. Used by `extract --explain` and the review app. */ explain?: boolean; } export interface ExplainedResult extends ExtractionResult { /** Present when `explain` is set. */ diagnostics?: { structure: string; primaryPart: string | null; blocks: { index: number; /** MIME part and section-local index, the coordinates stored annotations use. */ mimePart: string; sourceIndex: number; kind: string; label: string; confidence: number; reasons: Reason[]; evidence: { id: string; kind: string; strength: number; }[]; features: Record; preview: string; }[]; }; } export declare function extract(raw: Buffer | string, options?: ExtractOptions): Promise; //# sourceMappingURL=index.d.ts.map