Arbitrary metadata associated with the patch, which is not used by the library.
A list of operations in the patch.
Returns the patch ID, which is equal to the ID of the first operation in the patch.
The ID of the first operation in the patch.
The .rebase()
operation is meant to be applied to patches which have not
yet been advertised to the server (other peers), or when
the server clock is used and concurrent change on the server happened.
The .rebase() operation returns a new Patch
with the IDs recalculated
such that the first operation has the time
equal to newTime
.
Time where the patch ID should begin (ID of the first operation).
Optional
transformAfter: numberTime after (and including) which the IDs should be transformed. If not specified, equals to the time of the first operation.
Creates a new patch where all timestamps are transformed using the provided function.
Timestamp transformation function.
A new patch with transformed timestamps.
Static
from
Represents a JSON CRDT patch.
Normally, you would create a new patch using the PatchBuilder class.
Save patch to a binary representation:
Load patch from a binary representation: