/** * Line diffs for a mutation card. * * A tool hands over a before and an after image of the text it changed, and the * card has to say which lines moved. Reducing that to a common prefix and suffix * is only correct when the change is contiguous: for a file with two separate * edits it marks everything BETWEEN them as removed and re-added, which is both * wrong and expensive — the untouched middle eats the card's row budget. * * A longest-common-subsequence diff keeps those interior lines as context. It * costs O(n×m) cells, so a size guard falls back to the prefix-and-suffix * approximation rather than allocating a matrix for a whole-file rewrite; the * fallback is exactly right for a single contiguous change, which is the shape a * fallback is most likely to see. * @module @deepseek-ai/dshline/diff */ /** What happened to one line between the two images. */ export type DiffRowKind = 'context' | 'add' | 'remove'; /** One line of a rendered diff. */ export interface DiffRow { readonly kind: DiffRowKind; readonly text: string; } /** * Diff two images of a file into rows. * @param oldText - the before image, or null for a create or an overwrite where * no before image was available. * @param newText - the after image. * @returns rows in file order; every line of both images appears exactly once. */ export declare function diffRows(oldText: string | null, newText: string): DiffRow[]; //# sourceMappingURL=diff.d.ts.map