View Source OT.Text (OT v0.2.0-rc2)

A TP1 operational transformation implementation based heavily on ot-text, but modified to be invertable.

In this OT type, operations are represented as traversals of an entire string, with any final retain components implicit. This means that given the text "Foz Baz", the operation needed to change it to "Foo Bar Baz" would be represented thusly:

[2, %{d: "z"}, %{i: "o Bar"}]

Notice that the final retain component, 4 (to skip over " Baz") is implicit and it not included.

Link to this section Summary

Types

A string that this OT type can operate on

Link to this section Types

@type datum() :: String.t()

A string that this OT type can operate on

Link to this section Functions

Callback implementation for OT.Type.apply/2.

See OT.Text.Application.apply!/2.

Callback implementation for OT.Type.compose/2.

See OT.Text.Composition.compose_many/1.

@spec init() :: datum()

Initialize a blank text datum.

Callback implementation for OT.Type.transform/2.

Link to this function

transform_index(op, index)

View Source

Callback implementation for OT.Type.transform_index/2.