///
import { PacketMap } from '@realmlib/net';
import { EventEmitter } from 'events';
import { Client, LibraryManager, ResourceManager } from '../core';
import { Account } from '../models';
import { AccountService } from '../services';
import { Environment } from './environment';
/**
* An object which can be provided to the runtime when running.
*/
interface Arguments {
[argName: string]: unknown;
}
/**
* The runtime manages clients, resources, plugins and any other services
* which are used by an nrelay project.
*/
export declare class Runtime extends EventEmitter {
readonly env: Environment;
readonly accountService: AccountService;
readonly resources: ResourceManager;
readonly libraryManager: LibraryManager;
/**
* A bidirectional map of packet ids.
*/
packetMap: PacketMap;
buildVersion: string;
clientToken: string;
args: Arguments;
private logStream;
private readonly clients;
constructor(environment: Environment);
/**
* Starts this runtime.
* @param args The arguments to start the runtime with.
*/
run(args: Arguments): Promise;
/**
* Creates a new client which uses the provided account.
* @param account The account to login to.
*/
addClient(account: Account): Promise;
/**
* Removes the client with the given `guid` from this runtime.
* @param guid The guid of the client to remove.
*/
removeClient(guid: string): void;
/**
* Gets a copy of the clients in this runtime.
* Modifying this list will not affect the runtime.
*/
getClients(): Client[];
/**
* Updates the build version stored in the versions.json file.
* @param buildVersion The new build version to store.
*/
updateBuildVersion(buildVersion: string): void;
/**
* Creates a log file for this runtime.
*/
private createLog;
}
export {};