chore(types): cleanup

This commit is contained in:
moklick
2024-09-02 10:27:11 +02:00
parent eb1f2ad56a
commit ddeb3c6e7c
@@ -14,11 +14,10 @@ import {
getViewportForBounds, getViewportForBounds,
getElementsToRemove, getElementsToRemove,
rendererPointToPoint, rendererPointToPoint,
nodeHasDimensions,
nodeToBox, nodeToBox,
getBoundsOfBoxes, getBoundsOfBoxes,
boxToRect, boxToRect,
isInternalNodeBase isInternalNodeBase,
evaluateAbsolutePosition, evaluateAbsolutePosition,
type HandleType, type HandleType,
type HandleConnection type HandleConnection
@@ -245,7 +244,7 @@ export function useSvelteFlow(): {
* @returns the bounds of the given nodes * @returns the bounds of the given nodes
*/ */
getNodesBounds: (nodes: (Node | InternalNode | string)[]) => Rect; getNodesBounds: (nodes: (Node | InternalNode | string)[]) => Rect;
* Gets all connections for a given handle belonging to a specific node. /** Gets all connections for a given handle belonging to a specific node.
* *
* @param type - handle type 'source' or 'target' * @param type - handle type 'source' or 'target'
* @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle) * @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle)
@@ -280,7 +279,7 @@ export function useSvelteFlow(): {
nodeLookup, nodeLookup,
nodeOrigin, nodeOrigin,
edgeLookup, edgeLookup,
connectionLookup, connectionLookup
} = useStore(); } = useStore();
const getNodeRect = (node: Node | { id: Node['id'] }): Rect | null => { const getNodeRect = (node: Node | { id: Node['id'] }): Rect | null => {
@@ -581,7 +580,7 @@ export function useSvelteFlow(): {
); );
return boxToRect(box); return boxToRect(box);
} },
getHandleConnections: ({ type, id, nodeId }) => getHandleConnections: ({ type, id, nodeId }) =>
Array.from( Array.from(
get(connectionLookup) get(connectionLookup)