/** * Port Coordinate Store (Svelte 5 Runes) * * General-purpose store that maintains absolute canvas-space coordinates * for all port handles in the workflow. Built from SvelteFlow's internal * handle bounds data combined with FlowDrop port metadata. * * Primary consumers: * - Proximity connect (port-to-port distance instead of node center distance) * * Coordinates are derived from SvelteFlow's InternalNode.internals.handleBounds * which SvelteFlow already maintains for all node types. This avoids replicating * CSS positioning logic and stays automatically accurate. */ import type { WorkflowNode as WorkflowNodeType, PortCoordinate, PortCoordinateMap } from '../types/index.js'; import type { InternalNode } from '@xyflow/svelte'; /** * Rebuild coordinates for ALL nodes from SvelteFlow internals. * Call on initial workflow load (after render) and after bulk changes. * * @param nodes - All workflow nodes * @param getInternalNode - SvelteFlow's getInternalNode function */ export declare function rebuildAllPortCoordinates(nodes: WorkflowNodeType[], getInternalNode: (id: string) => InternalNode | undefined): void; /** * Update coordinates for a single node (efficient for drag updates). * Only recomputes ports for the specified node. * * @param node - The workflow node to update * @param getInternalNode - SvelteFlow's getInternalNode function */ export declare function updateNodePortCoordinates(node: WorkflowNodeType, getInternalNode: (id: string) => InternalNode | undefined): void; /** * Remove all coordinates for a node (on node delete). * * @param nodeId - ID of the node to remove */ export declare function removeNodePortCoordinates(nodeId: string): void; /** * Clear all port coordinates (lifecycle cleanup). */ export declare function clearPortCoordinates(): void; /** * Get coordinates for a specific handle. * * @param handleId - The handle ID to look up * @returns The port coordinate or undefined if not found */ export declare function getPortCoordinate(handleId: string): PortCoordinate | undefined; /** * Get all coordinates for a specific node. * * @param nodeId - The node ID to look up * @returns Array of port coordinates for the node */ export declare function getNodePortCoordinates(nodeId: string): PortCoordinate[]; /** * Get the current snapshot of all port coordinates. * Returns the reactive SvelteMap directly. * * @returns Current port coordinate map */ export declare function getPortCoordinateSnapshot(): PortCoordinateMap; /** * Get the reactive port coordinates state. * Useful for components that need to reactively read the coordinates. * * @returns The reactive port coordinate map */ export declare function getPortCoordinates(): PortCoordinateMap;