import { IEntity } from "../entity.spec" ; import { TTypeProto } from "../_.spec" ; import { ISerialFormat } from "../serde/serial-format.spec" ; import { TDeserializer , TSerDeOptions } from "../serde/serde.spec" ; import { IWorld , TGroupHandle } from "../world.spec" ; import { IIStateProto } from "../state.spec" ; import { ICommandEntityBuilder } from "./command-entity-builder.spec" ; import { TCommand } from "./commands-aggregator.spec" ; /**
 * Commands is an async interface, which aggregates commands for later execution.
 * The primary usage is to issue commands during system runtime and have them take effect on a common sync point,
 * like after all systems ran
 */ export interface ICommands { param entity addEntity ( entity ) : void ; param type param args addResource < T extends Object > ( type , ... args ) : T ; /**
     * Build an entity and add it to this world using an entity builder
     */ buildEntity ( ) : ICommandEntityBuilder ; /**
     * Remove all entities from this world
     */ clearEntities ( ) : void ; param prefab param options load ( prefab , options ? ) : TGroupHandle ; /**
     * Also trigger a maintain on the next execution
     */ maintain ( ) : void ; param world merge ( world ) : TGroupHandle ; /**
     * Revert the running world to a previous state
     */ popState ( ) : void ; param NewState pushState ( NewState ) : void ; param command queueCommand ( command ) : void ; param entity removeEntity ( entity ) : void ; param type removeResource < T extends Object > ( type ) : void ; param type param args replaceResource < T extends Object > ( type , ... args ) : void ; /**
     * Signal the world to stop its dispatch-loop
     */ stopRun ( ) : void ; param handle unloadPrefab ( handle ) : void ; }