UNPKG

@prismicio/richtext

Version:

A parser and serializer for Prismic's Rich Text format

12 lines (11 loc) 592 B
import { RichTextField } from "@prismicio/types"; /** * Serializes a rich text or title field to a plain text string * * @param richTextField - A rich text or title field from Prismic * @param separator - Separator used to join each element, defaults to a space * * @returns Plain text equivalent of the provided rich text or title field * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/technologies/templating-rich-text-and-title-fields-javascript} */ export declare const asText: (richTextField: RichTextField, separator?: string) => string;