@prismicio/client
Version:
The official JavaScript + TypeScript client library for Prismic
20 lines (19 loc) • 914 B
TypeScript
import type { RichTextField } from "../types/value/richText";
import type { RichTextFunctionSerializer } from "./types";
/**
* Serializes a rich text or title field with a given serializer
*
* @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
*
* @typeParam SerializerReturnType - Return type of the serializer
*
* @param richTextField - A rich text or title field from Prismic
* @param serializer - A function serializer to apply
*
* @returns An array of serialized nodes
*
* @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 serialize: <SerializerReturnType>(richTextField: RichTextField, serializer: RichTextFunctionSerializer<SerializerReturnType>) => SerializerReturnType[];