import { HighlighterCore, LanguageRegistration, ThemeRegistrationAny } from "shiki/core"; //#region src/highlighter.d.ts /** A dynamic import, such as `() => import("shiki/langs/typescript.mjs")`. */ export type Loader = () => Promise; export type LazyHighlighterOptions = { /** The grammars a fence may use, keyed by Shiki's name for each. Each one loads the first time a fence asks for it. */ languages: Record>; /** More names a fence may use for a language, such as `{ ts: "typescript" }`. */ aliases?: Record; /** The themes code is colored with. `dark` goes in `--shiki-dark`. Both load with the first grammar. */ themes: { light: Loader; dark?: Loader; }; }; export type LazyHighlighter = { /** Shiki with `language`'s grammar loaded, or `undefined` for a language it doesn't have. */ highlighter: (language: string) => Promise; /** The names `highlighter`'s themes are loaded under. */ themes: { light: string; dark?: string; }; /** The names in `languages`. */ languages: string[]; /** The name in `languages` that a fence's info string, or one of `aliases`, stands for. */ language: (info: string | null | undefined) => string | undefined; }; /** * A Shiki with the JavaScript regex engine, so it needs no WebAssembly and runs on Workers and in browsers, that loads * each grammar the first time a fence uses it. Pass the result as the preset's `shiki`. */ export declare function createLazyHighlighter(options: LazyHighlighterOptions): LazyHighlighter; //#endregion