export type DiagramType =
  | "bpmn"
  | "er"
  | "orgchart"
  | "architecture"
  | "sequence"
  | "flowchart";

export interface Column {
  name: string;
  type: string;
  isPrimaryKey?: boolean;
  isForeignKey?: boolean;
  isNullable?: boolean;
  isUnique?: boolean;
  references?: string;
}

export interface DiagramNode {
  id: string;
  type: string;
  tag?: string;
  label: string;
  icon?: string;
  color?: string;
  w?: number;
  position?: { x: number; y: number };
  manuallyPositioned?: boolean;
  lane?: string;
  group?: string;
  columns?: Column[];
  lifeline?: boolean;
  parentId?: string;
}

export interface DiagramEdge {
  id: string;
  from: string;
  to: string;
  label?: string;
  color?: string;
  type?: string;
  cardinality?: string;
}

export interface DiagramMeta {
  version: string;
  title: string;
  description?: string;
  diagramType: DiagramType;
  layoutDirection?: "DOWN" | "RIGHT" | "LEFT" | "UP";
  edgeRouting?: "ORTHOGONAL" | "SPLINES" | "POLYLINE";
}

export interface GraphData {
  meta?: DiagramMeta;
  nodes: DiagramNode[];
  edges: DiagramEdge[];
  pools?: Array<{
    id: string;
    label: string;
    lanes: Array<{ id: string; label: string }>;
  }>;
  groups?: Array<{ id: string; label: string; color?: string }>;
}
