Creates a new CRText instance.
Optionalsnapshot: CRTextSnapshotAn optional detached snapshot used to hydrate the initial state.
Returns the current number of grapheme clusters in the text projection.
Iterates over detached copies of the current live values in index order.
Returns the current text projection when coerced to a primitive.
Emits an acknowledgement frontier for the current replica state.
Dispatches an ack event when an acknowledgement is produced.
Registers an event listener.
The event type to listen for.
The listener to register.
Optionaloptions: boolean | AddEventListenerOptionsListener registration options.
Removes tombstoned history acknowledged by every provided frontier.
The acknowledgement frontiers that permit garbage collection.
Inserts characters immediately after the specified index.
Pass -1 to insert at the beginning of the document.
The anchor index after which the characters are inserted.
The text to insert.
Merges a remote delta into this replica.
Dispatches a change event when the merge updates the current projection.
The remote delta to merge.
Removes an event listener.
The event type to stop listening for.
The listener to remove.
Optionaloptions: boolean | EventListenerOptionsListener removal options.
Dispatches a detached snapshot of the current state.
Returns a detached structured-clone-compatible snapshot of this list.
Called automatically by JSON.stringify.
Returns this snapshot as a JSON string.
Returns the current text projection as a string.
Represents a convergent replicated text document backed by CR-List state.