forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deep-diff.d.ts
42 lines (36 loc) · 1.24 KB
/
deep-diff.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Type definitions for deep-diff
// Project: https://github.com/flitbit/diff/
// Definitions by: ZauberNerd <https://github.com/ZauberNerd/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module deepDiff {
interface IDiff {
kind: string;
path: string[];
lhs: any;
rhs: any;
index?: number;
item?: IDiff;
}
interface IAccumulator {
push(diff: IDiff): void;
length: number;
}
interface IPrefilter {
(path: string[], key: string): boolean;
}
interface IDeepDiff {
diff(): IDiff;
diff(lhs: Object, rhs: Object, prefilter?: IPrefilter, acc?: IAccumulator): IDiff[];
observableDiff(lhs: Object, rhs: Object, changes: Function, prefilter?: IPrefilter, path?: string[], key?: string, stack?: Object[]): void;
applyDiff(target: Object, source: Object, filter: Function): void;
applyChange(target: Object, source: Object, change: IDiff): void;
revertChange(target: Object, source: Object, change: IDiff): void;
isConflict(): boolean;
noConflict(): IDeepDiff;
}
}
declare var diff: deepDiff.IDeepDiff;
declare module "deep-diff" {
var diff: deepDiff.IDeepDiff;
export = diff;
}