import { Node, Edge } from 'reactflow'; // Node/Actor Types export interface ActorData { label: string; type: string; description?: string; metadata?: Record; } export type Actor = Node; // Edge/Relation Types export type EdgeDirectionality = 'directed' | 'bidirectional' | 'undirected'; export interface RelationData { label?: string; type: string; directionality?: EdgeDirectionality; strength?: number; metadata?: Record; } export type Relation = Edge; // Node Type Configuration export interface NodeTypeConfig { id: string; label: string; color: string; icon?: string; description?: string; } // Edge Type Configuration export interface EdgeTypeConfig { id: string; label: string; color: string; style?: 'solid' | 'dashed' | 'dotted'; description?: string; defaultDirectionality?: EdgeDirectionality; } // Graph State export interface GraphState { nodes: Actor[]; edges: Relation[]; nodeTypes: NodeTypeConfig[]; edgeTypes: EdgeTypeConfig[]; } // Editor Settings export interface EditorSettings { snapToGrid: boolean; showGrid: boolean; gridSize: number; panOnDrag: boolean; zoomOnScroll: boolean; } // Store Actions export interface GraphActions { addNode: (node: Actor) => void; updateNode: (id: string, updates: Partial) => void; deleteNode: (id: string) => void; addEdge: (edge: Relation) => void; updateEdge: (id: string, data: Partial) => void; deleteEdge: (id: string) => void; addNodeType: (nodeType: NodeTypeConfig) => void; updateNodeType: (id: string, updates: Partial>) => void; deleteNodeType: (id: string) => void; addEdgeType: (edgeType: EdgeTypeConfig) => void; updateEdgeType: (id: string, updates: Partial>) => void; deleteEdgeType: (id: string) => void; clearGraph: () => void; setNodes: (nodes: Actor[]) => void; setEdges: (edges: Relation[]) => void; setNodeTypes: (nodeTypes: NodeTypeConfig[]) => void; setEdgeTypes: (edgeTypes: EdgeTypeConfig[]) => void; // NOTE: exportToFile and importFromFile have been removed // Import/export is now handled by the workspace-level system (workspaceStore) loadGraphState: (data: { nodes: Actor[]; edges: Relation[]; nodeTypes: NodeTypeConfig[]; edgeTypes: EdgeTypeConfig[] }) => void; } export interface EditorActions { updateSettings: (settings: Partial) => void; }