diff options
Diffstat (limited to 'frontend/app/shiki.bundle.ts')
| -rw-r--r-- | frontend/app/shiki.bundle.ts | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/frontend/app/shiki.bundle.ts b/frontend/app/shiki.bundle.ts new file mode 100644 index 0000000..1d03de3 --- /dev/null +++ b/frontend/app/shiki.bundle.ts @@ -0,0 +1,58 @@ +/* Generate by @shikijs/codegen */ +import type { + DynamicImportLanguageRegistration, + DynamicImportThemeRegistration, + HighlighterGeneric, +} from '@shikijs/types' +import { + createSingletonShorthands, + createdBundledHighlighter, +} from '@shikijs/core' +import { createJavaScriptRegexEngine } from '@shikijs/engine-javascript' + +type BundledLanguage = 'php' +type BundledTheme = 'github-light' +type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme> + +const bundledLanguages = { + php: () => import('@shikijs/langs/php'), +} as Record<BundledLanguage, DynamicImportLanguageRegistration> + +const bundledThemes = { + 'github-light': () => import('@shikijs/themes/github-light'), +} as Record<BundledTheme, DynamicImportThemeRegistration> + +const createHighlighter = /* @__PURE__ */ createdBundledHighlighter< + BundledLanguage, + BundledTheme +>({ + langs: bundledLanguages, + themes: bundledThemes, + engine: () => createJavaScriptRegexEngine(), +}) + +const { + codeToHtml, + codeToHast, + codeToTokensBase, + codeToTokens, + codeToTokensWithThemes, + getSingletonHighlighter, + getLastGrammarState, +} = /* @__PURE__ */ createSingletonShorthands<BundledLanguage, BundledTheme>( + createHighlighter, +) + +export { + bundledLanguages, + bundledThemes, + codeToHast, + codeToHtml, + codeToTokens, + codeToTokensBase, + codeToTokensWithThemes, + createHighlighter, + getLastGrammarState, + getSingletonHighlighter, +} +export type { BundledLanguage, BundledTheme, Highlighter } |
