Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • at(position: number): Range
  • Returns a range such that range is constrained to the start and end points of to. The function will try to maintain the length of the range, but will shrink the range if its length is greater than to.

    Parameters

    Returns Range

  • contains(numOrRange: number | Range, range: Range): boolean
  • create(start: number, end: number): Range
  • Returns a range that represents the overlap between other and range. If the two ranges do not intersect, then undefined is returned.

    Parameters

    Returns undefined | Range

  • length(range: Range): number
  • Adjusts either the start or end position of a range so that its contained within another range. Unlike constrain, this will not attempt to retain the range's length.

    If other does not intersect with to, then the range cannot be truncated and undefined is returned.

    Parameters

    Returns undefined | Range

  • withLength(start: number, len: number): Range