/** * Pure paragraph-level diff for ODF comparison (Slice 1). * * A language-agnostic O(N·M) LCS over two arrays of paragraph visible-text strings, returning a * structured edit script in standard diff order. No DOM — this mirrors docx-core's `atomLcs.ts` * (kept separate from emission so it is testable in isolation). * * Order convention: a paragraph "replaced" in place (text differs at a matched slot) surfaces as * a `delete` of the original immediately followed by an `insert` of the revised, because at a * mismatch we prefer the deletion branch. The emitter relies on this delete-before-insert order * when both anchor at the same position. */ /** One step of the edit script, in merged document order. */ export type EditOp = { kind: 'equal'; originalIndex: number; revisedIndex: number; } | { kind: 'insert'; revisedIndex: number; } | { kind: 'delete'; originalIndex: number; } | { kind: 'modify'; originalIndex: number; revisedIndex: number; }; /** * Diff two paragraph-text arrays into an ordered edit script. * `equal` ops carry both indices; `insert` carries the revised index; `delete` the original index. */ export declare function diffParagraphs(original: string[], revised: string[]): EditOp[]; /** * Below this Jaccard word-overlap, an aligned delete/insert pair is a replacement, not an * in-place edit. Matches docx-core's `DEFAULT_PARAGRAPH_SIMILARITY_THRESHOLD` reference point. */ export declare const DEFAULT_ODF_SIMILARITY_THRESHOLD = 0.25; /** * Post-pass over a `diffParagraphs` script: inside each gap (a run of deletes followed by a run * of inserts between two anchors — the order `diffParagraphs`'s tie-break guarantees), convert * similar delete/insert pairs into `modify` ops. * * Pairing is an order-constrained DP, deterministic by construction: maximize the pair count, * then the total Jaccard similarity; a pair is admissible only when similarity ≥ * `similarityThreshold`. At ties, pairing beats skipping, and skipping a delete beats skipping * an insert (keeps the delete-first convention). Output preserves merged document order: * between pairs, unpaired deletes precede unpaired inserts, exactly as Slice 1 emitted them. */ export declare function pairModifications(ops: EditOp[], original: string[], revised: string[], similarityThreshold?: number): EditOp[]; //# sourceMappingURL=diff.d.ts.map