Structs
A collection used to store data in an indexed sequence structure. This type is internally
implemented as a double linked list, which may squash values inserted directly one after another
into single list node upon transaction commit.
Event generated by
YArray.observe
method. Emitted during transaction commit phase.A ywasm document type. Documents are most important units of collaborative resources management.
All shared collections live within a scope of their corresponding documents. All updates are
generated on per document basis (rather than individual shared type). All operations on shared
collections happen via YTransaction, which lifetime is also bound to a document.
Collection used to store key-value entries in an unordered manner. Keys are always represented
as UTF-8 strings. Values can be any value type supported by Yrs: JSON-like primitives as well as
shared data types.
Event generated by
YMap.observe
method. Emitted during transaction commit phase.A shared data type used for collaborative text editing. It enables multiple users to add and
remove chunks of text in efficient manner. This type is internally represented as a mutable
double-linked list of text chunks - an optimization occurs during
YTransaction.commit
, which
allows to squash multiple consecutively inserted characters together as a single chunk of text
even between transaction boundaries in order to preserve more efficient memory model.Event generated by
YYText.observe
method. Emitted during transaction commit phase.A transaction that serves as a proxy to document block store. Ywasm shared data types execute
their operations in a context of a given transaction. Each document can have only one active
transaction at the time - subsequent attempts will cause exception to be thrown.
XML element data type. It represents an XML node, which can contain key-value attributes
(interpreted as strings) as well as other nested XML elements or rich text (represented by
YXmlText
type).Event generated by
YXmlElement.observe
method. Emitted during transaction commit phase.Represents a list of
YXmlElement
and YXmlText
types.
A YXmlFragment
is similar to a YXmlElement
, but it does not have a
nodeName and it does not have attributes. Though it can be bound to a DOM
element - in this case the attributes and the nodeName are not sharedA shared data type used for collaborative text editing, that can be used in a context of
YXmlElement
nodee. It enables multiple users to add and remove chunks of text in efficient
manner. This type is internally represented as a mutable double-linked list of text chunksEvent generated by
YXmlText.observe
method. Emitted during transaction commit phase.Functions
Applies delta update generated by the remote document replica to a current document. This
method assumes that a payload maintains lib0 v1 encoding format.
Applies delta update generated by the remote document replica to a current document. This
method assumes that a payload maintains lib0 v2 encoding format.
Returns a string dump representation of a given
update
encoded using lib0 v1 encoding.Returns a string dump representation of a given
update
encoded using lib0 v2 encoding.Encodes all updates that have happened since a given version
vector
into a compact delta
representation using lib0 v1 encoding. If vector
parameter has not been provided, generated
delta payload will contain all changes of a current ywasm document, working effectivelly as its
state snapshot.Encodes all updates that have happened since a given version
vector
into a compact delta
representation using lib0 v2 encoding. If vector
parameter has not been provided, generated
delta payload will contain all changes of a current ywasm document, working effectivelly as its
state snapshot.Encodes a state vector of a given ywasm document into its binary representation using lib0 v1
encoding. State vector is a compact representation of updates performed on a given document and
can be used by
encode_state_as_update
on remote peer to generate a delta update payload to
synchronize changes between peers.When called will call console log errors whenever internal panic is called from within
WebAssembly module.