Constructors
constructor
- new Text<A>(context?, text?): Text<A>
Parameters
Optional
context: ChangeContext<Indexable>Optional
text: CRDTText<A>
Accessors
length
- get length(): number
Returns number
Methods
createRangeForTest
- createRangeForTest(fromIdx, toIdx): RGATreeSplitPosRange
Parameters
- fromIdx: number
- toIdx: number
Returns RGATreeSplitPosRange
delete
- delete(fromIdx, toIdx): undefined | [number, number]
Parameters
- fromIdx: number
- toIdx: number
Returns undefined | [number, number]
edit
- edit(fromIdx, toIdx, content, attributes?): undefined | [number, number]
Parameters
- fromIdx: number
- toIdx: number
- content: string
Optional
attributes: A
Returns undefined | [number, number]
empty
- empty(): undefined | [number, number]
Returns undefined | [number, number]
getTreeByID
- getTreeByID(): LLRBTree<RGATreeSplitNodeID, RGATreeSplitNode<CRDTTextValue>>
Returns LLRBTree<RGATreeSplitNodeID, RGATreeSplitNode<CRDTTextValue>>
getTreeByIndex
- getTreeByIndex(): SplayTree<CRDTTextValue>
Returns SplayTree<CRDTTextValue>
initialize
- initialize(context, text): void
Internal
Parameters
- context: ChangeContext<Indexable>
- text: CRDTText<A>
Returns void
posRangeToIndexRange
- posRangeToIndexRange(range): [number, number]
Returns [number, number]
setStyle
- setStyle(fromIdx, toIdx, attributes): boolean
Parameters
- fromIdx: number
- toIdx: number
- attributes: A
Returns boolean
toJSON
- toJSON(): string
Returns string
toString
- toString(): string
Returns string
toTestString
- toTestString(): string
Returns string
values
- values(): TextValueType<A>[]
Returns TextValueType<A>[]
Text
is an extended data type for the contents of a text editor.