UNPKG

1.11 kBTypeScriptView Raw
1import { Path, Descendant, ExtendedType, Ancestor } from '..';
2/**
3 * `Element` objects are a type of node in a Slate document that contain other
4 * element nodes or text nodes. They can be either "blocks" or "inlines"
5 * depending on the Slate editor's configuration.
6 */
7export interface BaseElement {
8 children: Descendant[];
9}
10export declare type Element = ExtendedType<'Element', BaseElement>;
11export interface ElementInterface {
12 isAncestor: (value: any) => value is Ancestor;
13 isElement: (value: any) => value is Element;
14 isElementList: (value: any) => value is Element[];
15 isElementProps: (props: any) => props is Partial<Element>;
16 isElementType: <T extends Element>(value: any, elementVal: string, elementKey?: string) => value is T;
17 matches: (element: Element, props: Partial<Element>) => boolean;
18}
19export declare const Element: ElementInterface;
20/**
21 * `ElementEntry` objects refer to an `Element` and the `Path` where it can be
22 * found inside a root node.
23 */
24export declare type ElementEntry = [Element, Path];
25//# sourceMappingURL=element.d.ts.map
\No newline at end of file