UNPKG

@dossierhq/core

Version:

The core Dossier library used by clients and server alike, used to interact with schema and entities directly, as well as remotely through a client.

20 lines (19 loc) 1.92 kB
import { type HeadingTagType, type TextFormatType } from '../third-party/Lexical.js'; import { type Component, type EntityReference, type RichText, type RichTextComponentNode, type RichTextEntityLinkNode, type RichTextEntityNode, type RichTextHeadingNode, type RichTextLineBreakNode, type RichTextListItemNode, type RichTextListNode, type RichTextNode, type RichTextParagraphNode, type RichTextTabNode, type RichTextTextNode } from '../Types.js'; export declare function createRichText(children: RichTextNode[]): RichText; export declare function createRichTextHeadingNode(tag: HeadingTagType, children: RichTextNode[]): RichTextHeadingNode; export declare function createRichTextParagraphNode(children: RichTextNode[]): RichTextParagraphNode; export declare function createRichTextTextNode(text: string, options?: { format?: TextFormatType[]; }): RichTextTextNode; export declare function createRichTextLineBreakNode(): RichTextLineBreakNode; export declare function createRichTextTabNode(): RichTextTabNode; export declare function createRichTextTextAndWhitespaceNodes(text: string, options?: { format?: TextFormatType[]; }): (RichTextTextNode | RichTextLineBreakNode)[]; export declare function createRichTextEntityNode(reference: EntityReference): RichTextEntityNode; export declare function createRichTextEntityLinkNode(reference: EntityReference, children: RichTextNode[]): RichTextEntityLinkNode; export declare function createRichTextListNode(listType: RichTextListNode['listType'], children: RichTextNode[]): RichTextListNode; export declare function createRichTextListItemNode(value: number, checked: boolean | undefined, children: RichTextNode[]): RichTextListItemNode; export declare function createRichTextComponentNode<T extends Component<string, object>>(data: T): RichTextComponentNode; export declare function richTextTextNodeHasFormat(node: RichTextTextNode, format: TextFormatType): boolean;