/** * Compatibility layer for the pre-block-editor data shape produced by the * TipTap-backed `RichTextEditor` in merchant-portal. * * Pre-block-editor records look like: * `[{ type: 'paragraph', data: { text: '

html…

' } }]` * with no `id`, no `version`. `parseBlocks` already accepts these via the * paragraph plugin's lenient validator + this helper which fills in the * envelope fields. */ import type { AnyBlock } from "../types/content-blocks.js"; /** * Depth-first flatten of a block tree into a linear AnyBlock[]. Container * blocks are replaced by their children in order. Use this in renderers and * tools that do not understand layout. */ export declare function flattenBlocks(blocks: AnyBlock[]): AnyBlock[]; /** * Compatibility helper for callers that still start with plain HTML/text. * * Deprecated for new write paths: prefer authoring `AnyBlock[]` directly. * This helper remains exported for older SDK consumers, but it now normalizes * obvious paragraphs instead of storing a whole document in one paragraph. */ export declare function htmlToBlocks(html: string): AnyBlock[]; /** * Best-effort: recover an HTML preview from a blocks array. Used by the * existing rich-text editor as a fallback rendering target while the * BlockNote-based editor is being rolled out. * * Lossy by design: only paragraph/heading/list-style blocks contribute. * Do not use as a renderer. */ export declare function blocksToHtmlPreview(blocks: AnyBlock[]): string; /** * Auto-extract a plain-text excerpt from a blocks array. Used by the API * service for `autoExcerpt`. Strips HTML tags from paragraph blocks. */ export declare function blocksToExcerpt(blocks: AnyBlock[], maxLen?: number): string | null; //# sourceMappingURL=legacy.d.ts.map