/** * Pure intra-paragraph diff for ODF comparison (issue #356). * * Token-level LCS over a single paragraph pair's visible text, returning char-offset spans. * Tokens are maximal runs of whitespace or non-whitespace — a partition of the string — so * every token boundary maps losslessly back to a character offset and the emitted spans land * on clean word boundaries (no ragged mid-word matches). Common token prefix/suffix are * trimmed before the O(N·M) DP, so the dominant case — one edited word in a long clause — * costs close to the edit size, not the paragraph size. * * Order convention mirrors `diffParagraphs`: at a mismatch the deletion branch wins, so a * replaced word surfaces as a `delete` immediately followed by an `insert` sharing `revStart`. * The emitter relies on that ordering when both anchor at the same offset. * * A grouping post-pass keeps multi-word replacements readable (issue #378): the LCS matches the * space between two replaced words as `equal`, which would otherwise split one logical * replacement into per-word delete/insert pairs. Change windows bridged by whitespace-only * equal spans collapse into a single delete+insert pair whenever both kinds are present. */ /** * One span of the intra-paragraph edit script, as half-open char offsets into the two visible * strings. `insert` spans have `origStart === origEnd`; `delete` spans have * `revStart === revEnd`; `equal` spans have the same length on both sides. */ export type SpanOp = { kind: 'equal' | 'insert' | 'delete'; origStart: number; origEnd: number; revStart: number; revEnd: number; }; /** * Diff two visible-text strings into an ordered span script. * Adjacent same-kind spans are coalesced; zero-length spans are never emitted. */ export declare function diffInline(original: string, revised: string): SpanOp[]; //# sourceMappingURL=inline_diff.d.ts.map