import { ISystem, ISystemConstructor } from './system'; export interface IEntity { id?: string; is?: string; has?: { [key: string]: IEntity; }; [key: string]: any; } export interface IAction { type: string; from?: string; [key: string]: any; } export interface IActionSet extends IAction { type: 'SET'; entityId: string; component: string; data: any; } export declare const DoSet: (entityId: string, component: string, data: any) => IActionSet; export declare const DoCreate: (newId: string, data: IEntity) => IAction; export declare const DoDestroy: (entityId: string) => IAction; export interface IStateConfig { systems: { [key: string]: ISystemConstructor; }; components: { [key: string]: any; }; ticker: (callback: () => void) => void; } export declare class State { running: boolean; systems: { [key: string]: ISystem; }; private actions; private nextActions; private map; private config; private clock; private configValues; private configHandlers; constructor(config: IStateConfig); dispatch(action: IAction, next?: boolean): void; get(key: string): Promise; raw(key: string): IEntity; set(key: string, entity: IEntity): void; reset(): Promise; start(): void; stop(): void; load(key: string, entity: IEntity): Promise; delete(entity: IEntity | string): Promise; toJSON(): any[]; action(actionKey: string): IAction[]; loadGame(gameData: any): Promise; fireComponent(entityId: string, component: string): Promise; private stopSystem(key); private updateSystem(key, value); private tick(); private fire(key, deleted?); private expandEntity(e, expand?); }