diff.d.ts 404 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
declare function diff(
    text1: string,
    text2: string,
    cursorPos?: number | diff.CursorInfo
): diff.Diff[];

declare namespace diff {
    type Diff = [-1 | 0 | 1, string];

    const DELETE: -1;
    const INSERT: 1;
    const EQUAL: 0;

    interface CursorInfo {
        oldRange: { index: number; length: number };
        newRange: { index: number; length: number };
    }
}

export = diff;