import { EventBus } from '../utils/EventBus'; import { ErrorOpt } from './ErrorOpt'; export declare type PlayerCommand = { player: string; }; export declare type Reducer = (state: State, command: Command) => State; export declare class StateHandler { state: State; stateBus: EventBus; reducer: Reducer; commandValidator: (state: State, command: Command) => ErrorOpt; commandBus: EventBus; constructor(initState: State, reducer: Reducer, commandValidator?: (state: State, command: Command) => ErrorOpt); receive(command: Command): ErrorOpt; setState(state: State): void; }