import Store from 'electron-store'
import type { AppSettings, TrackedGame } from '../shared/types'

export interface GameTrackingData {
  totalTime: number
  sessions: Array<{
    startTime: number
    endTime: number
    duration: number
  }>
  lastPlayed: number
}

export type StoreType = Store<{
  settings: AppSettings
  token: string | null
  trackedGames: Record<string, TrackedGame>
  trackingData: Record<string, GameTrackingData>
}>

// Extend Electron App type
declare global {
  namespace Electron {
    interface App {
      isQuitting?: boolean
    }
  }
}
