import { type CSSProperties, type PointerEvent, type ReactNode } from "react";
import type { ConnectEndState, Connection, ConnectStartParams, EdgeChange, NodeChange, Viewport, WorkflowEdge, WorkflowNode } from "../../editor";
import { type FlowInstance } from "../../hooks/useFlow";
import { type NodeKindRegistry } from "../FlowNode/nodeKinds";
import { type BuiltInNodeData } from "../kinds";
export interface FlowCanvasProps {
    nodes: WorkflowNode[];
    edges: WorkflowEdge[];
    onNodesChange?: (changes: NodeChange[]) => void;
    onEdgesChange?: (changes: EdgeChange[]) => void;
    viewport?: Viewport;
    defaultViewport?: Viewport;
    onViewportChange?: (viewport: Viewport) => void;
    minZoom?: number;
    maxZoom?: number;
    nodeKinds?: NodeKindRegistry;
    onConnect?: (connection: Connection) => void;
    onConnectStart?: (event: PointerEvent | globalThis.PointerEvent, params: ConnectStartParams) => void;
    onConnectEnd?: (event: PointerEvent | globalThis.PointerEvent, state: ConnectEndState) => void;
    isValidConnection?: (connection: Connection) => boolean;
    onSelectionChange?: (selection: {
        nodes: WorkflowNode[];
        edges: WorkflowEdge[];
    }) => void;
    onPaneClick?: () => void;
    onNodeClick?: (node: WorkflowNode) => void;
    onEdgeClick?: (edge: WorkflowEdge) => void;
    /** Double-clicking an edge label opens an inline editor; commit fires
     *  this callback. When omitted, labels are not editable. */
    onEdgeLabelChange?: (id: string, label: string) => void;
    /** Fires once when the canvas mounts. Hand-off for the imperative
     *  instance — consumers store it to call `fitView`, `addNodes`, etc. */
    onInit?: (instance: FlowInstance) => void;
    /** Async veto for deletions. Return `false` (or a Promise resolving
     *  false) to block. Fires from `instance.deleteElements`, Backspace,
     *  and the edge X button. */
    onBeforeDelete?: (params: {
        nodes: WorkflowNode[];
        edges: WorkflowEdge[];
    }) => boolean | Promise<boolean>;
    /** Right-click on a node. Consumer must `preventDefault()` to suppress
     *  the browser's native menu. */
    onNodeContextMenu?: (event: React.MouseEvent, node: WorkflowNode) => void;
    /** Right-click on an edge. */
    onEdgeContextMenu?: (event: React.MouseEvent, edge: WorkflowEdge) => void;
    /** Right-click on the empty pane. */
    onPaneContextMenu?: (event: React.MouseEvent) => void;
    nodesDraggable?: boolean;
    nodesConnectable?: boolean;
    panOnDrag?: boolean;
    zoomOnScroll?: boolean;
    /**
     * Trackpad / touch behaviour preset.
     *
     *   - `"mouse"` (default): mouse-first. Drag the pane to pan;
     *     wheel zooms; pinch zooms.
     *   - `"trackpad"`: two-finger trackpad scroll pans; pinch zooms;
     *     wheel-with-Ctrl zooms. Drag the pane is still pan (`panOnDrag`).
     *   - `"touch"`: same as trackpad but with enlarged hit areas (44 px
     *     on coarse pointers via `@media (pointer: coarse)`) and no pan
     *     on plain drag — single-finger drag selects, two-finger pans.
     *
     * Override individual policies (`panOnDrag`, `zoomOnScroll`, etc.)
     * after picking a preset to fine-tune.
     */
    preset?: "mouse" | "trackpad" | "touch";
    /** Pixels of pointer travel during a pane-press before it stops counting
     *  as a click (used to decide whether to clear selection on pointerup). */
    paneClickDistance?: number;
    /**
     * Whether a click on the empty canvas pane clears the current node /
     * edge selection. Defaults to `true` (the design-tool standard:
     * "click background to deselect"). Set to `false` when selection
     * should persist through pane clicks — e.g. when a side ConfigPanel
     * stays open until the user dismisses it explicitly.
     *
     * `onPaneClick` still fires regardless; this only controls whether
     * the canvas also clears its internal selection state.
     */
    paneClickClearsSelection?: boolean;
    /** Background grid style. Defaults to `"dots"`. */
    background?: "dots" | "lines" | "cross" | "none";
    /** Grid pitch in flow-space pixels. Defaults to 20. Also used for snap. */
    gridSize?: number;
    /** Snap node positions to the grid on drag-end. Defaults to false. */
    snapToGrid?: boolean;
    /**
     * Minimum gap (px) between sibling nodes during drag. When >= 0, a
     * dragged node is "magnet snapped" so it stays at least `nodeCollisionGap`
     * pixels from every other sibling — siblings share the same `parentId`
     * (or are both top-level). `0` means "no overlap allowed, zero buffer."
     * Pass `-1` (the default) to disable collision avoidance entirely.
     */
    nodeCollisionGap?: number;
    /**
     * Same as `nodeCollisionGap` but applied to subflow containers
     * (`type === "group" | "forEach"`). Lets you keep groups visually
     * separated without applying the rule to the action nodes inside.
     * Default falls back to `nodeCollisionGap`.
     */
    subflowCollisionGap?: number;
    height?: number | string;
    width?: number | string;
    className?: string;
    style?: CSSProperties;
    children?: ReactNode;
    emptyState?: ReactNode;
}
export declare function FlowCanvas({ nodes, edges, onNodesChange, onEdgesChange, viewport: controlledViewport, defaultViewport, onViewportChange, minZoom, maxZoom, nodeKinds, onConnect, onConnectStart, onConnectEnd, isValidConnection, onSelectionChange, onPaneClick, onNodeClick, onEdgeClick, onEdgeLabelChange, onInit, onBeforeDelete, onNodeContextMenu, onEdgeContextMenu, onPaneContextMenu, nodesDraggable, nodesConnectable, panOnDrag: panOnDragProp, zoomOnScroll: zoomOnScrollProp, preset, paneClickDistance, paneClickClearsSelection, background, gridSize, snapToGrid, nodeCollisionGap, subflowCollisionGap, height, width, className, style, children, emptyState, }: FlowCanvasProps): import("react/jsx-runtime").JSX.Element;
export type { BuiltInNodeData };
//# sourceMappingURL=FlowCanvas.d.ts.map