UNPKG

fcr-core

Version:

Core APIs for building online scenes

106 lines (105 loc) 3.22 kB
import { FcrCoreEngineConfig, FcrCoreEngineObserver } from '../type'; import { FcrMainRoomControl, FcrRoomJoinOptions, FcrWaitingRoomControl } from '../room-control/type'; import { FcrPeerSessionControl } from '../peer-session/type'; import { FcrMonitorControl } from '../monitor-control/type'; import { FcrDesktopMediaControl, FcrMobileMediaControl } from '../media-control/type'; import { FcrRoomRouter } from '../room-router/type'; export declare class FcrCoreEngine { constructor(config: FcrCoreEngineConfig); /** * Releases the engine and all its resources. */ release(): void; /** * Logins to the RTE service. */ login(): Promise<void>; /** * Logouts from the RTE service. */ logout(): Promise<void>; /** * Renews the user token. * @param token */ renewUserToken(token: string): void; /** * Gets the version of the SDK. * @returns The version of the SDK. */ getVersion(): string; getDependencyVersions(): Record<string, string>; /** * Creates a room control. * @param roomId * @returns The room control. */ createMainRoomControl(roomId: string): FcrMainRoomControl; /** * Creates a waiting room control. * @param roomId * @returns The room control. */ createWaitingRoomControl(roomId: string): FcrWaitingRoomControl; /** * Creates room router. * @param roomId * @returns The room router. */ createRoomRouter(roomId: string): FcrRoomRouter; /** * Creates a main room control or a waiting room control. * @param roomId * @returns The room control. */ createRoomControlAndJoin(roomId: string, options: FcrRoomJoinOptions): Promise<FcrMainRoomControl | FcrWaitingRoomControl>; /** * Gets the media control. * @returns The media control. */ getDesktopMediaControl(): FcrDesktopMediaControl; /** * Gets the mobile media control. * @returns The mobile media control. */ getMobileMediaControl(): FcrMobileMediaControl; /** * Gets the monitor control. * @returns The monitor control. */ getMonitorControl(): FcrMonitorControl; /** * Gets the peer session control. * @returns The peer session control. */ getPeerSessionControl(): FcrPeerSessionControl; /** * Sends a peer message. * @param payload * @param guaranteedDelivery * @param receiverId */ sendPeerMessage(payload: Record<string, unknown>, guaranteedDelivery: boolean, receiverId: string): Promise<void>; /** * Sets the parameters. * @param parameters */ setParameters(parameters: Record<string, unknown>): void; /** * Adds an observer. * @param observer */ addObserver(observer: FcrCoreEngineObserver): void; /** * Removes an observer. * @param observer */ removeObserver(observer: FcrCoreEngineObserver): void; private _addRteEngineObserver; private _addLogObserver; private _setupCoreIpList; private _setupChatConnection; private _createChatConnection; private _presetParameters; private _mergeRtcPresetParameters; }