@delove/reaflow
Version:
Node-based Visualizations for React
30 lines (29 loc) • 1.03 kB
TypeScript
import { RefObject } from 'react';
import { NodeData } from '../types';
/**
* Checks if the node can be linked or not.
*/
export declare function checkNodeLinkable(curNode: NodeData, enteredNode: NodeData | null, canLinkNode: boolean | null): boolean;
export interface CoordProps {
zoom: number;
layoutXY: [number, number];
containerRef: RefObject<HTMLDivElement | null>;
}
/**
* Given various dimensions and positions, create a matrix
* used for determining position.
*/
export declare function getCoords({ zoom, layoutXY, containerRef }: CoordProps): any;
/**
* Given a nodeId to find, a list of nodes to check against, and an optional parentId of the node
* find the node from the list of nodes
*/
export declare function findNestedNode(nodeId: string, children: any[], parentId?: string): {
[key: string]: any;
};
/**
* Return the layout node that is currently being dragged on the Canvas
*/
export declare function getDragNodeData(dragNode: NodeData, children?: any[]): {
[key: string]: any;
};