A CRDT for plain text. Characters are positioned into an n-ary tree, in which each node is a sparse array, extensible in either positive or negative index direction, 'belonging' to a process identity. The tree is read in depth-first order. The use of owned-arrays reflects an optimisation for the typical text document pattern of editing – a user extends some selected text with new text.
A TSeq requires the framework guarantees of a 'shared data type' in m-ld: operations must be applied only once, and in causal order.
The location of this node in the TSeq tree
The local process ID
Applies or reverts (see
revert param) remote operations to this local
clone of the TSeq.
the operation to apply, or
null if only reverting.
are local operations to be reverted prior to applying
operation, in reverse order of original application. The effect of these
will be included in the returned splice, but not in the
will be populated with reversion metadata for the
the actually-affected character nodes (ignoring empty -> empty)
Changes the text content of this TSeq by removing or replacing existing characters and/or adding new characters in place.
zero-based index at which to start changing the text
the number of characters in the text to remove from
the characters to add to the text, beginning from
will be populated with reversion metadata for the returned operation.