forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
json-patch.d.ts
41 lines (38 loc) · 1.04 KB
/
json-patch.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
// Type definitions for json-patch
// Project: https://github.com/bruth/jsonpatch-js
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module jsonpatch {
type OpPatch = AddPath | RemovePath | ReplacePath | MovePath | CopyPath | TestPath;
interface Patch {
op: string;
}
interface AddPath extends Patch {
path: string;
value: any;
}
interface RemovePath extends Patch {
path: string;
}
interface ReplacePath extends Patch {
path: string;
value: any;
}
interface MovePath extends Patch {
from: string;
path: string;
}
interface CopyPath extends Patch {
from: string;
path: string;
}
interface TestPath extends Patch {
path: string;
value: any;
}
function apply(document: any, patches: OpPatch[]): any;
function compile(patches: OpPatch[]): (document: any) => any;
}
declare module "json-patch" {
export = jsonpatch;
}