import ModalStack from './ModalStack.vue'; import Modals from './Modals'; import { createApp } from 'vue'; import type { ModalOptions } from './Types'; interface VueModalsDef { app?: ReturnType; install: (VueApp: ReturnType) => void; Modals: typeof Modals; ModalStack: typeof ModalStack; } const VueModals: VueModalsDef = { app: undefined, install(VueApp: ReturnType) { VueApp.component('vue-modals-stack', ModalStack); VueApp.config.globalProperties.$modals = Modals; VueModals.app = VueApp; }, Modals, ModalStack, }; export type { ModalOptions }; export default VueModals;