/** * Thread reconstruction over a scanned corpus. * * Resolves a message's In-Reply-To and References to files that are actually present, so that * Stage 5 has something to match against. Measured over the working corpus, 90.9 percent of replies * resolve their direct parent this way. * * Ancestors are returned nearest first. The direct parent carries most of the value: it is what the * sender's client quoted from. Older ancestors matter for deeply nested threads, where the reply * contains several generations of history at once. */ import { type HistoryDocument } from '../match/history'; import { type MessageHeaders } from '../mime/model'; import { type CorpusStore } from './store'; export interface ThreadResolver { /** Load history documents for a message, nearest ancestor first. */ resolve(headers: MessageHeaders, maxAncestors?: number): Promise; } /** How many ancestors to load by default. Each one costs a file read and a parse. */ export declare const DEFAULT_MAX_ANCESTORS = 3; /** * Build a resolver backed by a scanned corpus database. * * The lookup is a single indexed query per candidate Message-ID, so no in memory index of the whole * corpus is needed. That matters: a Message-ID map over 320k messages is tens of megabytes that * would otherwise be paid for on every process start. */ export declare function corpusThreadResolver(store: CorpusStore, root: string): ThreadResolver; /** Build a resolver from a folder of .eml files, for callers with no corpus database. */ export declare function folderThreadResolver(folder: string): ThreadResolver; //# sourceMappingURL=thread-index.d.ts.map