UNPKG

react-shiki

Version:

Syntax highlighter component for react using shiki

38 lines (37 loc) 1.74 kB
import { a as HighlighterOptions, c as Themes, i as Element, l as UseShikiHighlighter, n as isInlineCode, o as Language, r as rehypeInlineCodeProperty, s as Theme, t as ShikiHighlighterProps } from "./component-CjpuWrgO.mjs"; import * as _$react from "react"; import { createJavaScriptRawEngine, createJavaScriptRegexEngine } from "shiki/engine/javascript"; import { LanguageRegistration } from "shiki/bundle/web"; //#region src/web.d.ts /** * Highlight code with shiki (web bundle) * * @param code - Code to highlight * @param lang - Language (bundled or custom) * @param theme - Theme (bundled, multi-theme, or custom) * @param options - react-shiki options + shiki options * @returns Highlighted code as React elements or HTML string * * @example * ```tsx * const highlighted = useShikiHighlighter( * 'const x = 1;', * 'typescript', * { * light: 'github-light', * dark: 'github-dark' * } * ); * ``` * * Web bundle (~3.8MB minified, 695KB gzipped). For other bundles: `react-shiki` or `react-shiki/core` */ declare const useShikiHighlighter: UseShikiHighlighter; /** * ShikiHighlighter component using the web bundle. * Includes web-focused languages for balanced size and functionality. */ declare const ShikiHighlighter: _$react.ForwardRefExoticComponent<ShikiHighlighterProps & _$react.RefAttributes<HTMLElement>>; //#endregion export { type Element, type HighlighterOptions, type Language, type LanguageRegistration, ShikiHighlighter, ShikiHighlighter as default, type ShikiHighlighterProps, type Theme, type Themes, type UseShikiHighlighter, createJavaScriptRawEngine, createJavaScriptRegexEngine, isInlineCode, rehypeInlineCodeProperty, useShikiHighlighter }; //# sourceMappingURL=web.d.mts.map