UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

16 lines (15 loc) 830 B
/** Resolve a fence info string to a shiki language id, or `text` when unknown. */ export declare const resolveLanguage: (lang: string) => string; export interface HighlightThemes { light: string; dark: string; } /** * Highlight `code`. Returns the HTML string synchronously when everything needed is * already loaded; otherwise a promise that resolves to the HTML (or `null` when the * language/theme could not be loaded — callers keep the plain rendering then). */ export declare const highlight: (code: string, language: string, themes: HighlightThemes) => string | Promise<string | null>; export declare const DEFAULT_THEMES: HighlightThemes; /** Parse the `highlight` attribute: `""` → defaults, `"a"` → both, `"a b"` → light/dark. */ export declare const parseThemes: (value: string) => HighlightThemes;