code-suggester
Version:
Library to propose code changes
23 lines (22 loc) • 835 B
TypeScript
import { Hunk } from '../types';
/**
* Given a patch expressed in GNU diff format, return the range of lines
* from the original content that are changed.
* @param diff Diff expressed in GNU diff format.
* @returns Hunk[]
*/
export declare function parsePatch(patch: string): Hunk[];
/**
* Given a diff expressed in GNU diff format, return the range of lines
* from the original content that are changed.
* @param diff Diff expressed in GNU diff format.
* @returns Map<string, Hunk[]>
*/
export declare function parseAllHunks(diff: string): Map<string, Hunk[]>;
/**
* Given two texts, return the range of lines that are changed.
* @param oldContent The original content.
* @param newContent The new content.
* @returns Hunk[]
*/
export declare function getSuggestedHunks(oldContent: string, newContent: string): Hunk[];