-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplain.d.ts
More file actions
84 lines (84 loc) · 2 KB
/
plain.d.ts
File metadata and controls
84 lines (84 loc) · 2 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import * as JSONDiffPatch from 'jsondiffpatch';
/**
* @description
* Returns the changed value of the object.
*
* @param left any
* @param right any
*/
export declare const diff: (left: any, right: any) => JSONDiffPatch.Delta | undefined;
/**
* @description
* Returns the changed values of the object.
*
* @param object any
*/
export declare const diffs: (object: any[]) => JSONDiffPatch.Delta[];
export interface IChangeLogs {
op: 'add' | 'remove' | 'replace' | 'move';
path: string;
value: any;
}
/**
* @description
* Returns the changed content in
* JSON PATCH (RFC 6902) format.
*
* @param diff
* @param original any
* @returns It returns JSON PATCH (RFC 6902)
*/
export declare const changelogs: (diff: JSONDiffPatch.Delta, original: any) => IChangeLogs[] | undefined;
export interface IChangelogsFormattedOption {
diff: JSONDiffPatch.Delta;
original: any;
format: 'console' | 'annotated' | 'html';
}
/**
* @description
* Returns the changed content in
* human readable log form.
*
* @param option
* @returns string
*/
export declare const changelogsFormatted: (option: IChangelogsFormattedOption) => string | undefined;
/**
* @description
* Applies changes to objects.
*
* @param left any
* @param diff
*/
export declare const patch: (left: any, diff: JSONDiffPatch.Delta) => any;
/**
* @description
* Applies multiple changes to objects.
*
* @param left any
* @param diffs
*/
export declare const patches: (object: any, diffs: JSONDiffPatch.Delta[]) => any;
/**
* @description
* Exclude changes from objects.
*
* @param right any
* @param diff
*/
export declare const unpatch: (right: any, diff: JSONDiffPatch.Delta) => any;
/**
* @description
* Exclude multiple changes from objects.
*
* @param right any
* @param diff
*/
export declare const unpatches: (object: any, diffs: JSONDiffPatch.Delta[]) => any;
/**
* @description
* Reverse the diff order.
*
* @param diff
*/
export declare const reverse: (diff: JSONDiffPatch.Delta) => JSONDiffPatch.Delta | undefined;