import type { WorkflowGraphModel, WorkflowGraphNode } from "../workflow-graph-model";
import type { LayoutEngine, LayoutResult, LayoutScope, NodeDimensions } from "./types";
export interface UseWorkflowLayoutOptions {
    /**
     * Primary layout engine. Defaults to dagre if not provided.
     * Pass the result of `createElkLayoutEngine()` for ELK-powered layout.
     */
    engine?: LayoutEngine;
    /**
     * Fallback engine used when the primary engine fails.
     * Defaults to a dagre engine instance.
     */
    fallbackEngine?: LayoutEngine;
    /**
     * Per-node dimension provider. Used by the engine to size nodes correctly.
     * Defaults to fixed CANVAS_NODE_WIDTH/HEIGHT constants when omitted.
     * Pass `registryNodeDimensions` for shape-aware sizing from the visual registry.
     */
    getNodeDimensions?: (node: WorkflowGraphNode) => NodeDimensions;
}
export interface UseWorkflowLayoutReturn {
    /**
     * Trigger a layout computation for the given graph and scope.
     * Returns the layout result, or `null` if the request was superseded
     * by a newer one or if all engines failed.
     */
    readonly layoutGraph: (graph: WorkflowGraphModel, scope: LayoutScope) => Promise<LayoutResult | null>;
    /** Whether a layout computation is currently in progress. */
    readonly isLayouting: boolean;
    /** The most recent successful layout result. */
    readonly lastResult: LayoutResult | null;
    /** Error message from the last failed attempt (cleared on next success). */
    readonly error: string | null;
}
/**
 * Behavior hook (DD-003 layer 2) that orchestrates async layout computation.
 *
 * Manages:
 * - **Generation counter**: overlapping requests are deduplicated; only the
 *   latest result is returned. Stale results from prior requests are discarded.
 * - **Error fallback**: if the primary engine fails, the fallback (dagre) is
 *   tried automatically. Both failures result in a null return + error state.
 * - **Loading state**: `isLayouting` tracks whether computation is in flight.
 * - **Cleanup**: terminates the engine's Web Worker on unmount.
 */
export declare function useWorkflowLayout(options?: UseWorkflowLayoutOptions): UseWorkflowLayoutReturn;
//# sourceMappingURL=use-workflow-layout.d.ts.map