diff.d.ts 404 B

1234567891011121314151617181920
  1. declare function diff(
  2. text1: string,
  3. text2: string,
  4. cursorPos?: number | diff.CursorInfo
  5. ): diff.Diff[];
  6. declare namespace diff {
  7. type Diff = [-1 | 0 | 1, string];
  8. const DELETE: -1;
  9. const INSERT: 1;
  10. const EQUAL: 0;
  11. interface CursorInfo {
  12. oldRange: { index: number; length: number };
  13. newRange: { index: number; length: number };
  14. }
  15. }
  16. export = diff;