Crate ywasm

Source

Structs§

Array
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.
ArrayEvent
Event generated by YArray.observe method. Emitted during transaction commit phase.
Doc
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.
ImplicitTransaction
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.
MapEvent
Event generated by YMap.observe method. Emitted during transaction commit phase.
Text
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.
TextEvent
Event generated by YYText.observe method. Emitted during transaction commit phase.
Transaction
UndoEvent
UndoManager
WeakLink
WeakLinkEvent
Event generated by YXmlElement.observe method. Emitted during transaction commit phase.

Functions§

apply_update
Applies delta update generated by the remote document replica to a current document. This method assumes that a payload maintains lib0 v1 encoding format.
apply_update_v2
Applies delta update generated by the remote document replica to a current document. This method assumes that a payload maintains lib0 v2 encoding format.
create_offset_from_sticky_index
Converts a sticky index (see: createStickyIndexFromType) into an object containing human-readable index.
create_sticky_index_from_type
Retrieves a sticky index corresponding to a given human-readable index pointing into the shared ytype. Unlike standard indexes sticky indexes enables to track the location inside of a shared y-types, even in the face of concurrent updates.
debug_update_v1
Returns a string dump representation of a given update encoded using lib0 v1 encoding.
debug_update_v2
Returns a string dump representation of a given update encoded using lib0 v2 encoding.
decode_snapshot_v1
decode_snapshot_v2
decode_sticky_index
Deserializes sticky index serialized previously by encodeStickyIndex.
encode_snapshot_v1
encode_snapshot_v2
encode_state_as_update
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.
encode_state_as_update_v2
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.
encode_state_from_snapshot_v1
encode_state_from_snapshot_v2
encode_state_vector
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.
encode_sticky_index
Serializes sticky index created by createStickyIndexFromType into a binary payload.
equal_snapshots
set_panic_hook
When called will call console log errors whenever internal panic is called from within WebAssembly module.
snapshot