import { ComponentType } from 'react'; import { HighlighterCore } from 'shiki/core'; type MdxComponent = ComponentType<{ components?: Record; }>; /** * Compile an MDX string to a React component at runtime. Lazy-loads the MDX * compiler so it never enters the base bundle. The returned component renders * inside an `` (or accepts a `components` prop) for scope. */ declare function compileMdx(source: string): Promise; interface MdxRuntimeResult { Component: MdxComponent | null; error: Error | null; status: 'idle' | 'compiling' | 'ready' | 'error'; } /** * Debounced runtime compile of an MDX string. Keeps the last successfully * compiled component while compiling and on error, so a transient typo never * blanks the preview. */ declare function useMdxRuntime(source: string, debounceMs?: number): MdxRuntimeResult; declare function normalizeCodeLanguage(lang?: string): string | undefined; type ShikiHighlightResult = { error: Error | null; html: string | null; isLoading: boolean; language: string | undefined; }; declare function useShikiHighlightResult(code: string, lang?: string): ShikiHighlightResult; declare function useShikiHighlight(code: string, lang?: string): string | null; /** Trigger (or await) the shared shiki highlighter load. */ declare function loadHighlighter(): Promise; /** The loaded highlighter instance, or null if it hasn't finished loading. */ declare function getLoadedHighlighter(): HighlighterCore | null; export { compileMdx, getLoadedHighlighter, loadHighlighter, normalizeCodeLanguage, useMdxRuntime, useShikiHighlight, useShikiHighlightResult }; export type { MdxComponent, MdxRuntimeResult, ShikiHighlightResult };