type ObjectKey = string | number | symbol; type EmptyObject = Record; type UUID = string; type Base64Binary = string; type RequiredAtLeastOne = Pick> & { [K in Keys]-?: Required> & Partial>>; }[Keys]; type MediaId = string; type BaseMediaKind = "audio" | "video"; type Type = string; type SubType = string; type CommonMIMEType = `${Type}/${SubType}`; type MIMEType = T; declare enum SimulcastLayerRid { /** * Simulcast layer with the highest resolution */ High = "h", /** * Simulcast layer with a medium resolution */ Medium = "m", /** * Simulcast layer with the lowest resolution */ Low = "l" } declare enum VideoCodec { /** * Call or conference is set to prioritize the VP8 video codec. */ VP8 = "video/VP8", /** * Call or conference is set to prioritize the H.264 video codec. */ H264 = "video/H264", /** * Video codec for a call or conference is chosen automatically. */ Auto = "auto" } type OnValueChangeCallback = (newValue: T, oldValue: T) => unknown | Promise; type UnwatchFunction = () => void; interface WatchOptions { /** * Whether the callback should be called only once. The default value is false. */ once?: boolean; /** * A function that returns a boolean to determine if the callback should be called. * The guard not set by default. * * @since 5.1.0 */ guard?: (newValue: T, oldValue: T) => boolean; /** * Whether the callback should be removed after calling the clear method. The default value is true. */ clearable?: boolean; /** * An AbortSignal. The watch callback will be removed when the abort() method of the AbortController which owns the AbortSignal is called. * See [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) for details. * * @since 5.1.0 */ signal?: AbortSignal; /** * Whether the callback should be called immediately after being added. The default value is false. * * @since 5.1.0 */ immediate?: boolean; } interface Watchable { /** * Current value of the observable property. */ value: T; /** * Previous value of the observable property. */ get oldValue(): T; /** * Subscribes to the value changes. * * When the value is changed, the [Core.Watchable.OnValueChangeCallback] callback is triggered. * * Returns [Core.Watchable.UnwatchFunction], to unwatch observable value changes. * * @param onValueChangeCallback Observer to be triggered when the value is changed * @param options Options */ watch: (onValueChangeCallback: OnValueChangeCallback, options?: WatchOptions) => UnwatchFunction; /** * Stops triggering the specified callback on the value change. * * @param onValueChangeCallback Observer that should not be triggered anymore */ unwatch: (onValueChangeCallback: OnValueChangeCallback) => void; /** * Clears all observers for this watchable excluding the ones created with [Core.Watchable.WatchOptions.clearable]: false. */ clear: () => void; /** * Locks the watchable from mutations. The value becomes readonly. * @hidden */ lock: (key: string) => void; /** * Unlocks the watchable. The value becomes mutable again. * @hidden */ unlock: (key: string) => void; } interface ReadonlyWatchable extends Watchable { } interface BaseBusEvent { name: string; } interface ListenerOptions { /** * Whether a listener should be invoked at most once after being added. * The default value is false. */ once?: boolean; /** * A function that returns a boolean to determine if the listener should be called. * The guard not set by default. * * @since 5.1.0 */ guard?: (event: Extract) => boolean; /** * An AbortSignal. The listener will be removed when the abort() method of the AbortController which owns the AbortSignal is called. * See [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) for details. * * @since 5.1.0 */ signal?: AbortSignal; } type Listener = (event: Extract) => void | Promise; type AddEventListener = (event: EventName, listener: Listener, options?: ListenerOptions) => void; type RemoveEventListener = (event: EventName, listener: Listener) => void; /** * @folder Events */ export declare enum StreamEvent { /** * Triggered when a stream has ended. * * Listener is called with [Stream.Events.StreamEnded] and payload: * @cast Stream.Events.StreamEndedPayload */ Ended = "ENDED" } interface BaseStreamEvent extends BaseBusEvent { name: Name; payload: Payload; } /** * @folder Events */ export interface StreamEndedPayload { /** * Stream id */ streamId: Stream["id"]; } /** * @folder Events * @interface */ export type StreamEnded = BaseStreamEvent; /** * @folder Events */ export type AnyStreamEvent = StreamEnded; /** * Enum that represents the stream types. */ export declare enum StreamType { /** * Audio stream type. */ Audio = "audio", /** * Video stream type. */ Video = "video", /** * Screen sharing video stream type. */ ScreenVideo = "screen_video", /** * Screen sharing audio stream type. */ ScreenAudio = "screen_audio" } /** * Type that represents the stream source types. */ export type StreamSource = "local" | "remote"; /** * @hidden */ export interface StreamInfo { id: string; source: StreamSource; type: StreamType; trackId?: string; deviceId?: string; } /** * @interface * @internal * * Registers a handler for the specified event. * * One event can have more than one handler; handlers are executed in order of their registration. */ export type DocStreamAddEventListener = ( /** * Event name */ eventName: StreamEvent, /** * Handler function that is triggered when an event of the specified type occurs */ listener: (event: AnyStreamEvent) => void | Promise, /** * Object that specifies characteristics about the event listener */ options: ListenerOptions) => void; /** * @interface * @internal * * Removes a previously registered handler for the specified event. */ export type DocStreamRemoveEventListener = ( /** * Event name */ eventName: StreamEvent, /** * Handler function to remove from the event target */ listener: (event: AnyStreamEvent) => void | Promise) => void; /** * Interface that represents an audio or video stream. */ export interface Stream { /** * Stream id. */ readonly id: string; /** * Stream source type. */ readonly source: StreamSource; /** * Stream type. */ get type(): StreamType; /** * [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object. */ get track(): MediaStreamTrack; /** * [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) object. */ get sourceStream(): MediaStream; /** * @hidden */ get info(): StreamInfo; /** * @reinterpret Stream.DocStreamAddEventListener */ addEventListener: AddEventListener; /** * @reinterpret Stream.DocStreamAddEventListener */ removeEventListener: RemoveEventListener; } /** * Interface that represents any local stream. */ export interface LocalStream extends Stream { /** * Stream source type (local). */ readonly source: Extract; /** * Media device id that produces media data for the local stream. */ get sourceDeviceId(): string | null; /** * Stops capturing media and releases all resources. */ close: () => void; } /** * Interface that represents a local screen sharing stream. */ export interface LocalScreenSharingStream extends LocalStream { /** * Stream source type (local). */ readonly source: Extract; /** * Stream type. */ get type(): StreamType.ScreenVideo | StreamType.ScreenAudio; } /** * @hidden */ export interface RemoteStreamInfo extends StreamInfo { isReceiving: boolean; source: "remote"; } /** * Interface that represents a remote audio, video, or screen sharing stream. */ export interface RemoteStream extends Stream { /** * Stream source type (remote). */ readonly source: Extract; /** * Watchable property that allows getting and setting video receiving status and observe its changes. * * For the remote streams in a conference, changes the value when one of the following events is triggered: * - [Conference.EndpointEvents.EndpointEvent.StartReceivingAudioStream] * - [Conference.EndpointEvents.EndpointEvent.StartReceivingVideoStream] * - [Conference.EndpointEvents.EndpointEvent.StopReceivingAudioStream] * - [Conference.EndpointEvents.EndpointEvent.StopReceivingVideoStream] * * For remote stream in a call, it is always true. */ readonly isReceiving: Watchable; get info(): RemoteStreamInfo; } /** * Available kinds of input devices. */ export declare enum DeviceKind { Microphone = "Microphone", Camera = "Camera", Speaker = "Speaker" } interface Device { /** * Device id. */ id: string; /** * Device label. */ label: string; /** * Device group id. */ groupId: string; /** * Device kind. */ kind: T; } /** * @interface */ export type InputDevice = Device; /** * @interface */ export type OutputDevice = Device; declare enum ConferenceState { /** * Conference has been created */ Created = "CREATED", /** * Conference is connecting */ Connecting = "CONNECTING", /** * Conference is connected */ Connected = "CONNECTED", /** * Conference is reconnecting after a failure */ Reconnecting = "RECONNECTING", /** * Conference is disconnecting */ Disconnecting = "DISCONNECTING", /** * Conference has been disconnected */ Disconnected = "DISCONNECTED", /** * Conference failed */ Failed = "FAILED" } declare enum CallState { /** * Call has been created */ Created = "CREATED", /** * Call is connecting */ Connecting = "CONNECTING", /** * Call is connected */ Connected = "CONNECTED", /** * Call is reconnecting after a failure */ Reconnecting = "RECONNECTING", /** * Call is disconnecting */ Disconnecting = "DISCONNECTING", /** * Call has been disconnected */ Disconnected = "DISCONNECTED", /** * Call failed */ Failed = "FAILED" } /** * Interface that represents video quality presents. */ export declare enum VideoQuality { /** * Low video quality (320x240). */ Low = "LOW", /** * Medium video quality (640x480). */ Medium = "MEDIUM", /** * HD video quality (1280x720). */ HD = "HD", /** * Full HD video quality (1920x1080). */ FullHD = "FULL_HD" } /** * Interface that represents video frame rate presets. */ export declare enum FrameRate { /** * Low frame rate (15). */ Low = 15, /** * Medium frame rate (30). */ Medium = 30, /** * High frame rate (60). */ High = 60 } /** * Type that represents the union of video quality configurations. */ export type VideoConfig = VideoQuality | VideoConstraints; /** * Interface that represents extended video resolution constraints for a video stream. */ export interface ExtendedVideoConstraints { /** * Number specifying the smallest permissible value of the property it describes. * If the value cannot remain equal to or greater than this value, matching fails. */ min?: number; /** * Number specifying the largest permissible value of the property it describes. * If the value cannot remain equal to or less than this value, matching fails. */ max?: number; /** * Number specifying a specific, required, value the property should have to be considered acceptable. */ exact?: number; /** * Number specifying an ideal value for the property. * If possible, this value is used, but if it is not possible, the user agent uses the closest possible match. */ ideal?: number; } /** * Interface that represent constraints for a video stream. */ export interface VideoConstraints { /** * Video stream resolution. */ resolution?: { height: ExtendedVideoConstraints | number; width: ExtendedVideoConstraints | number; advanced: VideoResolution[]; }; /** * Video stream fps. */ fps?: FrameRate; } /** * Interface that represents a video resolution definition. */ export interface VideoResolution { /** * Video frame height. */ height: ExtendedVideoConstraints | number; /** * Video frame width. */ width: ExtendedVideoConstraints | number; } /** * Type that represents the union of audio configurations. */ export type AudioConfig = AudioPreset | AudioConstraints; /** * Interface that represents avaialable audio presets. * * Each audio preset contains a predefined audio configuration. */ export interface AudioPreset { /** * Whether the browser based audio processing is enabled. * * Enables [Stream.AudioConstraints.echoCancellation], [Stream.AudioConstraints.autoGainControl], and * [Stream.AudioConstraints.noiseSuppression] for an audio stream. */ audioProcessing: boolean; } /** * Interface that represents available audio constraints. */ export interface AudioConstraints { /** * Whether the browser based echo cancellation is enabled. */ echoCancellation?: boolean; /** * Whether the browser based auto gain control is enabled. */ autoGainControl?: boolean; /** * Whether the browser based noise suppression is enabled. */ noiseSuppression?: boolean; } declare enum ContainerEvent { ModuleRegistered = "MODULE_REGISTERED" } interface ModuleRegisteredEvent extends BaseBusEvent { name: ContainerEvent.ModuleRegistered; token: Token; } type ContainerEvents = ModuleRegisteredEvent; interface Container { readonly key: string; registerModule: (module: ModuleLoader) => void; registerModules: (modules: ModuleLoader[]) => void; getModule(token: Token, required?: false): Module | undefined; getModule(token: Token, required: true): Module; getModuleAsync: (token: Token) => Promise; addEventListener: AddEventListener; removeEventListener: RemoveEventListener; } interface Token { name: string; module?: ModuleType; } interface InitModuleOptions { container: Container; key: string; } interface ModuleLoader { token: Token; options: Options; required: Token[]; setup: (initOptions: InitModuleOptions) => ModuleType; } type ModuleFactory = Options extends EmptyObject ? () => ModuleLoader : (options: Options) => ModuleLoader; interface BaseModule { /** * @hidden */ container: Container; } /** * Interface that represents a WASM processor. */ export interface WasmProcessor { /** * WASM processor version. */ version: string; /** * Binary data of the WASM processor. */ wasm: Base64Binary; } interface MediaDiff { removedMids: MediaId[]; addedMids: MediaId[]; } declare enum StreamReceiveStopReason { /** * Receiving video on a remote video stream is stopped by the Voximplant Cloud due to a network issue on the device. */ Automatic = "Automatic", /** * Receiving audio or video on a remote stream is stopped by the client via the [Conference.Endpoint.stopReceivingAudio] * or [Conference.Endpoint.stopReceivingVideo] method. */ Manual = "Manual" } interface Endpoint { /** * Endpoint id. */ id: string; /** * Endpoint user name. */ userName: string; /** * Endpoint user display name. */ displayName: string; /** * Watchable property that allows getting the voice activity status of the remote participant and observing its changes. */ voiceActivityDetected: Watchable; /** * Watchable property that allows getting the remote participant mute status and observing its changes. */ isMicrophoneMuted: Watchable; /** * Whether the endpoint represents the remote participant screen sharing. */ isScreenSharing: boolean; /** * Map of the remote audio and video streams associated with the endpoint. */ streams: Map; /** * @hidden */ midData: Map; /** * Returns array of the remote audio streams associated with the endpoint. */ getAudioStreams: () => RemoteStream[]; /** * Returns the array of the remote video streams associated with the endpoint. */ getVideoStreams: () => RemoteStream[]; /** * Returns the array of the screen sharing video streams associated with the endpoint. */ getScreenSharingStreams: () => RemoteStream[]; /** * Returns the array of all the remote audio streams associated with the endpoint. */ getAnyAudioStreams: () => RemoteStream[]; /** * Returns the array of all the remote audio streams associated with the endpoint. */ getAnyVideoStreams: () => RemoteStream[]; /** * Starts receiving video from the endpoint. * * If the video has been already receiving, this method call is ignored. * * If the request is processed successfully, the [Conference.EndpointEvents.EndpointEvent.StartReceivingVideoStream] event is triggered. */ startReceivingVideo: () => void; /** * Stops receiving video from the endpoint. * * If the request is processed successfully, the [Conference.EndpointEvents.EndpointEvent.StopReceivingVideoStream] event is triggered * with the [Conference.StreamReceiveStopReason.Manual] reason. */ stopReceivingVideo: () => void; /** * Starts receiving audio from the endpoint. * * If the video has been already receiving, this method call is ignored. * * If the request is processed successfully, the [Conference.EndpointEvents.EndpointEvent.StartReceivingAudioStream] event is triggered. */ startReceivingAudio: () => void; /** * Stops receiving audio from the endpoint. * * If the request is processed successfully, the [Conference.EndpointEvents.EndpointEvent.StopReceivingAudioStream] event is triggered * with the [Conference.StreamReceiveStopReason.Manual] reason. */ stopReceivingAudio: () => void; /** * Requests the specified video size for a remote video stream. * * The stream resolution may be changed to the closest to the specified width and height. * * It only makes an impact if the endpoint has enabled the simulcast feature. * * @param width Requested video frame width * @param height Requested video frame height */ requestVideoSize: (width: number, height: number) => void; /** * @hidden */ addMidData: (mid: MediaId, kind: StreamType) => void; /** * @hidden */ updateMidData: (mids: Record) => void; /** * @hidden */ addMedia: (track: MediaStreamTrack, mid: MediaId) => RemoteStream; /** * @hidden */ removeMedia: (mid: MediaId) => RemoteStream; /** * @hidden */ diffMids: (mids: MediaId[]) => MediaDiff; /** * @reinterpret Conference.DocEndpointAddEventListener */ addEventListener: AddEventListener; /** * @reinterpret Conference.DocEndpointRemoveEventListener */ removeEventListener: RemoveEventListener; } declare enum EndpointEvent { /** * Triggered after an endpoint has added an audio or video stream. * * Listener is called with [Conference.EndpointEvents.EndpointRemoteMediaAdded] and payload: * @cast Conference.EndpointEvents.EndpointRemoteMediaAddedPayload */ RemoteMediaAdded = "RemoteMediaAdded", /** * Triggered after an endpoint has removed an audio or video stream. * * Listener is called with [Conference.EndpointEvents.EndpointRemoteMediaRemoved] and payload: * @cast Conference.EndpointEvents.EndpointRemoteMediaRemovedPayload */ RemoteMediaRemoved = "RemoteMediaRemoved", /** * Triggered when receiving video on a remote video stream is started after previously being stopped. * * Listener is called with [Conference.EndpointEvents.EndpointStartReceivingAudioStream] and payload: * @cast Conference.EndpointEvents.EndpointStartReceivingAudioStreamPayload */ StartReceivingAudioStream = "StartReceivingAudioStream", /** * Triggered when receiving audio on a remote audio stream is stopped. * * Listener is called with [Conference.EndpointEvents.EndpointStopReceivingAudioStream] and payload: * @cast Conference.EndpointEvents.EndpointStopReceivingAudioStreamPayload */ StopReceivingAudioStream = "StopReceivingAudioStream", /** * Triggered when receiving video on a remote video stream is started after previously being stopped. * * The event is triggered if: * - [Conference.Endpoint.startReceivingVideo] has been called and the request has been processed successfully. * - A network issue that caused the Voximplant Cloud to stop receiving video of the remote video stream is gone. * * The event is not triggered if the endpoint client has started sending video via the [Conference.Conference.addStream] API. * * Listener is called with [Conference.EndpointEvents.EndpointStartReceivingVideoStream] and payload: * @cast Conference.EndpointEvents.EndpointStartReceivingVideoStreamPayload */ StartReceivingVideoStream = "StartReceivingVideoStream", /** * Triggered when receiving video on a remote video stream is stopped. * * Receiving video on a remote video stream can be stopped due to: * - [Conference.Endpoint.stopReceivingVideo] has been called and the request has been processed successfully. In this case * the value of the “reason” parameter is [Conference.StreamReceiveStopReason.Manual]. * - Voximplant Cloud has detected a network issue on the client and automatically stopped the video. In this case * the value of the “reason” parameter is [Conference.StreamReceiveStopReason.Automatic]. * * If the receiving video is disabled automatically, it may be automatically enabled as soon as the network condition * on the device is good and there is enough bandwidth to receive the video on this remote video stream. * In this case [Conference.EndpointEvents.EndpointEvent.StartReceivingVideoStream] event is triggered. * * The event is not triggered if the endpoint client has stopped sending video via * the [Conference.Conference.removeStream] API. * * Listener is called with [Conference.EndpointEvents.EndpointStopReceivingVideoStream] and payload: * @cast Conference.EndpointEvents.EndpointStopReceivingVideoStreamPayload */ StopReceivingVideoStream = "StopReceivingVideoStream" } interface BaseEndpointEvent extends BaseBusEvent { name: Name; payload: Payload; } interface EndpointRemoteMediaAddedPayload { /** * Endpoint id. */ endpointId: Endpoint["id"]; /** * Remote audio or video stream. */ stream: RemoteStream; /** * Remote stream type. */ type: StreamType; } type EndpointRemoteMediaAdded = BaseEndpointEvent; interface EndpointRemoteMediaRemovedPayload { /** * Endpoint id. */ endpointId: Endpoint["id"]; /** * Remote audio or video stream. */ stream: RemoteStream; /** * Remote stream type. */ type: StreamType; } type EndpointRemoteMediaRemoved = BaseEndpointEvent; interface EndpointStartReceivingAudioStreamPayload { /** * Endpoint id. */ endpointId: Endpoint["id"]; /** * Remote audio stream id. */ streamId: RemoteStream["id"]; } type EndpointStartReceivingAudioStream = BaseEndpointEvent; interface EndpointStopReceivingAudioStreamPayload { /** * Endpoint id. */ endpointId: Endpoint["id"]; /** * Remote audio stream id. */ streamId: RemoteStream["id"]; /** * Reason for the event, such as receiving audio, is disabled by the client or automatically. */ reason: StreamReceiveStopReason; } type EndpointStopReceivingAudioStream = BaseEndpointEvent; interface EndpointStartReceivingVideoStreamPayload { /** * Endpoint id. */ endpointId: Endpoint["id"]; /** * Remote video stream id. */ streamId: RemoteStream["id"]; } type EndpointStartReceivingVideoStream = BaseEndpointEvent; interface EndpointStopReceivingVideoStreamPayload { /** * Endpoint id. */ endpointId: Endpoint["id"]; /** * Remote video stream id. */ streamId: RemoteStream["id"]; /** * Reason for the event, such as receiving video, is disabled by the client or automatically. */ reason: StreamReceiveStopReason; } type EndpointStopReceivingVideoStream = BaseEndpointEvent; type AnyEndpointEvent = EndpointRemoteMediaAdded | EndpointRemoteMediaRemoved | EndpointStartReceivingAudioStream | EndpointStopReceivingAudioStream | EndpointStartReceivingVideoStream | EndpointStopReceivingVideoStream; declare enum ScreenSharingFailedCode { /** * Internal error. */ Internal = 500, /** * Screen sharing frames are not sent due to a network connection problem. */ NetworkIssues = 503 } declare enum ConferenceEvent { /** * Triggered after a conference has been successfully connected. * * Listener is called with [Conference.Events.ConferenceConnected] and payload: * @cast Conference.Events.ConferenceConnectedPayload */ Connected = "Connected", /** * Triggered if a conference has failed. * * Listener is called with [Conference.Events.ConferenceFailed] and payload: * @cast Conference.Events.ConferenceFailedPayload */ Failed = "Failed", /** * Triggered after a conference has been disconnected. * * Listener is called with [Conference.Events.ConferenceDisconnected] and payload: * @cast Conference.Events.ConferenceDisconnectedPayload */ Disconnected = "Disconnected", /** * Triggered after an endpoint is added to a conference. * * Listener is called with [Conference.Events.ConferenceEndpointAddedPayload] and payload: * @cast Conference.Events.ConferenceEndpointAddedPayload */ EndpointAdded = "EndpointAdded", /** * Triggered after the endpoint is removed from a conference. * * Listener is called with [Conference.Events.ConferenceEndpointRemoved] and payload: * @cast Conference.Events.ConferenceEndpointRemovedPayload */ EndpointRemoved = "EndpointRemoved", /** * Triggered when an INFO message is received within a conference. * * Listener is called with [Conference.Events.ConferenceInfoReceived] and payload: * @cast Conference.Events.ConferenceInfoReceivedPayload */ InfoReceived = "InfoReceived", /** * Triggered when a message is received within a conference. * * Listener is called with [Conference.Events.ConferenceMessageReceived] and payload: * @cast Conference.Events.ConferenceMessageReceivedPayload */ MessageReceived = "MessageReceived", /** * Triggered when conference statistics are available for a conference. * * Listener is called with [Conference.Events.ConferenceStatsReport] and payload: * @cast Conference.Events.ConferenceStatsReportPayload */ StatsReport = "StatsReport", /** * Triggered when screen sharing has started in a conference. * * Listener is called with [Conference.Events.ConferenceScreenSharingStarted] and payload: * @cast Conference.Events.ConferenceScreenSharingStartedPayload */ ScreenSharingStarted = "ScreenSharingStarted", /** * Triggered when screen sharing has failed to start in a conference. * * Listener is called with [Conference.Events.ConferenceScreenSharingFailed] and payload: * @cast Conference.Events.ConferenceScreenSharingFailedPayload */ ScreenSharingFailed = "ScreenSharingFailed" } interface BaseConferenceEvent extends BaseBusEvent { name: Name; payload: Payload; } interface ConferenceConnectedPayload { /** * Conference id */ conferenceId: UUID; /** * Optional headers passed with the event */ headers?: Record; } type ConferenceConnected = BaseConferenceEvent; interface ConferenceFailedPayload { /** * Conference id */ conferenceId: UUID; /** * Optional headers passed with the event */ headers?: Record; /** * Conference status code */ code: number; /** * Conference failure reason */ reason: string; } type ConferenceFailed = BaseConferenceEvent; declare enum ConferenceDisconnectReason { /** * Local party has explicitly ended a conference. */ LocalEnded = "LOCAL_ENDED", /** * Conference has ended by a VoxEngine scenario. */ RemoteEnded = "REMOTE_ENDED", /** * Connection to the Voximplant Cloud has lost and cannot recover during a conference. */ ConnectionLost = "CONNECTION_LOST" } interface ConferenceDisconnectedPayload { /** * Conference id */ conferenceId: UUID; /** * Optional headers passed with the event */ headers?: Record; /** * Reason that the conference ended with */ reason: ConferenceDisconnectReason; } type ConferenceDisconnected = BaseConferenceEvent; interface ConferenceEndpointAddedPayload { /** * Conference id */ conferenceId: UUID; /** * Endpoint id */ newEndpointId: Endpoint["id"]; } type ConferenceEndpointAdded = BaseConferenceEvent; interface ConferenceEndpointRemovedPayload { /** * Conference id */ conferenceId: UUID; /** * Endpoint id */ removedEndpointId: Endpoint["id"]; } type ConferenceEndpointRemoved = BaseConferenceEvent; interface ConferenceInfoReceivedPayload { /** * Conference id */ conferenceId: UUID; /** * Body of an INFO message */ body: string; /** * Optional headers passed with the event */ headers?: Record; /** * MIME type of an INFO message */ mimeType: MIMEType; } type ConferenceInfoReceived = BaseConferenceEvent; interface ConferenceMessageReceivedPayload { /** * Conference id */ conferenceId: UUID; /** * Content of the message */ text: string; } type ConferenceMessageReceived = BaseConferenceEvent; interface ConferenceStatsReportPayload { /** * Time at which the conference statistics are collected, relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds. */ timestamp: number; /** * Media connectivity statistics */ connection: ConnectionStatsReport; /** * Statistics for all active outgoing audio streams in a conference at the moment of the statistics collection */ localAudio: LocalAudioStreamStatsReport; /** * Statistics for all active outgoing video streams in a conference at the moment of the statistics collection */ localVideo: LocalVideoStreamStatsReport; /** * Endpoint statistics */ remote: Record; } type ConferenceStatsReport = BaseConferenceEvent; interface ConferenceScreenSharingFailedPayload { conferenceId: UUID; /** * Conference screen sharing status code */ code: ScreenSharingFailedCode; /** * Conference screen sharing failure reason */ reason: string; } type ConferenceScreenSharingFailed = BaseConferenceEvent; interface ConferenceScreenSharingStartedPayload { /** * Conference id */ conferenceId: UUID; } type ConferenceScreenSharingStarted = BaseConferenceEvent; type AnyConferenceEvent = ConferenceConnected | ConferenceFailed | ConferenceDisconnected | ConferenceEndpointAdded | ConferenceEndpointRemoved | ConferenceInfoReceived | ConferenceMessageReceived | ConferenceStatsReport | ConferenceScreenSharingStarted | ConferenceScreenSharingFailed; interface Conference { /** * Conference id. */ readonly id: UUID; /** * Whether the simulcast feature is enabled in the conference call. */ readonly isSimulcast: boolean; /** * Conference endpoint id of this client. */ endpointId: ReadonlyWatchable; /** * Conference name. */ readonly conferenceName: string; /** * Watchable property that allows getting the current conference state and observing its changes. */ state: ReadonlyWatchable; /** * Watchable property that allows getting the local audio and video streams that are currently being sent. */ localStreams: ReadonlyWatchable>; /** * Watchable property that allows getting the array of the endpoints associated with the conference and observing * its changes. */ endpoints: ReadonlyWatchable>; /** * Watchable property that allows getting the voice activity status of the current user and observing its changes. */ voiceActivityDetected: ReadonlyWatchable; /** * Conference duration in milliseconds. */ get duration(): number; /** * @reinterpret Conference.DocConferenceAddEventListener */ addEventListener: AddEventListener; /** * @reinterpret Conference.DocConferenceRemoveEventListener */ removeEventListener: RemoveEventListener; /** * Joins a conference. * * Returns a promise that is resolved if the conference connection process has started successfully. A resolved promise * does not mean that the conference is connected. You should subscribe to [Conference.Events.ConferenceEvent.Connected] * to be notified that the current user has joined the conference. */ join: () => Promise; /** * Terminates the conference on the current user. * * @param headers Optional set of headers to be sent. Names should begin with “X-” to be processed by the SDK. */ hangup: (headers?: Record) => void; /** * Watchable property that allows getting the screen sharing sending status and observing its changes. */ hasScreenSharing: ReadonlyWatchable; /** * Starts sending a screen sharing stream to the conference. * * Other conference participants receive the [Conference.Events.ConferenceEvent.EndpointAdded] event. * * @param stream Array of screen sharing streams * @throws [Conference.Errors.ConferenceWrongStateError] if the conference is not in the [Conference.ConferenceState.Connected] state */ startScreenSharing: (stream: LocalScreenSharingStream[]) => Promise; /** * Stops sending a screen sharing stream to the conference. */ stopScreenSharing: () => void; /** * Watchable property that allows getting the audio mute status and observing its changes. */ isMicrophoneMuted: ReadonlyWatchable; /** * Mutes the audio in the conference. */ muteMicrophone: () => void; /** * Unmutes the audio in the conference. */ unmuteMicrophone: () => void; /** * Sends an INFO message within the conference. * * @param mimeType MIME type of the info * @param body Custom string data * @param extraHeaders Optional set of headers to be sent with the message. Names should begin with “X-” to be processed by the SDK. * @throws [Core.SharedErrors.InvalidMimeTypeError] if the provided mimeType is in an invalid format */ sendInfo: (mimeType: MIMEType, body: string, extraHeaders?: Record) => void; /** * Sends a message within the conference. * * Implemented atop of SIP INFO for communication between the conference endpoint and the Voximplant Cloud, * and is separated from Voximplant messaging API. * @param message Message text */ sendMessage: (message: string) => void; /** * Starts sending an audio or video stream to the conference. * * Returns a promise that is resolved when the operation is completed. * * @throws * • [Conference.Errors.ConferenceWrongStateError] if the conference is in [Conference.ConferenceState.Failed], * [Conference.ConferenceState.Disconnecting], or [Conference.ConferenceState.Disconnected] state * * * • [Core.SharedErrors.StreamUpdateFailedError] if the operation has failed * * * • [Core.SharedErrors.InactiveStreamError] if the stream is not active * * @param stream Audio or video stream */ addStream: (stream: LocalStream) => Promise; /** * Stops sending audio or video stream to the conference. * * Returns a promise that is resolved when the operation is completed. * * @throws * • [Conference.Errors.ConferenceWrongStateError] if the conference is in [Conference.ConferenceState.Failed], * [Conference.ConferenceState.Disconnecting], or [Conference.ConferenceState.Disconnected] state * * * • [Core.SharedErrors.StreamUpdateFailedError] if the operation has failed * * @param stream Audio or video stream */ removeStream: (stream: LocalStream) => Promise; /** * Replaces the local audio or video stream that is currently being sent to the conference with another local audio or video stream. * * Returns a promise that is resolved when the operation is completed. * * @throws * • [Conference.Errors.ConferenceWrongStateError] if the conference is in [Conference.ConferenceState.Failed], * [Conference.ConferenceState.Disconnecting], or [Conference.ConferenceState.Disconnected] state * * * • [Core.SharedErrors.InactiveStreamError] if the stream is not [active](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/active) * * * • [Core.SharedErrors.StreamUpdateFailedError] if the operation has failed * * @param newStream New local stream * @param oldStream Stream to replace */ replaceStream: (newStream: LocalStream, oldStream?: LocalStream) => Promise; } interface LocalAudioStatsReport { /** * Local audio stream type. */ streamType: StreamType.Audio | StreamType.ScreenAudio; /** * Total number of bytes sent within an audio stream. */ bytesSent: number; /** * Total number of packets sent within an audio stream. */ packetsSent: number; /** * Audio codec name for an audio stream. */ codec: string | null; /** * Audio level value is in the 0..1 range (linear), where 1.0 represents 0 dBov, 0 represents silence, and * 0.5 represents approximately 6 dBSPL change in the sound pressure level from 0 dBov. * * Not supported in the Safari browser below 17.4 and the Firefox browser. */ audioLevel: number | null; } interface LocalVideoLayerStats { /** * Encoding layer identifier. * * Not supported in the Firefox browser (the value is null). * * Returns null for calls and if the simulcast feature is disabled for a conference. */ rid: SimulcastLayerRid | null; /** * Total number of bytes sent within a video stream. */ bytesSent: number; /** * Total number of packets sent within a video stream. */ packetsSent: number; /** * Video frame width sent within a video stream at the moment of the statistics collection. */ frameWidth: number | null; /** * Video frame height sent within a video stream at the moment of the statistics collection. */ frameHeight: number | null; /** * The number of complete frames in the last second. */ fps: number | null; } interface LocalVideoStatsReport { /** * Video stream type. */ streamType: StreamType.Video | StreamType.ScreenVideo; /** * Total number of bytes sent within a video stream. */ bytesSent: number; /** * Total number of packets sent within a video stream. */ packetsSent: number; /** * Video codec name for a video stream. */ codec: string | null; /** * Width of the video frame captured by a video source. * * Not supported in the Safari browser (the value is null). * Partly supported in the Firefox browser. */ sourceFrameWidth: number | null; /** * Height of the video frame captured by a video source. * * Not supported in the Safari browser (the value is null). * Partly supported in the Firefox browser. */ sourceFrameHeight: number | null; /** * Number of complete source frames in the last second. * * Not supported in the Safari browser below 17.4 and party supported in the Firefox browser. */ sourceFps: number | null; /** * Statistics for the video stream layers. */ layers: LocalVideoLayerStats[]; } interface RemoteAudioStatsReport { /** * Total number of bytes received within an audio stream. */ bytesReceived: number; /** * Total number of packets received within an audio stream. */ packetsReceived: number; /** * Total number of audio packets lost for an audio stream. */ packetsLost: number; /** * Audio level value is in the 0..1 range (linear), where 1.0 represents 0 dBov, 0 represents silence, * and 0.5 represents approximately 6 dBSPLchange in the sound pressure level from 0 dBov. */ audioLevel: number | null; /** * Audio codec name for an audio stream. */ codec: string | null; } interface RemoteVideoStatsReport { /** * Total number of bytes received within a video stream. */ bytesReceived: number; /** * Total number of packets received within a video stream. */ packetsReceived: number; /** * Total number of video packets lost for a video stream. */ packetsLost: number; /** * Video frame width received within a video stream at the moment of the statistics collection. */ frameWidth: number | null; /** * Video frame height received within a video stream at the moment of the statistics collection. */ frameHeight: number | null; /** * Number of complete frames in the last second. */ fps: number | null; /** * Video codec name for a video stream. */ codec: string | null; } interface ConnectionStatsReport { /** * Available outgoing bitrate calculated by the underlying congestion control by combining the available bitrate * for all the outgoing RTP streams with the current selected candidate pair. * * Not supported in the Firefox browser (the value is null). */ availableOutgoingBitrate: number | null; /** * Represents the latest round trip time measured in seconds. * * Not supported in the Firefox browser (the value is null). */ rtt: number | null; /** * Local ICE candidate type. * * Possible values: * - "host" - A host candidate * - "srflx" - A server reflexive candidate * - "prflx" - A peer reflexive candidate * - "relay" - A relay candidate */ localCandidateType: string; /** * Remote ICE candidate type. * * Possible values: * - "host" - A host candidate * - "srflx" - A server reflexive candidate * - "prflx" - A peer reflexive candidate * - "relay" - A relay candidate */ remoteCandidateType: string; } type LocalAudioStreamStatsReport = Record; type LocalVideoStreamStatsReport = Record; type RemoteAudioStreamStatsReport = Record; type RemoteVideoStreamStatsReport = Record; type StatsReportInterval = number; declare global { interface Navigator { getBattery?: () => Promise; } } interface BatteryManager extends EventTarget { level: number; charging: boolean; chargingTime: number; dischargingTime: number; } declare enum CallDirection { /** * Incoming call */ Incoming = "INCOMING", /** * Outgoing call */ Outgoing = "OUTGOING" } declare enum RejectMode { /** * Call line is busy. */ Busy = "Busy", /** * Call has been declined. */ Decline = "Decline" } interface CallSettings { /** * Custom string associated with a call session. * * It can be passed to the cloud to be obtained from the [CallAlerting](/docs/references/voxengine/appevents#callalerting) * event or [Call History](/docs/references/httpapi/history#getcallhistory) via Management API. * * Maximum size is 200 bytes. * * Use the [Call.Call.sendMessage] method to pass a string over the limit; in order to pass a large data use * [media_session_access_url](/docs/references/httpapi/scenarios#startscenarios) on your backend. */ customData?: string; /** * Optional set of headers to be sent to the Voximplant cloud. Names should begin with “X-” to be processed by SDK. */ extraHeaders?: Record; /** * Call statistics collection interval in milliseconds. * * The default value is 1000. * * The interval value should be multiple of 500, otherwise the provided value is rounded to a less value that is multiple of 500. * * To receive the [Call.CallEvents.CallStatsReport] event, [Call.CallSettings.reportStats] should be set to true. */ statsReportInterval?: StatsReportInterval; /** * Whether the [Call.CallEvents.CallStatsReport] event should be triggered for a call. * * The default value is false. */ reportStats?: boolean; /** * Preferred video codec for a particular call that these settings are applied to. * * The default value is [Core.VideoCodec.Auto]. */ preferredVideoCodec?: VideoCodec; /** * Whether video receiving is enabled in a call. * * The default value is false. * * If the call is started without video and the user enables video in an active call * via the [Call.Call.addStream] API, enables video receiving. */ receiveVideo?: boolean; } interface Call { /** * Call id. */ readonly id: UUID; /** * Call duration in milliseconds. */ readonly duration: number; /** * Destination that the call has been created with. */ readonly destination: string; /** * Watchable property that allows getting the current call state and observing its changes. */ readonly state: ReadonlyWatchable; /** * Watchable property that allows getting the call participant user display name and observing its changes. * * Null for outgoing calls until the [Call.CallEvents.CallEvent.Connected] event is triggered. */ readonly remoteDisplayName: ReadonlyWatchable; /** * Watchable property that allows getting the call participant sip URI and observing its changes. * * Null for outgoing calls until the [Call.CallEvents.CallEvent.Connected] event is triggered. */ remoteSipUri: ReadonlyWatchable; /** * Watchable property that allows getting whether the call is on hold. */ isOnHold: ReadonlyWatchable; /** * Call direction. */ readonly direction: CallDirection; /** * Watchable property that allows getting the array of the local audio and video streams that are currently being sent. */ localStreams: ReadonlyWatchable>; /** * Watchable property that allows getting the array of the remote audio and video streams that are currently being received. */ remoteStreams: ReadonlyWatchable>; /** * Watchable property that indicates whether the video is enabled and allows observing its changes. */ isVideoEnabled: ReadonlyWatchable; /** * Starts sending an audio or video stream to the call. * * If a video stream is added to a call that was originally started as audio only, * the remote participant receives the [Call.CallEvents.CallEvent.CallUpgrade] event * and can accept or reject the request to switch the call to video. * * Returns a promise that is resolved when the operation is completed. * * @throws * - [Call.Errors.CallWrongStateError] — if the call is in the [Call.CallState.Failed], * [Call.CallState.Disconnecting], or [Call.CallState.Disconnected] state * - [Core.SharedErrors.StreamTypeMismatchError] — if the stream is of the [Stream.StreamType.ScreenVideo] type * - [Call.Errors.CallOnHoldError] — if the call is currently on hold * - [Core.SharedErrors.InactiveStreamError] — if the stream is not [active](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/active) * - [Core.SharedErrors.StreamUpdateFailedError] — if the operation has failed * * @param stream Audio or video stream */ addStream: (stream: LocalStream) => Promise; /** * Stops sending audio or video stream to the call. * * Returns a promise that is resolved when the operation is completed. * * @throws * - [Call.Errors.CallWrongStateError] — if the call is in the [Call.CallState.Failed], * [Call.CallState.Disconnecting], or [Call.CallState.Disconnected] state * - [Core.SharedErrors.StreamTypeMismatchError] — if the stream is of the [Stream.StreamType.ScreenAudio] or [Stream.StreamType.ScreenVideo] type * - [Call.Errors.CallOnHoldError] — if the call is currently on hold * - [Core.SharedErrors.StreamUpdateFailedError] — if the operation has failed * * @param stream */ removeStream: (stream: LocalStream) => Promise; /** * Replaces the local audio or video stream that is currently being sent to the call with another local audio or video stream. * * Returns a promise that is resolved when the operation is completed. * * @throws * - [Call.Errors.CallWrongStateError] — if the call is in the [Call.CallState.Failed], * [Call.CallState.Disconnecting], or [Call.CallState.Disconnected] state * - [Core.SharedErrors.StreamTypeMismatchError] — if the stream is of [Stream.StreamType.ScreenAudio] or [Stream.StreamType.ScreenVideo] type * - [Core.SharedErrors.InactiveStreamError] — if the stream is not [active](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/active) * - [Core.SharedErrors.StreamUpdateFailedError] — if the operation has failed * * @param stream New local stream * @param oldStream Stream to replace */ replaceStream: (stream: LocalStream, oldStream?: LocalStream) => Promise; /** * Watchable property that allows getting the screen sharing sending status and observing its changes. */ hasScreenSharing: ReadonlyWatchable; /** * Watchable property indicating the current sending status of the local video stream. * * This property holds one of the following values: * - [Call.VideoSendingStatus.Sending]: A local video stream is being sent. * - [Call.VideoSendingStatus.NotSending]: No local video is being sent. * - [Call.VideoSendingStatus.Pending]: A video stream is currently being added, removed, or replaced via the * [Call.Call.addStream], [Call.Call.removeStream], or [Call.Call.replaceStream] API. * * The initial status when the call is connected is available in the * [Call.CallEvents.CallEvent.Connected] event payload. * * @since 5.2.0 */ videoSendingStatus: ReadonlyWatchable; /** * Starts sending a screen sharing stream to the call. * * Returns a promise that is resolved when the operation is completed. * * @throws * - [Call.Errors.CallWrongStateError] — if the call is not in the [Call.CallState.Connected] state * - [Call.Errors.CallOnHoldError] — if the call is currently on hold * - [Core.SharedErrors.InactiveStreamError] — if the stream is not [active](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/active) * - [Core.SharedErrors.StreamUpdateFailedError] — if the operation has failed or the screen sharing is already being sent to the call * * @param stream Array of screen sharing streams */ startScreenSharing: (stream: LocalScreenSharingStream[]) => Promise; /** * Stops sending a screen sharing stream to the call. * * Returns a promise that is resolved when the operation is completed. * * @throws * - [Call.Errors.CallWrongStateError] — if the call is not in the [Call.CallState.Connected] state * - [Call.Errors.CallOnHoldError] — if the call is currently on hold * - [Core.SharedErrors.StreamUpdateFailedError] — if the operation has failed or the screen sharing is not currently being sent */ stopScreenSharing: () => Promise; /** * Watchable property that allows getting the audio mute status and observing its changes. */ isMicrophoneMuted: ReadonlyWatchable; /** * Toggles the audio mute status in the call. */ toggleMicrophone: () => boolean; /** * Mutes the audio in the call. */ muteMicrophone: () => void; /** * Unmutes the audio in the call. */ unmuteMicrophone: () => void; /** * Starts an outgoing call. * * Returns a promise that is resolved if the call connection process has started successfully. A resolved promise * does not mean that the call is connected. You should subscribe to [Call.CallEvents.CallEvent.Connected] to be * notified that the call is established. * * @throws * - [Call.Errors.CallWrongDirectionError] — if the method is called for an incoming call * - [Call.Errors.CallWrongStateError] — if the call is in a state different from [Call.CallState.Created] or [Call.CallState.Reconnecting] */ start: () => Promise; /** * Answers an incoming call. * * Returns a promise that is resolved if the call connection process has started successfully. A resolved promise * does not mean that the call is connected. You should subscribe to [Call.CallEvents.CallEvent.Connected] to be * notified that the call is established. * * @throws * - [Call.Errors.CallWrongDirectionError] — if the method is called for an outgoing call * - [Call.Errors.CallWrongStateError] — if the call is in a state different from [Call.CallState.Created] or [Call.CallState.Reconnecting] * - [Call.Errors.CallInternalError] — if the operation has failed * * @param settings Call settings with additional call parameters, such as the preferred video codec, custom data, extra headers, etc. */ answer: (settings?: CallSettings) => Promise; /** * Rejects an incoming call. * * @param rejectMode Call rejection mode * @param headers Optional set of headers to be sent. Names should begin with “X-” to be processed by the SDK. * @throws [Call.Errors.CallWrongDirectionError] if the method is called for the outgoing call */ reject: (rejectMode: RejectMode, headers?: Record) => void; /** * Terminates the call. * * @param headers Optional set of headers to be sent. Names should begin with “X-” to be processed by the SDK. */ hangup: (headers?: Record) => void; /** * Holds or unholds the call. * * Returns a promise that is resolved when the operation is completed. * * @throws * - [Call.Errors.CallWrongStateError] — if the call is not in the [Call.CallState.Connected] state * - [Call.Errors.CallOnHoldError] on the attempt to hold the call that is already on hold * - [Call.Errors.CallNotOnHoldError] on the attempt to resume the call that is currently not on hold * - [Call.Errors.CallInternalError] — if the operation has failed * * @param enable Whether to hold or unhold the call */ hold: (enable: boolean) => Promise; /** * Sends DTMF(s) within the call. * * @param tones DTMF(s) * @throws [Core.SharedErrors.InvalidArgumentsError] if the tones parameter is an empty string */ sendDTMF: (tones: string) => void; /** * Sends an INFO message within the call. * * @param mimeType MIME type of the info * @param body Custom string data * @param headers Optional set of headers to be sent with the message. Names should begin with “X-” to be processed by the SDK. * @throws [Core.SharedErrors.InvalidMimeTypeError] if the provided mimeType is in an invalid format */ sendInfo: (mimeType: MIMEType, body: string, headers?: Record) => void; /** * Sends a message within the call. * * Implemented atop of SIP INFO for communication between the call endpoint and the Voximplant Cloud, and is separated * from Voximplant messaging API. * @param message Message text */ sendMessage: (message: string) => void; /** * @reinterpret Call.DocCallAddEventListener */ addEventListener: AddEventListener; /** * @reinterpret Call.DocCallRemoveEventListener */ removeEventListener: RemoveEventListener; } declare enum CallUpgradeStatus { /** * Call upgrade request is pending. */ Pending = "Pending", /** * Call upgrade request has been accepted via the [Call.CallEvents.CallUpgradePayload.accept] API. */ Accepted = "Accepted", /** * Call upgrade request has been rejected via the [Call.CallEvents.CallUpgradePayload.reject] API * or when the request times out. */ Rejected = "Rejected" } declare enum VideoSendingStatus { /** * Video is currently being sent. */ Sending = "Sending", /** * Video is not currently being sent. */ NotSending = "NotSending", /** * Video is currently negotiating. */ Pending = "Pending" } declare enum CallEvent { /** * Triggered after a call has been successfully connected. * * Listener is called with [Call.CallEvents.CallConnected] and payload: * @cast Call.CallEvents.CallConnectedPayload */ Connected = "Connected", /** * Triggered if a call failed. * * Listener is called with [Call.CallEvents.CallFailed] and payload: * @cast Call.CallEvents.CallFailedPayload */ Failed = "Failed", /** * Triggered after a call has been disconnected. * * Listener is called with [Call.CallEvents.CallDisconnected] and payload: * @cast Call.CallEvents.CallDisconnectedPayload */ Disconnected = "Disconnected", /** * Triggered when the [Call.ring](/docs/references/voxengine/call#ring) method is called on the scenario side. * * Listener is called with [Call.CallEvents.CallStartRinging] and payload: * @cast Call.CallEvents.CallStartRingingPayload */ StartRinging = "StartRinging", /** * Triggered when the [Call.answer](/docs/references/voxengine/call#answer) or * [Call.startEarlyMedia method](/docs/references/voxengine/call#startearlymedia) is called on the scenario side. * * Listener is called with [Call.CallEvents.CallStopRinging] and payload: * @cast Call.CallEvents.CallStopRingingPayload */ StopRinging = "StopRinging", /** * Triggered when call statistics are available for a call. * * Listener is called with [Call.CallEvents.CallStatsReport] and payload: * @cast Call.CallEvents.CallStatsReportPayload */ StatsReport = "StatsReport", /** * Triggered when an INFO message is received within a call. * * Listener is called with [Call.CallEvents.CallInfoReceived] and payload: * @cast Call.CallEvents.CallInfoReceivedPayload */ InfoReceived = "InfoReceived", /** * Triggered when another call participant has added an audio or video stream to a call. * * Listener is called with [Call.CallEvents.CallRemoteMediaAdded] and payload: * @cast Call.CallEvents.CallRemoteMediaAddedPayload */ RemoteMediaAdded = "RemoteMediaAdded", /** * Triggered when another call participant has removed an audio or video stream from a call. * * Listener is called with [Call.CallEvents.CallRemoteMediaRemoved] and payload: * @cast Call.CallEvents.CallRemoteMediaRemovedPayload */ RemoteMediaRemoved = "RemoteMediaRemoved", /** * Triggered when a message is received within a call. * * Listener is called with [Call.CallEvents.CallMessageReceived] and payload: * @cast Call.CallEvents.CallMessageReceivedPayload */ MessageReceived = "MessageReceived", /** * Triggered when the remote participant enables video during an audio call. * * This event allows the application to either accept or reject the request * to upgrade the call to video. * * If no event listener is registered for the event, the SDK automatically accepts * the video upgrade. * * If a listener is registered, the application should explicitly call either `accept` * or `reject`. If neither method is invoked within 8 seconds, * the upgrade request is automatically rejected. * * Listener is called with [Call.CallEvents.CallUpgrade] and payload: * @cast Call.CallEvents.CallUpgradePayload * * @since 5.2.0 */ CallUpgrade = "CallUpgrade" } interface BaseCallEvent extends BaseBusEvent { name: Name; payload: Payload; } interface CallConnectedPayload { /** * Call id */ callId: UUID; /** * Optional headers passed with the event */ headers?: Record; /** * Local video sending status at the moment when the call is connected. * * This property is initialized with one of the following [Call.VideoSendingStatus] values: * - [Call.VideoSendingStatus.Sending]: A local video stream is being sent. * - [Call.VideoSendingStatus.NotSending]: No local video is being sent. * * To monitor status changes after the call is established, observe [Call.Call.videoSendingStatus]. * * @since 5.2.0 */ videoSendingStatus: VideoSendingStatus; } type CallConnected = BaseCallEvent; interface CallFailedPayload { /** * Call id */ callId: UUID; /** * Optional headers passed with the event */ headers?: Record; /** * Call status code */ code: number; /** * Call failure reason */ reason: string; } type CallFailed = BaseCallEvent; declare enum CallDisconnectReason { /** * Local party has explicitly ended a call. */ LocalEnded = "LOCAL_ENDED", /** * Remote party has explicitly ended a call. */ RemoteEnded = "REMOTE_ENDED", /** * Connection to the Voximplant Cloud has been lost and cannot be recovered during a call. */ ConnectionLost = "CONNECTION_LOST", /** * Another device has answered the call. */ AnsweredElsewhere = "ANSWERED_ELSEWHERE" } interface CallDisconnectedPayload { /** * Call id */ callId: UUID; /** * Optional headers passed with the event */ headers?: Record; /** * Reason that the call ended */ reason: CallDisconnectReason; } type CallDisconnected = BaseCallEvent; interface CallStartRingingPayload { /** * Call id */ callId: UUID; } type CallStartRinging = BaseCallEvent; interface CallStopRingingPayload { /** * Call id */ callId: UUID; } type CallStopRinging = BaseCallEvent; interface CallStatsReportPayload { /** * Time at which the call statistics are collected, relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds. */ timestamp: number; /** * Media connectivity statistics. */ connection: ConnectionStatsReport; /** * Statistics for all active outgoing audio streams in a call at the moment of the statistics collection. */ localAudio: LocalAudioStreamStatsReport; /** * Statistics for all active outgoing video streams in a call at the moment of the statistics collection. */ localVideo: LocalVideoStreamStatsReport; /** * Statistics for all incoming audio and video streams of a call at the moment of the statistics collection. */ remote: { audio: RemoteAudioStreamStatsReport; video: RemoteVideoStreamStatsReport; }; } type CallStatsReport = BaseCallEvent; interface CallRemoteMediaAddedPayload { /** * Call id */ callId: UUID; /** * Remote media stream */ stream: RemoteStream; /** * Remote media stream type */ type: StreamType; } type CallRemoteMediaAdded = BaseCallEvent; interface CallRemoteMediaRemovedPayload { /** * Call id */ callId: UUID; /** * Remote media stream */ stream: RemoteStream; /** * Remote media stream type */ type: StreamType; } type CallRemoteMediaRemoved = BaseCallEvent; interface CallInfoReceivedPayload { /** * Call id */ callId: UUID; /** * Body of an INFO message */ body: string; /** * Optional headers passed with the event */ headers?: Record; /** * MIME type of an INFO message */ mimeType: MIMEType; } type CallInfoReceived = BaseCallEvent; interface CallMessageReceivedPayload { /** * Call id */ callId: UUID; /** * Content of the message */ message: string; } type CallMessageReceived = BaseCallEvent; interface CallUpgradePayload { /** * Call id */ callId: UUID; /** * Watchable property that reflects the current state of the call upgrade request. * * Initially set to [Call.CallUpgradeStatus.Pending]. */ upgradeStatus: ReadonlyWatchable; /** * Accepts the call upgrade request and enables video receiving for the call. * * To also send local video, use [Call.Call.addStream] after accepting. * * @method */ accept: () => void; /** * Rejects the call upgrade request. * * The call continues as audio only. * * @method */ reject: () => void; } type CallUpgrade = BaseCallEvent; type AnyCallEvent = CallStartRinging | CallStopRinging | CallConnected | CallFailed | CallDisconnected | CallStatsReport | CallRemoteMediaAdded | CallRemoteMediaRemoved | CallInfoReceived | CallMessageReceived | CallUpgrade; declare const WEB_SDK_ERROR_SYMBOL: unique symbol; declare class WebSDKError extends Error { /** * @hidden */ [WEB_SDK_ERROR_SYMBOL]?: boolean; /** * Because of using class in different modules (bundled js files) need to override instanceof operator - * different physical instances of the class in different modules should be treated as the same class * @hidden */ static [Symbol.hasInstance](instance: unknown): instance is WebSDKError; } /** * @since 5.1.0 */ export interface DevicesPermissionState { camera: PermissionState; microphone: PermissionState; speaker: PermissionState; } /** * @interface * @since 5.1.0 */ export type RequestPermissionsOptions = RequiredAtLeastOne<{ audio: boolean; camera: boolean; }>; /** * Class that represents permission states for the microphone, speaker, camera, and screen sharing. * * Firefox-specific behavior: * - Dismissing the permission popup is treated as a temporary denial * * Safari-specific behavior: * - Dismissing the permission popup is treated as a temporary denial * - Permission changes in the browser settings may not update the SDK watchable properties * - When a denied permission is changed in the browser settings, the SDK watchable property remains denied, but the permission can be requested * - Temporary denial sets the SDK watchable property to denied, but allows requesting the permission again * - Denying temporarily or dismissing the permission popup 3 times blocks permission requests (even after the page refresh). Open the page in a new tab to request the permission again * */ export declare class DevicePermission { /** * Watchable property that allows getting the microphone permission state. */ microphone: ReadonlyWatchable; /** * Watchable property that allows getting the camera permission state. */ camera: ReadonlyWatchable; /** * Watchable property that allows getting the speaker permission state. */ speaker: ReadonlyWatchable; /** * Watchable property that allows getting the permission state for screen sharing. */ screenSharing: ReadonlyWatchable; private readonly logger?; private skipGetUserMediaProxyError; /** * @hidden */ constructor(container: Container); private updateSpeakerPermission; /** * Browser-specific permission handling: * * Chrome: * - dismissing permission popup (via 'Esc' or close button) throws `NotAllowedError`, but permission remains `prompt` & still can be requested * - after 3 popup dismissals permission in browser settings becomes Blocked firing change event (page refresh doesn't reset this count) * - dismissing `audio: true` popup then `audio: true, video: true` popup counts as 2 audio dismissals and 1 video dismissal * * Firefox: * - blocking permission from popup sets permission to `Blocked temporarily` * - while permission is `Blocked temporarily`, Permissions.query still returns `prompt` * - dismissing permission popup (via 'Esc') throws `NotAllowedError` & sets permission to `Blocked temporarily` * - if `getUserMedia` throws `NotAllowedError`, force deny permission by constraint * * Safari: * - dismissing permission popup (via 'Esc') throws `NotAllowedError`, but permission remains `prompt` & still can be requested * - safari allows requesting & dismissing permission popup 3 times * - after 3 popup dismissals, `getUserMedia` throws error on every call regardless of constraints, even after page refresh (requires new tab); permission remains `prompt` * - Permissions.query before `getUserMedia` call may cause unexpected behavior */ private registerPermissionStatusChecker; private handleGetUserMediaProxyError; private denyPermissionsByConstraints; /** * Returns the current permission status of devices. * @param {'audio' | 'video'} kind kind of device. * @returns {PermissionStatus} */ private getPermissionStatus; private refreshPermissionStatus; /** * Sets listeners for changing accesses to the microphone. * @param {PermissionStatus} permission */ private microphonePermissionListener; /** * Sets listeners for changing accesses to the camera. * @param {PermissionStatus} permission */ private cameraPermissionListener; private getUserMedia; /** * Requests the audio permission. * * Returns a promise that resolves to a [PermissionState]. */ requestAudioPermission(): Promise; /** * Requests the camera permission. * * Calling this method can affect [Stream.StreamManager.createVideoStream] or [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia). * * Note: Repeated calls of this method may briefly activate the camera indicator, even when the permission is already granted. * * Returns a promise that resolves to a [PermissionState]. */ requestCameraPermission(): Promise; /** Browser specific * Chrome works as expected * * Safari: * - Safari permissions are updated on-fly, but permissions.query `change` event is not fired * - if Permissions.query (`refreshPermissionStatus`) is called before `getUserMedia`, `getUserMedia` may throw an error, even if query returned `prompt` * * Firefox: * - handle `Blocked temporarily` behavior */ private isPermissionAllowedToRequest; private isPermissionAllowedToRetry; private resolveRequestPermissionsConstraints; /** * Requests permissions for camera and audio devices. * * Returns a promise that resolves to a [Stream.DevicesPermissionState] containing the permission states for camera, microphone, and speaker. * * If the initial request fails, automatically retries each requested permission separately * * @since 5.1.0 */ requestPermissions(options: RequestPermissionsOptions): Promise; } /** * Class that may be used to manage audio and video devices. */ export declare class Hardware { /** * Allows requesting the microphone and camera permissions and monitor permissions state changes. */ permission: DevicePermission; /** * Watchable property that allows getting the array of the currently available microphones ond observing its changes. */ microphones: ReadonlyWatchable; /** * Watchable property that allows getting the array of the currently available cameras ond observing its changes. */ cameras: ReadonlyWatchable; /** * Watchable property that allows getting the array of the currently available speakers ond observing its changes. */ speakers: ReadonlyWatchable; /** * Watchable property that allows getting the last added audio or video device and observing its changes. */ lastAddedDevice: ReadonlyWatchable; /** * Watchable property that allows getting the last removed audio or video device and observing its changes. */ lastRemovedDevice: ReadonlyWatchable; private readonly taskQueue; private readonly logger?; /** * @hidden */ constructor(container: Container); private init; private needResetDevices; private alreadyResetDevices; private readonly setDevices; /** * Initial setter for lists of each device kind. */ private setDevicesRoutine; /** * Retrieves current list of devices and formats it to `DeviceList` interface. * @returns {DeviceList} */ private getDevices; /** * Checks current state of devices, finds last added or removed * and finally update devices list. */ private updateDeviceList; private subscribeDeviceChanges; } /** * Represents only input devices like Camera and Microphone. * @hidden */ export declare class InputDeviceImpl implements InputDevice { id: string; groupId: string; label: string; kind: DeviceKind.Microphone | DeviceKind.Camera; constructor({ id, label, groupId, kind }: Device); } /** * Represents only output devices such as Speaker. * @hidden */ export declare class OutputDeviceImpl implements OutputDevice { id: string; groupId: string; label: string; kind: DeviceKind.Speaker; constructor({ id, groupId, label }: Omit, "kind">); } /** * Enum that represents the screen sharing video quality. * * @since 5.1.0 */ export declare enum ScreenSharingVideoQuality { /** * HD screen sharing video quality (1280x720). */ HD = "HD", /** * Full HD screen sharing video quality (1920x1080). */ FullHD = "FULL_HD", /** * Use the maximum available screen sharing video quality. */ MaxAvailable = "MAX_AVAILABLE" } /** * Interface that contains the configuration options for a screen sharing stream. */ export interface ScreenSharingConfig { /** * Whether the screen sharing should contain an audio stream. */ audio: boolean; /** * Screen sharing video quality. Default value is [Stream.ScreenSharingVideoQuality.MaxAvailable]. * Note: captured video stream quality is not guaranteed and can be lower than the requested one. * * @since 5.1.0 */ videoQuality?: ScreenSharingVideoQuality; } /** * Thrown if an operation is not supported. * * @folder Errors * @hideconstructor */ export declare class NotSupportedError extends WebSDKError { constructor(action: string); } /** * Class that provides API for creating and managing audio and video streams. * @hideconstructor */ export declare class StreamManager { private readonly streams; private readonly container; private readonly logger?; constructor(container: Container); /** * Returns a local audio or video stream by its id or null if there is no stream with the provided id. * * @param id Stream id */ getStream(id: string): LocalStream | LocalScreenSharingStream | null; /** * Creates an audio stream. * * Returns a promise that resolves to a [Stream.LocalStream] object. * * @param config Audio stream configuration * @param deviceId Preferred audio device id * @throws Any error from the [MediaDevices.getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#exceptions) API */ createAudioStream(config: AudioConfig, deviceId?: string): Promise; /** * Creates a local stream with a provided [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) object. * * @param stream MediaStream object * @throws [AtLeastOneTrackRequired] if a media stream does not contain tracks */ wrapAudioStream(stream: MediaStream): LocalStream; /** * Creates a video stream. * * The specified quality in the video configuration can be lowered if the device cannot provided, or if the stream capture has already begun. * * Please avoid concurrent calls of this method with [Stream.DevicePermission.requestCameraPermission] and [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia). * * Returns a promise that resolves to a [Stream.LocalStream] object. * * @param config Video stream configuration * @param deviceId Preferred video device id * @throws Any error from the [MediaDevices.getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#exceptions) API */ createVideoStream(config: VideoConfig, deviceId?: string): Promise; /** * Creates a screen sharing stream. * * Returns a promise that resolves to a [Stream.LocalScreenSharingStream] object. * @param config Screen sharing configuration * @throws Any error from the [MediaDevices.getDisplayMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#exceptions) API */ createScreenSharingStream(config?: ScreenSharingConfig): Promise; /** * Stops and removes a stream by its id. * * Stream stop results in closing all [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) * associated with the stream and releasing its source (microphone, camera, or display) * * After calling this method, the stream cannot be obtained by the [Stream.StreamManager.getStream] method. * * @param id Stream id */ stopStream(id: string): void; private addStreamToStore; private removeStream; } /** * Enum that represents audio processor states. */ export declare enum AudioProcessorState { /** * Audio processor is created. */ New = "NEW", /** * Audio processor is closed. */ Closed = "CLOSED", /** * Audio processor is initialized and ready to be used. */ Ready = "READY" } /** * Interface that represents an audio processor. */ export interface AudioProcessor { /** * Audio processor id. */ readonly id: UUID; /** * Watchable property that allows getting the audio processor state. */ state: ReadonlyWatchable; /** * Local audio stream with unprocessed audio. */ readonly originalStream: LocalStream | null; /** * Local audio stream with processed audio. */ readonly processedStream: LocalStream | null; /** * Whether the audio processor should pass [Stream.AudioProcessor.originalStream] directy to * [Stream.AudioProcessor.processedStream] without any processing. */ bypass: boolean; /** * Stops the audio processor. */ stop: () => Promise; /** * Updates the local audio stream. * @param streamToProcess Local audio stream * @throws [Stream.Errors.AudioProcessorNotInitialized] */ updateSourceStream: (streamToProcess: LocalStream) => Promise; /** * Starts processing audio in the provided local audio stream. * @param streamToProcess Local audio stream */ startProcessing: (streamToProcess: LocalStream) => Promise; /** * Sets a WASM processor. * @param processor WASM processor */ setProcessor: (processor: WasmProcessor) => void; } /** * Thrown if an audio processor instance has not been initialized or started * * @folder Errors * @hideconstructor */ export declare class AudioProcessorNotInitialized extends WebSDKError { constructor(description: string); } /** * Enum that represents audio prcessing types. */ export declare enum AudioProcessingType { /** * No audio enhancements. */ Disabled = "DISABLED", /** * Browser-based noise suppression, echo cancellation, and auto gain control, minimal CPU usage. * Good for low-end and mobile devices. */ Basic = "BASIC", /** * Advanced noise suppression with browser-based echo cancellation and auto gain control, moderate CPU usage. * Good for mid-range devices and desktop browsers. * * Not recommended for mobile devices. * * [NoiseSuppressionBalanced] module is required before using this option. */ Balanced = "BALANCED", /** * Aggressive noise suppression with browser-based echo cancellation and auto gain control, high CPU usage. * It is recommended to use only for very noisy environments. * Good for high-end devices and desktop browsers with an external microphone. * * Not recommended for mobile browsers and microphones with built-in noise suppression. * * [NoiseSuppressionAggressive] module is required before using this option. */ Aggressive = "AGGRESSIVE" } /** * Device tracker helper that simplifies handling audio and video device changes during an active call or conference. */ export interface DeviceTrackerHelper { /** * Instance id. */ readonly id: UUID; /** * Whether the helper is enabled. */ get enabled(): boolean; /** * Watchable property that allows getting and setting the video sending status in a call or conference. */ shouldSendVideo: Watchable; /** * Watchable property that allows getting the list of currently available camera devices. */ cameras: ReadonlyWatchable; /** * Watchable property that allows observing if a local video stream is currently being updated. */ isVideoStreamUpdating: ReadonlyWatchable; /** * Watchable property that allows getting the list of currently available microphone devices. */ microphones: ReadonlyWatchable; /** * Watchable property that allows observing if a local audio stream is currently being updated. */ isAudioStreamUpdating: ReadonlyWatchable; /** * Watchable property that allows getting the list of currently available speaker devices. */ speakers: ReadonlyWatchable; /** * Watchable property that allows getting and setting and changing the currently active microphone. */ currentMicrophone: Watchable; /** * Watchable property that allows getting and setting the currently active camera. * * If current camera is disconnected: * - [Stream.DeviceTrackerHelper.shouldSendVideo] sets to false * - [Stream.DeviceTrackerHelper.videoStream] stops and sets to null * - [Stream.DeviceTrackerHelper.currentCamera] switches to another available camera or null */ currentCamera: Watchable; /** * Watchable property that allows getting and setting the current video configuration for a call or conference. */ cameraConfig: Watchable; /** * Watchable property that allows getting and setting the currently active speaker. */ currentSpeaker: Watchable; /** * Watchable property that allows getting the currently active local audio stream and observe its changes. * * The audio stream updates if: * - the audio processing type changed * - the current microphone has changed * - the current microphone has been detached from the device * - a new headset attached */ audioStream: ReadonlyWatchable; /** * Watchable property that allows getting the currently active local video stream and observe its changes. * * The video stream is set to null and removed from the call/conference if the current input device detach. */ videoStream: ReadonlyWatchable; /** * Watchable property that allows getting a video stream preview. * * The preview video stream is not sending in a call or conference, but may be used to show the local preview before * a call or conference starts or in the video settings of the active call or conference. */ previewVideoStream: ReadonlyWatchable; /** * Watchable property that allows observing if a video stream for a local preview is currently being updated. */ isPreviewVideoStreamUpdating: ReadonlyWatchable; /** * Toggles the helper state (disables it if it is enabled and enables it if it is disabled). */ toggleTracker: () => void; /** * Enables the helper. */ enableTracker: () => void; /** * Disables the helper. */ disableTracker: () => void; /** * Toggles the video sending state in a call or conference (starts sending video if the video is not sent or * stops sending video if it is currently being sent). * * Returns a promise that is resolved when the operation is completed. * * This method does not throw an error in case of a failure, however, in this case [Stream.DeviceTrackerHelper.shouldSendVideo] is not changed. */ toggleSendingVideo: () => Promise; /** * Starts sending video to a call or conference. * * Returns a promise that is resolved when the operation is completed. * * This method does not throw an error in case of a failure, however, in this case [Stream.DeviceTrackerHelper.shouldSendVideo] is not changed. */ startSendingVideo: () => Promise; /** * Stops sending video to a call or conference. * * Returns a promise that is resolved when the operation is completed. * * This method does not throw an error in case of a failure, however, in this case [Stream.DeviceTrackerHelper.shouldSendVideo] is not changed. */ stopSendingVideo: () => Promise; /** * Watchable property that allows starting or stopping a preview video stream. */ shouldPreviewVideo: Watchable; /** * Creates or closes a local video stream for the local preview. * * Returns a promise that is resolved when the operation is completed. */ togglePreviewVideo: () => Promise; /** * Creates a local video stream for the local preview. * * Returns a promise that is resolved when the operation is completed. * * If the operation is completed successfully, [Stream.DeviceTrackerHelper.previewVideoStream] is updated. */ startPreviewVideo: () => Promise; /** * Closes a local video stream created for the local preview and releases its resources. * * Returns a promise that is resolved when the operation is completed. */ stopPreviewVideo: () => Promise; /** * Connects a conference instance to the device tracker helper. Only one [Conference.Conference] or [Call.Call] instance * can be connected to the device helper. * @param conference Conference instance */ attachConference: (conference: Conference) => Promise; /** * Connects a conference instance to the device tracker helper. Only one [Conference.Conference] or [Call.Call] instance * can be connected to the device helper. * @param call Call instance */ attachCall: (call: Call) => Promise; /** * Watchable property that allows getting and setting the audio processing type. */ audioProcessing: Watchable; /** * Watchable property that indicates if the audio processing should be applied. * * Affects only [Stream.AudioProcessingType.Balanced] and [Stream.AudioProcessingType.Aggressive] processing types. */ bypassAudioProcessing: Watchable; /** * Stops all streams managed by the device tracker helper and releases all resources. */ clear: () => Promise; } /** * Enum that represents available helpers for audio and video streams. */ export declare enum StreamHelper { /** * Device tracker helper simplifies the handling of audio and video device changes in an active call or conference and * covers the following cases: * - a new audio device is available * - the currently active audio device becomes unavailable * - a user switches audio or video device * - the quality of a video stream changes */ DeviceTracker = "DEVICE_TRACKER", /** * Audio processor helper gives the possibility to preprocess audio data before sending it to a call or conference. */ AudioProcessor = "AUDIO_PROCESSOR" } interface StreamHelperMapper { [StreamHelper.DeviceTracker]: DeviceTrackerHelper; [StreamHelper.AudioProcessor]: AudioProcessor; } /** * Type that represents the union of all available helpers for audio and video streams. */ export type AnyStreamHelper = DeviceTrackerHelper | AudioProcessor; /** * Enum that represents the media renderer types. */ export declare enum MediaRendererType { /** * Audio renderer. */ Audio = "Audio", /** * Video renderer. */ Video = "Video" } /** * Base interface for audio and video renderers. * * @see [Stream.AudioRenderer], [Stream.VideoRenderer] */ export interface Renderer { /** * Render type. */ readonly type: MediaRendererType; /** * Returns an HTML element. */ getElement: () => HTMLVideoElement | HTMLAudioElement; /** * Replaces a stream for a renderer. * @param stream Stream to be rendered */ updateStream: (stream: Stream) => void; /** * Changes the audio renderer output to the specified device id. * * @param speakerId Output device id */ updateSpeaker?: (speakerId: string) => Promise; /** * Stops playing media and releases all resources. */ clear: () => void; } /** * CSS styles as a record of property names and values, like: * ```javascript * { width: '100px', height: '100px' } * ``` */ export type PlainStyles = { [K in keyof CSSStyleDeclaration as CSSStyleDeclaration[K] extends string ? K : never]?: string | null; }; /** * Class that represents an audio renderer. * * An instance should be created via the [Stream.RendererManager.createVideoRenderer] method */ export declare class VideoRenderer implements Renderer { private readonly element; private static readonly NOT_OVERRIDDEN_STYLES; private readonly logger?; private stream; /** * @hidden */ constructor(stream: Stream, container: Container); /** * Returns the renderer type (video). */ get type(): MediaRendererType.Video; /** * Returns a [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement) object * and starts playing video. */ getElement(): HTMLVideoElement; /** * Updates the collection of the class attributes of the video element with the provided ones. * @param classes Array of class attributes */ setElementClasses(classes: string[]): this; /** * Sets the HTML id attribute to the video element. * @param elementId Id attribute */ setElementId(elementId: string): this; setStyles(styles: PlainStyles): this; /** * Mirrors the current video element. */ mirror(): this; /** * Replaces a stream for the renderer. * * @param stream Video stream to be rendered * @throws [Stream.Errors.StreamTypeMismatch] if the provided stream is not of type [Stream.StreamType.Video] */ updateStream(stream: Stream): void; /** * Stops playing audio and releases all resources. */ clear(): void; private isWritableStyle; private addDebugListeners; } /** * Class that represents an audio renderer. * * An instance should be created via the [Stream.RendererManager.createAudioRenderer] method. */ export declare class AudioRenderer implements Renderer { private readonly element; private readonly logger?; private stream; /** * Current speaker device id. */ currentSpeakerId: string | null; /** * @hidden */ constructor(stream: Stream, container: Container); /** * Returns the renderer type (audio). */ get type(): MediaRendererType.Audio; /** * Returns a [HTMLAudioElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) object * and starts playing audio. */ getElement(): HTMLAudioElement; /** * Sets the audio volume for the