import { Node, Edge } from '@xyflow/react';

/**
 * Layout Engine
 * =============
 * Auto-layout for workflow graphs using @dagrejs/dagre.
 * Pure utility — no React dependencies.
 */

/** Layout direction: free means no auto-layout is applied. */
type LayoutDirection = 'free' | 'LR' | 'TB';
/**
 * Apply dagre layout to the given nodes and edges.
 * Returns a new array of nodes with updated positions.
 * Group child nodes (parentId set) and note nodes are excluded from layout.
 */
declare function applyDagreLayout(nodes: Node[], edges: Edge[], direction: Exclude<LayoutDirection, 'free'>): Node[];

export { type LayoutDirection as L, applyDagreLayout as a };
