chore(types): Remove control events type

This commit is contained in:
Braks
2022-04-22 10:55:15 +02:00
parent fa23617ff1
commit b06ef3f9ab
2 changed files with 7 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { useZoomPanHelper, useVueFlow } from '../../composables'
import type { ControlProps, ControlEvents } from '../../types/components'
import type { ControlProps } from '../../types/components'
import ControlButton from './ControlButton.vue'
import PlusIcon from '~/assets/icons/plus.svg'
import MinusIcon from '~/assets/icons/minus.svg'
@@ -13,7 +13,12 @@ const props = withDefaults(defineProps<ControlProps>(), {
showFitView: true,
showInteractive: true,
})
const emit = defineEmits<ControlEvents>()
const emit = defineEmits<{
(event: 'zoom-in'): void
(event: 'zoom-out'): void
(event: 'fit-view'): void
(event: 'interaction-change', active: boolean): void
}>()
const { store } = useVueFlow()
const { zoomIn, zoomOut, fitView } = useZoomPanHelper()

View File

@@ -54,13 +54,6 @@ export interface ControlProps {
fitViewParams?: FitViewParams
}
export interface ControlEvents {
(event: 'zoom-in'): void
(event: 'zoom-out'): void
(event: 'fit-view'): void
(event: 'interaction-change', active: boolean): void
}
/** expects a node and returns a color value */
export type MiniMapNodeFunc<Data = ElementData> = (node: GraphNode<Data>) => string
// hack for vue-type imports