@casual-simulation/aux-vm-browser
Version:
A set of utilities required to securely run an AUX in a web browser.
44 lines • 2.33 kB
TypeScript
import type { PrecalculatedBot, PortalType } from '@casual-simulation/aux-common';
import type { BrowserSimulation } from './BrowserSimulation';
import type { Observable } from 'rxjs';
import type { BotWatcher, UpdatedBotInfo, BotHelper } from '@casual-simulation/aux-vm';
import type { PortalManager } from '@casual-simulation/aux-vm/managers';
import type { RemoteSimulation } from '@casual-simulation/aux-vm-client';
/**
* Gets an observable that resolves whenever the user bot for the given simulation changes.
* @param simulation The simulation.
*/
export declare function userBotChanged(simulation: BrowserSimulation): Observable<PrecalculatedBot>;
/**
* Gets an observable that resolves whenever the user bot for the given simulation changes.
* @param simulation The simulation.
*/
export declare function userBotTagsChanged(simulation: BrowserSimulation): Observable<UpdatedBotInfo>;
export declare function userBotChangedCore(botId: string, watcher: BotWatcher): Observable<UpdatedBotInfo>;
/**
* Gets the user bot for the given simulation asynchronously.
* @param simulation The simulation.
*/
export declare function getUserBotAsync(simulation: BrowserSimulation): Observable<PrecalculatedBot>;
/**
* Gets the config bot for the given portal.
* @param simulation The simulation.
* @param portal The portal.
*/
export declare function getPortalConfigBot(simulation: RemoteSimulation, portal: PortalType): PrecalculatedBot;
/**
* Watches the config bot for the given portal for changes.
* @param simulation The simulation.
* @param portal The portal.
* @param shouldRegisterBuiltinPortal Whether an event should be sent to register the given portal as a builtin portal.
*/
export declare function watchPortalConfigBot(simulation: RemoteSimulation, portal: PortalType, shouldRegisterBuiltinPortal?: boolean): Observable<PrecalculatedBot>;
/**
* Watches the config bot for the given portal for changes.
* @param watcher The bot watcher.
* @param portals The portal manager.
* @param helper The bot helper.
* @param portal The portal.
*/
export declare function watchPortalConfigBotCore(watcher: BotWatcher, portals: PortalManager, helper: BotHelper, portal: PortalType, shouldRegisterBuiltinPortal?: boolean): Observable<PrecalculatedBot>;
//# sourceMappingURL=BrowserSimulationCalculations.d.ts.map