location.d.ts 951 B

123456789101112131415161718192021222324
  1. import { 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. */
  10. export declare type Location = Path | Point | Range;
  11. export interface LocationInterface {
  12. isLocation: (value: any) => value is Location;
  13. }
  14. export declare const Location: LocationInterface;
  15. /**
  16. * The `Span` interface is a low-level way to refer to locations in nodes
  17. * without using `Point` which requires leaf text nodes to be present.
  18. */
  19. export declare type Span = [Path, Path];
  20. export interface SpanInterface {
  21. isSpan: (value: any) => value is Span;
  22. }
  23. export declare const Span: SpanInterface;
  24. //# sourceMappingURL=location.d.ts.map