import { ComponentType, ReactNode } from "react"; import { StoryblokRichTextElement, StoryblokRichTextImageOptions, StoryblokRichTextInput, StoryblokRichTextProps } from "@storyblok/richtext"; //#region src/core/rich-text-renderer.d.ts /** * Props type for React richtext node/mark components. * Extends the OpenAPI-sourced StoryblokRichTextCoreProps with a React-specific * context and ReactNode children (instead of the static renderer's string children). */ type StoryblokReactRichTextProps = Omit, "context" | "children"> & { context?: StoryblokReactRichTextRenderContext; children?: ReactNode; }; /** * @deprecated Use {@link StoryblokReactRichTextProps} instead. Will be removed in the next major version. */ type SbReactRichTextProps = StoryblokReactRichTextProps; type StoryblokReactRichTextComponent = ComponentType>; type StoryblokReactRichTextComponentMap = { [K in StoryblokRichTextElement]?: StoryblokReactRichTextComponent; }; /** * @deprecated Use {@link StoryblokReactRichTextComponentMap} instead. Will be removed in the next major version. */ type SbReactRichTextComponentMap = StoryblokReactRichTextComponentMap; interface StoryblokReactRichTextRenderContext { optimizeImage?: boolean | StoryblokRichTextImageOptions; components?: StoryblokReactRichTextComponentMap; data?: unknown; } /** * @deprecated Use {@link StoryblokReactRichTextRenderContext} instead. Will be removed in the next major version. */ type SbReactRichTextRenderContext = StoryblokReactRichTextRenderContext; /** Props for the `` React component. */ interface StoryblokReactRichTextComponentProps extends StoryblokReactRichTextRenderContext { document?: StoryblokRichTextInput; } declare function createRichTextRenderer(options: StoryblokReactRichTextRenderContext): (document: StoryblokRichTextInput) => ReactNode | null; //#endregion export { SbReactRichTextComponentMap, SbReactRichTextProps, SbReactRichTextRenderContext, StoryblokReactRichTextComponent, StoryblokReactRichTextComponentMap, StoryblokReactRichTextComponentProps, StoryblokReactRichTextProps, StoryblokReactRichTextRenderContext, createRichTextRenderer };