Hierarchy

  • Position

Constructors

  • A position is a logical location (zero-width, or "collapsed") in a post, typically between two characters in a section. Two positions (a head and a tail) make up a Range.

    Parameters

    • section: null | default
    • offset: number = 0
    • isBlank: boolean = false

    Returns Position

Properties

isBlank: boolean
offset: number
section: null | default

Accessors

  • get marker(): null | default
  • Returns the marker at this position, in the backward direction (i.e., the marker to the left of the cursor if the cursor is on a marker boundary and text is left-to-right)

    Returns

    Returns null | default

Methods

  • Returns the marker in direction from this position. If the position is in the middle of a marker, the direction is irrelevant. Otherwise, if the position is at a boundary between two markers, returns the marker to the left if direction === BACKWARD and the marker to the right if direction === FORWARD (assuming left-to-right text direction).

    Returns

    Parameters

    • direction: number

    Returns undefined | null | default

  • Move the position 1 unit in direction.

    Returns

    Return a new position one unit in the given direction. If the position is moving left and at the beginning of the post, the same position will be returned. Same if the position is moving right and at the end of the post.

    Parameters

    • units: number

      to move. > 0 moves right, < 0 moves left

    Returns Position

  • Returns a range from this position to the given tail. If no explicit tail is given this returns a collapsed range focused on this position.

    Returns

    Parameters

    • Optional tail: Position = ...

      The ending position

    • direction: null | number = null

    Returns Range

Generated using TypeDoc