Skip to content

Commit

Permalink
chore: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 24, 2025
1 parent 2eeec6e commit dc4abbb
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -17,7 +12,7 @@ const resolveLangSync = createSyncFn<ShikiResolveLang>(
require.resolve('@vuepress/plugin-shiki/resolveLang'),
)

export type ShikiLoadLang = (lang: LanguageRegistration | string) => boolean
export type ShikiLoadLang = (lang: string) => boolean

export const createShikiHighlighter = async ({
langs = [],
Expand All @@ -27,7 +22,7 @@ export const createShikiHighlighter = async ({
...options
}: ShikiHighlightOptions = {}): Promise<{
highlighter: HighlighterGeneric<BundledLanguage, BundledTheme>
loadLang: (lang: string) => boolean
loadLang: ShikiLoadLang
}> => {
const highlighter = await createHighlighter({
langs: [...langs, ...Object.values(langAlias)],
Expand Down

0 comments on commit dc4abbb

Please sign in to comment.