Location

API reference for locations in Slate.

A Location is either a Path, Point or Range. Methods will often accept a Location instead of requiring only a Path, Point or Range.

type TLocation = Path | Point | TRange

LocationApi

isAt

Check if a value implements the At interface.

Parameters

Collapse all

    The value to check.

Returnsboolean

    true if the value is either a location or a node.

isLocation

Check if a value implements the TLocation interface.

Parameters

Collapse all

    The value to check.

Returnsboolean

    true if the value is a Path, Point, or TRange.

isSpan

Check if a value implements the Span interface.

Parameters

Collapse all

    The value to check.

Returnsboolean

    true if the value is a valid Span.

Types

TLocation

Location is a type alias for TLocation.

Attributes

Collapse all

    An array of numbers representing a node's position.

    An object with path and offset.

    An object with anchor and focus.

Span

Attributes

Collapse all

    The start path.

    The end path.