import * as zustand from 'zustand';
import { Node, Edge } from '@xyflow/react';
import { L as LayoutDirection } from './layout-engine-YZcVr20M.js';

type GraphSnapshot = {
    nodes: Node[];
    edges: Edge[];
};
type CanvasControlMode = 'pointer' | 'hand';
type ContextMenuState = {
    type: 'node' | 'edge' | 'panel';
    position: {
        x: number;
        y: number;
    };
    targetId?: string;
} | null;
type NodeRunResult = {
    status: 'pending' | 'running' | 'success' | 'error';
    data?: unknown;
    error?: string;
    durationMs?: number;
};

type WorkflowStoreState = {
    nodes: Node[];
    edges: Edge[];
    past: GraphSnapshot[];
    future: GraphSnapshot[];
    clipboard: GraphSnapshot | null;
    editingNodeId: string | null;
    contextMenu: ContextMenuState;
    controlMode: CanvasControlMode;
    layoutDirection: LayoutDirection;
    showVariableInspector: boolean;
    showVersionHistory: boolean;
    showRunPanel: boolean;
    showMinimap: boolean;
    showDots: boolean;
    showShortcuts: boolean;
    cardDisplayMode: 'detailed' | 'compact';
    isRunning: boolean;
    nodeResults: Record<string, NodeRunResult>;
    selectedRunId: string | null;
    previewPanelOpen: boolean;
};
type WorkflowStoreActions = {
    setNodes: (updater: Node[] | ((nodes: Node[]) => Node[])) => void;
    setEdges: (updater: Edge[] | ((edges: Edge[]) => Edge[])) => void;
    takeSnapshot: () => void;
    undo: () => void;
    redo: () => void;
    copy: () => void;
    paste: (offset?: number) => void;
    selectAll: () => void;
    deselectAll: () => void;
    setEditingNodeId: (nodeId: string | null) => void;
    setContextMenu: (menu: ContextMenuState) => void;
    setControlMode: (mode: CanvasControlMode) => void;
    setLayoutDirection: (direction: LayoutDirection) => void;
    toggleVariableInspector: () => void;
    toggleVersionHistory: () => void;
    toggleRunPanel: () => void;
    toggleMinimap: () => void;
    toggleDots: () => void;
    toggleShortcuts: () => void;
    closeShortcuts: () => void;
    toggleCardDisplayMode: () => void;
    setIsRunning: (running: boolean) => void;
    setNodeResult: (nodeId: string, result: NodeRunResult) => void;
    clearNodeResults: () => void;
    setSelectedRunId: (runId: string | null) => void;
    togglePreviewPanel: () => void;
    reset: () => void;
};
type WorkflowStore = WorkflowStoreState & WorkflowStoreActions;
declare const useWorkflowStore: zustand.UseBoundStore<zustand.StoreApi<WorkflowStore>>;

export { type NodeRunResult as N, type WorkflowStore as W, useWorkflowStore as u };
