📄 src/lib/types.ts
export interface BirdLabel {
  scientificName: string;
  commonName: string;
}

export interface Prediction {
  labelIndex: number;
  confidence: number;
}

export interface HistoryEntry {
  labelIndex: number;
  confidence: number;
  detectedAt: string; // ISO 8601
}

export type WorkerInMessage =
  | { type: "init" }
  | { type: "analyze"; samples: Float32Array };

export type WorkerOutMessage =
  | { type: "ready" }
  | { type: "error"; message: string }
  | { type: "results"; predictions: Prediction[] };