import { CurrentPlayerValidation, Store, StoreContainer } from '../shared/interface'; import { HiddenObjectContainer } from './hiddenObjectsContainer'; import { Component, ComponentConstructor } from './games'; import { GroupEmitter, IServer } from './interface'; import { GameOptions, StandardGameAction } from '../shared/standardActions'; interface IGenericComponent { afterActionApplied(ctx: GroupEmitter, action: Action | StandardGameAction): void; container: StoreContainer; afterActionCallback?: (ctx: GroupEmitter, action: Action | StandardGameAction) => void; } export interface IAction { type: string; } interface ComponentData { game: IGenericComponent; hiddenObjects?: HiddenObjectContainer; } type AfterActionType = (store: Store, id: number, ctx: GroupEmitter, action: ActionType | StandardGameAction) => void; export declare class ComponentContainer { protected hasHiddenState: boolean; constructor(type: string, hasHiddenState?: boolean); createComponent(container: StoreContainer, options: GameOptions, afterAction?: AfterActionType): (id: number) => Component; getContainer(id: number): StoreContainer; protected get(id: number): ComponentData; sendServerAction(ctx: GroupEmitter, gameId: number, action: ActionType): void; registerServerWithCreation(server: IServer, storeConstructor: () => StoreContainer, settings: ICreationSettings): void; registerServer(server: IServer): void; protected beforeActionAplied(_ctx: GroupEmitter, _gameId: number, _action: ActionType | StandardGameAction, _validation: CurrentPlayerValidation): void; private applyAction; type: string; } export declare function registerGame(server: IServer, type: string, storeConstructor: () => StoreContainer, settings: ICreationSettings): void; export interface ICreationSettings { components?: ComponentConstructor[]; afterAction?: AfterActionType; timeout?: number; hasHiddenState?: boolean; } export {};