UNPKG

1.08 kBTypeScriptView Raw
1import { Path, Point, Range } from '..';
2/**
3 * The `Location` interface is a union of the ways to refer to a specific
4 * location in a Slate document: paths, points or ranges.
5 *
6 * Methods will often accept a `Location` instead of requiring only a `Path`,
7 * `Point` or `Range`. This eliminates the need for developers to manage
8 * converting between the different interfaces in their own code base.
9 */
10export type Location = Path | Point | Range;
11export interface LocationInterface {
12 /**
13 * Check if a value implements the `Location` interface.
14 */
15 isLocation: (value: any) => value is Location;
16}
17export declare const Location: LocationInterface;
18/**
19 * The `Span` interface is a low-level way to refer to locations in nodes
20 * without using `Point` which requires leaf text nodes to be present.
21 */
22export type Span = [Path, Path];
23export interface SpanInterface {
24 /**
25 * Check if a value implements the `Span` interface.
26 */
27 isSpan: (value: any) => value is Span;
28}
29export declare const Span: SpanInterface;
30//# sourceMappingURL=location.d.ts.map
\No newline at end of file