Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated.

Constructors

  • Creates a new Anchor and associates it with a document.

    Parameters

    • doc: Document

      The document to associate with the anchor

    • row: number | Point

      The starting row position

    • Optional column: number

      The starting column position

    Returns Anchor

Properties

$insertRight: boolean

experimental: allows anchor to stick to the next on the left

$onChange: any
column: number
document: Document

@type{Document}

row: any

Methods

  • Clips the anchor position to the specified row and column.

    Parameters

    • row: number

      The row index to clip the anchor to

    • column: number

      The column index to clip the anchor to

    Returns Point

  • When called, the "change" event listener is appended.

    Parameters

    • doc: Document

      The document to associate with

    Returns void

  • When called, the "change" event listener is removed.

    Returns void

  • Returns the current document.

    Returns Document

  • Returns an object identifying the row and column position of the current anchor.

    Returns Point

  • Internal function called when "change" event fired.

    Parameters

    • delta: Delta

    Returns void

  • Sets the anchor position to the specified row and column. If noClip is true, the position is not clipped.

    Parameters

    • row: number

      The row index to move the anchor to

    • column: number

      The column index to move the anchor to

    • Optional noClip: boolean

      Identifies if you want the position to be clipped

    Returns void

Generated using TypeDoc