import { Text } from "slate"; import { UnknownObject } from "../../types/misc/AnyObject"; import { Simplify, UnionToIntersection } from "../../types/misc/types"; import { TEditor, Value } from "../editor/TEditor"; import { TElement } from "../element/TElement"; import { TNode, TNodeProps } from "../node/TNode"; /** * `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. */ export interface TText extends Text, UnknownObject { text: string; } /** * Text node of an editor. */ export type EText = TextOf>; /** * A utility type to get all the text node types from a root node type. */ export type TextOf = TEditor extends N ? TText : TElement extends N ? TText : N extends TEditor ? TextOf : N extends TElement ? Extract | TextOf : N extends TText ? N : never; /** * A utility type to get all the mark types from a root node type. */ export type MarksOf = Simplify>>>; export type EMarks = MarksOf>; export type MarkKeysOf = {} extends MarksOf ? unknown : keyof MarksOf; //# sourceMappingURL=TText.d.ts.map