diff --git a/packages/core/src/types/flow.ts b/packages/core/src/types/flow.ts index f2192328..cf2fc8c2 100644 --- a/packages/core/src/types/flow.ts +++ b/packages/core/src/types/flow.ts @@ -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 = any, > = Element[] +export type MaybeElement = Node | Edge | Connection | FlowElement | Element export interface CustomThemeVars { [key: string]: string | number | undefined } diff --git a/packages/core/src/utils/graph.ts b/packages/core/src/utils/graph.ts index b397d570..6669a38a 100644 --- a/packages/core/src/utils/graph.ts +++ b/packages/core/src/utils/graph.ts @@ -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 = (element: MaybeElement): element is Edge => element && 'id' in element && 'source' in element && 'target' in element