UNPKG

@nacelle/rich-text-utils

Version:

A set of Typescript types and helpers to work with Rich Text fields.

19 lines (18 loc) 1.33 kB
import { Root, List, Blockquote, Block, Link, EntryLink, InlineEntry, Code, ListItem, Paragraph, Heading, Node, Span, WithChildrenNode, InlineNode, Record, RichText, ThematicBreak, Document } from './types'; export declare function hasChildren(node: Node): node is WithChildrenNode; export declare function isInlineNode(node: Node): node is InlineNode; export declare function isHeading(node: Node): node is Heading; export declare function isSpan(node: Node): node is Span; export declare function isRoot(node: Node): node is Root; export declare function isParagraph(node: Node): node is Paragraph; export declare function isList(node: Node): node is List; export declare function isListItem(node: Node): node is ListItem; export declare function isBlockquote(node: Node): node is Blockquote; export declare function isBlock(node: Node): node is Block; export declare function isCode(node: Node): node is Code; export declare function isLink(node: Node): node is Link; export declare function isEntryLink(node: Node): node is EntryLink; export declare function isInlineEntry(node: Node): node is InlineEntry; export declare function isThematicBreak(node: Node): node is ThematicBreak; export declare function isRichText<R extends Record>(obj: any): obj is RichText<R>; export declare function isDocument(obj: any): obj is Document;