import { Logger } from '../../common/utils'; import { BaseComponent } from '../base'; import { ComponentNames } from '../types'; import { WhoIsOnlinePosition, WhoIsOnlineOptions } from './types'; export declare class WhoIsOnline extends BaseComponent { private options?; name: ComponentNames; protected logger: Logger; private element; private position; private following; private localParticipantId; private initialized; constructor(options?: WhoIsOnlinePosition | WhoIsOnlineOptions); /** * @function start * @description Initializes the Who Is Online component * @returns {void} */ protected start(): void; /** * @function destroy * @description Destroys the Who Is Online component * @returns {void} */ protected destroy(): void; /** * @function addListeners * @description adds event listeners to the who is online element. * @returns {void} */ private addListeners; /** * @function removeListeners * @description adds event listeners from the who is online element. * @returns {void} */ private removeListeners; /** * @function subscribeToRealtimeEvents * @description Subscribes to realtime events * @returns {void} */ private subscribeToRealtimeEvents; /** * @function unsubscribeToRealtimeEvents * @description Unsubscribes to realtime events * @returns {void} */ private unsubscribeFromRealtimeEvents; /** * @function initializeList * @description Initializes the participants list with participants already in the room * @returns {void} */ private initializeList; /** * @function onParticipantListUpdate * @description Receives data about participants in the room who were not loaded * when the component was initialized * @param {PresenceEvent} event * @returns {void} */ private onParticipantListUpdate; /** * @function onParticipantLeave * @description Removes a participant from the participants list when they leave the room * @param {PresenceEvent} event * @returns {void} */ private onParticipantLeave; /** * @function updateParticipant * @description Update a regular participant with their newly sent data * @param {WhoIsOnlineParticipant} participant The participant with new data * @returns {void} */ private updateParticipant; /** * @function updateExtra * @description Update an extra participant (one that is only visible by * opening the dropdown) with their newly sent data * @param {WhoIsOnlineParticipant} participant The participant with new data * @returns {void} */ private updateExtra; /** * @function subscribeToLocalParticipantUpdates * @description Subscribes to updates in the local participant and updates * the presence accordingly * @param {Participant} participant The local participant * @returns {void} */ private subscribeToLocalParticipantUpdates; /** * @function goToMousePointer * @description Publishes the go to event to the event bus * @param {CustomEvent | PresenceEvent} event * @returns {void} */ private goToMousePointer; /** * @function followMousePointer * @description Publishes the follow event to the event bus * @param {CustomEvent} event * @returns {void} */ private followMousePointer; /** * @function setPrivate * @description Publishes the private event to realtime and the event bus * @param {CustomEvent} event * @returns {void} */ private setPrivate; /** * @function setFollow * @description Sets participant being followed after someone used Everyone Follows Me * @param followingData * @returns */ private setFollow; private follow; /** * @function stopFollowing * @description Stops following a participant * @param {PresenceEvent} event The message sent from room * (in case of being called as a callback) * @returns */ private stopFollowing; /** * @function gather * @description Propagates the gather all event in the room * @param {CustomEvent} data The custom event object containing data about * the participant calling for the gather all */ private gather; /** * @function setStyles * @param {string} styles - The user custom styles to be added to the who is online * @returns {void} */ private setStyles; /** * @function positionWhoIsOnline * @description Positions the Who Is Online component on the screen * @returns {void} */ private positionWhoIsOnline; /** * @function getParticipant * @description Processes the data from a participant to something usable in * the Who Is Online component * @param {Participant} participant The participant that will be processed * @returns {WhoIsOnlineParticipant} The data that will be used in the Who Is Online component */ private getParticipant; /** * @function shouldDisableDropdown * @description Decides whether the dropdown with presence controls should be * available in a given participant, varying whether they have a presence control enabled or not * @param {activeComponents: string[] | undefined; participantId: string;} * data Info regarding the participant that will be used to decide if their * avatar will be clickable * @returns {boolean} True or false depending if should disable the participant dropdown or not */ private shouldDisableDropdown; /** * @function getTooltipData * @description Processes the participant info and discovers how the tooltip * message should looking when hovering over their avatars * @param {isLocalParticipant: boolean; name: string; presenceEnabled: boolean } * data Relevant info about the participant that will be used to decide * @returns {TooltipData} What the participant tooltip will look like */ private getTooltipData; /** * @function getAvatar * @description Processes the info of the participant's avatar * @param { avatar: Avatar; name: string; color: string; letterColor: string } data Information * about the participant that will take part in their avatar somehow * @returns {Avatar} Information used to decide how to construct the participant's avatar html */ private getAvatar; /** * @function getControls * @description Decides which presence controls the user should see when opening a participant * dropdown * @param { participantId: string; presenceEnabled: boolean } data Relevant info about the * participant that will be used to decide * @returns {DropdownOption[]} The presence controls enabled for a given participant */ private getControls; /** * @function getOtherParticipantsControls * @description Decides which presence controls the user should see when opening the dropdown of * a participant that is not the local participant * @param {string} participantId Which participant is being analyzed * @returns {DropdownOption[]} The presence controls enabled for the participant */ private getOtherParticipantsControls; /** * @function getLocalParticipantControls * @description Decides which presence controls the user should see when opening the dropdown * of the local participant * @returns {DropdownOption[]} The presence controls enabled for the local participant */ private getLocalParticipantControls; /** * @function updateParticipantsControls * @description Updated what the presence controls of a single participant should look like * now that something about them was updated * @param {string | undefined} participantId The participant that suffered some update * @returns {void} The participants that did not fit the main list and will be inserted in * the extras participants list */ private updateParticipantsControls; /** * @function highlightParticipantBeingFollowed * @description Brings a participant that is in the list of extra participants to the front, * in the second place of the list of main participants, so they are visible while being followed * @returns {void} */ private highlightParticipantBeingFollowed; /** * @function isInPresence * @description Checks if the participant is in presence * @param {ComponentNames[]} activeComponents * @returns {boolean} */ private isInPresence; private onJoinedRoom; }