import { Room } from '@superviz/socket-client'; import { TranscriptState } from '../../common/types/events.types'; import { VideoParticipant } from '../../common/types/participant.types'; import { Logger, Observer } from '../../common/utils'; import { useStore as useStoreType } from '../../common/utils/use-store'; import { DrawingData } from '../video-conference-manager/types'; import { VideoRoomProperties } from './type'; export declare class RoomStateService { private room; private logger; private myParticipant; private localRoomProperties; private drawingData; private enableSync; private left; private isSyncFrozen; private state; private readonly MESSAGE_SIZE_LIMIT; private useStore; kickParticipantObserver: Observer; private started; private drawingRoom; constructor(room: Room, drawingRoom: Room, logger: Logger, useStore: typeof useStoreType); /** * @function join * @description subscribes to room events * @returns {void} */ private join; /** * @function updateMyProperties * @param {Partial} newProperties * @description updates local participant properties * @returns {void} */ updateMyProperties: (newProperties?: Partial) => void; /** * @function isMessageTooBig * @description calculates the size of a sync message and checks if it's bigger than limit * @param {unknown} msg * @param {number} limit * @returns {boolean} */ private isMessageTooBig; /** * @function updateRoomProperties * @param {VideoRoomProperties} properties * @description updates room properties * @returns {void} */ updateRoomProperties: (properties: VideoRoomProperties) => void; /** * @function updateDrawingProperties * @param {DrawingData} data * @description updates drawing properties * @returns {void} */ private updateDrawingProperties; /** * @function setHost * @param {string} participantId * @description set a new host to the room * @returns {void} */ setHost: (participantId: string) => void; /** * @function setKickParticipant * @param {string} kickParticipantId * @description set a participant to be kicked from the room * @returns {void} */ setKickParticipant: (kickParticipantId: string) => Promise; /** * @function setGridMode * @param {boolean} isGridModeEnabled * @description synchronizes the grid mode of the cameras in the room * @returns {void} */ setGridMode(isGridModeEnabled: boolean): void; /** * @function setDrawing * @param drawing {DrawingData} - drawing payload* * @description synchronizes the drawing in the room * @returns {void} */ setDrawing(drawing: DrawingData): void; /** * @function setTranscript * @param state {TranscriptState} * @description synchronizes the transcript state in the room * @returns {void} */ setTranscript(state: TranscriptState): void; /** * @function initializeRoomProperties * @description Initializes the room properties, including setting the host client ID and updating the participant list. * @returns {Promise} */ private initializeRoomProperties; /** * @function onParticipantLeave * @returns {void} * @param presence */ private onParticipantLeave; /** * @function fetchRoomProperties * @returns {VideoRoomProperties | null} */ private fetchRoomProperties; /** * @function start * @returns {Promise} */ start: () => Promise; /** * @function publishStateUpdate * @description saves the room locally and publishes it to the sdk * @param {RealtimeStateTypes} state * @returns */ private publishStateUpdate; /** * @function onAblyPresenceEnter * @description callback that receives the event that a participant has entered the room * @returns {void} */ private onPresenceEnter; /** * @function setFollowParticipant * @param {string} participantId * @description add/change and sync a property in the room * @returns {void} */ setFollowParticipant(participantId?: string): void; /** * @function setGather * @param {boolean} active * @description sync to all participants to go to the host position * @returns {void} */ setGather(active: boolean): void; /** * @function updateLocalRoomState * @description update room data * @param {VideoRoomProperties} data * @returns {void} */ private updateLocalRoomState; private updateDrawing; /** * @function freezeSync * @param {boolean} isFrozen * @description Detaches and unsubscribes from channels to freeze synchronization with the room. * @returns {void} */ freezeSync: (isFrozen: boolean) => void; /** * @function destroy * @description stopsthe service */ destroy(): void; }