import type { LayoutEngine, LayoutOptions, NodeChange, WorkflowEdge, WorkflowNode } from "../editor";
export interface UseAutoLayoutOptions {
    /** The engine. Required. */
    engine: LayoutEngine | null | undefined;
    /** Current nodes (controlled). */
    nodes: WorkflowNode[];
    /** Current edges (controlled). */
    edges: WorkflowEdge[];
    /** Where to send position changes. Required. */
    onNodesChange?: (changes: NodeChange[]) => void;
    /** Layout options forwarded to the engine. */
    options?: LayoutOptions;
    /** Re-run on every graph-shape change (debounced 250ms). Default false. */
    auto?: boolean;
    /** Debounce delay for `auto` mode (ms). Default 250. */
    debounceMs?: number;
    /** Called after each successful run. */
    onLayout?: (positions: {
        id: string;
        position: {
            x: number;
            y: number;
        };
    }[]) => void;
    /** Called when the engine throws (network / worker / library). */
    onError?: (err: unknown) => void;
}
export interface UseAutoLayoutResult {
    /** Manually trigger a layout pass. Returns the promise of the engine. */
    runLayout(): Promise<void>;
    /** True while a layout pass is in flight. */
    isLaying: boolean;
}
export declare function useAutoLayout({ engine, nodes, edges, onNodesChange, options, auto, debounceMs, onLayout, onError, }: UseAutoLayoutOptions): UseAutoLayoutResult;
//# sourceMappingURL=useAutoLayout.d.ts.map