Initial commit
This commit is contained in:
20
src/main/games/provider.ts
Normal file
20
src/main/games/provider.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { GameId, GameStat, GameStatus } from '@shared/types'
|
||||
|
||||
export type MatchEndPayload = {
|
||||
durationMs: number
|
||||
won?: boolean
|
||||
stats: Partial<Record<GameStat, number>>
|
||||
}
|
||||
|
||||
export type ProviderEventHandler = (event: { type: 'match_end'; payload: MatchEndPayload }) => void
|
||||
|
||||
export interface GameProvider {
|
||||
readonly id: GameId
|
||||
readonly displayName: string
|
||||
detect(): Promise<GameStatus>
|
||||
install(): Promise<void>
|
||||
uninstall(): Promise<void>
|
||||
start(emit: ProviderEventHandler): Promise<void>
|
||||
stop(): Promise<void>
|
||||
reconcile?(): Promise<void>
|
||||
}
|
||||
Reference in New Issue
Block a user