Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DLocRange

Represents a range spanning locations indicated by two DLoc objects. Though this is not enforced at the VM level, objects of this class are to be considered immutable.

Hierarchy

  • DLocRange

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

end

end: DLoc

The end of the range.

start

start: DLoc

The start of the range.

Accessors

collapsed

  • get collapsed(): boolean
  • Whether this range is collapsed.

    Returns boolean

Methods

contains

  • contains(loc: DLoc): boolean
  • Parameters

    • loc: DLoc

      The location to test.

    Returns boolean

    Whether a location is within the range.

equals

  • equals(other: DLocRange | undefined | null): boolean
  • Parameters

    Returns boolean

    Whether this and other are equal. They are equal if they are the same object or if they have equal start and ends.

isValid

  • isValid(): boolean
  • Returns boolean

    Whether the two endpoints of the range are valid.

makeDOMRange

  • makeDOMRange(): Range | undefined
  • Make a DOM range.

    throws

    {Error} If trying to make a range from an attribute node. DOM ranges can only point into elements or text nodes.

    Returns Range | undefined

    The range. Or undefined if either the start or end are not pointing to valid positions.

mustMakeDOMRange

  • mustMakeDOMRange(): Range

Generated using TypeDoc