// Generated by scripts/generate-tsrx-types.mjs for the built package. import type { MermaidConfig } from 'mermaid'; import { type ComponentBody, type OctaneNode } from 'octane'; import { type RemendOptions } from 'remend'; import type { Pluggable } from 'unified'; import { type AnimateOptions, type AnimatePlugin } from './lib/animate'; import { type IconMap } from './lib/icon-context.js'; import { type Options } from './lib/markdown.js'; import type { PluginConfig, ThemeInput } from './lib/plugin-types'; import { type StreamdownTranslations } from './lib/translations-context.js'; export type { BundledLanguage, BundledTheme, ThemeRegistrationAny } from 'shiki'; export type { AnimateOptions } from './lib/animate'; export { createAnimatePlugin } from './lib/animate'; export { useIsCodeFenceIncomplete } from './lib/block-incomplete-context'; export { CodeBlock } from './lib/code-block/index.js'; export { CodeBlockContainer } from './lib/code-block/container.js'; export { CodeBlockCopyButton } from './lib/code-block/copy-button.js'; export { CodeBlockDownloadButton } from './lib/code-block/download-button.js'; export { CodeBlockHeader } from './lib/code-block/header.js'; export { CodeBlockSkeleton } from './lib/code-block/skeleton.js'; export { detectTextDirection } from './lib/detect-direction'; export type { IconMap } from './lib/icon-context.js'; export type { AllowElement, Components, ExtraProps, UrlTransform } from './lib/markdown.js'; export { defaultUrlTransform } from './lib/markdown.js'; export { parseMarkdownIntoBlocks } from './lib/parse-blocks.js'; export type { CjkPlugin, CodeHighlighterPlugin, CustomRenderer, CustomRendererProps, DiagramPlugin, HighlightOptions, MathPlugin, PluginConfig, ThemeInput, } from './lib/plugin-types'; export { TableCopyDropdown, type TableCopyDropdownProps } from './lib/table/copy-dropdown.js'; export { TableDownloadButton, type TableDownloadButtonProps, TableDownloadDropdown, type TableDownloadDropdownProps, } from './lib/table/download-dropdown.js'; export { escapeMarkdownTableCell, extractTableDataFromElement, type TableData, tableDataToCSV, tableDataToMarkdown, tableDataToTSV, } from './lib/table/utils'; export type { StreamdownTranslations } from './lib/translations-context.js'; export { defaultTranslations } from './lib/translations-context.js'; /** * Normalizes indentation in HTML blocks to prevent Markdown parsers from * treating indented HTML tags as code blocks (4+ spaces = code in Markdown). * * Useful when rendering AI-generated HTML content with nested tags that * are indented for readability. * * @param content - The raw HTML/Markdown string to normalize * @returns The normalized string with reduced indentation before HTML tags */ export declare const normalizeHtmlIndentation: (content: string) => string; export type ControlsConfig = boolean | { table?: boolean | { copy?: boolean; download?: boolean; fullscreen?: boolean; }; code?: boolean | { copy?: boolean; download?: boolean; }; mermaid?: boolean | { download?: boolean; copy?: boolean; fullscreen?: boolean; panZoom?: boolean; }; }; export interface LinkSafetyModalProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; url: string; } export interface LinkSafetyConfig { enabled: boolean; onLinkCheck?: (url: string) => Promise | boolean; renderModal?: (props: LinkSafetyModalProps) => OctaneNode; } export interface MermaidErrorComponentProps { chart: string; error: string; retry: () => void; } export interface MermaidOptions { config?: MermaidConfig; errorComponent?: ComponentBody; } export type AllowedTags = Record; export type StreamdownProps = Options & { mode?: 'static' | 'streaming'; /** Text direction for blocks. "auto" detects per-block using first strong character algorithm. */ dir?: 'auto' | 'ltr' | 'rtl'; BlockComponent?: ComponentBody; parseMarkdownIntoBlocksFn?: (markdown: string) => string[]; parseIncompleteMarkdown?: boolean; /** Normalize HTML block indentation to prevent 4+ spaces being treated as code blocks. @default false */ normalizeHtmlIndentation?: boolean; className?: string; shikiTheme?: [ThemeInput, ThemeInput]; mermaid?: MermaidOptions; controls?: ControlsConfig; isAnimating?: boolean; animated?: boolean | AnimateOptions; caret?: keyof typeof carets; plugins?: PluginConfig; remend?: RemendOptions; linkSafety?: LinkSafetyConfig; /** Custom tags to allow through sanitization with their permitted attributes */ allowedTags?: AllowedTags; /** * Tags whose children should be treated as plain text (no markdown parsing). * Useful for mention/entity tags in AI UIs where child content is a data * label rather than prose. Requires the tag to also be listed in `allowedTags`. * * @example * ```tsx * * {`@_some_username_`} * * ``` */ literalTagContent?: string[]; /** Override UI strings for i18n / custom labels */ translations?: Partial; /** Custom icons to override the default icons used in controls */ icons?: Partial; /** Tailwind CSS prefix to prepend to all utility classes (e.g. `"tw"` produces `tw:flex` instead of `flex`). Enables Tailwind v4's `prefix()` support. Note: user-supplied `className` values are also prefixed. */ prefix?: string; /** Show line numbers in code blocks. @default true */ lineNumbers?: boolean; /** Called when isAnimating transitions from false to true. Suppressed in mode="static". */ onAnimationStart?: () => void; /** Called when isAnimating transitions from true to false. Suppressed in mode="static". */ onAnimationEnd?: () => void; }; export declare const defaultRehypePlugins: Record; export declare const defaultRemarkPlugins: Record; declare const carets: { block: string; circle: string; }; export interface StreamdownContextType { controls: ControlsConfig; isAnimating: boolean; /** Show line numbers in code blocks. @default true */ lineNumbers: boolean; linkSafety?: LinkSafetyConfig; mermaid?: MermaidOptions; mode: 'static' | 'streaming'; shikiTheme: [ThemeInput, ThemeInput]; } export declare const StreamdownContext: import("octane").Context; export type BlockProps = Options & { content: string; shouldParseIncompleteMarkdown: boolean; shouldNormalizeHtmlIndentation: boolean; index: number; /** Whether this block is incomplete (still being streamed) */ isIncomplete: boolean; /** Resolved text direction for this block */ dir?: 'ltr' | 'rtl'; /** Animate plugin instance for tracking previous content length */ animatePlugin?: AnimatePlugin | null; }; export declare const Block: (({ content, shouldParseIncompleteMarkdown: _, shouldNormalizeHtmlIndentation, index, isIncomplete, dir, animatePlugin: animatePluginProp, ...props }: BlockProps) => import("octane/jsx-runtime").JSX.Element) & { readonly type: ({ content, shouldParseIncompleteMarkdown: _, shouldNormalizeHtmlIndentation, index, isIncomplete, dir, animatePlugin: animatePluginProp, ...props }: BlockProps) => import("octane/jsx-runtime").JSX.Element; displayName?: string; }; export declare const Streamdown: (({ children, mode, dir, parseIncompleteMarkdown: shouldParseIncompleteMarkdown, normalizeHtmlIndentation: shouldNormalizeHtmlIndentation, components, rehypePlugins, remarkPlugins, className, shikiTheme, mermaid, controls, isAnimating, animated, BlockComponent, parseMarkdownIntoBlocksFn, caret, plugins, remend: remendOptions, linkSafety, lineNumbers, allowedTags, literalTagContent, translations, icons: iconOverrides, prefix, onAnimationStart, onAnimationEnd, ...props }: StreamdownProps) => import("octane/jsx-runtime").JSX.Element) & { readonly type: ({ children, mode, dir, parseIncompleteMarkdown: shouldParseIncompleteMarkdown, normalizeHtmlIndentation: shouldNormalizeHtmlIndentation, components, rehypePlugins, remarkPlugins, className, shikiTheme, mermaid, controls, isAnimating, animated, BlockComponent, parseMarkdownIntoBlocksFn, caret, plugins, remend: remendOptions, linkSafety, lineNumbers, allowedTags, literalTagContent, translations, icons: iconOverrides, prefix, onAnimationStart, onAnimationEnd, ...props }: StreamdownProps) => import("octane/jsx-runtime").JSX.Element; displayName?: string; };