/**
 * 3D 态势感知系统类型定义
 */

/**
 * 坐标点
 */
export interface Coordinate {
  lon: number
  lat: number
}

/**
 * Cartesian3 坐标
 */
export interface Cartesian3Coordinate {
  x: number
  y: number
  z: number
}

/**
 * 相机视角配置
 */
export interface CameraView {
  lon?: number
  lat?: number
  height: number
  heading: number
  pitch: number
  roll: number
}

/**
 * 人员点位数据
 */
export interface PersonnelPoint {
  type: 'soldier'
  name: string
  department: string
  lon: number
  lat: number
  distance: number
  estimatedArrival: string
  location?: string
}

/**
 * 设备点位数据
 */
export interface DevicePoint {
  type: 'device'
  name: string
  deviceType: string
  lon: number
  lat: number
  distance: number
  estimatedArrival: string
  location?: string
}

/**
 * 动画路径数据
 */
export interface AnimationPath {
  startPoint: Cartesian3Coordinate
  waypoints: Cartesian3Coordinate[]
  metadata: {
    type: 'soldier' | 'device'
    name: string
    department?: string
    deviceType?: string
  }
}

/**
 * Tooltip 字段
 */
export interface TooltipField {
  label: string
  value: string
}

/**
 * Tooltip 操作按钮
 */
export interface TooltipAction {
  label: string
  type: 'link' | 'connect' | 'view'
  data: any
}

/**
 * Tooltip 数据
 */
export interface TooltipData {
  fields: TooltipField[]
  actions?: TooltipAction[]
  supportVideo?: boolean
  videoTitle?: string
  videoSrc?: string
}

/**
 * Tooltip 状态
 */
export interface TooltipState {
  visible: boolean
  x: number
  y: number
  title: string
  icon: string
  zIndex: number
  data: TooltipData | null
}

/**
 * 视频监控数据
 */
export interface VideoMonitor {
  id: string
  title: string
  videoSrc: string
  dateRange: string
  hasMegaphone: boolean
  hasAudio: boolean
  hasDirectionControl: boolean
}

/**
 * 人员详情
 */
export interface PersonnelDetail {
  name: string
  department: string
  distance: number
  estimatedArrival: number
  avatar: string | null
}

/**
 * 应急中心详情
 */
export interface EmergencyCenterDetail {
  name: string
  adminLevel: string
  department: string
  distance: number
  image: string | null
}

/**
 * 灾害信息
 */
export interface DisasterInfo {
  type: string
  volume: number
  length: number
  width: number
  casualties: number
  location: string
}

/**
 * 力量预置信息
 */
export interface ForcePreset {
  equipment: number
  emergencyBases: number
  personnel: number
  searchRadius: number
  stations: any[]
}

/**
 * 力量调度信息
 */
export interface ForceDispatch {
  responseLevel: string
  estimatedClearTime: string
  plan: string
}

/**
 * 协同信息
 */
export interface CollaborationInfo {
  weatherWarning: any
  publicSecurity: any
  mediaCenter: any
}

/**
 * 图标配置
 */
export interface IconConfig {
  soldierIcon: string
  deviceIcon: string
  emergencyCenterIcon: string
  emergencyBaseIcon: string
  reserveCenterIcon: string
}

/**
 * 范围圈样式配置
 */
export interface RangeCircleStyle {
  fillColor: string
  fillAlpha: number
  outlineColor: string
  outlineAlpha: number
  outlineWidth: number
}

/**
 * 动画配置
 */
export interface AnimationConfig {
  duration: number
  loadingDuration: number
  cameraFlyDuration: number
  cameraPadding: number
}

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

/**
 * 应急资源响应数据
 */
export interface EmergencyResourcesResponse {
  stations: any[]
  equipment: number
  emergencyBases: number
  personnel: number
}

/**
 * 储备中心和预置点响应数据
 */
export type ReserveCentersResponse = any[]
