import { Node, Edge } from '@xyflow/react'; // Node/Actor Types export interface ActorData extends Record { label: string; type: string; description?: string; labels?: string[]; // Array of LabelConfig IDs citations?: string[]; // Array of bibliography reference IDs metadata?: Record; } export type Actor = Node; // Edge/Relation Types export type EdgeDirectionality = 'directed' | 'bidirectional' | 'undirected'; export interface RelationData extends Record { label?: string; type: string; directionality?: EdgeDirectionality; strength?: number; labels?: string[]; // Array of LabelConfig IDs citations?: string[]; // Array of bibliography reference IDs metadata?: Record; } export type Relation = Edge; // Node Shape Types export type NodeShape = | 'rectangle' | 'circle' | 'roundedRectangle' | 'ellipse' | 'pill'; // Node Type Configuration export interface NodeTypeConfig { id: string; label: string; color: string; shape: NodeShape; icon?: string; description?: string; } // Edge Type Configuration export interface EdgeTypeConfig { id: string; label: string; color: string; style?: 'solid' | 'dashed' | 'dotted'; description?: string; defaultDirectionality?: EdgeDirectionality; } // Label Configuration export type LabelScope = 'actors' | 'relations' | 'both'; export interface LabelConfig { id: string; name: string; color: string; appliesTo: LabelScope; description?: string; } // Tangible Configuration export type TangibleMode = 'filter' | 'state' | 'stateDial'; export interface TangibleConfig { id: string; // Internal unique identifier (auto-generated from name) name: string; mode: TangibleMode; description?: string; hardwareId?: string; // Hardware token/device ID (editable, must be unique if present) filterLabels?: string[]; // For filter mode: array of LabelConfig IDs stateId?: string; // For state/stateDial mode: ConstellationState ID } // Group Types export interface GroupData extends Record { label: string; description?: string; color: string; actorIds: string[]; minimized?: boolean; metadata?: Record; } export type Group = Node; // Graph State export interface GraphState { nodes: Actor[]; edges: Relation[]; groups: Group[]; nodeTypes: NodeTypeConfig[]; edgeTypes: EdgeTypeConfig[]; labels: LabelConfig[]; tangibles: TangibleConfig[]; } // 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; addLabel: (label: LabelConfig) => void; updateLabel: (id: string, updates: Partial>) => void; deleteLabel: (id: string) => void; addTangible: (tangible: TangibleConfig) => void; updateTangible: (id: string, updates: Partial>) => void; deleteTangible: (id: string) => void; setTangibles: (tangibles: TangibleConfig[]) => void; addGroup: (group: Group) => void; updateGroup: (id: string, updates: Partial) => void; deleteGroup: (id: string, ungroupActors?: boolean) => void; addActorToGroup: (actorId: string, groupId: string) => void; removeActorFromGroup: (actorId: string, groupId: string) => void; toggleGroupMinimized: (groupId: string) => void; clearGraph: () => void; setNodes: (nodes: Actor[]) => void; setEdges: (edges: Relation[]) => void; setGroups: (groups: Group[]) => void; setNodeTypes: (nodeTypes: NodeTypeConfig[]) => void; setEdgeTypes: (edgeTypes: EdgeTypeConfig[]) => void; setLabels: (labels: LabelConfig[]) => 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[]; groups?: Group[]; nodeTypes: NodeTypeConfig[]; edgeTypes: EdgeTypeConfig[]; labels?: LabelConfig[]; tangibles?: TangibleConfig[] }) => void; } export interface EditorActions { updateSettings: (settings: Partial) => void; } // Re-export workspace types export type { WorkspaceSettings } from '../stores/workspace/types';