chore(core): remove MaybeRefOrGetter util type and use MaybeComputedRef

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-04-11 20:28:02 +02:00
committed by Braks
parent 88c59a8f02
commit ac23388394
3 changed files with 8 additions and 11 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ import type { D3DragEvent, DragBehavior, SubjectPosition } from 'd3-drag'
import { drag } from 'd3-drag'
import { select } from 'd3-selection'
import type { Ref } from 'vue'
import type { MaybeComputedRef } from '@vueuse/core'
import type { NodeDragEvent, NodeDragItem, XYPosition } from '~/types'
import type { MaybeRefOrGetter } from '~/types/utils'
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>
@@ -12,8 +12,8 @@ interface UseDragParams {
onDrag: (event: Omit<NodeDragEvent, 'intersections'>) => void
onStop: (event: Omit<NodeDragEvent, 'intersections'>) => void
el: Ref<Element | undefined>
disabled?: MaybeRefOrGetter<boolean>
selectable?: MaybeRefOrGetter<boolean>
disabled?: MaybeComputedRef<boolean>
selectable?: MaybeComputedRef<boolean>
id?: string
}
+5 -5
View File
@@ -1,12 +1,12 @@
import type { MaybeComputedRef } from '@vueuse/core'
import type { Connection, ConnectionHandle, HandleType, MouseTouchEvent, ValidConnectionFunc } from '~/types'
import type { MaybeRefOrGetter } from '~/types/utils'
interface UseHandleProps {
handleId: MaybeRefOrGetter<string | null>
nodeId: MaybeRefOrGetter<string>
type: MaybeRefOrGetter<HandleType>
handleId: MaybeComputedRef<string | null>
nodeId: MaybeComputedRef<string>
type: MaybeComputedRef<HandleType>
isValidConnection?: ValidConnectionFunc | null
edgeUpdaterType?: MaybeRefOrGetter<HandleType>
edgeUpdaterType?: MaybeComputedRef<HandleType>
onEdgeUpdate?: (event: MouseTouchEvent, connection: Connection) => void
onEdgeUpdateEnd?: (event: MouseTouchEvent) => void
}
-3
View File
@@ -1,3 +0,0 @@
import type { MaybeRef } from '@vueuse/core'
export type MaybeRefOrGetter<T> = MaybeRef<T> | (() => T)