@prismicio/richtext
Version:
A parser and serializer for Prismic's Rich Text format
14 lines (13 loc) • 457 B
TypeScript
import { RTNode } from "@prismicio/types";
import { Tree } from "./types";
/**
* Parses a rich text or title field into a tree
*
* @remarks
* This is a low level helper mainly intended to be used by higher level
* packages. Most users aren't expected to this function directly.
* @param nodes - A rich text or title field from Prismic
*
* @returns Tree from given rich text or title field
*/
export declare const asTree: (nodes: RTNode[]) => Tree;