export type OTAStatus =
  | "INSTALLED" // Green Check
  | "INVALID"
  | "MISSING"
  | "STAGED"; // Green Half Check

export interface OTAArtifactInfo {
  hash: string;
  identifier: string;
  miniHash: string;
  name?: string;
  size: number;
  version?: string;
}

export interface OTARequest {
  currentSize: number;
  downloaderActive: boolean;
  downloaderName: string;
  errorCount: number;
  fileNotFoundCount: number;
  kabId: string;
  lastErrorReason?: string;
  lastUpdateTime: number;
}

export interface OTAArtifactResponse {
  artifactInfo?: OTAArtifactInfo;
  done: boolean;
  error?: string;
  requests: Record<string, OTARequest>;
  status: OTAStatus;
}

export type UpdaterStatus =
  | "downloading"
  | "error"
  | "idle"
  | "pending"
  | "ready";

export interface UpdaterItem {
  manifest?: boolean;
  error?: string;
  errorCount?: number;
  id: string;
  label?: string;
  name?: string;
  progress?: number;
  size?: number;
  status: UpdaterStatus;
}

export interface UpdaterOptions {
  otaArtifactResponse: OTAArtifactResponse[];
}
