Private
changeIDPrivate
checkpointPrivate
Optional
clonePrivate
eventPrivate
eventhistory
is exposed to the user to manage undo/redo operations.
canRedo
returns whether there are any operations to redo.
canUndo
returns whether there are any operations to undo.
redo
redoes the last operation executed by the current client.
It does not impact operations made by other clients.
undo
undoes the last operation executed by the current client.
It does not impact operations made by other clients.
internalHistory
is used to manage undo/redo operations internally.
Private
isisUpdating
is whether the document is updating by updater or not. It is
used to prevent the updater from calling undo/redo.
Private
keyPrivate
localPrivate
onlineonlineClients
is a set of client IDs that are currently online.
Private
optsPrivate
presencespresences
is a map of client IDs to their presence information.
Private
rootPrivate
statusInternal
applyChangePack
applies the given change pack into this document.
change pack
applyDocEvent
applies the docEvent into this document.
applySnapshot
applies the given snapshot into this document.
Optional
snapshot: Uint8ArrayapplyStatus
applies the document status into this document.
applyTransactionEvent
applies the given TransactionEvent into this document.
Private
canPrivate
canPrivate
filter'filterVersionVector' filters detached client's lamport from version vector.
Internal
garbageCollect
purges elements that were removed before the given time.
getRoot
returns a new proxy of cloned root.
getValueByPath
returns the JSONElement corresponding to the given path.
getVersionVector
returns the version vector of document
Private
ispublish
triggers an event in this document, which can be received by
callback functions from document.subscribe().
Private
redoPrivate
removesubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the document is changed.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the clients watching the document
establishe or update its presence.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the current client establishes or updates its presence.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the client establishes or terminates a connection,
or updates its presence.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the stream connection status changes.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the document status changes.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the document is synced with the server.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the targetPath or any of its nested values change.
Optional
error: ErrorFnOptional
complete: CompleteFnsubscribe
registers a callback to subscribe to events on the document.
The callback will be called when the broadcast event is received from the remote client.
subscribe
registers a callback to subscribe to events on the document.
The callback will be called when the local client sends a broadcast event.
subscribe
registers a callback to subscribe to events on the document.
The callback will be called when the authentification error occurs.
subscribe
registers a callback to subscribe to events on the document.
Optional
error: ErrorFnOptional
complete: CompleteFntoJSForTest
returns value with meta data for testing.
Private
undoupdate
executes the given updater to update this document.
Optional
message: string
Document
is a CRDT-based data type. We can represent the model of the application and edit it even while offline.