From af265f26cb0ec397caccb340b319d18d967b760b Mon Sep 17 00:00:00 2001 From: Rotem Harel Date: Sun, 21 Aug 2016 15:45:53 +0200 Subject: [PATCH 1/3] Adding missing method definitions to diff-match-patch --- diff-match-patch/diff-match-patch.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/diff-match-patch/diff-match-patch.d.ts b/diff-match-patch/diff-match-patch.d.ts index 028fe9d65c..35d0ede3e2 100644 --- a/diff-match-patch/diff-match-patch.d.ts +++ b/diff-match-patch/diff-match-patch.d.ts @@ -5,6 +5,13 @@ declare module "diff-match-patch" { type Diff = [number, string]; + export class Patch { + diffs: Diff[]; + start1: number; + start2: number; + length1: number; + length2: number; + } export class diff_match_patch { static new (): diff_match_patch; @@ -31,6 +38,12 @@ declare module "diff-match-patch" { diff_levenshtein(diffs: Diff[]): number; diff_toDelta(diffs: Diff[]): string; diff_fromDelta(text1: string, delta: string): Diff[]; + + patch_make(text1, text2: string): Patch[]; + patch_deepCopy(patches: Patch[]): Patch[]; + patch_apply(patches: Patch[], text: string): [string, boolean[]]; + patch_fromText(text: string): Patch[]; + patch_toText(patches: Patch[]): string; } export var DIFF_DELETE: number; From 9b891bddf49bfd18bf9596143f544d9a6066988f Mon Sep 17 00:00:00 2001 From: Rotem Harel Date: Sun, 21 Aug 2016 15:51:36 +0200 Subject: [PATCH 2/3] Fixed a missing parameter type. --- diff-match-patch/diff-match-patch.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-match-patch/diff-match-patch.d.ts b/diff-match-patch/diff-match-patch.d.ts index 35d0ede3e2..617944ff82 100644 --- a/diff-match-patch/diff-match-patch.d.ts +++ b/diff-match-patch/diff-match-patch.d.ts @@ -39,7 +39,7 @@ declare module "diff-match-patch" { diff_toDelta(diffs: Diff[]): string; diff_fromDelta(text1: string, delta: string): Diff[]; - patch_make(text1, text2: string): Patch[]; + patch_make(text1: string, text2: string): Patch[]; patch_deepCopy(patches: Patch[]): Patch[]; patch_apply(patches: Patch[], text: string): [string, boolean[]]; patch_fromText(text: string): Patch[]; From 675907148aa12cce0aa1d5237f7d0d9d419d287a Mon Sep 17 00:00:00 2001 From: Rotem Harel Date: Sun, 21 Aug 2016 16:03:00 +0200 Subject: [PATCH 3/3] Second parameter to is optional, first one can be a Diff[]. --- diff-match-patch/diff-match-patch.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-match-patch/diff-match-patch.d.ts b/diff-match-patch/diff-match-patch.d.ts index 617944ff82..b648363ead 100644 --- a/diff-match-patch/diff-match-patch.d.ts +++ b/diff-match-patch/diff-match-patch.d.ts @@ -39,7 +39,7 @@ declare module "diff-match-patch" { diff_toDelta(diffs: Diff[]): string; diff_fromDelta(text1: string, delta: string): Diff[]; - patch_make(text1: string, text2: string): Patch[]; + patch_make(text1: any, text2?: string): Patch[]; patch_deepCopy(patches: Patch[]): Patch[]; patch_apply(patches: Patch[], text: string): [string, boolean[]]; patch_fromText(text: string): Patch[];