-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
46 lines (40 loc) · 1.79 KB
/
index.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
43
44
45
/*!
* https://github.com/Palindrom/JSON-Patch-OT-agent
* JSON-Patch-OT-agent version: 1.1.0
* (c) 2017 Tomek Wytrebowicz
* MIT license
*/
declare class JSONPatchOTAgent {
/**
* [JSONPatchOTAgent description]
* @param {Function} transform function(seqenceA, sequences) that transforms `seqenceA` against `sequences`.
* @param {Array<JSON-Pointer>} versionPaths JSON-Pointers to version numbers [local, remote]
* @param {function} apply apply(JSONobj, JSONPatchSequence) function to apply JSONPatch to object.
* @param {Boolean} purity [description]
* @constructor
* @extends {JSONPatchQueue}
* @version: 1.1.0
*/
constructor(transform: Function, versionPaths: Array<String>, apply: Function, purity: Boolean);
/**
* Wraps JSON Patch sequence with version related operation objects
* @param {JSONPatch} sequence JSON Patch sequence to wrap
* @return {VersionedJSONPatch}
*/
public send(JSONPatch: Object, VersionedJSONPatch: Object);
/**
* Process received versioned JSON Patch
* Adds to queue, transform and apply when applicable.
* @param {Object} obj object to apply patches to
* @param {JSONPatch} versionedJsonPatch patch to be applied
* @param {Function} [applyCallback] optional `function(object, consecutiveTransformedPatch)` to be called when applied, if not given #apply will be called
*/
receive(obj: Object, versionedJsonPatch: Object, applyCallback: Function);
/**
* Reset queue internals and object to new, given state
* @param obj object to apply new state to
* @param newState versioned object representing desired state along with versions
*/
reset(obj: Object, newState: Object);
}
export default JSONPatchOTAgent;