import type { CSSProperties } from "react";
export interface Position {
    x: number;
    y: number;
}
export interface Dimensions {
    width: number;
    height: number;
}
export interface Rect {
    x: number;
    y: number;
    width: number;
    height: number;
}
export interface Viewport {
    x: number;
    y: number;
    zoom: number;
}
export type HandleType = "source" | "target";
export type HandlePosition = "top" | "right" | "bottom" | "left";
export type BuiltInNodeKind = "action" | "trigger" | "condition" | "loop" | "parallel" | "wait" | "output" | "error" | "group" | "sticky";
export type NodeKind = BuiltInNodeKind | string;
export interface WorkflowNode<TData = unknown> {
    id: string;
    /** Registry key — `"action"` etc., or any custom string. */
    type: NodeKind;
    /** Always absolute flow-space coordinates (see ADR-003). */
    position: Position;
    /** Consumer payload — the node renderer reads from `data`. */
    data: TData;
    selected?: boolean;
    dragging?: boolean;
    hidden?: boolean;
    width?: number;
    height?: number;
    isConnectable?: boolean;
    parentId?: string;
    extent?: "parent" | [Position, Position];
    zIndex?: number;
    sourcePosition?: HandlePosition;
    targetPosition?: HandlePosition;
    ariaLabel?: string;
    className?: string;
    style?: CSSProperties;
}
export type BuiltInEdgeKind = "default" | "conditional" | "loop" | "error" | "straight" | "smoothstep";
export type EdgeKind = BuiltInEdgeKind | string;
/**
 * Visual routing for the edge path. Independent of `edge.type` (which
 * carries semantics like conditional / error). Defaults to "bezier".
 */
export type EdgeRouting = "bezier" | "step" | "smoothstep" | "straight";
export interface WorkflowEdge<TData = unknown> {
    id: string;
    source: string;
    target: string;
    sourceHandle?: string;
    targetHandle?: string;
    /** Semantic type — drives stroke colour and dash pattern. */
    type?: EdgeKind;
    /** Visual path routing — bezier (default), step, smoothstep, straight. */
    routing?: EdgeRouting;
    data?: TData;
    selected?: boolean;
    animated?: boolean;
    hidden?: boolean;
    label?: string;
    zIndex?: number;
    /** Hit area width — default 16 px on mouse, 32 px on coarse pointers. */
    interactionWidth?: number;
    ariaLabel?: string;
    className?: string;
    style?: CSSProperties;
}
export interface Connection {
    source: string;
    target: string;
    sourceHandle?: string | null;
    targetHandle?: string | null;
}
export interface ConnectStartParams {
    nodeId: string;
    handleId: string | null;
    handleType: HandleType;
}
export interface ConnectEndState {
    /** Was the gesture cancelled (no valid target)? */
    cancelled: boolean;
    /** Pixel position where the user released the pointer (screen coords). */
    position: Position;
    /** Same position in flow coordinates. Useful for "drop on canvas to spawn a node." */
    flowPosition: Position;
    /** The handle the drag started from. */
    from: ConnectStartParams;
    /** The handle the drag landed on, if any. */
    to?: ConnectStartParams;
}
export type NodeChange<TData = unknown> = {
    type: "add";
    item: WorkflowNode<TData>;
} | {
    type: "remove";
    id: string;
} | {
    type: "position";
    id: string;
    position: Position;
    dragging: boolean;
} | {
    type: "dimensions";
    id: string;
    dimensions: Dimensions;
} | {
    type: "select";
    id: string;
    selected: boolean;
} | {
    type: "replace";
    id: string;
    item: WorkflowNode<TData>;
};
export type EdgeChange<TData = unknown> = {
    type: "add";
    item: WorkflowEdge<TData>;
} | {
    type: "remove";
    id: string;
} | {
    type: "select";
    id: string;
    selected: boolean;
} | {
    type: "replace";
    id: string;
    item: WorkflowEdge<TData>;
};
export interface SelectionState {
    nodes: WorkflowNode[];
    edges: WorkflowEdge[];
}
export interface FlowStoreSnapshot {
    nodes: WorkflowNode[];
    edges: WorkflowEdge[];
    viewport: Viewport;
    selectedNodeIds: ReadonlySet<string>;
    selectedEdgeIds: ReadonlySet<string>;
    /** In-flight connection drag, if any. */
    connection: ConnectStartParams | null;
}
export interface FitViewOptions {
    padding?: number;
    maxZoom?: number;
    minZoom?: number;
    duration?: number;
    /** Restrict to a subset of nodes. */
    nodes?: {
        id: string;
    }[];
}
export type LayoutDirection = "TB" | "BT" | "LR" | "RL";
export interface LayoutOptions {
    direction?: LayoutDirection;
    nodeSpacing?: number;
    rankSpacing?: number;
    /** Engine-specific options (typed escape hatch). */
    engine?: Record<string, unknown>;
}
export interface LayoutEngine {
    name: string;
    /**
     * Compute new positions. Engines may skip nodes (e.g. those with
     * `data.layoutLocked`); the caller patches only the returned ids.
     */
    layout(nodes: WorkflowNode[], edges: WorkflowEdge[], options?: LayoutOptions): Promise<{
        id: string;
        position: Position;
    }[]>;
}
//# sourceMappingURL=editor.d.ts.map