mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
refactor deep-diff.d.ts
This commit is contained in:
44
deep-diff/deep-diff.d.ts
vendored
44
deep-diff/deep-diff.d.ts
vendored
@@ -3,27 +3,26 @@
|
||||
// Definitions by: ZauberNerd <https://github.com/ZauberNerd/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
declare module deepDiff {
|
||||
export interface IDeepDiff {
|
||||
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;
|
||||
@@ -35,8 +34,7 @@ declare module deepDiff {
|
||||
}
|
||||
}
|
||||
|
||||
declare var diff: deepDiff.IDeepDiff;
|
||||
|
||||
declare module "deep-diff" {
|
||||
var diff: deepDiff.IDeepDiff;
|
||||
export = diff;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user