refactor(core): move MaybeElement type

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-01 23:00:08 +01:00
committed by Braks
parent 6ea60349fd
commit 51270caa73
2 changed files with 3 additions and 5 deletions
+1 -4
View File
@@ -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