/** * Hand-rolled unified-diff generator for bounded codemods. * NOT a spec-perfect unified-diff (no EOF-no-newline handling, etc.). * Sufficient for the 3 bounded codemods in V0.1.0. * If we later need robustness, swap in the `diff` npm library. */ /** * Generate a single-hunk unified diff for a single-line substitution. * Format: standard `diff -u` output with 3 lines of context. */ export declare function singleLineDiff(filePath: string, source: string, lineNumber: number, // 1-based oldLineContent: string, newLineContent: string): string; /** * Generate ONE unified diff that both inserts a line (e.g. an import) and * substitutes a fragment on another line. Both edits live under a single * `--- a/ +++ b/` header in a single hunk spanning them, so the line offsets * stay self-consistent. * * Concatenating two independently-generated diffs (each computed against the * original file) is NOT valid: the second hunk's offsets are wrong once the * first hunk changes the file's length, and `git apply` rejects it. * * `insertAfterLine` is 1-based (0 = before the first line). `replaceLineNumber` * is 1-based. */ export declare function insertAndReplaceDiff(filePath: string, source: string, insertAfterLine: number, newLine: string, replaceLineNumber: number, oldFragment: string, newFragment: string): string;