yorkie-js-sdk

Home > yorkie-js-sdk > Text

Text class

Text represents text element for representing contents of a text editor.

Signature:

declare class Text 

Constructors

Constructor Modifiers Description
(constructor)(context, text)   Constructs a new instance of the Text class

Properties

Property Modifiers Type Description
length   number length returns size of RGATreeList.

Methods

Method Modifiers Description
checkWeight()   checkWeight returns false when there is an incorrect weight node. for debugging purpose.
createRange(fromIdx, toIdx)   createRange returns pair of RGATreeSplitNodePos of the given integer offsets.
edit(fromIdx, toIdx, content)   edit edits this text with the given content.
getAnnotatedString()   getAnnotatedString returns a String containing the meta data of the node for debugging purpose.
getID()   getID returns the ID of this text.
onChanges(handler)   onChanges registers a handler of onChanges event.
select(fromIdx, toIdx)   select selects the given range.
toString()   toString returns the string representation of this text.