/**
 * TypeScript 类型定义
 */

// 用户类型
export interface User {
  id: string
  username: string
  email: string
  role: string
  created_at?: string
  updated_at?: string
}

// 工作流节点类型
export interface WorkflowNode {
  id: string
  type: string
  position: { x: number; y: number }
  data: Record<string, any>
}

// 工作流边类型
export interface WorkflowEdge {
  id: string
  source: string
  target: string
  sourceHandle?: string
  targetHandle?: string
}

// 工作流类型
export interface Workflow {
  id: string
  name: string
  description?: string
  nodes: WorkflowNode[]
  edges: WorkflowEdge[]
  version: number
  status: 'draft' | 'published' | 'running' | 'stopped'
  user_id: string
  created_at: string
  updated_at: string
}

// API响应类型
export interface ApiResponse<T = any> {
  code?: number
  message?: string
  data: T
  timestamp?: string
}
