import type { MarkdownDocument as MarkdownDocumentType, ComponentManifest } from 'comark'; import React from 'react'; export interface MarkdownDocumentProps { /** * The parsed Comark document to render — either a full `MarkdownDocument` or a bare * `Node[]`. When a node array is passed, frontmatter and meta * default to `{}` and runtime data should be supplied via `data`. */ value?: MarkdownDocumentType | { nodes: MarkdownDocumentType['nodes']; }; /** * Custom component mappings for element tags * Key: tag name (e.g., 'h1', 'p', 'MyComponent') * Value: React component */ components?: Record>; /** * Dynamic component resolver function * Used to resolve components that aren't in the components map */ componentsManifest?: ComponentManifest; /** * Enable streaming mode with stream-specific components */ streaming?: boolean; /** * If caret is true, a caret will be appended to the document's last text node * If caret is an object, it will be appended with the given class */ caret?: boolean | { class: string; }; /** * Additional data to pass to the renderer — referenced from markdown * via `:`-prefixed props using dot paths (e.g. `:foo="data.user.name"`). */ data?: Record; /** * Additional className for the wrapper div */ className?: string; } /** * MarkdownDocument component * * Renders an already-parsed Markdown document to React components/HTML — no parser * in the client bundle. Supports custom component mapping for element tags. * * @example * ```tsx * import { MarkdownDocument } from '@comark/react' * import CustomHeading from './CustomHeading' * * const customComponents = { * h1: CustomHeading, * h2: CustomHeading, * } * * export default function App() { * return * } * ``` */ export declare const MarkdownDocument: React.FC;