ReadonlyapiPatch builder for the local changes.
ReadonlymodelModel instance on which the API operates.
ReadonlyonEmitted before local changes through model.api are applied.
ReadonlyonEmitted before a patch is applied using model.applyPatch().
ReadonlyonEmitted before the model is reset, using the .reset() method.
ReadonlyonEmitted before a transaction is started.
ReadonlyonEmitted when the model changes. Combines onReset, onPatch and onLocalChange.
ReadonlyonEmitted when the model changes. Same as .onChange, but this event is emitted once per microtask.
ReadonlyonEmitted when the model.api builder change buffer is flushed.
ReadonlyonEmitted after local changes through model.api are applied.
ReadonlyonEmitted after local changes through model.api are applied. Same as
.onLocalChange, but this event buffered withing a microtask.
ReadonlyonEmitted after a patch is applied using model.applyPatch().
ReadonlyonEmitted after the model is reset, using the .reset() method.
ReadonlyonEmitted after transaction completes.
OptionalstopEvent target for listening to node changes. You can subscribe to "view"
events, which are triggered every time the node's view changes.
node.events.on('view', () => {
// do something...
});
Returns a proxy object for this node. Allows to access the value of the
node by accessing the .val property.
Apply locally any operations from the .builder, which haven't been
applied yet.
Optionalpath: ApiPathReturns the API object of the extension if the node is an extension node.
When the ext parameter is provided, it checks if the node is an instance
of the given extension and returns the object's TypeScript type. Otherwise,
it returns the API object of the extension, but without any type checking.
API of the extension
Returns the API object of the extension if the node is an extension node.
When the ext parameter is provided, it checks if the node is an instance
of the given extension and returns the object's TypeScript type. Otherwise,
it returns the API object of the extension, but without any type checking.
API of the extension
Begins to automatically flush buffered operations into patches, grouping
operations by microtasks or by transactions. To capture the patch, listen
to the .onFlush event.
Callback to stop auto flushing.
Optionalpath: ApiPathOptionalpath: ApiPathFind a child node at the given path starting from this node.
Optionalpath: ApiPathPath to the child node to find.
JSON CRDT node at the given path.
ReadonlygetOptionalpath: ApiPathOptionalpath: ApiPathSets the value of the node.
JSON/CBOR value or ID (logical timestamp) of the value to set.
Reference to itself.
Optionalpath: ApiPathReadonlysubscribeOptionalpath: ApiPathOptionalpath: ApiPathReturns a local change API for the given node. If an instance already exists, returns the existing instance.
Local changes API for a JSON CRDT model. This class is the main entry point for executing local user actions on a JSON CRDT document.