From 25b64fe3a7aa69fb6b38d9ad72355463debfb435 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:31:59 +0100 Subject: [PATCH] fix(types): shims overwriting component internal instance type Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- src/composables/useVueFlow.ts | 2 +- src/shims-vue.d.ts | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/composables/useVueFlow.ts b/src/composables/useVueFlow.ts index 8f5d2855..407ca418 100644 --- a/src/composables/useVueFlow.ts +++ b/src/composables/useVueFlow.ts @@ -5,7 +5,7 @@ import { useStore } from '~/store' let id = 0 export default (options?: FlowOptions): UseVueFlow => { - const currentInstance = getCurrentInstance() + const currentInstance: any = getCurrentInstance() let vueFlow: UseVueFlow | false | undefined = currentInstance ? inject(VueFlow, undefined) ?? (currentInstance.vueFlow as UseVueFlow) : false diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts index 7ed080c8..a191098d 100644 --- a/src/shims-vue.d.ts +++ b/src/shims-vue.d.ts @@ -1,14 +1,6 @@ -import { UseVueFlow } from '~/types' - declare module '*.vue' { import { DefineComponent } from 'vue' // eslint-disable-next-line @typescript-eslint/ban-types const component: DefineComponent<{}, {}, any> export default component } - -declare module '@vue/runtime-core' { - interface ComponentInternalInstance { - vueFlow: UseVueFlow - } -}