import { Port, Node, Connection } from '../../../types/core'; import { PortDefinition } from '../../../types/NodeDefinition'; /** * Get all connections for a specific port (both directions) */ export declare function getPortConnections(port: Port, connections: Record): Connection[]; /** * Get connections for a port in a specific direction */ export declare function getPortConnectionsByDirection(port: Port, connections: Record, direction: "from" | "to"): Connection[]; /** * Check if a port has any connections */ export declare function hasPortConnections(port: Port, connections: Record): boolean; /** * Count the number of connections for a port (both directions) */ export declare function countPortConnections(port: Port, connections: Record): number; /** * Result of checking port capacity */ export type PortCapacityResult = { /** Whether the port is at capacity */ atCapacity: boolean; /** Existing connections for the port in the specified direction */ existingConnections: Connection[]; /** Normalized max connections (undefined = unlimited) */ maxConnections: number | undefined; }; /** * Check port capacity and return detailed information. * Single source of truth for capacity checking logic. * * @param port - The port to check * @param connections - All connections in the editor * @param direction - Direction to check ("from" for output, "to" for input) * @param portDefinition - Optional port definition for fallback maxConnections */ export declare function checkPortCapacity(port: Port, connections: Record, direction: "from" | "to", portDefinition?: PortDefinition): PortCapacityResult; /** * Get the other port information for a connection. * This function requires a context callback (getNodePorts) to resolve ports. */ export declare function getOtherPortInfo(connection: Connection, port: Port, nodes: Record, getNodePorts: (nodeId: string) => Port[]): { otherNode: Node; otherPort: Port; isFromPort: boolean; } | null;