import type { ReactNode } from "react"; import type { CreateRichTextBlockOptions, RichTextBlockProps } from "./common.js"; /** * Creates a pair of rich-text block components that render CMS RichText block * data (draft-js raw content) as themed text. * * Call the factory once per configuration — at the top level of a file, not * inside a component — and reuse the returned components. Call it again for * differently-configured rich-text blocks (e.g. a generic and a headline-only * one). * * `MjmlRichTextBlock` renders each draft block as `MjmlText` and must be * placed within an `MjmlColumn`. `HtmlRichTextBlock` renders each draft block * as `HtmlText` for raw-HTML contexts (e.g. inside `MjmlRaw`); inside * `MjmlRaw` in an `MjmlColumn`, place `HtmlRichTextBlock` in a `` and * `` of its own. * * ```ts * export const { MjmlRichTextBlock, HtmlRichTextBlock } = createRichTextBlock({ * blockTypes: { * "header-one": { variant: "heading1" }, * "paragraph-standard": { variant: "body" }, * }, * }); * ``` */ export declare function createRichTextBlock = Record>(options?: CreateRichTextBlockOptions): { /** Renders CMS RichText block data (draft-js raw content) as one `MjmlText` per draft block. Must be placed within an `MjmlColumn`. */ MjmlRichTextBlock: (props: RichTextBlockProps) => ReactNode; /** Renders CMS RichText block data (draft-js raw content) as one `HtmlText` div per draft block, for raw-HTML contexts such as `MjmlRaw`. Inside `MjmlRaw` in an `MjmlColumn`, place `HtmlRichTextBlock` in a `` and `` of its own. */ HtmlRichTextBlock: (props: RichTextBlockProps) => ReactNode; };