Document
A CRDT-based data type. We can represent the model of the application and edit it even while offline.
A single-threaded, Closeable is used as default. Therefore you need to close the document, when the document is no longer needed. If you provide your own dispatcher, it is up to you to decide close is needed or not.
Types
BroadcastOptions are the options to create a new broadcast.
Interface for undo/redo operations on a document.
Properties
Functions
Subscribes to events on the document with the specific targetPath.
Deletes elements that were removed before the given time.
getDocSize returns the size of this document.
getMaxSizePerDocument gets the maximum size of this document.
Returns a new proxy of cloned root.
getSchemaRules gets the schema rules of this document.
getStatus returns the status of this document.
Returns the JsonElement corresponding to the path.
getVersionVector returns the version vector of document
hasLocalChanges returns whether this document has local changes or not.
True once this document has queued a change carrying at least one operation -- local, undo/redo, or replayed from a store. Read by dev.yorkie.core.Client to decide whether this document's key takes the per-client pre-attach re-issue claim on attach or on detach. Ports yorkie-js-sdk document.ts's hasMintedOperations() (ed25355e, #1449, yorkie#2111).
True unless a resync has suspended minting on this document (see mintingSuspended) -- i.e. no resync is currently between its discard and its re-anchor. DocumentHistory.canUndo/DocumentHistory.canRedo gate on this in addition to their own stack checks, and updateAsync/undo-redo refuse with YorkieException.Code.ErrRefused via ensureMintableAtEntry while it is false.
Serializes just the checkpoint and changeID — plus the compaction epoch and docId — the client's position against the server, without touching the root. Mirrors JS metaToBytes.
publish publishes an event to notify observers about changes in this resource.
setMaxSizePerDocument sets the maximum size of this document.
setSchemaRules sets the schema rules of this document.
Serializes this document's full restorable state — root, presences, checkpoint, changeID, pending changes, compaction epoch, and docId — into a self-contained byte envelope. The reverse of Companion.fromBytes.
Executes the given updater to update this document.