slate

  • Version 0.66.5
  • Published
  • 1.51 MB
  • 3 dependencies
  • MIT license

Install

npm i slate
yarn add slate
pnpm add slate

Overview

A completely customizable framework for building rich text editors.

Index

Variables

Functions

Interfaces

Type Aliases

Variables

variable Editor

const Editor: EditorInterface;

    variable Element

    const Element: ElementInterface;

      variable Location

      const Location: LocationInterface;

        variable Node

        const Node: NodeInterface;

          variable Operation

          const Operation: OperationInterface;

            variable Path

            const Path: PathInterface;

              variable PathRef

              const PathRef: PathRefInterface;

                variable Point

                const Point: PointInterface;

                  variable PointRef

                  const PointRef: PointRefInterface;

                    variable Range

                    const Range: RangeInterface;

                      variable RangeRef

                      const RangeRef: RangeRefInterface;

                        variable Span

                        const Span: SpanInterface;

                          variable Text

                          const Text: TextInterface;

                            variable Transforms

                            const Transforms: GeneralTransforms &
                            NodeTransforms &
                            SelectionTransforms &
                            TextTransforms;

                              Functions

                              function createEditor

                              createEditor: () => Editor;
                              • Create a new Slate Editor object.

                              Interfaces

                              interface BaseEditor

                              interface BaseEditor {}
                              • The Editor interface stores all the state of a Slate editor. It is extended by plugins that wish to add their own helpers and implement new behaviors.

                              property addMark

                              addMark: (key: string, value: any) => void;

                                property apply

                                apply: (operation: Operation) => void;

                                  property children

                                  children: Descendant[];

                                    property deleteBackward

                                    deleteBackward: (unit: 'character' | 'word' | 'line' | 'block') => void;

                                      property deleteForward

                                      deleteForward: (unit: 'character' | 'word' | 'line' | 'block') => void;

                                        property deleteFragment

                                        deleteFragment: (direction?: 'forward' | 'backward') => void;

                                          property getFragment

                                          getFragment: () => Descendant[];

                                            property insertBreak

                                            insertBreak: () => void;

                                              property insertFragment

                                              insertFragment: (fragment: Node[]) => void;

                                                property insertNode

                                                insertNode: (node: Node) => void;

                                                  property insertText

                                                  insertText: (text: string) => void;

                                                    property isInline

                                                    isInline: (element: Element) => boolean;

                                                      property isVoid

                                                      isVoid: (element: Element) => boolean;

                                                        property marks

                                                        marks: Omit<Text, 'text'> | null;

                                                          property normalizeNode

                                                          normalizeNode: (entry: NodeEntry) => void;

                                                            property onChange

                                                            onChange: () => void;

                                                              property operations

                                                              operations: Operation[];

                                                                property removeMark

                                                                removeMark: (key: string) => void;

                                                                  property selection

                                                                  selection: Selection;

                                                                    interface BaseElement

                                                                    interface BaseElement {}
                                                                    • Element objects are a type of node in a Slate document that contain other element nodes or text nodes. They can be either "blocks" or "inlines" depending on the Slate editor's configuration.

                                                                    property children

                                                                    children: Descendant[];

                                                                      interface BasePoint

                                                                      interface BasePoint {}
                                                                      • Point objects refer to a specific location in a text node in a Slate document. Its path refers to the location of the node in the tree, and its offset refers to the distance into the node's string of text. Points can only refer to Text nodes.

                                                                      property offset

                                                                      offset: number;

                                                                        property path

                                                                        path: Path;

                                                                          interface BaseRange

                                                                          interface BaseRange {}
                                                                          • Range objects are a set of points that refer to a specific span of a Slate document. They can define a span inside a single node or a can span across multiple nodes.

                                                                          property anchor

                                                                          anchor: Point;

                                                                            property focus

                                                                            focus: Point;

                                                                              interface BaseText

                                                                              interface BaseText {}
                                                                              • Text objects represent the nodes that contain the actual text content of a Slate document along with any formatting properties. They are always leaf nodes in the document tree as they cannot contain any children.

                                                                              property text

                                                                              text: string;

                                                                                interface CustomTypes

                                                                                interface CustomTypes {}

                                                                                  index signature

                                                                                  [key: string]: unknown;

                                                                                    interface EditorInterface

                                                                                    interface EditorInterface {}

                                                                                      property above

                                                                                      above: <T extends Ancestor>(
                                                                                      editor: Editor,
                                                                                      options?: {
                                                                                      at?: Location;
                                                                                      match?: NodeMatch<T>;
                                                                                      mode?: 'highest' | 'lowest';
                                                                                      voids?: boolean;
                                                                                      }
                                                                                      ) => NodeEntry<T> | undefined;

                                                                                        property addMark

                                                                                        addMark: (editor: Editor, key: string, value: any) => void;

                                                                                          property after

                                                                                          after: (
                                                                                          editor: Editor,
                                                                                          at: Location,
                                                                                          options?: {
                                                                                          distance?: number;
                                                                                          unit?: 'offset' | 'character' | 'word' | 'line' | 'block';
                                                                                          voids?: boolean;
                                                                                          }
                                                                                          ) => Point | undefined;

                                                                                            property before

                                                                                            before: (
                                                                                            editor: Editor,
                                                                                            at: Location,
                                                                                            options?: {
                                                                                            distance?: number;
                                                                                            unit?: 'offset' | 'character' | 'word' | 'line' | 'block';
                                                                                            voids?: boolean;
                                                                                            }
                                                                                            ) => Point | undefined;

                                                                                              property deleteBackward

                                                                                              deleteBackward: (
                                                                                              editor: Editor,
                                                                                              options?: {
                                                                                              unit?: 'character' | 'word' | 'line' | 'block';
                                                                                              }
                                                                                              ) => void;

                                                                                                property deleteForward

                                                                                                deleteForward: (
                                                                                                editor: Editor,
                                                                                                options?: {
                                                                                                unit?: 'character' | 'word' | 'line' | 'block';
                                                                                                }
                                                                                                ) => void;

                                                                                                  property deleteFragment

                                                                                                  deleteFragment: (
                                                                                                  editor: Editor,
                                                                                                  options?: {
                                                                                                  direction?: 'forward' | 'backward';
                                                                                                  }
                                                                                                  ) => void;

                                                                                                    property edges

                                                                                                    edges: (editor: Editor, at: Location) => [Point, Point];

                                                                                                      property end

                                                                                                      end: (editor: Editor, at: Location) => Point;

                                                                                                        property first

                                                                                                        first: (editor: Editor, at: Location) => NodeEntry;

                                                                                                          property fragment

                                                                                                          fragment: (editor: Editor, at: Location) => Descendant[];

                                                                                                            property hasBlocks

                                                                                                            hasBlocks: (editor: Editor, element: Element) => boolean;

                                                                                                              property hasInlines

                                                                                                              hasInlines: (editor: Editor, element: Element) => boolean;

                                                                                                                property hasPath

                                                                                                                hasPath: (editor: Editor, path: Path) => boolean;

                                                                                                                  property hasTexts

                                                                                                                  hasTexts: (editor: Editor, element: Element) => boolean;

                                                                                                                    property insertBreak

                                                                                                                    insertBreak: (editor: Editor) => void;

                                                                                                                      property insertFragment

                                                                                                                      insertFragment: (editor: Editor, fragment: Node[]) => void;

                                                                                                                        property insertNode

                                                                                                                        insertNode: (editor: Editor, node: Node) => void;

                                                                                                                          property insertText

                                                                                                                          insertText: (editor: Editor, text: string) => void;

                                                                                                                            property isBlock

                                                                                                                            isBlock: (editor: Editor, value: any) => value is Element;

                                                                                                                              property isEdge

                                                                                                                              isEdge: (editor: Editor, point: Point, at: Location) => boolean;

                                                                                                                                property isEditor

                                                                                                                                isEditor: (value: any) => value is Editor;

                                                                                                                                  property isEmpty

                                                                                                                                  isEmpty: (editor: Editor, element: Element) => boolean;

                                                                                                                                    property isEnd

                                                                                                                                    isEnd: (editor: Editor, point: Point, at: Location) => boolean;

                                                                                                                                      property isInline

                                                                                                                                      isInline: (editor: Editor, value: any) => value is Element;

                                                                                                                                        property isNormalizing

                                                                                                                                        isNormalizing: (editor: Editor) => boolean;

                                                                                                                                          property isStart

                                                                                                                                          isStart: (editor: Editor, point: Point, at: Location) => boolean;

                                                                                                                                            property isVoid

                                                                                                                                            isVoid: (editor: Editor, value: any) => value is Element;

                                                                                                                                              property last

                                                                                                                                              last: (editor: Editor, at: Location) => NodeEntry;

                                                                                                                                                property leaf

                                                                                                                                                leaf: (
                                                                                                                                                editor: Editor,
                                                                                                                                                at: Location,
                                                                                                                                                options?: {
                                                                                                                                                depth?: number;
                                                                                                                                                edge?: 'start' | 'end';
                                                                                                                                                }
                                                                                                                                                ) => NodeEntry<Text>;

                                                                                                                                                  property levels

                                                                                                                                                  levels: <T extends Node>(
                                                                                                                                                  editor: Editor,
                                                                                                                                                  options?: {
                                                                                                                                                  at?: Location;
                                                                                                                                                  match?: NodeMatch<T>;
                                                                                                                                                  reverse?: boolean;
                                                                                                                                                  voids?: boolean;
                                                                                                                                                  }
                                                                                                                                                  ) => Generator<NodeEntry<T>, void, undefined>;

                                                                                                                                                    property marks

                                                                                                                                                    marks: (editor: Editor) => Omit<Text, 'text'> | null;

                                                                                                                                                      property next

                                                                                                                                                      next: <T extends Descendant>(
                                                                                                                                                      editor: Editor,
                                                                                                                                                      options?: {
                                                                                                                                                      at?: Location;
                                                                                                                                                      match?: NodeMatch<T>;
                                                                                                                                                      mode?: 'all' | 'highest' | 'lowest';
                                                                                                                                                      voids?: boolean;
                                                                                                                                                      }
                                                                                                                                                      ) => NodeEntry<T> | undefined;

                                                                                                                                                        property node

                                                                                                                                                        node: (
                                                                                                                                                        editor: Editor,
                                                                                                                                                        at: Location,
                                                                                                                                                        options?: {
                                                                                                                                                        depth?: number;
                                                                                                                                                        edge?: 'start' | 'end';
                                                                                                                                                        }
                                                                                                                                                        ) => NodeEntry;

                                                                                                                                                          property nodes

                                                                                                                                                          nodes: <T extends Node>(
                                                                                                                                                          editor: Editor,
                                                                                                                                                          options?: {
                                                                                                                                                          at?: Location | Span;
                                                                                                                                                          match?: NodeMatch<T>;
                                                                                                                                                          mode?: 'all' | 'highest' | 'lowest';
                                                                                                                                                          universal?: boolean;
                                                                                                                                                          reverse?: boolean;
                                                                                                                                                          voids?: boolean;
                                                                                                                                                          }
                                                                                                                                                          ) => Generator<NodeEntry<T>, void, undefined>;

                                                                                                                                                            property normalize

                                                                                                                                                            normalize: (
                                                                                                                                                            editor: Editor,
                                                                                                                                                            options?: {
                                                                                                                                                            force?: boolean;
                                                                                                                                                            }
                                                                                                                                                            ) => void;

                                                                                                                                                              property parent

                                                                                                                                                              parent: (
                                                                                                                                                              editor: Editor,
                                                                                                                                                              at: Location,
                                                                                                                                                              options?: {
                                                                                                                                                              depth?: number;
                                                                                                                                                              edge?: 'start' | 'end';
                                                                                                                                                              }
                                                                                                                                                              ) => NodeEntry<Ancestor>;

                                                                                                                                                                property path

                                                                                                                                                                path: (
                                                                                                                                                                editor: Editor,
                                                                                                                                                                at: Location,
                                                                                                                                                                options?: {
                                                                                                                                                                depth?: number;
                                                                                                                                                                edge?: 'start' | 'end';
                                                                                                                                                                }
                                                                                                                                                                ) => Path;

                                                                                                                                                                  property pathRef

                                                                                                                                                                  pathRef: (
                                                                                                                                                                  editor: Editor,
                                                                                                                                                                  path: Path,
                                                                                                                                                                  options?: {
                                                                                                                                                                  affinity?: 'backward' | 'forward' | null;
                                                                                                                                                                  }
                                                                                                                                                                  ) => PathRef;

                                                                                                                                                                    property pathRefs

                                                                                                                                                                    pathRefs: (editor: Editor) => Set<PathRef>;

                                                                                                                                                                      property point

                                                                                                                                                                      point: (
                                                                                                                                                                      editor: Editor,
                                                                                                                                                                      at: Location,
                                                                                                                                                                      options?: {
                                                                                                                                                                      edge?: 'start' | 'end';
                                                                                                                                                                      }
                                                                                                                                                                      ) => Point;

                                                                                                                                                                        property pointRef

                                                                                                                                                                        pointRef: (
                                                                                                                                                                        editor: Editor,
                                                                                                                                                                        point: Point,
                                                                                                                                                                        options?: {
                                                                                                                                                                        affinity?: 'backward' | 'forward' | null;
                                                                                                                                                                        }
                                                                                                                                                                        ) => PointRef;

                                                                                                                                                                          property pointRefs

                                                                                                                                                                          pointRefs: (editor: Editor) => Set<PointRef>;

                                                                                                                                                                            property positions

                                                                                                                                                                            positions: (
                                                                                                                                                                            editor: Editor,
                                                                                                                                                                            options?: {
                                                                                                                                                                            at?: Location;
                                                                                                                                                                            unit?: 'offset' | 'character' | 'word' | 'line' | 'block';
                                                                                                                                                                            reverse?: boolean;
                                                                                                                                                                            voids?: boolean;
                                                                                                                                                                            }
                                                                                                                                                                            ) => Generator<Point, void, undefined>;

                                                                                                                                                                              property previous

                                                                                                                                                                              previous: <T extends Node>(
                                                                                                                                                                              editor: Editor,
                                                                                                                                                                              options?: {
                                                                                                                                                                              at?: Location;
                                                                                                                                                                              match?: NodeMatch<T>;
                                                                                                                                                                              mode?: 'all' | 'highest' | 'lowest';
                                                                                                                                                                              voids?: boolean;
                                                                                                                                                                              }
                                                                                                                                                                              ) => NodeEntry<T> | undefined;

                                                                                                                                                                                property range

                                                                                                                                                                                range: (editor: Editor, at: Location, to?: Location) => Range;

                                                                                                                                                                                  property rangeRef

                                                                                                                                                                                  rangeRef: (
                                                                                                                                                                                  editor: Editor,
                                                                                                                                                                                  range: Range,
                                                                                                                                                                                  options?: {
                                                                                                                                                                                  affinity?: 'backward' | 'forward' | 'outward' | 'inward' | null;
                                                                                                                                                                                  }
                                                                                                                                                                                  ) => RangeRef;

                                                                                                                                                                                    property rangeRefs

                                                                                                                                                                                    rangeRefs: (editor: Editor) => Set<RangeRef>;

                                                                                                                                                                                      property removeMark

                                                                                                                                                                                      removeMark: (editor: Editor, key: string) => void;

                                                                                                                                                                                        property setNormalizing

                                                                                                                                                                                        setNormalizing: (editor: Editor, isNormalizing: boolean) => void;

                                                                                                                                                                                          property start

                                                                                                                                                                                          start: (editor: Editor, at: Location) => Point;

                                                                                                                                                                                            property string

                                                                                                                                                                                            string: (
                                                                                                                                                                                            editor: Editor,
                                                                                                                                                                                            at: Location,
                                                                                                                                                                                            options?: {
                                                                                                                                                                                            voids?: boolean;
                                                                                                                                                                                            }
                                                                                                                                                                                            ) => string;

                                                                                                                                                                                              property unhangRange

                                                                                                                                                                                              unhangRange: (
                                                                                                                                                                                              editor: Editor,
                                                                                                                                                                                              range: Range,
                                                                                                                                                                                              options?: {
                                                                                                                                                                                              voids?: boolean;
                                                                                                                                                                                              }
                                                                                                                                                                                              ) => Range;

                                                                                                                                                                                                property void

                                                                                                                                                                                                void: (
                                                                                                                                                                                                editor: Editor,
                                                                                                                                                                                                options?: {
                                                                                                                                                                                                at?: Location;
                                                                                                                                                                                                mode?: 'highest' | 'lowest';
                                                                                                                                                                                                voids?: boolean;
                                                                                                                                                                                                }
                                                                                                                                                                                                ) => NodeEntry<Element> | undefined;

                                                                                                                                                                                                  property withoutNormalizing

                                                                                                                                                                                                  withoutNormalizing: (editor: Editor, fn: () => void) => void;

                                                                                                                                                                                                    interface ElementInterface

                                                                                                                                                                                                    interface ElementInterface {}

                                                                                                                                                                                                      property isAncestor

                                                                                                                                                                                                      isAncestor: (value: any) => value is Ancestor;

                                                                                                                                                                                                        property isElement

                                                                                                                                                                                                        isElement: (value: any) => value is Element;

                                                                                                                                                                                                          property isElementList

                                                                                                                                                                                                          isElementList: (value: any) => value is Element[];

                                                                                                                                                                                                            property isElementProps

                                                                                                                                                                                                            isElementProps: (props: any) => props is Partial<Element>;

                                                                                                                                                                                                              property isElementType

                                                                                                                                                                                                              isElementType: <T extends Element>(
                                                                                                                                                                                                              value: any,
                                                                                                                                                                                                              elementVal: string,
                                                                                                                                                                                                              elementKey?: string
                                                                                                                                                                                                              ) => value is T;

                                                                                                                                                                                                                property matches

                                                                                                                                                                                                                matches: (element: Element, props: Partial<Element>) => boolean;

                                                                                                                                                                                                                  interface LocationInterface

                                                                                                                                                                                                                  interface LocationInterface {}

                                                                                                                                                                                                                    property isLocation

                                                                                                                                                                                                                    isLocation: (value: any) => value is Location;

                                                                                                                                                                                                                      interface NodeInterface

                                                                                                                                                                                                                      interface NodeInterface {}

                                                                                                                                                                                                                        property ancestor

                                                                                                                                                                                                                        ancestor: (root: Node, path: Path) => Ancestor;

                                                                                                                                                                                                                          property ancestors

                                                                                                                                                                                                                          ancestors: (
                                                                                                                                                                                                                          root: Node,
                                                                                                                                                                                                                          path: Path,
                                                                                                                                                                                                                          options?: {
                                                                                                                                                                                                                          reverse?: boolean;
                                                                                                                                                                                                                          }
                                                                                                                                                                                                                          ) => Generator<NodeEntry<Ancestor>, void, undefined>;

                                                                                                                                                                                                                            property child

                                                                                                                                                                                                                            child: (root: Node, index: number) => Descendant;

                                                                                                                                                                                                                              property children

                                                                                                                                                                                                                              children: (
                                                                                                                                                                                                                              root: Node,
                                                                                                                                                                                                                              path: Path,
                                                                                                                                                                                                                              options?: {
                                                                                                                                                                                                                              reverse?: boolean;
                                                                                                                                                                                                                              }
                                                                                                                                                                                                                              ) => Generator<NodeEntry<Descendant>, void, undefined>;

                                                                                                                                                                                                                                property common

                                                                                                                                                                                                                                common: (root: Node, path: Path, another: Path) => NodeEntry;

                                                                                                                                                                                                                                  property descendant

                                                                                                                                                                                                                                  descendant: (root: Node, path: Path) => Descendant;

                                                                                                                                                                                                                                    property descendants

                                                                                                                                                                                                                                    descendants: (
                                                                                                                                                                                                                                    root: Node,
                                                                                                                                                                                                                                    options?: {
                                                                                                                                                                                                                                    from?: Path;
                                                                                                                                                                                                                                    to?: Path;
                                                                                                                                                                                                                                    reverse?: boolean;
                                                                                                                                                                                                                                    pass?: (node: NodeEntry) => boolean;
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                    ) => Generator<NodeEntry<Descendant>, void, undefined>;

                                                                                                                                                                                                                                      property elements

                                                                                                                                                                                                                                      elements: (
                                                                                                                                                                                                                                      root: Node,
                                                                                                                                                                                                                                      options?: {
                                                                                                                                                                                                                                      from?: Path;
                                                                                                                                                                                                                                      to?: Path;
                                                                                                                                                                                                                                      reverse?: boolean;
                                                                                                                                                                                                                                      pass?: (node: NodeEntry) => boolean;
                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                      ) => Generator<ElementEntry, void, undefined>;

                                                                                                                                                                                                                                        property extractProps

                                                                                                                                                                                                                                        extractProps: (node: Node) => NodeProps;

                                                                                                                                                                                                                                          property first

                                                                                                                                                                                                                                          first: (root: Node, path: Path) => NodeEntry;

                                                                                                                                                                                                                                            property fragment

                                                                                                                                                                                                                                            fragment: (root: Node, range: Range) => Descendant[];

                                                                                                                                                                                                                                              property get

                                                                                                                                                                                                                                              get: (root: Node, path: Path) => Node;

                                                                                                                                                                                                                                                property has

                                                                                                                                                                                                                                                has: (root: Node, path: Path) => boolean;

                                                                                                                                                                                                                                                  property isNode

                                                                                                                                                                                                                                                  isNode: (value: any) => value is Node;

                                                                                                                                                                                                                                                    property isNodeList

                                                                                                                                                                                                                                                    isNodeList: (value: any) => value is Node[];

                                                                                                                                                                                                                                                      property last

                                                                                                                                                                                                                                                      last: (root: Node, path: Path) => NodeEntry;

                                                                                                                                                                                                                                                        property leaf

                                                                                                                                                                                                                                                        leaf: (root: Node, path: Path) => Text;

                                                                                                                                                                                                                                                          property levels

                                                                                                                                                                                                                                                          levels: (
                                                                                                                                                                                                                                                          root: Node,
                                                                                                                                                                                                                                                          path: Path,
                                                                                                                                                                                                                                                          options?: {
                                                                                                                                                                                                                                                          reverse?: boolean;
                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                          ) => Generator<NodeEntry, void, undefined>;

                                                                                                                                                                                                                                                            property matches

                                                                                                                                                                                                                                                            matches: (node: Node, props: Partial<Node>) => boolean;

                                                                                                                                                                                                                                                              property nodes

                                                                                                                                                                                                                                                              nodes: (
                                                                                                                                                                                                                                                              root: Node,
                                                                                                                                                                                                                                                              options?: {
                                                                                                                                                                                                                                                              from?: Path;
                                                                                                                                                                                                                                                              to?: Path;
                                                                                                                                                                                                                                                              reverse?: boolean;
                                                                                                                                                                                                                                                              pass?: (entry: NodeEntry) => boolean;
                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                              ) => Generator<NodeEntry, void, undefined>;

                                                                                                                                                                                                                                                                property parent

                                                                                                                                                                                                                                                                parent: (root: Node, path: Path) => Ancestor;

                                                                                                                                                                                                                                                                  property string

                                                                                                                                                                                                                                                                  string: (node: Node) => string;

                                                                                                                                                                                                                                                                    property texts

                                                                                                                                                                                                                                                                    texts: (
                                                                                                                                                                                                                                                                    root: Node,
                                                                                                                                                                                                                                                                    options?: {
                                                                                                                                                                                                                                                                    from?: Path;
                                                                                                                                                                                                                                                                    to?: Path;
                                                                                                                                                                                                                                                                    reverse?: boolean;
                                                                                                                                                                                                                                                                    pass?: (node: NodeEntry) => boolean;
                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                    ) => Generator<NodeEntry<Text>, void, undefined>;

                                                                                                                                                                                                                                                                      interface OperationInterface

                                                                                                                                                                                                                                                                      interface OperationInterface {}

                                                                                                                                                                                                                                                                        property inverse

                                                                                                                                                                                                                                                                        inverse: (op: Operation) => Operation;

                                                                                                                                                                                                                                                                          property isNodeOperation

                                                                                                                                                                                                                                                                          isNodeOperation: (value: any) => value is NodeOperation;

                                                                                                                                                                                                                                                                            property isOperation

                                                                                                                                                                                                                                                                            isOperation: (value: any) => value is Operation;

                                                                                                                                                                                                                                                                              property isOperationList

                                                                                                                                                                                                                                                                              isOperationList: (value: any) => value is Operation[];

                                                                                                                                                                                                                                                                                property isSelectionOperation

                                                                                                                                                                                                                                                                                isSelectionOperation: (value: any) => value is SelectionOperation;

                                                                                                                                                                                                                                                                                  property isTextOperation

                                                                                                                                                                                                                                                                                  isTextOperation: (value: any) => value is TextOperation;

                                                                                                                                                                                                                                                                                    interface PathInterface

                                                                                                                                                                                                                                                                                    interface PathInterface {}

                                                                                                                                                                                                                                                                                      property ancestors

                                                                                                                                                                                                                                                                                      ancestors: (
                                                                                                                                                                                                                                                                                      path: Path,
                                                                                                                                                                                                                                                                                      options?: {
                                                                                                                                                                                                                                                                                      reverse?: boolean;
                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                      ) => Path[];

                                                                                                                                                                                                                                                                                        property common

                                                                                                                                                                                                                                                                                        common: (path: Path, another: Path) => Path;

                                                                                                                                                                                                                                                                                          property compare

                                                                                                                                                                                                                                                                                          compare: (path: Path, another: Path) => -1 | 0 | 1;

                                                                                                                                                                                                                                                                                            property endsAfter

                                                                                                                                                                                                                                                                                            endsAfter: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                              property endsAt

                                                                                                                                                                                                                                                                                              endsAt: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                property endsBefore

                                                                                                                                                                                                                                                                                                endsBefore: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                  property equals

                                                                                                                                                                                                                                                                                                  equals: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                    property hasPrevious

                                                                                                                                                                                                                                                                                                    hasPrevious: (path: Path) => boolean;

                                                                                                                                                                                                                                                                                                      property isAfter

                                                                                                                                                                                                                                                                                                      isAfter: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                        property isAncestor

                                                                                                                                                                                                                                                                                                        isAncestor: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                          property isBefore

                                                                                                                                                                                                                                                                                                          isBefore: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                            property isChild

                                                                                                                                                                                                                                                                                                            isChild: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                              property isCommon

                                                                                                                                                                                                                                                                                                              isCommon: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                                property isDescendant

                                                                                                                                                                                                                                                                                                                isDescendant: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                                  property isParent

                                                                                                                                                                                                                                                                                                                  isParent: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                                    property isPath

                                                                                                                                                                                                                                                                                                                    isPath: (value: any) => value is Path;

                                                                                                                                                                                                                                                                                                                      property isSibling

                                                                                                                                                                                                                                                                                                                      isSibling: (path: Path, another: Path) => boolean;

                                                                                                                                                                                                                                                                                                                        property levels

                                                                                                                                                                                                                                                                                                                        levels: (
                                                                                                                                                                                                                                                                                                                        path: Path,
                                                                                                                                                                                                                                                                                                                        options?: {
                                                                                                                                                                                                                                                                                                                        reverse?: boolean;
                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                        ) => Path[];

                                                                                                                                                                                                                                                                                                                          property next

                                                                                                                                                                                                                                                                                                                          next: (path: Path) => Path;

                                                                                                                                                                                                                                                                                                                            property parent

                                                                                                                                                                                                                                                                                                                            parent: (path: Path) => Path;

                                                                                                                                                                                                                                                                                                                              property previous

                                                                                                                                                                                                                                                                                                                              previous: (path: Path) => Path;

                                                                                                                                                                                                                                                                                                                                property relative

                                                                                                                                                                                                                                                                                                                                relative: (path: Path, ancestor: Path) => Path;

                                                                                                                                                                                                                                                                                                                                  property transform

                                                                                                                                                                                                                                                                                                                                  transform: (
                                                                                                                                                                                                                                                                                                                                  path: Path,
                                                                                                                                                                                                                                                                                                                                  operation: Operation,
                                                                                                                                                                                                                                                                                                                                  options?: {
                                                                                                                                                                                                                                                                                                                                  affinity?: 'forward' | 'backward' | null;
                                                                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                                                                  ) => Path | null;

                                                                                                                                                                                                                                                                                                                                    interface PathRef

                                                                                                                                                                                                                                                                                                                                    interface PathRef {}
                                                                                                                                                                                                                                                                                                                                    • PathRef objects keep a specific path in a document synced over time as new operations are applied to the editor. You can access their current property at any time for the up-to-date path value.

                                                                                                                                                                                                                                                                                                                                    property affinity

                                                                                                                                                                                                                                                                                                                                    affinity: 'forward' | 'backward' | null;

                                                                                                                                                                                                                                                                                                                                      property current

                                                                                                                                                                                                                                                                                                                                      current: Path | null;

                                                                                                                                                                                                                                                                                                                                        method unref

                                                                                                                                                                                                                                                                                                                                        unref: () => Path | null;

                                                                                                                                                                                                                                                                                                                                          interface PathRefInterface

                                                                                                                                                                                                                                                                                                                                          interface PathRefInterface {}

                                                                                                                                                                                                                                                                                                                                            property transform

                                                                                                                                                                                                                                                                                                                                            transform: (ref: PathRef, op: Operation) => void;

                                                                                                                                                                                                                                                                                                                                              interface PointInterface

                                                                                                                                                                                                                                                                                                                                              interface PointInterface {}

                                                                                                                                                                                                                                                                                                                                                property compare

                                                                                                                                                                                                                                                                                                                                                compare: (point: Point, another: Point) => -1 | 0 | 1;

                                                                                                                                                                                                                                                                                                                                                  property equals

                                                                                                                                                                                                                                                                                                                                                  equals: (point: Point, another: Point) => boolean;

                                                                                                                                                                                                                                                                                                                                                    property isAfter

                                                                                                                                                                                                                                                                                                                                                    isAfter: (point: Point, another: Point) => boolean;

                                                                                                                                                                                                                                                                                                                                                      property isBefore

                                                                                                                                                                                                                                                                                                                                                      isBefore: (point: Point, another: Point) => boolean;

                                                                                                                                                                                                                                                                                                                                                        property isPoint

                                                                                                                                                                                                                                                                                                                                                        isPoint: (value: any) => value is Point;

                                                                                                                                                                                                                                                                                                                                                          property transform

                                                                                                                                                                                                                                                                                                                                                          transform: (
                                                                                                                                                                                                                                                                                                                                                          point: Point,
                                                                                                                                                                                                                                                                                                                                                          op: Operation,
                                                                                                                                                                                                                                                                                                                                                          options?: {
                                                                                                                                                                                                                                                                                                                                                          affinity?: 'forward' | 'backward' | null;
                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                          ) => Point | null;

                                                                                                                                                                                                                                                                                                                                                            interface PointRef

                                                                                                                                                                                                                                                                                                                                                            interface PointRef {}
                                                                                                                                                                                                                                                                                                                                                            • PointRef objects keep a specific point in a document synced over time as new operations are applied to the editor. You can access their current property at any time for the up-to-date point value.

                                                                                                                                                                                                                                                                                                                                                            property affinity

                                                                                                                                                                                                                                                                                                                                                            affinity: 'forward' | 'backward' | null;

                                                                                                                                                                                                                                                                                                                                                              property current

                                                                                                                                                                                                                                                                                                                                                              current: Point | null;

                                                                                                                                                                                                                                                                                                                                                                method unref

                                                                                                                                                                                                                                                                                                                                                                unref: () => Point | null;

                                                                                                                                                                                                                                                                                                                                                                  interface PointRefInterface

                                                                                                                                                                                                                                                                                                                                                                  interface PointRefInterface {}

                                                                                                                                                                                                                                                                                                                                                                    property transform

                                                                                                                                                                                                                                                                                                                                                                    transform: (ref: PointRef, op: Operation) => void;

                                                                                                                                                                                                                                                                                                                                                                      interface RangeInterface

                                                                                                                                                                                                                                                                                                                                                                      interface RangeInterface {}

                                                                                                                                                                                                                                                                                                                                                                        property edges

                                                                                                                                                                                                                                                                                                                                                                        edges: (
                                                                                                                                                                                                                                                                                                                                                                        range: Range,
                                                                                                                                                                                                                                                                                                                                                                        options?: {
                                                                                                                                                                                                                                                                                                                                                                        reverse?: boolean;
                                                                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                                                                        ) => [Point, Point];

                                                                                                                                                                                                                                                                                                                                                                          property end

                                                                                                                                                                                                                                                                                                                                                                          end: (range: Range) => Point;

                                                                                                                                                                                                                                                                                                                                                                            property equals

                                                                                                                                                                                                                                                                                                                                                                            equals: (range: Range, another: Range) => boolean;

                                                                                                                                                                                                                                                                                                                                                                              property includes

                                                                                                                                                                                                                                                                                                                                                                              includes: (range: Range, target: Path | Point | Range) => boolean;

                                                                                                                                                                                                                                                                                                                                                                                property intersection

                                                                                                                                                                                                                                                                                                                                                                                intersection: (range: Range, another: Range) => Range | null;

                                                                                                                                                                                                                                                                                                                                                                                  property isBackward

                                                                                                                                                                                                                                                                                                                                                                                  isBackward: (range: Range) => boolean;

                                                                                                                                                                                                                                                                                                                                                                                    property isCollapsed

                                                                                                                                                                                                                                                                                                                                                                                    isCollapsed: (range: Range) => boolean;

                                                                                                                                                                                                                                                                                                                                                                                      property isExpanded

                                                                                                                                                                                                                                                                                                                                                                                      isExpanded: (range: Range) => boolean;

                                                                                                                                                                                                                                                                                                                                                                                        property isForward

                                                                                                                                                                                                                                                                                                                                                                                        isForward: (range: Range) => boolean;

                                                                                                                                                                                                                                                                                                                                                                                          property isRange

                                                                                                                                                                                                                                                                                                                                                                                          isRange: (value: any) => value is Range;

                                                                                                                                                                                                                                                                                                                                                                                            property points

                                                                                                                                                                                                                                                                                                                                                                                            points: (range: Range) => Generator<PointEntry, void, undefined>;

                                                                                                                                                                                                                                                                                                                                                                                              property start

                                                                                                                                                                                                                                                                                                                                                                                              start: (range: Range) => Point;

                                                                                                                                                                                                                                                                                                                                                                                                property transform

                                                                                                                                                                                                                                                                                                                                                                                                transform: (
                                                                                                                                                                                                                                                                                                                                                                                                range: Range,
                                                                                                                                                                                                                                                                                                                                                                                                op: Operation,
                                                                                                                                                                                                                                                                                                                                                                                                options?: {
                                                                                                                                                                                                                                                                                                                                                                                                affinity?: 'forward' | 'backward' | 'outward' | 'inward' | null;
                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                ) => Range | null;

                                                                                                                                                                                                                                                                                                                                                                                                  interface RangeRef

                                                                                                                                                                                                                                                                                                                                                                                                  interface RangeRef {}
                                                                                                                                                                                                                                                                                                                                                                                                  • RangeRef objects keep a specific range in a document synced over time as new operations are applied to the editor. You can access their current property at any time for the up-to-date range value.

                                                                                                                                                                                                                                                                                                                                                                                                  property affinity

                                                                                                                                                                                                                                                                                                                                                                                                  affinity: 'forward' | 'backward' | 'outward' | 'inward' | null;

                                                                                                                                                                                                                                                                                                                                                                                                    property current

                                                                                                                                                                                                                                                                                                                                                                                                    current: Range | null;

                                                                                                                                                                                                                                                                                                                                                                                                      method unref

                                                                                                                                                                                                                                                                                                                                                                                                      unref: () => Range | null;

                                                                                                                                                                                                                                                                                                                                                                                                        interface RangeRefInterface

                                                                                                                                                                                                                                                                                                                                                                                                        interface RangeRefInterface {}

                                                                                                                                                                                                                                                                                                                                                                                                          property transform

                                                                                                                                                                                                                                                                                                                                                                                                          transform: (ref: RangeRef, op: Operation) => void;

                                                                                                                                                                                                                                                                                                                                                                                                            interface SpanInterface

                                                                                                                                                                                                                                                                                                                                                                                                            interface SpanInterface {}

                                                                                                                                                                                                                                                                                                                                                                                                              property isSpan

                                                                                                                                                                                                                                                                                                                                                                                                              isSpan: (value: any) => value is Span;

                                                                                                                                                                                                                                                                                                                                                                                                                interface TextInterface

                                                                                                                                                                                                                                                                                                                                                                                                                interface TextInterface {}

                                                                                                                                                                                                                                                                                                                                                                                                                  property decorations

                                                                                                                                                                                                                                                                                                                                                                                                                  decorations: (node: Text, decorations: Range[]) => Text[];

                                                                                                                                                                                                                                                                                                                                                                                                                    property equals

                                                                                                                                                                                                                                                                                                                                                                                                                    equals: (
                                                                                                                                                                                                                                                                                                                                                                                                                    text: Text,
                                                                                                                                                                                                                                                                                                                                                                                                                    another: Text,
                                                                                                                                                                                                                                                                                                                                                                                                                    options?: {
                                                                                                                                                                                                                                                                                                                                                                                                                    loose?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    ) => boolean;

                                                                                                                                                                                                                                                                                                                                                                                                                      property isText

                                                                                                                                                                                                                                                                                                                                                                                                                      isText: (value: any) => value is Text;

                                                                                                                                                                                                                                                                                                                                                                                                                        property isTextList

                                                                                                                                                                                                                                                                                                                                                                                                                        isTextList: (value: any) => value is Text[];

                                                                                                                                                                                                                                                                                                                                                                                                                          property isTextProps

                                                                                                                                                                                                                                                                                                                                                                                                                          isTextProps: (props: any) => props is Partial<Text>;

                                                                                                                                                                                                                                                                                                                                                                                                                            property matches

                                                                                                                                                                                                                                                                                                                                                                                                                            matches: (text: Text, props: Partial<Text>) => boolean;

                                                                                                                                                                                                                                                                                                                                                                                                                              Type Aliases

                                                                                                                                                                                                                                                                                                                                                                                                                              type Ancestor

                                                                                                                                                                                                                                                                                                                                                                                                                              type Ancestor = Editor | Element;
                                                                                                                                                                                                                                                                                                                                                                                                                              • The Ancestor union type represents nodes that are ancestors in the tree. It is returned as a convenience in certain cases to narrow a value further than the more generic Node union.

                                                                                                                                                                                                                                                                                                                                                                                                                              type BaseInsertNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                              type BaseInsertNodeOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                              type: 'insert_node';
                                                                                                                                                                                                                                                                                                                                                                                                                              path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                              node: Node;
                                                                                                                                                                                                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                                                                                                                                                                                                type BaseInsertTextOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                type BaseInsertTextOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                type: 'insert_text';
                                                                                                                                                                                                                                                                                                                                                                                                                                path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                offset: number;
                                                                                                                                                                                                                                                                                                                                                                                                                                text: string;
                                                                                                                                                                                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                                                                                                                                                                                  type BaseMergeNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                  type BaseMergeNodeOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                  type: 'merge_node';
                                                                                                                                                                                                                                                                                                                                                                                                                                  path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                  position: number;
                                                                                                                                                                                                                                                                                                                                                                                                                                  properties: Partial<Node>;
                                                                                                                                                                                                                                                                                                                                                                                                                                  };

                                                                                                                                                                                                                                                                                                                                                                                                                                    type BaseMoveNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                    type BaseMoveNodeOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                    type: 'move_node';
                                                                                                                                                                                                                                                                                                                                                                                                                                    path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                    newPath: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                                                                                                                                                                      type BaseNode

                                                                                                                                                                                                                                                                                                                                                                                                                                      type BaseNode = Editor | Element | Text;
                                                                                                                                                                                                                                                                                                                                                                                                                                      • The Node union type represents all of the different types of nodes that occur in a Slate document tree.

                                                                                                                                                                                                                                                                                                                                                                                                                                      type BaseRemoveNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                      type BaseRemoveNodeOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                      type: 'remove_node';
                                                                                                                                                                                                                                                                                                                                                                                                                                      path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                      node: Node;
                                                                                                                                                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                                                                                                                                                        type BaseRemoveTextOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                        type BaseRemoveTextOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                        type: 'remove_text';
                                                                                                                                                                                                                                                                                                                                                                                                                                        path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                        offset: number;
                                                                                                                                                                                                                                                                                                                                                                                                                                        text: string;
                                                                                                                                                                                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                                                                                                                                                                                          type BaseSelection

                                                                                                                                                                                                                                                                                                                                                                                                                                          type BaseSelection = Range | null;

                                                                                                                                                                                                                                                                                                                                                                                                                                            type BaseSetNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                            type BaseSetNodeOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                            type: 'set_node';
                                                                                                                                                                                                                                                                                                                                                                                                                                            path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                            properties: Partial<Node>;
                                                                                                                                                                                                                                                                                                                                                                                                                                            newProperties: Partial<Node>;
                                                                                                                                                                                                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                                                                                                                                                                                                              type BaseSetSelectionOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                              type BaseSetSelectionOperation =
                                                                                                                                                                                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                                                                                                                                                                              type: 'set_selection';
                                                                                                                                                                                                                                                                                                                                                                                                                                              properties: null;
                                                                                                                                                                                                                                                                                                                                                                                                                                              newProperties: Range;
                                                                                                                                                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                                                                                                                                                                              type: 'set_selection';
                                                                                                                                                                                                                                                                                                                                                                                                                                              properties: Partial<Range>;
                                                                                                                                                                                                                                                                                                                                                                                                                                              newProperties: Partial<Range>;
                                                                                                                                                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                                                                                                                                                                              type: 'set_selection';
                                                                                                                                                                                                                                                                                                                                                                                                                                              properties: Range;
                                                                                                                                                                                                                                                                                                                                                                                                                                              newProperties: null;
                                                                                                                                                                                                                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                                                                                                                                                                                                                type BaseSplitNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                type BaseSplitNodeOperation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                type: 'split_node';
                                                                                                                                                                                                                                                                                                                                                                                                                                                path: Path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                position: number;
                                                                                                                                                                                                                                                                                                                                                                                                                                                properties: Partial<Node>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type Descendant

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type Descendant = Element | Text;
                                                                                                                                                                                                                                                                                                                                                                                                                                                  • The Descendant union type represents nodes that are descendants in the tree. It is returned as a convenience in certain cases to narrow a value further than the more generic Node union.

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type Editor

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type Editor = ExtendedType<'Editor', BaseEditor>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Element

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Element = ExtendedType<'Element', BaseElement>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ElementEntry

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ElementEntry = [Element, Path];
                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ElementEntry objects refer to an Element and the Path where it can be found inside a root node.

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtendedType

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtendedType<K extends ExtendableTypes, B> = unknown extends CustomTypes[K]
                                                                                                                                                                                                                                                                                                                                                                                                                                                      ? B
                                                                                                                                                                                                                                                                                                                                                                                                                                                      : CustomTypes[K];

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type InsertNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type InsertNodeOperation = ExtendedType<
                                                                                                                                                                                                                                                                                                                                                                                                                                                        'InsertNodeOperation',
                                                                                                                                                                                                                                                                                                                                                                                                                                                        BaseInsertNodeOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type InsertTextOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type InsertTextOperation = ExtendedType<
                                                                                                                                                                                                                                                                                                                                                                                                                                                          'InsertTextOperation',
                                                                                                                                                                                                                                                                                                                                                                                                                                                          BaseInsertTextOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                          >;

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Location

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Location = Path | Point | Range;
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • The Location interface is a union of the ways to refer to a specific location in a Slate document: paths, points or ranges.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Methods will often accept a Location instead of requiring only a Path, Point or Range. This eliminates the need for developers to manage converting between the different interfaces in their own code base.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type MergeNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type MergeNodeOperation = ExtendedType<'MergeNodeOperation', BaseMergeNodeOperation>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                              type MoveNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                              type MoveNodeOperation = ExtendedType<'MoveNodeOperation', BaseMoveNodeOperation>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                type Node

                                                                                                                                                                                                                                                                                                                                                                                                                                                                type Node = Editor | Element | Text;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type NodeEntry

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type NodeEntry<T extends Node = Node> = [T, Path];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • NodeEntry objects are returned when iterating over the nodes in a Slate document tree. They consist of the node and its Path relative to the root node in the document.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type NodeMatch

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type NodeMatch<T extends Node> =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | ((node: Node, path: Path) => node is T)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | ((node: Node, path: Path) => boolean);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • A helper type for narrowing matched nodes with a predicate.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type NodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type NodeOperation =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | InsertNodeOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | MergeNodeOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | MoveNodeOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | RemoveNodeOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | SetNodeOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | SplitNodeOperation;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type NodeProps

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type NodeProps =
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Omit<Editor, 'children'>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Omit<Element, 'children'>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Omit<Text, 'text'>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Convenience type for returning the props of a node.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Operation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Operation = NodeOperation | SelectionOperation | TextOperation;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Operation objects define the low-level instructions that Slate editors use to apply changes to their internal state. Representing all changes as operations is what allows Slate editors to easily implement history, collaboration, and other features.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Path

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Path = number[];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Path arrays are a list of indexes that describe a node's exact position in a Slate node tree. Although they are usually relative to the root Editor object, they can be relative to any Node object.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Point

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Point = ExtendedType<'Point', BasePoint>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type PointEntry

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type PointEntry = [Point, 'anchor' | 'focus'];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • PointEntry objects are returned when iterating over Point objects that belong to a range.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type Range

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type Range = ExtendedType<'Range', BaseRange>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type RemoveNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type RemoveNodeOperation = ExtendedType<
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        'RemoveNodeOperation',
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        BaseRemoveNodeOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type RemoveTextOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type RemoveTextOperation = ExtendedType<
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          'RemoveTextOperation',
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          BaseRemoveTextOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          >;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Selection

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Selection = ExtendedType<'Selection', BaseSelection>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type SelectionOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type SelectionOperation = SetSelectionOperation;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type SetNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type SetNodeOperation = ExtendedType<'SetNodeOperation', BaseSetNodeOperation>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type SetSelectionOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type SetSelectionOperation = ExtendedType<
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  'SetSelectionOperation',
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  BaseSetSelectionOperation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  >;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Span

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type Span = [Path, Path];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • The Span interface is a low-level way to refer to locations in nodes without using Point which requires leaf text nodes to be present.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type SplitNodeOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type SplitNodeOperation = ExtendedType<'SplitNodeOperation', BaseSplitNodeOperation>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type Text

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type Text = ExtendedType<'Text', BaseText>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type TextOperation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type TextOperation = InsertTextOperation | RemoveTextOperation;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Package Files (16)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Dependencies (3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Dev Dependencies (4)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          No peer dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Badge

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/slate.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/slate)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <a href="https://www.jsdocs.io/package/slate"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>