pengzhanbo b1f996cb0e
feat(plugin-md-power): add ::: encrypt container, close #815 (#831)
* feat(plugin-md-power): add `::: encrypt` container

* chore: tweak

* chore: tweak

* chore: tweak
2026-02-12 23:55:21 +08:00

46 lines
1.3 KiB
TypeScript

import type { LocaleConfig } from 'vuepress'
import type { EncryptSnippetLocale } from '../shared/encrypt.js'
import type { MarkdownPowerPluginOptions } from '../shared/index.js'
declare const __MD_POWER_INJECT_OPTIONS__: MarkdownPowerPluginOptions
declare const __MD_POWER_DASHJS_INSTALLED__: boolean
declare const __MD_POWER_HLSJS_INSTALLED__: boolean
declare const __MD_POWER_MPEGTSJS_INSTALLED__: boolean
declare const __MD_POWER_ENCRYPT_LOCALES__: LocaleConfig<EncryptSnippetLocale>
export const pluginOptions: MarkdownPowerPluginOptions = __MD_POWER_INJECT_OPTIONS__
export const installed: {
dashjs: boolean
hlsjs: boolean
mpegtsjs: boolean
} = {
dashjs: __MD_POWER_DASHJS_INSTALLED__,
hlsjs: __MD_POWER_HLSJS_INSTALLED__,
mpegtsjs: __MD_POWER_MPEGTSJS_INSTALLED__,
}
export const ART_PLAYER_SUPPORTED_VIDEO_TYPES: string[] = ['mp4', 'mp3', 'webm', 'ogg']
if (installed.dashjs) {
ART_PLAYER_SUPPORTED_VIDEO_TYPES.push('mpd', 'dash')
}
if (installed.hlsjs) {
ART_PLAYER_SUPPORTED_VIDEO_TYPES.push('m3u8', 'hls')
}
if (installed.mpegtsjs) {
ART_PLAYER_SUPPORTED_VIDEO_TYPES.push('ts', 'flv')
}
export const INJECT_TIMELINE_KEY: symbol = Symbol(
__VUEPRESS_DEV__ ? 'timeline' : '',
)
export const INJECT_COLLAPSE_KEY: symbol = Symbol(
__VUEPRESS_DEV__ ? 'collapse' : '',
)
export const ENCRYPT_LOCALES = __MD_POWER_ENCRYPT_LOCALES__