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.

7 lines (6 loc) 631 B
import { type ErrorType, type Result } from '../ErrorResult.js'; import type { RichText, RichTextNode } from '../Types.js'; import { type ContentValuePath } from './ContentPath.js'; type RichTextNodeTransformer<TError extends ErrorType> = (path: ContentValuePath, node: Readonly<RichTextNode>) => Result<Readonly<RichTextNode | null>, TError>; export declare function transformRichText<T extends Readonly<RichText> | RichText, TError extends ErrorType>(path: ContentValuePath, richText: T, transformer: RichTextNodeTransformer<TError>): Result<T | null, TError | typeof ErrorType.BadRequest | typeof ErrorType.Generic>; export {};