refactor(core): move MaybeElement type
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import type { CSSProperties } from 'vue'
|
||||
import type { KeyFilter } from '@vueuse/core'
|
||||
import type { DefaultEdgeOptions, Edge, EdgeUpdatable, GraphEdge } from './edge'
|
||||
import type { CoordinateExtent, GraphNode, Node } from './node'
|
||||
import type { ConnectionLineOptions, ConnectionLineType, ConnectionMode, Connector } from './connection'
|
||||
import type { Connection, ConnectionLineOptions, ConnectionLineType, ConnectionMode, Connector } from './connection'
|
||||
import type { PanOnScrollMode, ViewportTransform } from './zoom'
|
||||
import type { EdgeTypesObject, NodeTypesObject } from './components'
|
||||
import type { CustomEvent } from './hooks'
|
||||
@@ -39,6 +39,7 @@ export type Elements<
|
||||
EdgeEvents extends Record<string, CustomEvent> = any,
|
||||
> = Element<NodeData, EdgeData, NodeEvents, EdgeEvents>[]
|
||||
|
||||
export type MaybeElement = Node | Edge | Connection | FlowElement | Element
|
||||
export interface CustomThemeVars {
|
||||
[key: string]: string | number | undefined
|
||||
}
|
||||
|
||||
@@ -8,12 +8,11 @@ import type {
|
||||
Dimensions,
|
||||
Edge,
|
||||
EdgeMarkerType,
|
||||
Element,
|
||||
ElementData,
|
||||
Elements,
|
||||
FlowElement,
|
||||
GraphEdge,
|
||||
GraphNode,
|
||||
MaybeElement,
|
||||
Node,
|
||||
Rect,
|
||||
ViewportTransform,
|
||||
@@ -54,8 +53,6 @@ export const getHostForElement = (element: HTMLElement): Document => {
|
||||
else return window.document
|
||||
}
|
||||
|
||||
type MaybeElement = Node | Edge | Connection | FlowElement | Element
|
||||
|
||||
export const isEdge = <Data = ElementData>(element: MaybeElement): element is Edge<Data> =>
|
||||
element && 'id' in element && 'source' in element && 'target' in element
|
||||
|
||||
|
||||
Reference in New Issue
Block a user