/**
 * API 响应基础结构
 */
export interface ApiResponse<T = unknown> {
  success: boolean;
  data?: T;
  message?: string;
  error?: {
    code: string;
    message: string;
    details?: unknown;
  };
}

/**
 * 分页请求参数
 */
export interface PaginationQuery {
  page?: number;
  pageSize?: number;
}

/**
 * 分页响应数据
 */
export interface PaginatedData<T> {
  items: T[];
  total: number;
  page: number;
  pageSize: number;
  totalPages: number;
}

/**
 * WebSocket 消息类型
 */
export type WebSocketMessageType = 
  | 'auth'
  | 'auth:success'
  | 'auth:error'
  | 'account:added'
  | 'account:updated'
  | 'account:deleted'
  | 'task:created'
  | 'task:status_changed'
  | 'task:progress'
  | 'comment:new'
  | 'comment:replied'
  | 'analytics:updated'
  | 'ping'
  | 'pong';

/**
 * WebSocket 消息
 */
export interface WebSocketMessage<T = unknown> {
  type: WebSocketMessageType;
  payload?: T;
  timestamp: number;
}

/**
 * 服务器健康检查响应
 */
export interface HealthCheckResponse {
  status: 'ok' | 'error';
  version: string;
  uptime: number;
  timestamp: string;
}

/**
 * 系统配置
 */
export interface SystemConfig {
  allowRegistration: boolean;
  defaultUserRole: string;
  maxUploadSize: number;
  supportedPlatforms: string[];
}
