import Vue , { PluginFunction , PluginObject } from 'vue' ; import HighlightCode from './components/HighlightCode' ; import { registerLanguages } from './lib' ; import { HLJSLang } from './types' ; export { HLJSLang } ; export interface export interface Options { type { Record < string , HLJSLang > } memberof languages ? : Record < string , HLJSLang > ; } param { typeof Vue } vue param { Options } options const install = ( vue , options = { languages : { } } ) : void => { const { languages } = options ; if ( IS_WEB_BUNDLE ) { const xml = window . hljs . getLanguage ( 'xml' ) ; window . hljs . registerLanguage ( 'vue' , ( ) => xml ) ; } else { languages && registerLanguages ( languages ) ; } vue . component ( 'highlight-code' , HighlightCode ) ; } ; if ( typeof window !== 'undefined' && window . Vue ) { install ( window . Vue ) ; } export default { install } as PluginObject < Options > ;