import { ServerMuteReason } from '@webex/media-helpers'; export declare const createMuteState: (type: any, meeting: any, enabled: boolean) => MuteState; /** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches the last requested state by the client. More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html# This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called */ export declare class MuteState { state: { client: { enabled: boolean; localMute: boolean; }; server: { localMute: boolean; remoteMute: boolean; unmuteAllowed: boolean; }; syncToServerInProgress: boolean; }; type: any; ignoreMuteStateChange: boolean; /** * Constructor * * @param {String} type - audio or video * @param {Object} meeting - the meeting object (used for reading current remote mute status) * @param {boolean} enabled - whether the client audio/video is enabled at all */ constructor(type: string, meeting: any, enabled: boolean); /** * Starts the mute state machine. Needs to be called after a new MuteState instance is created. * * @param {Object} meeting - the meeting object * @returns {void} */ init(meeting: any): void; /** * This method needs to be called whenever the local audio/video stream has changed. * It reapplies the remote mute state onto the new stream and also reads the current * local mute state from the stream and updates the internal state machine and sends * any required requests to the server. * * @param {Object} meeting - the meeting object * @returns {void} */ handleLocalStreamChange(meeting: any): void; /** * Enables/disables audio/video * * @param {Object} meeting - the meeting object * @param {boolean} enable * @returns {void} */ enable(meeting: any, enable: boolean): void; /** * Mutes/unmutes local stream * * @param {Object} meeting - the meeting object * @param {Boolean} mute - true to mute the stream, false to unmute it * @param {ServerMuteReason} reason - reason for muting/unmuting * @returns {void} */ private muteLocalStream; /** * This method should be called when the local stream mute state is changed * @public * @memberof MuteState * @param {Object} [meeting] the meeting object * @returns {void} */ handleLocalStreamMuteStateChange(meeting?: any): void; /** * Applies the current mute state to the local stream (by enabling or disabling it accordingly) * * @public * @param {Object} [meeting] the meeting object * @param {ServerMuteReason} reason - reason why we're applying our client state to the local stream * @memberof MuteState * @returns {void} */ applyClientStateLocally(meeting?: any, reason?: ServerMuteReason): void; /** Returns true if client is locally muted - it takes into account not just the client local mute state, * but also whether audio/video is enabled at all * * @returns {boolean} */ private getClientLocalMuteState; /** * Updates the server local and remote mute values so that they match the current client desired state. * * @private * @param {Object} [meeting] the meeting object * @memberof MuteState * @returns {void} */ private applyClientStateToServer; /** * Sets the local mute value in the server * * @private * @param {Object} [meeting] the meeting object * @memberof MuteState * @returns {Promise} */ private sendLocalMuteRequestToServer; /** * Sets the remote mute value in the server * * @private * @param {Object} [meeting] the meeting object * @memberof MuteState * @returns {Promise} */ private sendRemoteMuteRequestToServer; /** Applies the current value for unmute allowed to the underlying stream * * @param {Meeting} meeting * @returns {void} */ private applyUnmuteAllowedToStream; /** * This method should be called whenever the server remote mute state is changed * * @public * @memberof MuteState * @param {Meeting} meeting * @param {Boolean} [muted] true if user is remotely muted, false otherwise * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when "hard mute" feature is used) * @returns {undefined} */ handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean): void; /** * This method should be called whenever we receive from the server a requirement to locally unmute * * @public * @memberof MuteState * @param {Object} [meeting] the meeting object * @param {Boolean} [unmuteAllowed] whether the user is allowed to unmute self * @returns {undefined} */ handleServerLocalUnmuteRequired(meeting: any, unmuteAllowed: boolean): void; /** * Returns true if the user is locally or remotely muted. * It only checks the mute status, ignoring the fact whether audio/video is enabled. * * @public * @memberof MuteState * @returns {Boolean} */ isMuted(): boolean; /** * Returns true if the user is remotely muted * * @public * @memberof MuteState * @returns {Boolean} */ isRemotelyMuted(): boolean; /** * Returns true if unmute is allowed * * @public * @memberof MuteState * @returns {Boolean} */ isUnmuteAllowed(): boolean; /** * Returns true if the user is locally muted or audio/video is disabled * * @public * @memberof MuteState * @returns {Boolean} */ isLocallyMuted(): boolean; }