import React from 'react'; import type { PropsWithChildren, JSX } from 'react'; import { type BaseElementRendererProps, type BaseLeafRendererProps, type BaseElementMap, type BaseLeafMap, type HtmlComponentConfig, type RichTextPropsBase, type LinkElement, type ImageElement, type TableElement, type TableCellElement } from '../../components/richText/renderer.js'; /** * React-specific element renderer props (extends shared props with React children) */ export interface ElementRendererProps extends BaseElementRendererProps, PropsWithChildren { } /** * React-specific props for link elements with type safety */ export interface LinkElementProps extends Omit, PropsWithChildren { element: LinkElement; } /** * React-specific props for image elements with type safety */ export interface ImageElementProps extends Omit, PropsWithChildren { element: ImageElement; } /** * React-specific props for table elements with type safety */ export interface TableElementProps extends Omit, PropsWithChildren { element: TableElement; } /** * React-specific props for table cell elements with type safety */ export interface TableCellElementRendererProps extends Omit, PropsWithChildren { element: TableCellElement; } /** * Prop type used for custom Element components */ export type ElementProps = ElementRendererProps; /** * React-specific leaf renderer props (extends shared props with React children) */ export interface LeafRendererProps extends BaseLeafRendererProps, PropsWithChildren { } /** * Prop type used for custom Leaf components */ export type LeafProps = LeafRendererProps; /** * React component for rendering Slate elements */ export type ElementRenderer = React.ComponentType; /** * React component for rendering link elements with type safety */ export type LinkElementRenderer = React.ComponentType; /** * React component for rendering image elements with type safety */ export type ImageElementRenderer = React.ComponentType; /** * React component for rendering table elements with type safety */ export type TableElementRenderer = React.ComponentType; /** * React component for rendering table cell elements with type safety */ export type TableCellElementRenderer = React.ComponentType; /** * React component for rendering Slate text leaves */ export type LeafRenderer = React.ComponentType; /** * React-specific mapping types (specializes generic types with React components) */ export type ElementMap = BaseElementMap; /** * React-specific mapping types (specializes generic types with React components) */ export type LeafMap = BaseLeafMap; /** * React-specific RichText props */ export interface RichTextProps extends RichTextPropsBase, Omit, 'content'> { } /** * Maps HTML attribute names to React JSX attribute names * Only includes attributes that actually need conversion (camelCase changes or reserved keywords) * Attributes that work as-is in React are omitted for better performance */ export declare const HTML_TO_REACT_ATTRS: Record; /** * Converts framework-agnostic attributes to React props * Handles HTML attribute to React JSX attribute conversion and CSS properties */ export declare function toReactProps(attributes: Record, elementType?: string): Record; /** * Creates a React component that renders an HTML element */ export declare function createHtmlComponent(tag: T, config?: HtmlComponentConfig): ElementRenderer; /** * Creates a type-safe React component for link elements */ export declare function createLinkComponent(tag?: T, config?: HtmlComponentConfig): LinkElementRenderer; /** * Creates a type-safe React component for image elements */ export declare function createImageComponent(tag?: T, config?: HtmlComponentConfig): ImageElementRenderer; /** * Creates a type-safe React component for table elements */ export declare function createTableComponent(tag?: T, config?: HtmlComponentConfig): TableElementRenderer; /** * Creates a type-safe React component for table cell elements */ export declare function createTableCellComponent(tag: T, config?: HtmlComponentConfig): TableCellElementRenderer; /** * Creates a React component that renders a text leaf with formatting */ export declare function createLeafComponent(tag: T, config?: HtmlComponentConfig): LeafRenderer; /** * Generate complete element map from core defaults with type-safe specialized components */ export declare function generateDefaultElements(): ElementMap; /** * Generate complete leaf map from core defaults */ export declare function generateDefaultLeafs(): LeafMap;