refactor(types): cleanup

This commit is contained in:
moklick
2021-11-09 14:52:39 +01:00
parent a79e953ab3
commit 8a2ac1e31e
24 changed files with 655 additions and 667 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import { boxToRect, clamp, getBoundsOfBoxes, rectToBox } from '../utils';
import { ElementId, Node, Edge, Elements, Transform, XYPosition, Rect, Connection, EdgeMarkerType } from '../types';
import { Node, Edge, Elements, Connection, EdgeMarkerType, Transform, XYPosition, Rect } from '../types';
export const isEdge = (element: Node | Connection | Edge): element is Edge =>
'id' in element && 'source' in element && 'target' in element;
@@ -26,7 +26,7 @@ export const getIncomers = (node: Node, nodes: Node[], edges: Edge[]): Node[] =>
return nodes.filter((n) => incomersIds.includes(n.id));
};
const getEdgeId = ({ source, sourceHandle, target, targetHandle }: Connection): ElementId =>
const getEdgeId = ({ source, sourceHandle, target, targetHandle }: Connection): string =>
`reactflow__edge-${source}${sourceHandle}-${target}${targetHandle}`;
export const getMarkerId = (marker: EdgeMarkerType | undefined): string => {