import MediaOption from '../enums/MediaOption'; import ParticipantState from '../enums/ParticipantState'; import UserRole from '../enums/UserRole'; import { ParticipantStatus } from '../static/External'; import MediaSettings from '../types/MediaSettings'; import { ExternalId, ExternalParticipantId, ExternalParticipantListMarkers } from './ExternalId'; import { ISharedMovieInfo } from './MovieShare'; import MuteStates from './MuteStates'; import ParticipantLayout from './ParticipantLayout'; import { StreamDescriptionString } from './ParticipantStreamDescription'; /** * Уникально идентифицирует пользователя или группу */ export type CompositeUserId = string; /** * Уникально идентифицирует участника звонка * (одному пользователю могут соответствовать несколько участников, в случае если пользователь зашёл в звонок с нескольких устройств) * Включает композитный id и постфикс с номером устройства, если он не равен 0 */ export type ParticipantId = string; export type OkUserId = number; /** * Тип списка участников в звонке */ export type ParticipantListType = 'GRID' | 'SIDE' | 'ADMIN'; /** * Маркер определяющий положение участника в списке */ export interface ParticipantListMarker { rank?: number; ts?: number; id?: CompositeUserId; } /** * Маркеры определяющие положения участников в списке */ export type ParticipantListMarkers = Record; /** * Стейт участника звонка */ export interface ParticipantStateMapped { [key: string]: { state: string; ts: number; }; } /** * Состояния участников звонка */ export type ParticipantsStateList = { externalId: ExternalParticipantId; participantState: ParticipantStateMapped; markers: ExternalParticipantListMarkers | null; }[]; export interface Participant { /** * string representation */ id: ParticipantId; /** * If user has 'decorative external id' it will be set as externalId */ externalId: ExternalParticipantId; mediaSettings: MediaSettings; state: ParticipantState; status: ParticipantStatus; remoteStream?: MediaStream | null; remoteAudioTrack?: MediaStreamTrack | null; secondStream?: MediaStream | null; mediaSource?: MediaStreamAudioSourceNode | null; platform: string; clientType: string; roles: UserRole[]; participantState: ParticipantStateMapped; networkRating: number; lastRequestedLayouts: { [key: StreamDescriptionString]: ParticipantLayout; }; muteStates: MuteStates; unmuteOptions: MediaOption[]; observedIds: CompositeUserId[]; markers: ExternalParticipantListMarkers | null; movieShareInfos?: ISharedMovieInfo[]; isInRoom?: boolean; } export interface IGetParticipantsParameters { externalIds: ExternalId[]; } export type ParticipantStateDataKey = 'hand' | 'drat'; export declare enum ParticipantStateDataValue { OFF = "0", ON = "1" } /** * Список состояний в виде ключ-значение. Максимальная длина ключей и значений - 5 символов. Пустые значения будут пропущены */ export type ParticipantStateData = Partial>;