@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
15 lines (14 loc) • 783 B
TypeScript
import type { BuiltinTheme, CodeToHastOptions } from 'shiki';
import { SWRResponse } from 'swr';
export declare const FALLBACK_LANG = "txt";
declare const MD5_LENGTH_THRESHOLD = 10000;
type ICodeToHtml = (code: string, options: CodeToHastOptions) => Promise<string>;
declare const loadShiki: () => Promise<ICodeToHtml | null>;
declare const shikiPromise: Promise<ICodeToHtml | null>;
declare const escapeHtml: (str: string) => string;
export declare const useHighlight: (text: string, { language, enableTransformer, theme: builtinTheme, }: {
enableTransformer?: boolean | undefined;
language: string;
theme?: import("shiki/dist/themes.mjs").BundledTheme | undefined;
}) => SWRResponse<string, Error>;
export { escapeHtml, loadShiki, MD5_LENGTH_THRESHOLD, shikiPromise };