A logical range of a Post. Usually an instance of Range will be read from the range property, but it may be useful to instantiate a range directly when programmatically modifying a Post.

Hierarchy

  • Range

Properties

direction: Option<Direction>
head: Position
tail: Position

Accessors

Methods

  • expand a range to all markers matching a given check

    Returns

    The expanded range

    Parameters

    • detectMarker: ((marker: default) => boolean)
        • (marker: default): boolean
        • Parameters

          • marker: default

          Returns boolean

    Returns Range

  • Expands the range 1 unit in the given direction If the range is expandable in the given direction, always returns a non-collapsed range.

    Returns

    Parameters

    • units: number

      If units is > 0, the range is extended to the right, otherwise range is extended to the left.

    Returns Range

  • Moves this range 1 unit in the given direction. If the range is collapsed, returns a collapsed range shifted by 1 unit, otherwise collapses this range to the position at the direction end of the range. Always returns a collapsed range.

    Returns

    Parameters

    • direction: Direction

    Returns Range

  • Shorthand to create a new range from a section(s) and offset(s). When given only a head section and offset, creates a collapsed range.

    Returns

    Parameters

    • headSection: default
    • headOffset: number
    • Optional tailSection: default = headSection
    • Optional tailOffset: number = headOffset
    • Optional direction: Option<Direction> = null

    Returns Range

Generated using TypeDoc