Home > yorkie-js-sdk > RichText

RichText class

RichText is an extended data type for the contents of a text editor.


export declare class RichText 


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


Method Modifiers Description
createRange(fromIdx, toIdx)   createRange returns pair of RGATreeSplitNodePos of the given integer offsets.
edit(fromIdx, toIdx, content, attributes)   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.
setStyle(fromIdx, toIdx, attributes)   setStyle styles this text with the given attributes.
values()   values returns values of this text.