/** * Shared debounced syntax-highlighted code block. * * Performance characteristics vs the old per-site implementations: * - While code is still growing (streaming), Shiki re-highlight is debounced * to ~150 ms (trailing). Between debounce fires the previous highlighted * HTML is kept — no blank flash. * - A content hash gate means identical re-renders never re-invoke Shiki. * - A final highlight is triggered immediately when streaming ends (caller * passes streaming=false). * - Non-streaming first paint waits for Shiki (invisible placeholder reserves * space) so the UI never snaps from plain text to highlighted HTML. * * Usage: * */ import React from "react"; export interface HighlightedCodeBlockProps { code: string; lang: string; /** Class applied to the wrapper div when Shiki HTML is rendered. */ containerClass: string; /** Pass true while the parent message is still streaming. When false the * block fires an immediate (non-debounced) highlight pass. */ streaming?: boolean; /** Loader for the site-specific Shiki highlighter instance. Each call site * has its own highlighter loader (different language sets, different CSS * class, etc.) — pass it in so this component stays decoupled. */ loadHighlighter: () => Promise<{ codeToHtml: (code: string, options: { lang: string; themes: { light: string; dark: string; }; defaultColor?: false | "light" | "dark"; }) => string | Promise; getLoadedLanguages: () => string[]; }>; } export declare function HighlightedCodeBlock({ code, lang, containerClass, streaming, loadHighlighter, }: HighlightedCodeBlockProps): React.ReactElement; //# sourceMappingURL=HighlightedCodeBlock.d.ts.map