Location

PreviousNext

API reference for locations in Plate.

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 Location = Path | Point | Range
type Location = Path | Point | Range

LocationApi

isAt

Check if a value implements the At interface.

Parameters

    The value to check.

Returnsboolean

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

isLocation

Check if a value implements the Location interface.

Parameters

    The value to check.

Returnsboolean

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

isSpan

Check if a value implements the Span interface.

Parameters

    The value to check.

Returnsboolean

    true if the value is a valid Span.

Types

Location

Attributes

    An array of numbers representing a node's position.

    An object with path and offset.

    An object with anchor and focus.

Span

Attributes

    The start path.

    The end path.