import React from 'react';
import type { Processor } from 'unified';
import { type MarkdownRemarkPlugin, type MarkdownToHtmlConfig } from '../MarkdownEditor/editor/utils/markdownToHtml';
import type { RendererBlockProps } from './types';
declare const createHastProcessor: (extraRemarkPlugins?: MarkdownRemarkPlugin[], config?: MarkdownToHtmlConfig) => Processor;
/**
 * 构建与 MarkdownEditor Readonly 组件对齐的 hast→React 组件映射。
 *
 * MarkdownEditor 的 Slate 元素使用 data-be 属性和 prefixCls 类名，
 * 这里为原生 HTML 标签添加相同的属性，使共用的 CSS 能正确命中。
 */
declare const buildEditorAlignedComponents: (prefixCls: string, userComponents: Record<string, React.ComponentType<RendererBlockProps>>, streaming?: boolean, linkConfig?: {
    openInNewTab?: boolean | undefined;
    onClick?: ((url?: string) => boolean | void) | undefined;
} | undefined, streamingParagraphAnimation?: boolean) => {
    p: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    h1: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    h2: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    h3: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    h4: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    h5: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    h6: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    blockquote: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    ul: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    ol: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    li: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    table: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    thead: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    tbody: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    tr: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    th: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    td: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    input: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    a: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    strong: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    em: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    del: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    code: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    mark: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    kbd: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    sub: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    pre: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    img: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    video: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    audio: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    iframe: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    hr: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    sup: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    span: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    section: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
    think: (props: any) => React.FunctionComponentElement<import("../ToolUseBarThink").ToolUseBarThinkProps>;
    answer: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
};
/**
 * 在 hast 上标记「最后一个 p」，用于流式时仅该段落播放入场（单块长文时避免全页 p 一起闪）
 */
declare const markLastParagraphStreamingTail: (hast: any) => void;
/**
 * 将单个 markdown 片段转为 React 元素（内部函数）
 */
declare const renderMarkdownBlock: (blockContent: string, processor: Processor, components: Record<string, any>, blockOpts?: {
    markStreamingTailParagraph?: boolean;
}) => React.ReactNode;
/**
 * 将 markdown 按块（双换行）拆分，尊重代码围栏边界。
 * 返回的每个块是一个独立的 markdown 片段，可单独解析。
 */
declare const splitMarkdownBlocks: (content: string) => string[];
export interface UseMarkdownToReactOptions {
    remarkPlugins?: MarkdownRemarkPlugin[];
    htmlConfig?: MarkdownToHtmlConfig;
    components?: Record<string, React.ComponentType<RendererBlockProps>>;
    /** MarkdownEditor 的 CSS 前缀，用于生成对齐的 className */
    prefixCls?: string;
    /** 链接配置：onClick 拦截、openInNewTab 控制 */
    linkConfig?: {
        openInNewTab?: boolean;
        onClick?: (url?: string) => boolean | void;
    };
    /** 是否处于流式状态，用于最后一个块的打字动画 */
    streaming?: boolean;
    /**
     * 流式时是否对「生长中的末段」启用段落淡入（AnimationText）。
     * 默认 false：重解析时频繁触发动画易导致整页闪动；需要时再显式传入 true。
     */
    streamingParagraphAnimation?: boolean;
    /**
     * 单调增长的原始流字符串，仅用于判断是否应保留分块缓存。
     * 与 `content`（常为 useStreaming 输出的可解析串）分离，避免占位符与正文切换时误判为非前缀修订。
     */
    contentRevisionSource?: string;
}
export { buildEditorAlignedComponents, createHastProcessor, markLastParagraphStreamingTail, renderMarkdownBlock, splitMarkdownBlocks, };
