import type { FitViewOptions, Position, Rect, Viewport, WorkflowEdge, WorkflowNode } from "../editor";
export interface FlowInstance {
    getViewport(): Viewport;
    setViewport(viewport: Viewport, opts?: {
        duration?: number;
    }): void;
    setCenter(x: number, y: number, opts?: {
        duration?: number;
        zoom?: number;
    }): void;
    fitView(opts?: FitViewOptions): Promise<boolean>;
    zoomIn(opts?: {
        step?: number;
    }): void;
    zoomOut(opts?: {
        step?: number;
    }): void;
    zoomTo(level: number): void;
    /** Convert a pointer position (relative to the canvas container) into
     *  flow-space coordinates. */
    screenToFlowPosition(p: Position): Position;
    /** Inverse of `screenToFlowPosition`. */
    flowToScreenPosition(p: Position): Position;
    getNodes(): WorkflowNode[];
    getEdges(): WorkflowEdge[];
    getNode(id: string): WorkflowNode | undefined;
    getEdge(id: string): WorkflowEdge | undefined;
    /** Axis-aligned bounding box of the given nodes (or every node when omitted). */
    getNodesBounds(nodes?: {
        id: string;
    }[]): Rect;
    /** Find every node whose bbox overlaps the given rect.
     *  `partially=true` includes partial overlaps; `false` requires full containment. */
    getIntersectingNodes(area: Rect, partially?: boolean): WorkflowNode[];
    addNodes(nodes: WorkflowNode | WorkflowNode[]): void;
    addEdges(edges: WorkflowEdge | WorkflowEdge[]): void;
    /** Merge a partial into the node's existing `data` field. Cheap shorthand
     *  for the common case of editing a node's payload without rebuilding it. */
    updateNodeData<TData = unknown>(id: string, partial: Partial<TData>): void;
    /** Replace the node entirely (use sparingly — usually `updateNodeData` is enough). */
    updateNode(id: string, partial: Partial<WorkflowNode>): void;
    /** Imperatively remove nodes and/or edges. Returns false if the host's
     *  `onBeforeDelete` vetoed; true otherwise. Synchronous for non-async
     *  vetoes; awaits the promise when the host returns one. */
    deleteElements(params: {
        nodes?: {
            id: string;
        }[];
        edges?: {
            id: string;
        }[];
    }): Promise<boolean>;
}
export declare const FlowInstanceContext: import("react").Context<FlowInstance>;
/**
 * Imperative handle for `<FlowCanvas>`. Throws if called outside the
 * canvas — the instance is canvas-scoped (not a global singleton) so
 * multiple canvases on the same page each have their own.
 */
export declare function useFlow(): FlowInstance;
//# sourceMappingURL=useFlow.d.ts.map