UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

22 lines (21 loc) 674 B
import { TypesOf } from 'alinea/core'; export declare namespace TextNode { type Mark = { type: string; attrs?: Record<string, string>; }; type Text = { type: 'text'; text?: string; marks?: Array<Mark>; }; type Element<T = any> = { type: 'paragraph' | 'heading' | 'bold' | 'italic' | 'bulletList' | 'listItem' | TypesOf<T>; content?: TextDoc<T>; [key: string]: any; }; function isText(node: any): node is Text; function isElement(node: any): node is Element; } export type TextNode<T = {}> = TextNode.Text | TextNode.Element<T>; export type TextDoc<T = {}> = Array<TextNode<T>>;