export type DiffLine = { kind: "context" | "delete" | "insert"; text: string; oldNum: number | null; newNum: number | null; }; export type Hunk = { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: DiffLine[]; }; export type RenderDiffOpts = { lineNumbers?: boolean; colored?: boolean; oldLabel?: string; newLabel?: string; hunkHeaders?: boolean; summary?: boolean; renderBody?: (code: string, kind: DiffLine["kind"], width: number) => string; }; /** * Compute a line-level diff grouped into hunks. * `context < 0` -> one hunk spanning everything (full context). * `context >= 0` -> keep only changed lines plus `context` unchanged lines on * each side; runs separated by more than 2*context unchanged lines split into * separate hunks. */ export declare function computeHunks(oldText: string, newText: string, context: number, ignoreWhitespace: boolean): Hunk[]; /** Render hunks as a human-readable diff string. */ export declare function renderDiff(hunks: Hunk[], opts?: RenderDiffOpts): string; /** Render hunks as a standard unified diff that std::fs::applyPatch can apply. */ export declare function renderPatch(hunks: Hunk[], oldLabel: string, newLabel: string): string; /** * Back-compat shim: full-context, colored-by-default inline diff. Existing * callers (optimizer reporter, test runner, sourceMutator) rely on this exact * output, so it must not change. */ export declare function formatDiff(expected: string, actual: string, opts?: { colorize?: boolean; }): string;