/** * Edge Styling Utility * * Standalone functions for determining edge categories and applying * visual styling to workflow edges based on source port data types. * Used by both the visual editor and the command DSL system. */ import type { WorkflowNode as WorkflowNodeType, WorkflowEdge, EdgeCategory } from '../types/index.js'; /** * Check if a port ID matches a dynamic branch in a Gateway node. * Gateway nodes store branches in config.branches array. */ export declare function isGatewayBranch(node: WorkflowNodeType, portId: string): boolean; /** * Get the data type of a port from a node's metadata. * Also handles dynamic ports like Gateway branches. */ export declare function getPortDataType(node: WorkflowNodeType, portId: string, portType: 'input' | 'output'): string | null; /** * Determine the edge category based on source port data type. * Note: This does not check for loopback edges — use getEdgeCategoryWithLoopback() for that. */ export declare function getEdgeCategory(sourcePortDataType: string | null): EdgeCategory; /** * Determine the full edge category including loopback detection. * Loopback edges take precedence over source port data type. */ export declare function getEdgeCategoryWithLoopback(edge: WorkflowEdge, sourcePortDataType: string | null): EdgeCategory; /** * Apply custom styling to a connection edge based on its source/target nodes. * * Sets: * - edge.data.metadata.edgeType (trigger/tool/loopback/data) * - edge.style, edge.class, edge.markerEnd based on category * - edge.data.targetNodeType and edge.data.targetCategory */ export declare function applyConnectionStyling(edge: WorkflowEdge, sourceNode: WorkflowNodeType, targetNode: WorkflowNodeType): void; /** * Update existing edges with custom styling rules. * Batch operation that applies styling to all edges using a node map for O(1) lookup. */ export declare function updateEdgeStyles(edges: WorkflowEdge[], nodes: WorkflowNodeType[]): WorkflowEdge[];