From dc4abbbdd0a8d9dc204989f69dad6601591f26f2 Mon Sep 17 00:00:00 2001 From: Mister-Hope Date: Fri, 24 Jan 2025 22:57:54 +0800 Subject: [PATCH] chore: fix types --- .../markdown/highlighter/createShikiHighlighter.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/markdown/plugin-shiki/src/node/markdown/highlighter/createShikiHighlighter.ts b/plugins/markdown/plugin-shiki/src/node/markdown/highlighter/createShikiHighlighter.ts index c78c31c53..557fc9809 100644 --- a/plugins/markdown/plugin-shiki/src/node/markdown/highlighter/createShikiHighlighter.ts +++ b/plugins/markdown/plugin-shiki/src/node/markdown/highlighter/createShikiHighlighter.ts @@ -1,10 +1,5 @@ import { createRequire } from 'node:module' -import type { - BundledLanguage, - BundledTheme, - HighlighterGeneric, - LanguageRegistration, -} from 'shiki' +import type { BundledLanguage, BundledTheme, HighlighterGeneric } from 'shiki' import { createHighlighter, isSpecialLang } from 'shiki' import { createSyncFn } from 'synckit' import type { ShikiResolveLang } from '../../resolveLang.js' @@ -17,7 +12,7 @@ const resolveLangSync = createSyncFn( require.resolve('@vuepress/plugin-shiki/resolveLang'), ) -export type ShikiLoadLang = (lang: LanguageRegistration | string) => boolean +export type ShikiLoadLang = (lang: string) => boolean export const createShikiHighlighter = async ({ langs = [], @@ -27,7 +22,7 @@ export const createShikiHighlighter = async ({ ...options }: ShikiHighlightOptions = {}): Promise<{ highlighter: HighlighterGeneric - loadLang: (lang: string) => boolean + loadLang: ShikiLoadLang }> => { const highlighter = await createHighlighter({ langs: [...langs, ...Object.values(langAlias)],