import { isVue3 , Plugin , Vue2 } from "vue-demi" ; import Flag from "./components/Flag" ; export type { FlagSize } from "./components/Flag" ; export * from "./data" ; export { Flag } ; export type VueFlagsOptions = { iconPath ? : string ; } ; declare global { interface __VLS_GlobalComponents { VueFlag : typeof Flag ; "vue-flag" : typeof Flag ; } } const plugin = { install ( app , options ? ) { app . component ( "vue-flag" , Flag ) ; if ( isVue3 ) { app . provide ( "vueflags" , options || { } ) ; } else { Vue2 . prototype . $vueflags = options || { } ; } } , } ; let GlobalVue = null ; if ( typeof window !== "undefined" ) { GlobalVue = ( window as any ) . Vue ; } else if ( typeof global !== "undefined" ) { GlobalVue = ( global as any ) . Vue ; } if ( GlobalVue ) { GlobalVue . use ( plugin ) ; } export default plugin ;