import { VariantProps } from 'class-variance-authority'; import { ComponentProps, MemoExoticComponent } from 'react'; import { ClassProp } from 'class-variance-authority/types'; declare const jsonHighlightVariants: (props?: ({ theme?: "default" | "branded" | "monochrome" | null | undefined; } & ClassProp) | undefined) => string; type JsonHighlightProps = { code: string; } & VariantProps & ComponentProps<"div">; /** * Lightweight, synchronous JSON syntax highlighter. * * Uses a single-pass regex tokenizer — **O(n)** over the input string — to * colour keys, strings, numbers, and keywords (true / false / null). * * ## Themes * * Use the `theme` prop to pick a colour preset: * * - `"default"` — amber keys, red strings, teal numbers, green true, red false, gray null. * - `"branded"` — uses design system tokens (chart-2, chart-1, warning, success, destructive). * - `"monochrome"` — foreground keys, muted values (for subdued contexts). * * ## Customising individual colours * * Token colours are CSS custom properties. Override any via `className`: * * | Variable | Token | * | ------------ | ------------ | * | `--jh-key` | Object keys | * | `--jh-str` | Strings | * | `--jh-num` | Numbers | * | `--jh-true` | `true` | * | `--jh-false` | `false` | * | `--jh-null` | `null` | * * ```tsx * * ``` * * ## When to use this over `CodeBlockCode` * * - The content is **always JSON** (no multi-language support needed). * - The component appears in a **hot path** where Shiki's WASM bundle * (~695 KB gzipped) and async initialisation would cause visible lag. * - You need **synchronous first-paint** (no loading flash). * * ## When to prefer `CodeBlockCode` (Shiki) * * - The language is not JSON, or can vary at runtime. * - You need advanced features like line numbers or line highlighting. * - The code block renders once in a non-latency-critical context. */ declare const JsonHighlight: MemoExoticComponent<({ code, theme, className, ...props }: JsonHighlightProps) => import("react").JSX.Element>; export type { JsonHighlightProps }; export { JsonHighlight, jsonHighlightVariants }; //# sourceMappingURL=json-highlight.d.ts.map