import { LocalActions , BotAction , StateUpdatedEvent , RuntimeStateVersion , } from '@casual-simulation/aux-common' ; import { StatusUpdate , DeviceAction , CurrentVersion , VersionVector , } from '@casual-simulation/causal-trees' ; import { AuxConfig } from './AuxConfig' ; import { AuxChannelErrorType } from './AuxChannelErrorTypes' ; import { AuxUser } from '../AuxUser' ; import { Observable , SubscriptionLike } from 'rxjs' ; import { StoredAux } from '../StoredAux' ; /**
 * Defines an interface for the static members of an AUX.
 */ export interface AuxStatic { /**
     * Creates a new AUX using the given config.
     */ new ( defaultHost , user , config ) : AuxChannel ; } /**
 * Defines an interface for an AUX.
 * That is, a channel that interfaces with the AUX bot format in realtime.
 */ export interface AuxChannel extends SubscriptionLike { /**
     * The observable that should be triggered whenever a device event is sent to the AUX.
     */ onDeviceEvents : Observable < DeviceAction [ ] > ; /**
     * The observable that should be triggered whenever a local event is emitted from the AUX.
     */ onLocalEvents : Observable < LocalActions [ ] > ; /**
     * The observable that should be triggered whenever the bots state is updated.
     */ onStateUpdated : Observable < StateUpdatedEvent > ; /**
     * The observable that should be triggered whenever the state version updated.
     */ onVersionUpdated : Observable < RuntimeStateVersion > ; /**
     * The observable that should be triggered whenever the connection state changes.
     */ onConnectionStateChanged : Observable < StatusUpdate > ; /**
     * The observable that is resolved whenever an error occurs.
     */ onError : Observable < AuxChannelErrorType > ; param onLocalEvents param onDeviceEvents param onStateUpdated param onConnectionStateChanged param onError init ( onLocalEvents ? , onDeviceEvents ? , onStateUpdated ? , onVersionUpdated ? , onConnectionStateChanged ? , onError ? ) : Promise < void > ; param onLocalEvents param onDeviceEvents param onStateUpdated param onConnectionStateChanged param onError initAndWait ( onLocalEvents ? , onDeviceEvents ? , onStateUpdated ? , onVersionUpdated ? , onConnectionStateChanged ? , onError ? ) : Promise < void > ; param onLocalEvents param onDeviceEvents param onStateUpdated param onConnectionStateChanged param onError registerListeners ( onLocalEvents ? , onDeviceEvents ? , onStateUpdated ? , onVersionUpdated ? , onConnectionStateChanged ? , onError ? ) : Promise < void > ; 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 in use.
     */ getTags ( ) : Promise < string [ ] > ; } export interface ChannelActionResult { /**
     * The actions that were queued.
     */ actions : BotAction [ ] ; /**
     * The results from the scripts that were run.
     */ results : any [ ] ; }