import { GraphNode, GraphEdge, Elements } from "@vue-flow/core"; import dagre from "dagre"; declare enum BranchType { ERROR = "ERROR", FINALLY = "FINALLY", AFTER_EXECUTION = "AFTER_EXECUTION" } interface MinimalNode { unused?: boolean; executionId?: string; branchType?: BranchType; uid: string; type: string; task?: { id?: string; type: string; namespace: string; flowId: string; }; } interface Cluster { uid: string; type: string; nodes: MinimalNode[]; taskNode: { uid: string; task: { type: string; namespace: string; flowId: string; }; }; branchType: BranchType; } export interface FlowGraph { nodes: MinimalNode[]; clusters: { cluster: Cluster; nodes: string[]; parents: { uid: string; }[]; }[]; edges: GraphEdge[]; } type EdgeReplacer = Record; export declare function predecessorsEdge(vueFlowId: string, nodeUid: string): GraphEdge[]; export declare function successorsEdge(vueFlowId: string, nodeUid: string): GraphEdge[]; export declare function predecessorsNode(vueFlowId: string, nodeUid: string): (GraphEdge | GraphNode)[]; export declare function successorsNode(vueFlowId: string, nodeUid: string): (GraphNode | undefined)[]; export declare function linkedElements(vueFlowId: string, nodeUid: string): ((import("@vue-flow/core").DefaultEdge & { selected: boolean; sourceNode: GraphNode; targetNode: GraphNode; data: any; events: Partial>; type: string; } & import("@vue-flow/core").EdgePositions) | GraphNode | undefined)[]; export declare function generateDagreGraph(flowGraph: { nodes: any; clusters: any; edges: any; }, hiddenNodes: string[], isHorizontal: boolean, clustersWithoutRootNode: string[], edgeReplacer: EdgeReplacer, collapsed: Set, clusterToNode: MinimalNode[], getNodeDimensions?: (node: MinimalNode, getNodeWidth: (node: MinimalNode) => number, getNodeHeight: (node: MinimalNode) => number) => { width: number; height: number; }): dagre.graphlib.Graph<{}>; export declare function getNodePosition(n: { x: number; y: number; width: number; height: number; }, parent?: { x: number; y: number; width: number; height: number; }): { x: number; y: number; }; export declare function getNodeWidth(node: MinimalNode): 184 | 5 | 150; export declare function getNodeHeight(node: MinimalNode): 44 | 5; export declare function isTaskNode(node: MinimalNode): boolean; export declare function isTriggerNode(node: MinimalNode): boolean; export declare function isCustomNode(node: MinimalNode): boolean; export declare function isCollapsedCluster(node: MinimalNode): boolean; export declare function replaceIfCollapsed(source: string, target: string, edgeReplacer: EdgeReplacer, hiddenNodes: string[]): { target: string; source: string; } | null; export declare function cleanGraph(vueflowId: string): void; export declare function flowHaveTasks(source: string): boolean; export declare function nodeColor(node: MinimalNode, collapsed: Set): "default" | "success" | "primary" | "danger" | "warning" | "blue"; export declare function haveAdd(edge: GraphEdge, nodeByUid: Record, clustersRootTaskUids: string[], readOnlyUidPrefixes: string[]): (string | undefined)[] | undefined; export declare function getEdgeColor(edge: GraphEdge, nodeByUid: Record, clusterByNodeUid: Record): "danger" | "warning" | null; export declare function generateGraph(_vueFlowId: string, flowId: string | undefined, namespace: string | undefined, flowGraph: FlowGraph | undefined, flowSource: string | undefined, hiddenNodes: string[], isHorizontal: boolean, edgeReplacer: EdgeReplacer, collapsed: Set, clusterToNode: MinimalNode[], isReadOnly: boolean, isAllowedEdit: boolean, enableSubflowInteraction: boolean, getNodeDimensions?: (node: MinimalNode, getNodeWidth: (node: MinimalNode) => number, getNodeHeight: (node: MinimalNode) => number) => { width: number; height: number; }, animated?: boolean): Elements | undefined; export declare function isClusterRootOrEnd(node: MinimalNode): boolean; export declare function computeClusterColor(cluster: Cluster): "success" | "primary" | "danger" | "blue"; export declare function isExpandableTask(node: MinimalNode, clusterByNodeUid: Record, edgeReplacer: EdgeReplacer, enableSubflowInteraction?: boolean): boolean | undefined; /** * Get nodes that have no incoming edges, i.e., root nodes of the graph. */ export declare function getRootNodes(graph: FlowGraph): MinimalNode[]; /** * Get the edges connected as the source to a specific node. (outward facing arrows) * @param graph The flow graph. * @param nodeUid The UID of the node. * @returns An array of edges connected to the node. */ export declare function getTargetNodesEdges(graph: FlowGraph, nodeUid?: string): GraphEdge[] | undefined; /** * Follow the graph from a specific node to find the next task nodes. * This function traverses the graph until it finds a node that is not a cluster. * @param graph * @param initialNode The initial node to start the search from. * @returns An array of the next task nodes found. */ export declare function getNextTaskNodes(graph: FlowGraph, initialNode: MinimalNode): MinimalNode[]; /** * Check if the tasks in the current graph are identical to the previous graph until the specified task. * @param previousGraph The graph from the previous execution. * @param currentGraph The graph from the current execution. * @param taskId The ID of the task to check. * @returns True if all tasks are identical, false otherwise. */ export declare function areTasksIdenticalInGraphUntilTask(previousGraph: FlowGraph, currentGraph: FlowGraph, taskId?: string): boolean; export {}; //# sourceMappingURL=VueFlowUtils.d.ts.map