site/node_modules/shiki/dist/bundle-web.d.mts

44 lines
3.5 KiB
TypeScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
import { R as Root } from './types/wasm-dynamic.mjs';
export { g as getWasmInlined } from './types/wasm-dynamic.mjs';
import * as _shikijs_core from '@shikijs/core';
import { BundledLanguageInfo, DynamicImportLanguageRegistration, HighlighterGeneric, CreateHighlighterFactory } from '@shikijs/core';
export * from '@shikijs/core';
import { BundledTheme } from './themes.mjs';
export { bundledThemes, bundledThemesInfo } from './themes.mjs';
import '@shikijs/core/types';
declare const bundledLanguagesInfo: BundledLanguageInfo[];
declare const bundledLanguagesBase: {
[k: string]: DynamicImportLanguageRegistration;
};
declare const bundledLanguagesAlias: {
[k: string]: DynamicImportLanguageRegistration;
};
type BundledLanguage = 'angular-html' | 'angular-ts' | 'astro' | 'bash' | 'blade' | 'c' | 'c++' | 'coffee' | 'coffeescript' | 'cpp' | 'css' | 'glsl' | 'gql' | 'graphql' | 'haml' | 'handlebars' | 'hbs' | 'html' | 'html-derivative' | 'http' | 'imba' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'jl' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsx' | 'julia' | 'less' | 'lua' | 'markdown' | 'marko' | 'md' | 'mdc' | 'mdx' | 'php' | 'postcss' | 'pug' | 'py' | 'python' | 'r' | 'rb' | 'ruby' | 'sass' | 'scss' | 'sh' | 'shell' | 'shellscript' | 'sql' | 'styl' | 'stylus' | 'svelte' | 'toml' | 'ts' | 'tsx' | 'typescript' | 'vue' | 'vue-html' | 'wasm' | 'wgsl' | 'xml' | 'yaml' | 'yml' | 'zsh';
declare const bundledLanguages: Record<BundledLanguage, DynamicImportLanguageRegistration>;
type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>;
/**
* Initiate a highlighter instance and load the specified languages and themes.
* Later it can be used synchronously to highlight code.
*
* Importing this function will bundle all languages and themes.
* @see https://shiki.style/guide/bundles#shiki-bundle-web
*
* For granular control over the bundle, check:
* @see https://shiki.style/guide/install#fine-grained-bundle
*/
declare const createHighlighter: CreateHighlighterFactory<BundledLanguage, BundledTheme>;
declare const codeToHtml: (code: string, options: _shikijs_core.CodeToHastOptions<BundledLanguage, BundledTheme>) => Promise<string>;
declare const codeToHast: (code: string, options: _shikijs_core.CodeToHastOptions<BundledLanguage, BundledTheme>) => Promise<Root>;
declare const codeToTokensBase: (code: string, options: _shikijs_core.RequireKeys<_shikijs_core.CodeToTokensBaseOptions<BundledLanguage, BundledTheme>, "theme" | "lang">) => Promise<_shikijs_core.ThemedToken[][]>;
declare const codeToTokens: (code: string, options: _shikijs_core.CodeToTokensOptions<BundledLanguage, BundledTheme>) => Promise<_shikijs_core.TokensResult>;
declare const codeToTokensWithThemes: (code: string, options: _shikijs_core.RequireKeys<_shikijs_core.CodeToTokensWithThemesOptions<BundledLanguage, BundledTheme>, "lang" | "themes">) => Promise<_shikijs_core.ThemedTokenWithVariants[][]>;
declare const getSingletonHighlighter: (options?: Partial<_shikijs_core.BundledHighlighterOptions<BundledLanguage, BundledTheme>> | undefined) => Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>;
/**
* @deprecated Use `createHighlighter` or `getSingletonHighlighter` instead.
*/
declare const getHighlighter: CreateHighlighterFactory<BundledLanguage, BundledTheme>;
export { type BundledLanguage, BundledTheme, type Highlighter, bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createHighlighter, getHighlighter, getSingletonHighlighter };