import type { Song } from '../../features/song-select/types'
import type { LetterGrade } from '../../lib/judgmentGrade'

export type GameStatsState = {
  currentSong: Song | null
  perfectHits: number
  goodHits: number
  misses: number
  score: number
  computedGrade: number
  computedGradeLetter: LetterGrade
}

export type GameStatsActions = {
  setCurrentSong: (song: Song | null) => void
  setScore: (score: number) => void
  addScore: (amount: number) => void
  addPerfectHit: () => void
  addGoodHit: () => void
  addMiss: () => void
  setJudgments: (stats: { perfectHits: number; goodHits: number; misses: number }) => void
  resetStats: () => void
  resetAll: () => void
}

export type GameStatsStore = GameStatsState & GameStatsActions
