import { Edge as FlowEdge, Position } from '@xyflow/react';
import { FlowEdgeData } from '../../../../../types/src/graph-view';

type Coordinate = {
    depth: number;
    x: number;
    y: number;
};
type Rect = {
    bottom: number;
    left: number;
    right: number;
    top: number;
};
export type NodeRect = Rect & Coordinate & {
    id: string;
};
export declare const getNodeHandleId: (node: {
    id: string;
    width: number;
}, handlePosition: Position, type: "source" | "target", index?: number) => string;
/**
 * Assigns handle positions to edges based on their source and target nodes.
 * This function will determine the handle position for each edge based on which position has the least overlapping nodes.
 * - For tree's edges, the source handle will always be at the bottom of the source node and the target handle will always be at the top of the target node.
 * - For loop edges:
 *
 *    - It will try to place the edge in the Left and Right direction. If it is possible to avoid all nodes, it will use this position. (using the `findOptimizePositionByOffset`)
 *    - It will try to place the edge at every positions possible and count the number of nodes that overlap with the edge. It will choose the position with the least number of overlapping nodes. (using the `findOptimizePositionByNodes`)
 *
 * @param edges - An array of edges with optional forceHidden property.
 * @param nodeMap - A record of node IDs to their corresponding NodeRect objects.
 * @param links - An array of links representing the connections between nodes.
 * @returns An array of edges with updated handle positions and additional data.

 */
export declare const assignEdgesHandlePosition: (edges: Array<FlowEdge & {
    forceHidden?: boolean;
}>, nodeMap: Record<string, NodeRect>, nodeHandleUsageMap: Record<string, number>, links: any[]) => Array<FlowEdge<FlowEdgeData & {
    isLoopEdge?: boolean;
}>>;
export {};
