A preliminary array. It’s can be used to initialize an YArray, when it’s about to be nested
into another Yrs data collection, such as [Map] or another YArray.
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.
A Yrs document type. Documents are the 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 Transaction, which lifetime is also bound to a document.
A descriptor used to reference to shared collections by their unique logical identifiers,
which can be either Root-level collections or shared collections Nested into each other.
It can be resolved from any shared reference using SharedRef::hook.
Block identifier, which allows to uniquely identify any element insertion in a global scope
(across different replicas of the same document). It consists of client ID (which is a unique
document replica identifier) and monotonically incrementing clock value.
A preliminary map. It can be used to early initialize the contents of a Map, when it’s about
to be inserted into another Yrs collection, such as Array or another Map.
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.
A logical reference used to represent a shared collection nested within another one. Unlike
Root-level types which cannot be deleted and exist eternally, Nested collections can be
added (therefore don’t exist prior their instantiation) and deleted (so that any SharedRef
values referencing them become unsafe and can point to objects that no longer exists!).
Data structure used to handle publish/subscribe callbacks of specific type. Observers perform
subscriber changes in thread-safe manner, using atomic hardware intrinsics.
Data structure used to handle publish/subscribe callbacks of specific type. Observers perform
subscriber changes in thread-safe manner, using atomic hardware intrinsics.
A binary marker that can be assigned to a read-write transaction upon creation via
Transact::try_transact_mut_with/Transact::transact_mut_with. It can be used to classify
transaction updates within a specific context, which exists for the duration of a transaction
(it’s not persisted in the document store itself), i.e. you can use unique document client
identifiers to differentiate updates incoming from remote nodes from those performed locally.
Snapshot describes a state of a document store at a given point in (logical) time. In practice
it’s a combination of StateVector (a summary of all observed insert/update operations)
and a DeleteSet (a summary of all observed deletions).
State vector is a compact representation of all known blocks inserted and integrated into
a given document. This descriptor can be serialized and used to determine a difference between
seen and unseen inserts of two replicas of the same document, potentially existing in different
processes.
A sticky index is based on the Yjs model and is not affected by document changes.
E.g. If you place a sticky index before a certain character, it will always point to this character.
If you place a sticky index at the end of a type, it will always point to the end of the type.
Store is a core element of a document. It contains all of the information, like block store
map of root types, pending updates waiting to be applied once a missing update information
arrives and all subscribed callbacks.
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 [Transaction::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.
A very lightweight read-only transaction. These transactions are guaranteed to not modify the
contents of an underlying Doc and can be used to read it or for serialization purposes.
For this reason it’s allowed to have a multiple active read-only transactions, but it’s
not allowed to have any active read-write transactions at the same time.
Read-write transaction. It can be used to modify an underlying state of the corresponding Doc.
Read-write transactions require an exclusive access to document store - only one such
transaction can be present per Doc at the same time (read-only Transactions are not allowed
to coexists at the same time as well).
Update type which contains an information about all decoded blocks which are incoming from a
remote peer. Since these blocks are not yet integrated into current document’s block store,
they still may require repairing before doing so as they don’t contain full data about their
relations.
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
XmlTextRef type).
A shared data type used for collaborative text editing, that can be used in a context of
XmlElementRef node. 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
Association type used by StickyIndex. In general StickyIndex refers to a cursor
space between two elements (eg. “ab.c” where “abc” is our string and . is the StickyIndex
placement). However in a situation when another peer is updating a collection concurrently,
a new set of elements may be inserted into that space, expanding it in the result. In such case
Assoc tells us if the StickyIndex should stick to location before or after referenced index.
An unique logical identifier of a shared collection. Can be shared across document boundaries
to reference to the same logical entity across different replicas of a document.
Struct describing context in which StickyIndex is placed. For items pointing inside of
the shared typed sequence it’s always [StickyIndex::Relative] which refers to a block ID
found under corresponding position.
Value that can be returned by Yrs data types. This includes Any which is an extension
representation of JSON, but also nested complex collaborative structures specific to Yrs.
An return type from XML elements retrieval methods. It’s an enum of all supported values, that
can be nested inside of XmlElementRef. These are other XmlElementRefs, XmlFragmentRefs
or XmlTextRef values.
Trait used to retrieve a StickyIndex corresponding to a given human-readable index.
Unlike standard indexes StickyIndex enables to track the location inside of a shared
y-types, even in the face of concurrent updates.
A subset of SharedRef used to mark collaborative collections that can be used as a
root level collections. This includes common types like ArrayRef, MapRef, TextRef and
XmlFragmentRef.
Givens an input update (encoded using lib0 v1 encoding) of document A and an encoded
state_vector of document B, returns a lib0 v1 encoded update, that contains all changes
from A which have not been observed by B (based on its state vector).
Givens an input update (encoded using lib0 v2 encoding) of document A and an encoded
state_vector of document B, returns a lib0 v2 encoded update, that contains all changes
from A which have not been observed by B (based on its state vector).
Merges a sequence of updates (encoded using lib0 v1 encoding) together, producing another
update (also lib0 v1 encoded) in the result. Returned binary is a combination of all input
updates, compressed.
Merges a sequence of updates (encoded using lib0 v2 encoding) together, producing another
update (also lib0 v2 encoded) in the result. Returned binary is a combination of all input
updates, compressed.