@yorkie-js/sdk
    Preparing search index...

    Class Text<A>

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

    Type Parameters

    Index

    Constructors

    Accessors

    Methods

    • createRangeForTest returns pair of RGATreeSplitNodePos of the given indexes for testing purpose.

      Parameters

      • fromIdx: number
      • toIdx: number

      Returns RGATreeSplitPosRange

    • delete deletes the text in the given range.

      Parameters

      • fromIdx: number
      • toIdx: number

      Returns [number, number] | undefined

    • edit edits this text with the given content.

      Parameters

      • fromIdx: number
      • toIdx: number
      • content: string
      • Optionalattributes: A

      Returns [number, number] | undefined

    • empty makes the text empty.

      Returns [number, number] | undefined

    • getTreeByID returns IDTree of the text for testing purpose.

      Returns LLRBTree<RGATreeSplitNodeID, RGATreeSplitNode<CRDTTextValue>>

    • getTreeByIndex returns IndexTree of the text for testing purpose.

      Returns SplayTree<CRDTTextValue>

    • initialize initialize this text with context and internal text.

      Parameters

      • context: ChangeContext
      • text: CRDTText<A>

      Returns void

    • setStyle styles this text with the given attributes.

      Parameters

      • fromIdx: number
      • toIdx: number
      • attributes: A

      Returns boolean

    • toString returns the string representation of this text.

      Returns string

    • toTestString returns a String containing the meta data of the node for debugging purpose.

      Returns string