import { LocalActions , BotAction , StateUpdatedEvent , RuntimeStateVersion , } from '@casual-simulation/aux-common' ; import { StatusUpdate , DeviceAction } from '@casual-simulation/causal-trees' ; import { Observable } from 'rxjs' ; import { Initable } from '../managers/Initable' ; import { AuxChannelErrorType } from './AuxChannelErrorTypes' ; import { AuxUser } from '../AuxUser' ; import { StoredAux } from '../StoredAux' ; import { ChannelActionResult } from './AuxChannel' ; /**
 * Defines an interface for an AUX that is run inside a virtual machine.
 */ export interface AuxVM extends Initable { /**
     * The ID of the simulation that the VM is running.
     */ id : string ; /**
     * Gets the observable list of local events from the simulation.
     */ localEvents : Observable < LocalActions [ ] > ; /**
     * Gets the observable list of device events from the simulation.
     */ deviceEvents : Observable < DeviceAction [ ] > ; /**
     * Gets the observable list of state updates from the simulation.
     */ stateUpdated : Observable < StateUpdatedEvent > ; /**
     * Gets the observable list of version updates from the simulation.
     */ versionUpdated : Observable < RuntimeStateVersion > ; /**
     * Gets an observable that resolves whenever the connection state changes.
     */ connectionStateChanged : Observable < StatusUpdate > ; /**
     * Gets an observable that resolves whenever an error occurs inside the VM.
     */ onError : Observable < AuxChannelErrorType > ; param user setUser ( user ) : Promise < void > ; param grant setGrant ( grant ) : Promise < void > ; param events sendEvents ( events ) : Promise < void > ; param eventName param botIds param arg shout ( eventName , botIds ? , arg ? ) : Promise < ChannelActionResult > ; param formulas formulaBatch ( formulas ) : Promise < void > ; param newId forkAux ( newId ) : Promise < void > ; param botIds exportBots ( botIds ) : Promise < StoredAux > ; /**
     * Exports the causal tree for the simulation.
     */ export ( ) : Promise < StoredAux > ; /**
     * Gets the list of tags that are currently in use.
     */ getTags ( ) : Promise < string [ ] > ; /**
     * Creates a new MessagePort that can be used to connect to the internal aux channel.
     */ createEndpoint ? ( ) : Promise < MessagePort > ; }