/** * Strapi 5 Blocks <-> the pivot document. * * Strapi's blocks field is Slate-shaped: a flat array of block objects, each * with a `children` array, and formatting expressed as *boolean props on the * text node* (`bold: true`) rather than as a list of marks. Links are inline * nodes wrapping their text, the way Contentful does it, so the same * gather-adjacent-text logic applies on the way out. * * Nesting is real here — a `list` may appear inside another list's children — * which makes lists the one place Strapi is closer to the pivot than Portable * Text is. Like Contentful and unlike Sanity, nothing carries a key, so a write * replaces the field and there is nothing to merge against. * * The vocabulary has no thematic break. A `horizontalRule` in the pivot has * nowhere to go and is dropped rather than faked as a paragraph of dashes. */ import { type RichTextDoc } from "./doc.ts"; export type StrapiText = { type: "text"; text: string; bold?: boolean; italic?: boolean; underline?: boolean; strikethrough?: boolean; code?: boolean; [key: string]: unknown; }; export type StrapiNode = { type: string; children?: StrapiNode[]; level?: number; format?: string; url?: string; text?: string; [key: string]: unknown; }; /** Convert a Strapi Blocks value into the pivot document. */ export declare function fromStrapiBlocks(blocks: unknown): RichTextDoc; /** Convert the pivot document back to a Strapi Blocks value. */ export declare function toStrapiBlocks(doc: RichTextDoc): StrapiNode[];