/** * The line-level diff behind the paper view's snapshot comparison: a simple * LCS diff of two texts (common prefix/suffix trimmed first), plus the * display compaction that folds long unchanged runs into gap markers so the * panel never mounts one row per unchanged line. Pure functions, no JSX. * @module dsh-client-ui-mimir/client/snapshot-diff */ /** One row of the line diff between a snapshot and the current source. */ export type SnapshotDiffRow = { readonly type: 'same'; readonly oldLine: number; readonly newLine: number; readonly text: string; } | { readonly type: 'del'; readonly oldLine: number; readonly text: string; } | { readonly type: 'add'; readonly newLine: number; readonly text: string; }; /** * Diff two texts line by line: `before` (the snapshot) against `after` (the * current source). Rows carry 1-based line numbers of the side they belong * to. Identical texts yield only `same` rows. */ export declare function diffLines(before: string, after: string): SnapshotDiffRow[]; /** * One display row of the compacted diff: either a real diff row or a gap * marker folding `count` unchanged lines. */ export type SnapshotDiffDisplayRow = SnapshotDiffRow | { readonly type: 'gap'; readonly count: number; }; /** * Fold long `same` runs into gap markers, keeping {@link DIFF_CONTEXT_LINES} * context lines on each side of every change. Runs of at most twice the * context stay expanded — folding them would save nothing. */ export declare function collapseDiffRows(rows: readonly SnapshotDiffRow[]): SnapshotDiffDisplayRow[]; //# sourceMappingURL=snapshot-diff.d.ts.map