import React from 'react';
import { type Components } from 'react-markdown';
import type { PluggableList } from 'unified';
export type TextSizeElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'li' | 'blockquote' | 'code' | 'th' | 'td';
export type TextSizeClassMap = Partial<Record<TextSizeElement, string>>;
export type TextSizePreset = 'default' | 'compact' | 'large';
export type TextSizeConfig = TextSizePreset | TextSizeClassMap | {
    preset: TextSizePreset;
    overrides: TextSizeClassMap;
};
export interface ResolveLinkResult {
    success: boolean;
    resolvedPath?: string;
    type?: string;
    action?: string;
    error?: string;
    message?: string;
}
export interface SimpleMarkdownRendererProps {
    content: string;
    className?: string;
    /** Backend-provided heading IDs for deep-link anchors */
    sectionIds?: Array<{
        id: string;
        title: string;
        level: number;
    }>;
    /** When the page already has an H1, render markdown `#` as `<h2>` */
    demoteMarkdownH1ToH2?: boolean;
    /** List of broken link hrefs detected server-side (shown with [BROKEN] badge) */
    brokenLinks?: string[];
    /** Callback for internal (non-http, non-anchor) link clicks */
    onInternalLinkClick?: (path: string, options?: {
        expandFolder?: boolean;
        fromInternalLink?: boolean;
    }) => void;
    /** Current documentation path — enables internal-link mode when set */
    currentPath?: string;
    /**
     * Resolve an internal link href to a navigation path.
     * Called when a user clicks an internal doc link.
     */
    onResolveLink?: (href: string, currentPath: string) => Promise<ResolveLinkResult>;
    /** Pre-process the raw markdown string before rendering (e.g. shortcode expansion) */
    preprocessContent?: (content: string) => string;
    /** Merge additional or override react-markdown component renderers */
    componentOverrides?: Partial<Components>;
    /**
     * Extra remark plugins appended after the built-in `remarkGfm` and
     * `remarkBreaks`. Used by chat consumers to inject `remarkCardLinks`,
     * which converts `[card://<type>:<id>]` markers into synthetic `link`
     * nodes; the host's `componentOverrides.a` then swaps those for whatever
     * inline entity-card component it provides.
     *
     * Each entry is either a Plugin reference or a [Plugin, options] tuple
     * — same shape as react-markdown's own `remarkPlugins` prop. Pass an
     * empty array (or omit) to keep the default plugin set.
     */
    additionalRemarkPlugins?: PluggableList;
    /**
     * Configure text sizing for all rendered elements.
     * - `"default"` — current behavior (large article-style typography)
     * - `"compact"` — smaller sizes for sidebars, cards, changelogs
     * - `"large"` — extra-large sizes for hero/landing content
     * - `{ p: "text-sm", h1: "text-2xl" }` — per-element overrides (merged onto default)
     * - `{ preset: "compact", overrides: { h1: "text-heading-1" } }` — preset + tweaks
     */
    textSize?: TextSizeConfig;
}
/**
 * Memoized so a parent re-render with UNCHANGED props (same `content` string,
 * same memoized `componentOverrides`/plugins) does NOT re-parse the markdown.
 * Re-parsing rebuilds the entire react-markdown subtree, which RE-MOUNTS any
 * embedded inline entity cards — closing their open menus and re-triggering
 * their fetch on every chat re-render (streaming chunk AND scroll). With
 * stable props the renderer bails, so completed messages' cards stay mounted.
 */
export declare const SimpleMarkdownRenderer: React.NamedExoticComponent<SimpleMarkdownRendererProps>;
//# sourceMappingURL=simple-markdown-renderer.d.ts.map