@cloudflare/realtimekit 0.5.0-staging.49 → 0.5.0-staging.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,7 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import { MessageType as MessageType$1 } from '@protobuf-ts/runtime';
3
+ import * as _dyteinternals_utils from '@dyteinternals/utils';
4
+ import { ViewType, PresetTypeV2, MediaVideoQualityType, MediaProductionPermissionType, WaitingRoomTypes, MediaScreenShareQualityType, LivestreamViewerMediaQualityType, PluginAccessControls, RecorderType as RecorderType$1, BorderRadius, BorderWidth, Theme } from '@dyteinternals/utils';
3
5
  import * as WorkerTimers from 'worker-timers';
4
6
  // TypeScript Version: 3.0
5
7
  type AxiosRequestHeaders = Record<string, string | number | boolean>;
@@ -224,6 +226,54 @@ declare enum ProducerKind {
224
226
  */
225
227
  VIDEO = 1
226
228
  }
229
+ declare class Codec$Type extends MessageType$1<Codec> {
230
+ constructor();
231
+ }
232
+ /**
233
+ * @generated from protobuf message media.Codec
234
+ */
235
+ interface Codec {
236
+ /**
237
+ * @generated from protobuf field: optional int32 channels = 1;
238
+ */
239
+ channels?: number;
240
+ /**
241
+ * @generated from protobuf field: int32 clock_rate = 2;
242
+ */
243
+ clockRate: number;
244
+ /**
245
+ * @generated from protobuf field: string mime_type = 3;
246
+ */
247
+ mimeType: string;
248
+ /**
249
+ * @generated from protobuf field: optional string sdp_fmtp_line = 4;
250
+ */
251
+ sdpFmtpLine?: string;
252
+ }
253
+ /**
254
+ * @generated MessageType for protobuf message media.Codec
255
+ */
256
+ declare const Codec: Codec$Type;
257
+ declare class HeaderExtension$Type extends MessageType$1<HeaderExtension> {
258
+ constructor();
259
+ }
260
+ /**
261
+ * @generated from protobuf message media.HeaderExtension
262
+ */
263
+ interface HeaderExtension {
264
+ /**
265
+ * @generated from protobuf field: optional string direction = 1;
266
+ */
267
+ direction?: string;
268
+ /**
269
+ * @generated from protobuf field: string uri = 2;
270
+ */
271
+ uri: string;
272
+ }
273
+ /**
274
+ * @generated MessageType for protobuf message media.HeaderExtension
275
+ */
276
+ declare const HeaderExtension: HeaderExtension$Type;
227
277
  declare class SessionDescription$Type extends MessageType$1<SessionDescription> {
228
278
  constructor();
229
279
  }
@@ -307,6 +357,10 @@ interface ProducerState$1 {
307
357
  * @generated from protobuf field: optional string producing_transport_id = 6;
308
358
  */
309
359
  producingTransportId?: string;
360
+ /**
361
+ * @generated from protobuf field: optional string mime_type = 7;
362
+ */
363
+ mimeType?: string;
310
364
  }
311
365
  /**
312
366
  * @generated MessageType for protobuf message media.ProducerState
@@ -336,6 +390,66 @@ interface ConsumerState {
336
390
  * @generated MessageType for protobuf message media.ConsumerState
337
391
  */
338
392
  declare const ConsumerState: ConsumerState$Type;
393
+ declare class PeerRtpCapabilitites$Type extends MessageType$1<PeerRtpCapabilitites> {
394
+ constructor();
395
+ }
396
+ /**
397
+ * @generated from protobuf message media.PeerRtpCapabilitites
398
+ */
399
+ interface PeerRtpCapabilitites {
400
+ /**
401
+ * @generated from protobuf field: media.RtpCapabilitites sender = 1;
402
+ */
403
+ sender?: RtpCapabilitites;
404
+ /**
405
+ * @generated from protobuf field: media.RtpCapabilitites receiver = 2;
406
+ */
407
+ receiver?: RtpCapabilitites;
408
+ }
409
+ /**
410
+ * @generated MessageType for protobuf message media.PeerRtpCapabilitites
411
+ */
412
+ declare const PeerRtpCapabilitites: PeerRtpCapabilitites$Type;
413
+ declare class RtpCapability$Type extends MessageType$1<RtpCapability> {
414
+ constructor();
415
+ }
416
+ /**
417
+ * @generated from protobuf message media.RtpCapability
418
+ */
419
+ interface RtpCapability {
420
+ /**
421
+ * @generated from protobuf field: repeated media.Codec codecs = 1;
422
+ */
423
+ codecs: Codec[];
424
+ /**
425
+ * @generated from protobuf field: repeated media.HeaderExtension header_extensions = 2;
426
+ */
427
+ headerExtensions: HeaderExtension[];
428
+ }
429
+ /**
430
+ * @generated MessageType for protobuf message media.RtpCapability
431
+ */
432
+ declare const RtpCapability: RtpCapability$Type;
433
+ declare class RtpCapabilitites$Type extends MessageType$1<RtpCapabilitites> {
434
+ constructor();
435
+ }
436
+ /**
437
+ * @generated from protobuf message media.RtpCapabilitites
438
+ */
439
+ interface RtpCapabilitites {
440
+ /**
441
+ * @generated from protobuf field: media.RtpCapability audio = 1;
442
+ */
443
+ audio?: RtpCapability;
444
+ /**
445
+ * @generated from protobuf field: media.RtpCapability video = 2;
446
+ */
447
+ video?: RtpCapability;
448
+ }
449
+ /**
450
+ * @generated MessageType for protobuf message media.RtpCapabilitites
451
+ */
452
+ declare const RtpCapabilitites: RtpCapabilitites$Type;
339
453
  declare class GeoLocation$Type extends MessageType$1<GeoLocation> {
340
454
  constructor();
341
455
  }
@@ -429,6 +543,10 @@ interface RoomParticipants {
429
543
  * @generated from protobuf field: optional string user_id = 4;
430
544
  */
431
545
  userId?: string;
546
+ /**
547
+ * @generated from protobuf field: optional media.PeerRtpCapabilitites capabilities = 5;
548
+ */
549
+ capabilities?: PeerRtpCapabilitites;
432
550
  }
433
551
  /**
434
552
  * @generated MessageType for protobuf message media.edge.RoomParticipants
@@ -571,7 +689,7 @@ declare const GlobalPeerPinningBroadcastResponse: GlobalPeerPinningBroadcastResp
571
689
  *
572
690
  * @generated from protobuf enum common.RecordingType
573
691
  */
574
- declare enum RecordingType {
692
+ declare enum RecordingType$1 {
575
693
  /**
576
694
  * @generated from protobuf enum value: BROWSER = 0;
577
695
  */
@@ -613,7 +731,7 @@ declare enum StageType {
613
731
  /**
614
732
  * @generated from protobuf enum socket.room.RecorderType
615
733
  */
616
- declare enum RecorderType$1 {
734
+ declare enum RecorderType {
617
735
  /**
618
736
  * @generated from protobuf enum value: RECORDER_TYPE_NONE = 0;
619
737
  */
@@ -818,7 +936,7 @@ interface ActiveRecording {
818
936
  /**
819
937
  * @generated from protobuf field: common.RecordingType recording_type = 2;
820
938
  */
821
- recordingType: RecordingType;
939
+ recordingType: RecordingType$1;
822
940
  /**
823
941
  * @generated from protobuf field: string recording_status = 3;
824
942
  */
@@ -863,6 +981,18 @@ interface WaitingRoomRequest {
863
981
  * @generated from protobuf field: string display_name = 3;
864
982
  */
865
983
  displayName: string;
984
+ /**
985
+ * @generated from protobuf field: optional string picture = 4;
986
+ */
987
+ picture?: string;
988
+ /**
989
+ * @generated from protobuf field: optional string custom_participant_id = 5;
990
+ */
991
+ customParticipantId?: string;
992
+ /**
993
+ * @generated from protobuf field: optional string preset_name = 6;
994
+ */
995
+ presetName?: string;
866
996
  }
867
997
  /**
868
998
  * @generated MessageType for protobuf message socket.room.WaitingRoomRequest
@@ -1214,7 +1344,7 @@ interface PresetUpdates {
1214
1344
  /**
1215
1345
  * @generated from protobuf field: optional socket.room.RecorderType recorder_type = 18;
1216
1346
  */
1217
- recorderType?: RecorderType$1;
1347
+ recorderType?: RecorderType;
1218
1348
  /**
1219
1349
  * @generated from protobuf field: optional bool hidden_participant = 19;
1220
1350
  */
@@ -1865,202 +1995,117 @@ interface RecordingEvent {
1865
1995
  /**
1866
1996
  * @generated from protobuf field: common.RecordingType recording_type = 3;
1867
1997
  */
1868
- recordingType: RecordingType;
1998
+ recordingType: RecordingType$1;
1869
1999
  }
1870
2000
  /**
1871
2001
  * @generated MessageType for protobuf message socket.recording.RecordingEvent
1872
2002
  */
1873
2003
  declare const RecordingEvent: RecordingEvent$Type;
1874
- declare type BorderWidth = 'none' | 'thin' | 'fat';
1875
- declare type BorderRadius = 'sharp' | 'rounded' | 'extra-rounded' | 'circular';
1876
- declare type Theme = 'darkest' | 'dark' | 'light';
1877
- /**
1878
- * UI Colors
1879
- *
1880
- * Accepts hex color codes.
1881
- */
1882
- interface UIColors {
1883
- brand: {
1884
- 300: string;
1885
- 400: string;
1886
- 500: string;
1887
- 600: string;
1888
- 700: string;
1889
- };
1890
- background: {
1891
- 600: string;
1892
- 700: string;
1893
- 800: string;
1894
- 900: string;
1895
- 1000: string;
1896
- };
1897
- danger: string;
1898
- success: string;
1899
- text_on_brand: string;
1900
- text: string;
1901
- video_bg: string;
1902
- warning: string;
1903
- }
1904
- interface DesignTokens {
1905
- border_radius: BorderRadius;
1906
- border_width: BorderWidth;
1907
- colors: UIColors;
1908
- font_family?: string;
1909
- google_font?: string;
1910
- logo?: string;
1911
- spacing_base: number;
1912
- theme: Theme;
1913
- }
1914
- declare enum ViewType {
1915
- GroupCall = "GROUP_CALL",
1916
- Webinar = "WEBINAR",
1917
- AudioRoom = "AUDIO_ROOM",
1918
- Livestream = "LIVESTREAM",
1919
- Chat = "CHAT"
1920
- }
1921
- declare enum WaitingRoomTypes {
1922
- Skip = "SKIP",
1923
- OnPrivilegedUserEntry = "ON_PRIVILEGED_USER_ENTRY",
1924
- SkipOnAccept = "SKIP_ON_ACCEPT"
1925
- }
1926
- declare enum MediaProductionPermissionType {
1927
- Allowed = "ALLOWED",
1928
- NotAllowed = "NOT_ALLOWED",
1929
- CanRequest = "CAN_REQUEST"
1930
- }
1931
- declare type MediaVideoQualityType = 'qvga' | 'vga' | 'hd' | 'hd_cropped' | 'fhd';
1932
- declare type MediaScreenShareQualityType = 'vga' | 'hd' | 'full_hd';
1933
- declare type Config = {
1934
- view_type: ViewType;
1935
- media: {
1936
- audio: {
1937
- enable_stereo: boolean;
1938
- enable_high_bitrate: boolean;
1939
- };
1940
- video: {
1941
- quality: MediaVideoQualityType;
1942
- frame_rate: number;
1943
- };
1944
- screenshare: {
1945
- quality: MediaScreenShareQualityType;
1946
- frame_rate: number;
1947
- };
1948
- };
1949
- max_video_streams: {
1950
- mobile: number;
1951
- desktop: number;
1952
- };
1953
- max_screenshare_count: number;
1954
- };
1955
- declare enum PluginAccessControls {
1956
- FULL_ACCESS = "FULL_ACCESS",
1957
- VIEW_ONLY = "VIEW_ONLY"
1958
- }
1959
- declare type PluginConfig$1 = {
1960
- access_control: PluginAccessControls.FULL_ACCESS | PluginAccessControls.VIEW_ONLY;
1961
- disabled: boolean;
1962
- handles_view_only: boolean;
1963
- };
1964
- declare type PluginPermissionsType = {
1965
- can_close: boolean;
1966
- can_start: boolean;
1967
- can_edit_config?: boolean;
1968
- config: {
1969
- [pluginId: string]: Partial<PluginConfig$1>;
1970
- };
1971
- };
1972
- declare type Permissions = {
1973
- accept_waiting_requests: boolean;
1974
- can_accept_production_requests: boolean;
1975
- can_edit_display_name: boolean;
1976
- can_record: boolean;
1977
- can_livestream: boolean;
1978
- can_spotlight?: boolean;
1979
- disable_participant_audio: boolean;
1980
- disable_participant_screensharing: boolean;
1981
- disable_participant_video: boolean;
1982
- kick_participant: boolean;
1983
- pin_participant: boolean;
1984
- plugins: PluginPermissionsType;
1985
- waiting_room_type: WaitingRoomTypes;
1986
- polls: {
1987
- can_create: boolean;
1988
- can_vote: boolean;
1989
- can_view: boolean;
1990
- };
1991
- media: {
1992
- video: {
1993
- can_produce: MediaProductionPermissionType;
1994
- };
1995
- audio: {
1996
- can_produce: MediaProductionPermissionType;
1997
- };
1998
- screenshare: {
1999
- can_produce: MediaProductionPermissionType;
2000
- };
2001
- };
2002
- chat: ChatPermissionTypes;
2003
- is_recorder?: boolean;
2004
- recorder_type: RecorderType;
2005
- hidden_participant: boolean;
2006
- show_participant_list: boolean;
2007
- can_change_participant_permissions: boolean;
2008
- connected_meetings: {
2009
- can_alter_connected_meetings: boolean;
2010
- can_switch_connected_meetings: boolean;
2011
- can_switch_to_parent_meeting: boolean;
2012
- };
2013
- stage_enabled?: boolean;
2014
- stage_access?: MediaProductionPermissionType;
2015
- accept_stage_requests?: boolean;
2016
- transcription_enabled?: boolean;
2017
- };
2018
- declare type PresetTypeV2 = {
2019
- ui: {
2020
- design_tokens: DesignTokens;
2021
- config_diff: ConfigDiff;
2022
- };
2023
- permissions: Permissions;
2024
- config: Config;
2025
- version?: string;
2026
- name?: string;
2027
- };
2028
- declare type ChatPermissionTypes = {
2029
- public: PublicChatPermissionTypes;
2030
- private?: PrivateChatPermissionTypes;
2031
- channel?: ChannelPermissionTypes;
2032
- message?: MessagePermissionTypes;
2033
- };
2034
- declare type PublicChatPermissionTypes = {
2035
- can_send: boolean;
2036
- text: boolean;
2037
- files: boolean;
2038
- };
2039
- declare type PrivateChatPermissionTypes = {
2040
- can_send: boolean;
2041
- can_receive: boolean;
2042
- text: boolean;
2043
- files: boolean;
2044
- };
2045
- declare type ChannelPermissionTypes = {
2046
- can_create: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
2047
- can_delete: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
2048
- can_update: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
2049
- can_read_all: boolean;
2050
- };
2051
- declare type MessagePermissionTypes = {
2052
- can_delete: 'NONE' | 'SELF' | 'ALL';
2053
- can_edit: 'NONE' | 'SELF' | 'ALL';
2054
- delete_cutoff_time_seconds: number;
2055
- edit_cutoff_time_seconds: number;
2056
- };
2057
- declare enum RecorderType {
2058
- none = "NONE",
2059
- recorder = "RECORDER",
2060
- livestreamer = "LIVESTREAMER"
2004
+ type ClientEnvTypeAll = 'devel' | 'preprod' | 'prod';
2005
+ declare class RTKSelectedPeers {
2006
+ private readonly _activeSpeakerPeers;
2007
+ private readonly _compulsoryPeers;
2008
+ constructor();
2009
+ add(peerId: string, priority: number): number;
2010
+ delete(peerId: string): void;
2011
+ index(peerId: string): number;
2012
+ readonly peers: string[];
2013
+ readonly compulsoryPeers: string[];
2014
+ readonly activeSpeakerPeers: string[];
2015
+ private _removeFromCompulsoryPeer;
2061
2016
  }
2062
- declare type ConfigDiff = Record<string, any>;
2063
- declare type ClientEnvTypeAll = 'devel' | 'preprod' | 'prod';
2017
+ type PipEvents = {
2018
+ ['cameraToggled']: () => void;
2019
+ ['micToggled']: () => void;
2020
+ ['hangup']: () => void;
2021
+ ['pipStarted']: () => void;
2022
+ ['pipEnded']: () => void;
2023
+ ['*']: (eventName: string, ...args: any[]) => void;
2024
+ };
2025
+ declare class RTKPip extends RTKTypedEventEmitter<PipEvents> {
2026
+ private "RTKPip.#private";
2027
+ private constructor();
2028
+ static _init(context: Context<RTKContextState>, self: RTKSelf$1): Promise<RTKPip>;
2029
+ private setupIcon;
2030
+ overrideIcon(icon: 'handRaise' | 'pin', value: string): Promise<void>;
2031
+ private constructImage;
2032
+ private createVideoContainer;
2033
+ private setupEventListeners;
2034
+ private cleanupEventListeners;
2035
+ private enablePipMediaControls;
2036
+ private onSelfVideoUpdateListener;
2037
+ private onSelfAudioUpdateListener;
2038
+ private handlePipMediaControls;
2039
+ private createCanvas;
2040
+ private eventCallback;
2041
+ private setupMediaSessionEvents;
2042
+ private mountAudioEvents;
2043
+ private mountVideoEvents;
2044
+ private unmountEvents;
2045
+ private getSources;
2046
+ private drawEmptyTile;
2047
+ private drawIcons;
2048
+ private drawTile;
2049
+ private calcGridElemSize;
2050
+ private paintCanvas;
2051
+ private animate;
2052
+ isSupported(): boolean;
2053
+ readonly isActive: boolean;
2054
+ private cleanup;
2055
+ init({ height, width }?: {
2056
+ height?: number;
2057
+ width?: number;
2058
+ }): void;
2059
+ private updateMediaSession;
2060
+ enableSource(source: string): void;
2061
+ disableSource(source: string): void;
2062
+ private generateAvatar;
2063
+ addSource(id: string, element: HTMLVideoElement, enabled: boolean, pinned?: boolean, displayText?: string, imageUrl?: string, handRaised?: boolean): void;
2064
+ updateSource(id: string, source: any): void;
2065
+ removeSource(id: string): void;
2066
+ removePinnedSource(): void;
2067
+ removeAllSources(): void;
2068
+ enable(): void;
2069
+ disable: (partial?: boolean) => void;
2070
+ }
2071
+ interface AudioProducerScoreStats {
2072
+ score: number;
2073
+ packetsLostPercentage: number;
2074
+ jitter: number;
2075
+ isScreenShare: boolean;
2076
+ bitrate: number;
2077
+ }
2078
+ interface VideoProducerScoreStats {
2079
+ score: number;
2080
+ frameWidth: number;
2081
+ frameHeight: number;
2082
+ framesPerSecond: number;
2083
+ packetsLostPercentage: number;
2084
+ jitter: number;
2085
+ isScreenShare: boolean;
2086
+ bitrate: number;
2087
+ cpuLimitations: boolean;
2088
+ bandwidthLimitations: boolean;
2089
+ }
2090
+ interface AudioConsumerScoreStats {
2091
+ score: number;
2092
+ packetsLostPercentage: number;
2093
+ jitter: number;
2094
+ isScreenShare: boolean;
2095
+ bitrate: number;
2096
+ }
2097
+ interface VideoConsumerScoreStats {
2098
+ score: number;
2099
+ frameWidth: number;
2100
+ frameHeight: number;
2101
+ framesPerSecond: number;
2102
+ packetsLostPercentage: number;
2103
+ jitter: number;
2104
+ isScreenShare: boolean;
2105
+ bitrate: number;
2106
+ }
2107
+ type ProducerScoreStats = AudioProducerScoreStats | VideoProducerScoreStats;
2108
+ type ConsumerScoreStats = AudioConsumerScoreStats | VideoConsumerScoreStats;
2064
2109
  type TranscriptionData = {
2065
2110
  id: string;
2066
2111
  name: string;
@@ -2098,11 +2143,11 @@ declare enum MediaNodeType {
2098
2143
  CF = 3
2099
2144
  }
2100
2145
  type MediaConnectionState = {
2101
- consuming: {
2146
+ recv: {
2102
2147
  state: string;
2103
2148
  reconnected: boolean;
2104
2149
  };
2105
- producing: {
2150
+ send: {
2106
2151
  state: string;
2107
2152
  reconnected: boolean;
2108
2153
  };
@@ -2226,6 +2271,7 @@ declare class RTKMap<T extends (EventMap & WildCardEvent<T>), U extends {
2226
2271
  clear(emitEvent?: boolean, removeListeners?: boolean): void;
2227
2272
  toArray(): U[];
2228
2273
  }
2274
+ type MediaKind$1 = 'audio' | 'video';
2229
2275
  type DCMessage = {
2230
2276
  type: string;
2231
2277
  payload: Record<string, unknown>;
@@ -2271,11 +2317,15 @@ type ParticipantEvents = {
2271
2317
  isScreenshare: boolean;
2272
2318
  score: number;
2273
2319
  participantId: string;
2320
+ scoreStats: ConsumerScoreStats;
2274
2321
  }) => void;
2275
2322
  ['kicked']: () => void;
2276
2323
  ['*']: (event: string, ...args: any[]) => void;
2277
2324
  };
2278
2325
  type SelfEvents = {
2326
+ ['toggleTile']: (payload: {
2327
+ hidden: boolean;
2328
+ }) => void;
2279
2329
  ['videoUpdate']: (payload: {
2280
2330
  videoEnabled: boolean;
2281
2331
  videoTrack: MediaStreamTrack;
@@ -2315,6 +2365,7 @@ type SelfEvents = {
2315
2365
  isScreenshare: boolean;
2316
2366
  score: number;
2317
2367
  participantId: string;
2368
+ scoreStats: ProducerScoreStats;
2318
2369
  }) => void;
2319
2370
  ['waitlisted']: () => void;
2320
2371
  ['roomLeft']: (payload: {
@@ -2354,93 +2405,359 @@ declare class RTKBasicParticipantsMap extends RTKEventEmitter<'participantsUpdat
2354
2405
  get(objId: string): RTKBasicParticipant;
2355
2406
  toArray(): RTKBasicParticipant[];
2356
2407
  }
2357
- type PipEvents = {
2358
- ['cameraToggled']: () => void;
2359
- ['micToggled']: () => void;
2360
- ['hangup']: () => void;
2361
- ['pipStarted']: () => void;
2362
- ['pipEnded']: () => void;
2363
- ['*']: (eventName: string, ...args: any[]) => void;
2364
- };
2365
- declare class RTKPip extends RTKTypedEventEmitter<PipEvents> {
2366
- private "RTKPip.#private";
2367
- constructor(context: Context<RTKContextState>, self: RTKSelf$1);
2368
- private createVideoContainer;
2369
- private setupEventListeners;
2370
- private cleanupEventListeners;
2371
- private enablePipMediaControls;
2372
- private onSelfVideoUpdateListener;
2373
- private onSelfAudioUpdateListener;
2374
- private handlePipMediaControls;
2375
- private createCanvas;
2376
- private eventCallback;
2377
- private setupMediaSessionEvents;
2378
- private mountAudioEvents;
2379
- private mountVideoEvents;
2380
- private unmountEvents;
2381
- private getSources;
2382
- private drawEmptyTile;
2383
- private drawGrid;
2384
- private calcGridElemSize;
2385
- private paintCanvas;
2386
- private animate;
2387
- isSupported(): boolean;
2388
- readonly isActive: boolean;
2389
- private cleanup;
2390
- init({ height, width }?: {
2391
- height?: number;
2392
- width?: number;
2393
- }): void;
2394
- private updateMediaSession;
2395
- enableSource(source: string): void;
2396
- disableSource(source: string): void;
2397
- addSource(id: string, element: HTMLVideoElement, enabled: boolean, pinned?: boolean, displayText?: string): void;
2398
- removeSource(id: string): void;
2399
- removePinnedSource(): void;
2400
- removeAllSources(): void;
2401
- enable(): void;
2402
- disable: () => void;
2403
- }
2404
- type ChatChannelSocketMessage = GetChatChannelResponse;
2405
- interface ChatChannel {
2406
- id: string;
2407
- displayName: string;
2408
- memberIds: string[];
2409
- displayPictureUrl?: string;
2410
- visibility?: string;
2411
- isDirectMessage?: boolean;
2412
- latestMessage?: Message;
2413
- unreadCount: number;
2414
- }
2415
- interface UpdateChannelRequestPayload {
2416
- memberIds?: string[];
2417
- displayName?: string;
2418
- displayPictureUrl?: string;
2419
- visibility?: string;
2420
- }
2421
- declare class ChatChannelSocketHandler {
2422
- private "ChatChannelSocketHandler.#private";
2423
- constructor(socketService: SocketService);
2424
- createChannel(displayName: string, memberIds: string[], displayPictureUrl?: string, visibility?: string, isDirectMessage?: boolean): Promise<ChatChannel>;
2425
- updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
2426
- static formatChannel(socketChannel: ChatChannel$1): ChatChannel;
2427
- getChannelMembers(channelId: string): Promise<RTKBasicParticipant[]>;
2428
- on(event: number, handler: (socketMessage: ChatChannelSocketMessage) => void): void;
2429
- }
2430
- declare enum ChatMessageType {
2431
- TEXT = 0,
2432
- IMAGE = 1,
2433
- FILE = 2,
2434
- CUSTOM = 3
2408
+ declare const modes: readonly [
2409
+ "ACTIVE_GRID",
2410
+ "PAGINATED",
2411
+ "MANUAL"
2412
+ ];
2413
+ type ViewMode = (typeof modes)[number];
2414
+ interface BroadcastMessagePayload {
2415
+ [key: string]: boolean | number | string | Date | ActiveTab;
2435
2416
  }
2436
- type ChatSocketMessage = SendChatMessageToRoomResponse | SendChatMessageToPeersResponse | EditChatMessageResponse | DeleteChatMessageResponse;
2437
- interface SearchFilters {
2438
- channelId?: string;
2439
- timestamp?: number;
2440
- size?: number;
2441
- reversed?: boolean;
2417
+ interface PeerProducerConfig {
2418
+ audio: boolean;
2419
+ video: boolean;
2420
+ screenshareAudio: boolean;
2421
+ screenshareVideo: boolean;
2442
2422
  }
2443
- declare class ChatSocketHandler {
2423
+ type BroadcastMessageTarget = {
2424
+ participantIds: string[];
2425
+ } | {
2426
+ presetNames: string[];
2427
+ } | {
2428
+ meetingIds: string[];
2429
+ };
2430
+ type ParticipantsEvents = {
2431
+ ['viewModeChanged']: (payload: {
2432
+ viewMode: string;
2433
+ currentPage: number;
2434
+ pageCount: number;
2435
+ }) => void;
2436
+ ['activeSpeaker']: (payload: {
2437
+ peerId: string;
2438
+ volume: number;
2439
+ }) => void;
2440
+ ['broadcastedMessage']: (payload: {
2441
+ type: string;
2442
+ payload: BroadcastMessagePayload;
2443
+ timestamp: number;
2444
+ }) => void;
2445
+ ['poorConnection']: (payload: {
2446
+ participantId: string;
2447
+ score: number;
2448
+ kind: string;
2449
+ }) => void;
2450
+ ['pageChanged']: (payload: {
2451
+ viewMode: string;
2452
+ currentPage: number;
2453
+ pageCount: number;
2454
+ }) => void;
2455
+ ['mediaScoreUpdate']: (payload: {
2456
+ kind: string;
2457
+ isScreenshare: boolean;
2458
+ score: number;
2459
+ participantId: string;
2460
+ scoreStats: ConsumerScoreStats;
2461
+ }) => void;
2462
+ ['media_decode_error']: (payload: {
2463
+ reason: string;
2464
+ code: '1702' | '1703';
2465
+ }) => void;
2466
+ ['*']: (event: string, ...args: any[]) => void;
2467
+ };
2468
+ declare class RTKParticipants$1 extends RTKTypedEventEmitter<ParticipantsEvents> {
2469
+ private "RTKParticipants$1.#private";
2470
+ readonly waitlisted: Readonly<RTKParticipantMap$1<Pick<RTKParticipant$1, Exclude<keyof RTKParticipant$1, 'audioTrack' | 'videoTrack' | 'screenShareTracks'>>>>;
2471
+ readonly joined: Readonly<RTKParticipantMap$1>;
2472
+ readonly active: Readonly<RTKParticipantMap$1>;
2473
+ readonly videoSubscribed: Readonly<RTKParticipantMap$1>;
2474
+ readonly audioSubscribed: Readonly<RTKParticipantMap$1>;
2475
+ readonly pinned: Readonly<RTKParticipantMap$1>;
2476
+ readonly all: Readonly<RTKBasicParticipantsMap>;
2477
+ readonly pip: RTKPip;
2478
+ private readonly socketJoined: any;
2479
+ private readonly mediaJoined: any;
2480
+ rateLimitConfig: {
2481
+ maxInvocations: number;
2482
+ period: number;
2483
+ };
2484
+ readonly rateLimits: {
2485
+ maxInvocations: number;
2486
+ period: number;
2487
+ };
2488
+ updateRateLimits(num: number, period: number): void;
2489
+ viewMode: ViewMode;
2490
+ currentPage: number;
2491
+ lastActiveSpeaker: string;
2492
+ selectedPeers: RTKSelectedPeers;
2493
+ constructor(context: Context<RTKContextState>, self: RTKSelf$1, roomSocketHandler: RoomSocketHandler);
2494
+ setupEvents(): void;
2495
+ readonly count: number;
2496
+ readonly maxActiveParticipantsCount: number;
2497
+ setMaxActiveParticipantsCount(limit: number): void;
2498
+ readonly pageCount: number;
2499
+ acceptWaitingRoomRequest(id: string): void;
2500
+ acceptAllWaitingRoomRequest(userIds: string[]): Promise<void>;
2501
+ rejectWaitingRoomRequest(id: string): Promise<void>;
2502
+ setViewMode(viewMode: ViewMode): Promise<void>;
2503
+ subscribe(peerIds: string[], kinds?: ('audio' | 'video' | 'screenshareAudio' | 'screenshareVideo')[]): Promise<void>;
2504
+ unsubscribe(peerIds: string[], kinds?: ('audio' | 'video' | 'screenshareAudio' | 'screenshareVideo')[]): Promise<void>;
2505
+ getPeerIdsForCurrentPage(): string[];
2506
+ setPage(page: number): Promise<void>;
2507
+ disableAllAudio(allowUnmute: boolean): Promise<void>;
2508
+ disableAllVideo(): Promise<void>;
2509
+ disableAudio(participantId: string): Promise<void>;
2510
+ disableVideo(participantId: string): Promise<void>;
2511
+ kick(participantId: string): Promise<void>;
2512
+ kickAll(): Promise<void>;
2513
+ broadcastMessage(type: Exclude<string, 'spotlight'>, payload: BroadcastMessagePayload, target?: BroadcastMessageTarget): Promise<void>;
2514
+ getAllJoinedPeers(searchQuery: string, limit: number, offset: number): Promise<{
2515
+ id: string;
2516
+ userId: string;
2517
+ name: string;
2518
+ displayName: string;
2519
+ stageType: StageStatus;
2520
+ customParticipantId: string;
2521
+ presetId: string;
2522
+ picture: string;
2523
+ waitlisted: boolean;
2524
+ stageStatus: StageStatus;
2525
+ metadata: {
2526
+ preset_name: string;
2527
+ };
2528
+ recorderType: string;
2529
+ flags: {
2530
+ hiddenParticipant: boolean;
2531
+ hidden_participant: boolean;
2532
+ recorder: boolean;
2533
+ };
2534
+ }[]>;
2535
+ updatePermissions(participantIds: string[], permissions: PresetUpdates): Promise<void>;
2536
+ getParticipantsInMeetingPreJoin(): Promise<RoomPeersInfoResponse>;
2537
+ }
2538
+ type EventHandlerTypes = PeerInfoResponse | GetWaitingRoomRequests | RecordingEvent | UpdatePeersPresetResponse | PeerJoinBroadcastResponse | PeerJoinCompleteResponse | GlobalPeerPinningBroadcastResponse | PeerLeaveResponse | SelectedPeersResponse | SelectedPeersDiffResponse;
2539
+ declare class RoomSocketHandler {
2540
+ private "RoomSocketHandler.#private";
2541
+ socket: SocketService;
2542
+ static create(socket: SocketService, context: Context<RTKContextState>): RoomSocketHandler;
2543
+ static cleanup(): void;
2544
+ constructor(socketService: SocketService, context: Context<RTKContextState>);
2545
+ joinRoom(opts: {
2546
+ name: string;
2547
+ id: string;
2548
+ userId: string;
2549
+ customParticipantId: string;
2550
+ picture?: string;
2551
+ }, viewType: ViewType): Promise<{
2552
+ peer: Peer;
2553
+ }>;
2554
+ getAllAddedParticipants(): Promise<RTKBasicParticipant[]>;
2555
+ getRoomPeers(searchQuery: string, limit: number, offset: number): Promise<RoomPeersInfoResponse>;
2556
+ getRoomPeersNonPaginated(): Promise<RoomPeersInfoResponse>;
2557
+ getStagePeers(): Promise<RoomPeersInfoResponse>;
2558
+ getPeerInfo(peerId: string): Promise<PeerInfoResponse>;
2559
+ getRoomState(): Promise<RoomInfoResponse>;
2560
+ getRoomStageState(): Promise<GetRoomStageStateResponse>;
2561
+ broadcastMessage(type: string, payload: BroadcastMessagePayload): Promise<{
2562
+ id: string;
2563
+ payload: Uint8Array;
2564
+ }>;
2565
+ broadcastToMeetings(type: string, meetingIds: string[], payload: BroadcastMessagePayload): Promise<{
2566
+ id: string;
2567
+ payload: Uint8Array;
2568
+ }>;
2569
+ broadcastToPeers(type: string, peerIds: string[], payload: BroadcastMessagePayload): Promise<boolean>;
2570
+ leaveRoom(): Promise<void>;
2571
+ kick(peerId: string): Promise<void>;
2572
+ kickAll(propagateKickAll?: boolean): Promise<void>;
2573
+ getWaitingRoomRequests(): void;
2574
+ acceptWaitingRoomRequest(userIds: string[]): void;
2575
+ rejectWaitingRoomRequest(userIds: string[]): void;
2576
+ updatePermissions(userIds: string[], patch: PresetUpdates): Promise<{
2577
+ id: string;
2578
+ payload: Uint8Array;
2579
+ }>;
2580
+ private handleSocketEvents;
2581
+ on(event: number, handler: (message: EventHandlerTypes) => void): void;
2582
+ getUserPermissions(userId: string): Promise<Pick<PresetTypeV2['permissions'], 'chat' | 'polls' | 'plugins'>>;
2583
+ }
2584
+ interface DeviceConfig {
2585
+ browserName: string;
2586
+ browserVersion: string;
2587
+ isMobile: boolean;
2588
+ engineName: string;
2589
+ osName: string;
2590
+ }
2591
+ interface ProducerState {
2592
+ producerId: string;
2593
+ kind: 'audio' | 'video';
2594
+ pause: boolean;
2595
+ screenShare: boolean;
2596
+ producingTransportId: string;
2597
+ producingPeerId: string;
2598
+ }
2599
+ interface Participant {
2600
+ id: string;
2601
+ userId: string;
2602
+ displayName: string;
2603
+ device?: DeviceConfig;
2604
+ picture?: string;
2605
+ isHost: boolean;
2606
+ flags: {
2607
+ [key: string]: string | boolean;
2608
+ };
2609
+ clientSpecificId?: string;
2610
+ customParticipantId?: string;
2611
+ stageStatus?: StageStatus;
2612
+ audioMuted: boolean;
2613
+ audioTrack: MediaStreamTrack;
2614
+ videoTrack: MediaStreamTrack;
2615
+ videoEnabled: boolean;
2616
+ producers?: ProducerState[];
2617
+ metadata?: {
2618
+ preset_name?: string;
2619
+ };
2620
+ recorderType?: string;
2621
+ }
2622
+ declare class RTKParticipant$1 extends RTKTypedEventEmitter<ParticipantEvents> {
2623
+ private "RTKParticipant$1.#private";
2624
+ id: string;
2625
+ userId: string;
2626
+ name: string;
2627
+ picture: string;
2628
+ isHost: boolean;
2629
+ customParticipantId?: string;
2630
+ readonly clientSpecificId: string;
2631
+ flags: {
2632
+ [key: string]: string | boolean;
2633
+ };
2634
+ device: DeviceConfig;
2635
+ videoTrack: MediaStreamTrack;
2636
+ audioTrack: MediaStreamTrack;
2637
+ screenShareTracks: {
2638
+ audio: MediaStreamTrack;
2639
+ video: MediaStreamTrack;
2640
+ };
2641
+ videoEnabled: boolean;
2642
+ audioEnabled: boolean;
2643
+ screenShareEnabled: boolean;
2644
+ producers: ProducerState[];
2645
+ manualProducerConfig: PeerProducerConfig;
2646
+ supportsRemoteControl: boolean;
2647
+ presetName?: string;
2648
+ readonly stageStatus: StageStatus;
2649
+ private readonly mediaJoined: any;
2650
+ private readonly socketJoined: any;
2651
+ constructor(context: Context<RTKContextState>, participant: Participant, self: RTKSelf, roomSocket: RoomSocketHandler);
2652
+ setVideoEnabled(videoEnabled: boolean, emitEvent?: boolean): void;
2653
+ setAudioEnabled(audioEnabled: boolean, emitEvent?: boolean): void;
2654
+ setScreenShareEnabled(screenShareEnabled: boolean, emitEvent?: boolean): void;
2655
+ private setupEvents;
2656
+ pin(): Promise<unknown>;
2657
+ unpin(): Promise<unknown>;
2658
+ setIsPinned(isPinned: boolean, emitEvent?: boolean): void;
2659
+ disableAudio(): Promise<void>;
2660
+ kick(): Promise<void>;
2661
+ disableVideo(): Promise<void>;
2662
+ getPermissions(): Promise<Pick<_dyteinternals_utils.Permissions, "plugins" | "polls" | "chat">>;
2663
+ setStageStatus(stageStatus: StageStatus): void;
2664
+ readonly isPinned: boolean;
2665
+ registerVideoElement(videoElem: HTMLVideoElement): void;
2666
+ deregisterVideoElement(videoElem?: HTMLVideoElement): void;
2667
+ private updateVideo;
2668
+ }
2669
+ declare abstract class RoomNodeClient {
2670
+ private "RoomNodeClient.#private";
2671
+ meetingTitle: string;
2672
+ roomName: string;
2673
+ roomUUID: string;
2674
+ context: Context<RTKContextState>;
2675
+ readonly peerId: string;
2676
+ authToken: string;
2677
+ maxPreferredStreams: number;
2678
+ mediaJoined: boolean;
2679
+ readonly sfuHandler: any;
2680
+ readonly mediaState: MediaConnectionState;
2681
+ reconnect(): void;
2682
+ partialJoinRoom(displayName: string, roomUuid: string, rejoining?: boolean, loc?: GeoLocation): Promise<void>;
2683
+ joinRoom(displayName: string, roomUUID: string, currentUserSharedMediaStates?: {
2684
+ audio?: boolean;
2685
+ video?: boolean;
2686
+ screen?: boolean;
2687
+ }, forceFullReset?: boolean, rejoining?: boolean): Promise<{
2688
+ roomJoined: boolean;
2689
+ }>;
2690
+ leaveRoom(): Promise<void>;
2691
+ reset(full?: boolean): void;
2692
+ handleSocketCallbacks(message: any): Promise<void>;
2693
+ handleSockets(message: any, callBack: (arg?: string) => void): Promise<void>;
2694
+ shareMic(audioTrack: MediaStreamTrack): Promise<void>;
2695
+ shareWebcam(videoTrack: MediaStreamTrack): Promise<MediaStreamTrack | null>;
2696
+ shareScreen(screenShareTracks: {
2697
+ audio?: MediaStreamTrack;
2698
+ video?: MediaStreamTrack;
2699
+ }): Promise<void>;
2700
+ unmuteSelf(): Promise<void>;
2701
+ muteSelf(): Promise<void>;
2702
+ pauseWebcam(): Promise<void>;
2703
+ disableScreenShare(): Promise<void>;
2704
+ acceptWaitingRequest(id: string): Promise<void>;
2705
+ rejectWaitingRequest(id: string): Promise<void>;
2706
+ muteAll(allowUnMute: boolean): Promise<void>;
2707
+ muteAllVideo(): Promise<void>;
2708
+ disableAudio(peerId: string): Promise<void>;
2709
+ disableVideo(peerId: string): Promise<void>;
2710
+ kickAll(): Promise<void>;
2711
+ kick(peerId: string): Promise<void>;
2712
+ pinPeer(id: string): Promise<unknown>;
2713
+ getConsumers(): any;
2714
+ stopAllProducers(): void;
2715
+ activatePeers(producers: ProducerState[]): Promise<void>;
2716
+ deactivatePeers(producers: ProducerState[], mode?: 'manual' | 'default'): Promise<void>;
2717
+ createConsumers(producers: ProducerState[]): Promise<void>;
2718
+ closeConsumers(producers: ProducerState[]): Promise<void>;
2719
+ switchConsumersToLayer(consumerIds: string[], layer: number): Promise<void>;
2720
+ }
2721
+ type ChatChannelSocketMessage = GetChatChannelResponse;
2722
+ interface ChatChannel {
2723
+ id: string;
2724
+ displayName: string;
2725
+ memberIds: string[];
2726
+ displayPictureUrl?: string;
2727
+ visibility?: string;
2728
+ isDirectMessage?: boolean;
2729
+ latestMessage?: Message;
2730
+ unreadCount: number;
2731
+ }
2732
+ interface UpdateChannelRequestPayload {
2733
+ memberIds?: string[];
2734
+ displayName?: string;
2735
+ displayPictureUrl?: string;
2736
+ visibility?: string;
2737
+ }
2738
+ declare class ChatChannelSocketHandler {
2739
+ private "ChatChannelSocketHandler.#private";
2740
+ constructor(socketService: SocketService);
2741
+ createChannel(displayName: string, memberIds: string[], displayPictureUrl?: string, visibility?: string, isDirectMessage?: boolean): Promise<ChatChannel>;
2742
+ updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
2743
+ static formatChannel(socketChannel: ChatChannel$1): ChatChannel;
2744
+ getChannelMembers(channelId: string): Promise<RTKBasicParticipant[]>;
2745
+ on(event: number, handler: (socketMessage: ChatChannelSocketMessage) => void): void;
2746
+ }
2747
+ declare enum ChatMessageType {
2748
+ TEXT = 0,
2749
+ IMAGE = 1,
2750
+ FILE = 2,
2751
+ CUSTOM = 3
2752
+ }
2753
+ type ChatSocketMessage = SendChatMessageToRoomResponse | SendChatMessageToPeersResponse | EditChatMessageResponse | DeleteChatMessageResponse;
2754
+ interface SearchFilters {
2755
+ channelId?: string;
2756
+ timestamp?: number;
2757
+ size?: number;
2758
+ reversed?: boolean;
2759
+ }
2760
+ declare class ChatSocketHandler {
2444
2761
  private "ChatSocketHandler.#private";
2445
2762
  constructor(socketService: SocketService);
2446
2763
  getChatMessages(): Promise<{
@@ -2524,8 +2841,10 @@ declare class LocalMediaHandler extends RTKEventEmitter<LocalMediaEvents> {
2524
2841
  getSpeakerDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
2525
2842
  addAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<ResponseStatus>;
2526
2843
  removeAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<ResponseStatus>;
2844
+ removeAllAudioMiddlewares(): Promise<ResponseStatus>;
2527
2845
  addVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<ResponseStatus>;
2528
2846
  removeVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<ResponseStatus>;
2847
+ removeAllVideoMiddlewares(): Promise<ResponseStatus>;
2529
2848
  setVideoMiddlewareGlobalConfig(config: VideoMiddlewareGlobalConfig): Promise<void>;
2530
2849
  destruct(): void;
2531
2850
  onDeviceChange(changedDevices: {
@@ -2534,6 +2853,8 @@ declare class LocalMediaHandler extends RTKEventEmitter<LocalMediaEvents> {
2534
2853
  devices: MediaDeviceInfo[];
2535
2854
  }, skipDeviceChange: boolean): Promise<void>;
2536
2855
  removeAllTracks(): void;
2856
+ removeAudioTrack(): void;
2857
+ removeVideoTrack(): void;
2537
2858
  removeDocumentEventListeners(): Promise<void>;
2538
2859
  }
2539
2860
  declare enum MediaPermission {
@@ -2614,6 +2935,7 @@ type PresetV2CamelCased = {
2614
2935
  frameRate: number;
2615
2936
  };
2616
2937
  };
2938
+ livestreamViewerQualities: LivestreamViewerMediaQualityType[];
2617
2939
  maxVideoStreams: {
2618
2940
  mobile: number;
2619
2941
  desktop: number;
@@ -2687,7 +3009,7 @@ type PresetV2CamelCased = {
2687
3009
  };
2688
3010
  };
2689
3011
  isRecorder?: boolean;
2690
- recorderType: RecorderType;
3012
+ recorderType: RecorderType$1;
2691
3013
  hiddenParticipant: boolean;
2692
3014
  showParticipantList: boolean;
2693
3015
  canChangeParticipantPermissions: boolean;
@@ -2778,6 +3100,7 @@ declare class RTKThemePreset$1 {
2778
3100
  }>;
2779
3101
  readonly pipMode: Readonly<boolean>;
2780
3102
  readonly viewType: Readonly<ViewType>;
3103
+ readonly livestreamViewerQualities: Readonly<LivestreamViewerMediaQualityType[]>;
2781
3104
  readonly maxVideoStreams: Readonly<MaxVideoStreams>;
2782
3105
  readonly maxScreenShareCount: Readonly<number>;
2783
3106
  readonly plugins: Readonly<string[]>;
@@ -2793,7 +3116,7 @@ type PermissionEvents = {
2793
3116
  ['chatUpdate']: () => void;
2794
3117
  ['pollsUpdate']: () => void;
2795
3118
  ['pluginsUpdate']: () => void;
2796
- ['permissionsUpdate']: () => void;
3119
+ ['permissionsUpdate']: (patch: PresetUpdates) => void;
2797
3120
  ['*']: () => void;
2798
3121
  };
2799
3122
  declare class RTKPermissionsPreset$1 extends RTKTypedEventEmitter<PermissionEvents> {
@@ -2854,6 +3177,37 @@ interface UserDetailsResponseV2 {
2854
3177
  preset: PresetV2CamelCased;
2855
3178
  }
2856
3179
  type leaveRoomState = 'kicked' | 'ended' | 'left' | 'rejected' | 'connected-meeting' | 'disconnected' | 'failed';
3180
+ type LivestreamState = 'IDLE' | 'STARTING' | 'WAITING_ON_MANUAL_INGESTION' | 'LIVESTREAMING' | 'STOPPING';
3181
+ type LivestreamEvents = {
3182
+ ['livestreamUpdate']: (state: LivestreamState) => void;
3183
+ ['viewerCountUpdate']: (count: number) => void;
3184
+ ['*']: (eventName: string, ...args: any[]) => void;
3185
+ };
3186
+ type StartLivestreamConfig = {
3187
+ manualIngestion: boolean;
3188
+ };
3189
+ interface LivestreamIngestionCredentials {
3190
+ ingestionServer: string;
3191
+ streamKey: string;
3192
+ }
3193
+ type LivestreamResponse = {
3194
+ status: string;
3195
+ playbackUrl: string;
3196
+ manualIngest: boolean;
3197
+ ingestionCredentials?: LivestreamIngestionCredentials;
3198
+ };
3199
+ declare class RTKLivestream$1 extends RTKTypedEventEmitter<LivestreamEvents> {
3200
+ private "RTKLivestream$1.#private";
3201
+ state: LivestreamState;
3202
+ playbackUrl: string | undefined;
3203
+ ingestionCredentials: LivestreamIngestionCredentials;
3204
+ viewerCount: number;
3205
+ constructor(self: RTKSelf);
3206
+ setLivestreamState(livestreamState: LivestreamState): void;
3207
+ private emitCurrentLivestreamState;
3208
+ start(livestreamConfig?: StartLivestreamConfig): Promise<void>;
3209
+ stop(): Promise<void>;
3210
+ }
2857
3211
  interface RecordingConfig {
2858
3212
  fileNamePrefix?: string;
2859
3213
  videoConfig?: {
@@ -2885,15 +3239,12 @@ declare abstract class BaseAPIClient extends API {
2885
3239
  abstract getActiveTranscript(): Promise<{
2886
3240
  transcript: string;
2887
3241
  }>;
2888
- abstract startLivestreaming(): Promise<string>;
3242
+ abstract startLivestreaming(startLivestreamConfig: StartLivestreamConfig): Promise<LivestreamResponse>;
2889
3243
  abstract stopLivestreaming(): Promise<void>;
2890
- abstract getActiveLivestream(): Promise<{
2891
- status: string;
2892
- playbackUrl: string;
2893
- }>;
3244
+ abstract getActiveLivestream(): Promise<LivestreamResponse>;
2894
3245
  getIPDetails(): Promise<any>;
2895
3246
  getICEServers(): Promise<any>;
2896
- getPlugins(): Promise<RTKPluginResponse[]>;
3247
+ getPlugins(): Promise<any[]>;
2897
3248
  getPluginDetails(pluginId: string): Promise<RTKPluginResponse>;
2898
3249
  getPluginConfig(pluginBaseUrl: string): Promise<PluginConfig>;
2899
3250
  authorizePlugin(pluginId: string): Promise<string>;
@@ -3005,7 +3356,7 @@ declare class RTKChat$1 extends RTKTypedEventEmitter<ChatEvents> {
3005
3356
  channels: ChatChannel[];
3006
3357
  maxTextLimit: number;
3007
3358
  setMaxTextLimit(limit: number): void;
3008
- private readonly roomJoined: any;
3359
+ private readonly socketJoined: any;
3009
3360
  constructor(context: Context<RTKContextState>, chatSocketHandler: ChatSocketHandler, chatChannelSocketHandler: ChatChannelSocketHandler, self: RTKSelf$1, participants: RTKParticipants$1);
3010
3361
  private sendMessageInternal;
3011
3362
  private sendTextMessageInternal;
@@ -3058,6 +3409,7 @@ declare class PollSocketHandler {
3058
3409
  createPoll(question: string, options: string[], anonymous?: boolean, hideVotes?: boolean): boolean;
3059
3410
  votePoll(id: string, index: number): boolean;
3060
3411
  on(event: number, handler: (message: UpdatePollResponse) => void): void;
3412
+ removeListeners(event: number): void;
3061
3413
  }
3062
3414
  interface PollOption {
3063
3415
  text: string;
@@ -3087,7 +3439,7 @@ type PollsEvents = {
3087
3439
  declare class RTKPolls$1 extends RTKTypedEventEmitter<PollsEvents> {
3088
3440
  private "RTKPolls$1.#private";
3089
3441
  items: Poll[];
3090
- private readonly roomJoined: any;
3442
+ private readonly socketJoined: any;
3091
3443
  constructor(context: Context<RTKContextState>, self: RTKSelf$1, pollSocketHandler: PollSocketHandler);
3092
3444
  create(question: string, options: string[], anonymous?: boolean, hideVotes?: boolean): Promise<void>;
3093
3445
  vote(id: string, index: number): Promise<void>;
@@ -3175,6 +3527,10 @@ declare class RTKSelfMedia extends RTKTypedEventEmitter<SelfEvents> {
3175
3527
  success: boolean;
3176
3528
  message: string;
3177
3529
  }>;
3530
+ removeAllAudioMiddlewares(): Promise<{
3531
+ success: boolean;
3532
+ message: string;
3533
+ }>;
3178
3534
  readonly videoTrack: MediaStreamTrack;
3179
3535
  readonly rawVideoTrack: MediaStreamTrack;
3180
3536
  addVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<{
@@ -3186,6 +3542,10 @@ declare class RTKSelfMedia extends RTKTypedEventEmitter<SelfEvents> {
3186
3542
  success: boolean;
3187
3543
  message: string;
3188
3544
  }>;
3545
+ removeAllVideoMiddlewares(): Promise<{
3546
+ success: boolean;
3547
+ message: string;
3548
+ }>;
3189
3549
  readonly screenShareTracks: {
3190
3550
  audio: MediaStreamTrack;
3191
3551
  video: MediaStreamTrack;
@@ -3211,9 +3571,11 @@ declare class RTKSelfMedia extends RTKTypedEventEmitter<SelfEvents> {
3211
3571
  setDevice(device: MediaDeviceInfo): Promise<void>;
3212
3572
  }
3213
3573
  type RecordingState = 'IDLE' | 'STARTING' | 'RECORDING' | 'PAUSED' | 'STOPPING';
3574
+ type RecordingType = 'BROWSER' | 'TRACK' | 'COMPOSITE';
3214
3575
  type RecordingInfo = {
3215
3576
  state: RecordingState;
3216
3577
  id: string;
3578
+ type: RecordingType;
3217
3579
  };
3218
3580
  type RecordingEvents = {
3219
3581
  ['recordingUpdate']: (state: RecordingState) => void;
@@ -3313,6 +3675,7 @@ declare const enum PRODUCERS_TYPE {
3313
3675
  type SupportedEventSeverities = 'info' | 'error' | 'debug' | 'log' | 'warn';
3314
3676
  type LogData$2 = {
3315
3677
  error?: ReturnType<typeof createSafeToLogError>;
3678
+ peers?: string;
3316
3679
  flags?: string | {
3317
3680
  [key: string]: {
3318
3681
  enabled: boolean;
@@ -3324,6 +3687,7 @@ type LogData$2 = {
3324
3687
  constraints?: string | RTKMediaStreamConstraints;
3325
3688
  timeout?: number;
3326
3689
  execTime?: number;
3690
+ country?: string;
3327
3691
  media?: {
3328
3692
  audio?: {
3329
3693
  enabled: boolean;
@@ -3374,6 +3738,11 @@ type LogData$2 = {
3374
3738
  message: string;
3375
3739
  deviceId?: string;
3376
3740
  };
3741
+ pip?: {
3742
+ id: string;
3743
+ handRaised?: boolean;
3744
+ source?: any;
3745
+ };
3377
3746
  memoize?: {
3378
3747
  doubleInvoked?: {
3379
3748
  property: string;
@@ -3554,6 +3923,8 @@ type LogData$2 = {
3554
3923
  chunk: string;
3555
3924
  transprtId: string;
3556
3925
  };
3926
+ peerIds?: string[];
3927
+ producers?: ProducerState[];
3557
3928
  };
3558
3929
  type EventSeverities = SupportedEventSeverities;
3559
3930
  type LogData$1 = LogData$2;
@@ -3562,6 +3933,9 @@ declare class RTKTelemetry {
3562
3933
  [key: string]: any;
3563
3934
  }[];
3564
3935
  static logsProcessorTimer: NodeJS.Timer;
3936
+ static location: {
3937
+ country: string;
3938
+ };
3565
3939
  static readonly logsEndpoint: string;
3566
3940
  static tracingEnabled: boolean;
3567
3941
  static initialized: boolean;
@@ -3578,7 +3952,7 @@ declare class RTKTelemetry {
3578
3952
  };
3579
3953
  static resetPeerId(peerId: string): void;
3580
3954
  static init(context: Context<RTKContextState>, enableTracing: boolean): void;
3581
- static trace(spanName: string): (_target: Object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
3955
+ static trace(spanName: string, metadata?: LogData$1 | undefined): (_target: Object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
3582
3956
  static injectContext(injectionReceiver: any): void;
3583
3957
  static addLogInCurrentSpan(eventSeverity: EventSeverities, eventName: string, metadata?: LogData$1, noCache?: boolean): void;
3584
3958
  static sendOtelLogsToNewRelic(logs: object[]): void;
@@ -3586,444 +3960,245 @@ declare class RTKTelemetry {
3586
3960
  static destruct(): void;
3587
3961
  }
3588
3962
  type LogData = LogData$1;
3589
- declare class RTKLogger {
3963
+ declare class RTKLogger$1 {
3590
3964
  static info(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
3591
3965
  static error(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
3592
3966
  static debug(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
3593
3967
  static log(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
3594
- static warn(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
3595
- }
3596
- declare class RTKInternals {
3597
- logger: typeof RTKLogger;
3598
- features: typeof RTKFeatures;
3599
- browserSpecs: BrowserCapabilities;
3600
- callStats: any;
3601
- constructor(logger: typeof RTKLogger, features: typeof RTKFeatures, callStats: any);
3602
- static init(callstats: any): RTKInternals;
3603
- }
3604
- type LivestreamState = 'IDLE' | 'STARTING' | 'LIVESTREAMING' | 'STOPPING';
3605
- type LivestreamEvents = {
3606
- ['livestreamUpdate']: (state: LivestreamState) => void;
3607
- ['viewerCountUpdate']: (count: number) => void;
3608
- ['*']: (eventName: string, ...args: any[]) => void;
3609
- };
3610
- declare class RTKLivestream$1 extends RTKTypedEventEmitter<LivestreamEvents> {
3611
- private "RTKLivestream$1.#private";
3612
- state: LivestreamState;
3613
- playbackUrl: string | undefined;
3614
- viewerCount: number;
3615
- constructor(self: RTKSelf);
3616
- setLivestreamState(livestreamState: LivestreamState): void;
3617
- private emitCurrentLivestreamState;
3618
- start(): Promise<void>;
3619
- stop(): Promise<void>;
3620
- }
3621
- type StoreData = {
3622
- [type: string]: any;
3623
- };
3624
- declare class RTKStore {
3625
- private "RTKStore.#private";
3626
- name: string;
3627
- volatile: boolean;
3628
- private listeners;
3629
- constructor({ name, socketHandler, meetingId }: {
3630
- name: string;
3631
- socketHandler: PluginSocketHandler;
3632
- meetingId: string;
3633
- });
3634
- set(key: string, value: any, sync?: boolean, emit?: boolean): Promise<void>;
3635
- bulkSet(data: {
3636
- key: string;
3637
- payload: any;
3638
- }[]): Promise<void>;
3639
- update(key: string, value: any, sync?: boolean): Promise<void>;
3640
- delete(key: string, sync?: boolean, emit?: boolean): Promise<void>;
3641
- bulkDelete(data: {
3642
- key: string;
3643
- }[]): Promise<void>;
3644
- get(key: string): any;
3645
- getAll(): StoreData;
3646
- subscribe(key: string | '*', cb: (value: any) => any): void;
3647
- unsubscribe(key: string | '*'): void;
3648
- populate(data: StoreData): void;
3649
- }
3650
- declare class RTKStoreManager {
3651
- private "RTKStoreManager.#private";
3652
- stores: Map<String, RTKStore>;
3653
- constructor(context: Context<RTKContextState>, handler: PluginSocketHandler);
3654
- create(name: string): Promise<RTKStore>;
3655
- }
3656
- declare class RTKSelectedPeers {
3657
- private readonly _activeSpeakerPeers;
3658
- private readonly _compulsoryPeers;
3659
- constructor();
3660
- add(peerId: string, priority: number): number;
3661
- delete(peerId: string): void;
3662
- index(peerId: string): number;
3663
- readonly peers: string[];
3664
- readonly compulsoryPeers: string[];
3665
- readonly peerPriorities: number[];
3666
- readonly activeSpeakerPeers: string[];
3667
- private _removeFromCompulsoryPeer;
3668
- }
3669
- interface Modules {
3670
- pip?: boolean;
3671
- chat?: boolean;
3672
- poll?: boolean;
3673
- theme?: boolean;
3674
- stage?: boolean;
3675
- plugin?: boolean;
3676
- tracing?: boolean;
3677
- internals?: boolean;
3678
- recording?: boolean;
3679
- livestream?: boolean;
3680
- participant?: boolean;
3681
- connectedMeetings?: boolean;
3682
- e2ee?: {
3683
- manager: any;
3684
- enabled: boolean;
3685
- };
3686
- devTools?: {
3687
- logs: boolean;
3688
- plugins?: {
3689
- id: string;
3690
- name: string;
3691
- port: number;
3692
- picture?: string;
3693
- description?: string;
3694
- staggered?: boolean;
3695
- }[];
3696
- };
3697
- }
3698
- interface DefaultOptions {
3699
- video?: boolean;
3700
- audio?: boolean;
3701
- recording?: RecordingConfig;
3702
- mediaHandler?: RTKSelfMedia;
3703
- autoSwitchAudioDevice?: boolean;
3704
- mediaConfiguration?: {
3705
- video?: VideoQualityConstraints;
3706
- audio?: AudioQualityConstraints;
3707
- screenshare?: ScreenshareQualityConstraints;
3708
- };
3709
- isNonPreferredDevice?: (device: MediaDeviceInfo) => boolean;
3710
- }
3711
- interface RoomDetails {
3712
- sfu: MediaNodeType;
3713
- roomNodeUrl: string;
3714
- meetingTitle: string;
3715
- useHiveMedia: boolean;
3716
- }
3717
- declare const modes: readonly [
3718
- "ACTIVE_GRID",
3719
- "PAGINATED",
3720
- "MANUAL"
3721
- ];
3722
- type ViewMode = (typeof modes)[number];
3723
- interface BroadcastMessagePayload {
3724
- [key: string]: boolean | number | string | Date | ActiveTab;
3725
- }
3726
- interface PeerProducerConfig {
3727
- audio: boolean;
3728
- video: boolean;
3729
- screenshareAudio: boolean;
3730
- screenshareVideo: boolean;
3731
- }
3732
- interface SubscriptionProducerConfig {
3733
- id: string;
3734
- producers: PeerProducerConfig;
3735
- }
3736
- type BroadcastMessageTarget = {
3737
- participantIds: string[];
3738
- } | {
3739
- presetNames: string[];
3740
- };
3741
- type ParticipantsEvents = {
3742
- ['viewModeChanged']: (payload: {
3743
- viewMode: string;
3744
- currentPage: number;
3745
- pageCount: number;
3746
- }) => void;
3747
- ['activeSpeaker']: (payload: {
3748
- peerId: string;
3749
- volume: number;
3750
- }) => void;
3751
- ['broadcastedMessage']: (payload: {
3752
- type: string;
3753
- payload: BroadcastMessagePayload;
3754
- timestamp: number;
3755
- }) => void;
3756
- ['poorConnection']: (payload: {
3757
- participantId: string;
3758
- score: number;
3759
- kind: string;
3760
- }) => void;
3761
- ['pageChanged']: (payload: {
3762
- viewMode: string;
3763
- currentPage: number;
3764
- pageCount: number;
3765
- }) => void;
3766
- ['mediaScoreUpdate']: (payload: {
3767
- kind: string;
3768
- isScreenshare: boolean;
3769
- score: number;
3770
- participantId: string;
3771
- }) => void;
3772
- ['media_decode_error']: (payload: {
3773
- reason: string;
3774
- code: '1702' | '1703';
3775
- }) => void;
3776
- ['*']: (event: string, ...args: any[]) => void;
3777
- };
3778
- declare class RTKParticipants$1 extends RTKTypedEventEmitter<ParticipantsEvents> {
3779
- private "RTKParticipants$1.#private";
3780
- readonly waitlisted: Readonly<RTKParticipantMap$1<Pick<RTKParticipant$1, Exclude<keyof RTKParticipant$1, 'audioTrack' | 'videoTrack' | 'screenShareTracks'>>>>;
3781
- readonly joined: Readonly<RTKParticipantMap$1>;
3782
- readonly active: Readonly<RTKParticipantMap$1>;
3783
- readonly pinned: Readonly<RTKParticipantMap$1>;
3784
- readonly all: Readonly<RTKBasicParticipantsMap>;
3785
- readonly pip: Readonly<RTKPip>;
3786
- private readonly roomJoined: any;
3787
- viewMode: ViewMode;
3788
- currentPage: number;
3789
- lastActiveSpeaker: string;
3790
- selectedPeers: RTKSelectedPeers;
3791
- constructor(context: Context<RTKContextState>, self: RTKSelf$1, roomSocketHandler: RoomSocketHandler, modules?: Modules);
3792
- setupEvents(): void;
3793
- readonly count: number;
3794
- readonly maxActiveParticipantsCount: number;
3795
- setMaxActiveParticipantsCount(limit: number): void;
3796
- readonly pageCount: number;
3797
- acceptWaitingRoomRequest(id: string): void;
3798
- acceptAllWaitingRoomRequest(userIds: string[]): Promise<void>;
3799
- rejectWaitingRoomRequest(id: string): Promise<void>;
3800
- setViewMode(viewMode: ViewMode): Promise<void>;
3801
- subscribe(peers: SubscriptionProducerConfig[]): Promise<void>;
3802
- unsubscribe(peers: string[]): Promise<void>;
3803
- getPeerIdsForCurrentPage(): string[];
3804
- setPage(page: number): Promise<void>;
3805
- disableAllAudio(allowUnmute: boolean): Promise<void>;
3806
- disableAllVideo(): Promise<void>;
3807
- disableAudio(participantId: string): Promise<void>;
3808
- disableVideo(participantId: string): Promise<void>;
3809
- kick(participantId: string): Promise<void>;
3810
- kickAll(): Promise<void>;
3811
- broadcastMessage(type: Exclude<string, 'spotlight'>, payload: BroadcastMessagePayload, target?: BroadcastMessageTarget): Promise<void>;
3812
- getAllJoinedPeers(searchQuery: string, limit: number, offset: number): Promise<{
3813
- id: string;
3814
- userId: string;
3815
- name: string;
3816
- displayName: string;
3817
- stageType: StageStatus;
3818
- customParticipantId: string;
3819
- presetId: string;
3820
- picture: string;
3821
- waitlisted: boolean;
3822
- stageStatus: StageStatus;
3823
- metadata: {
3824
- preset_name: string;
3825
- };
3826
- recorderType: string;
3827
- flags: {
3828
- hiddenParticipant: boolean;
3829
- recorder: boolean;
3830
- };
3831
- }[]>;
3832
- updatePermissions(participantIds: string[], permissions: PresetUpdates): Promise<void>;
3833
- getParticipantsInMeetingPreJoin(): Promise<RoomPeersInfoResponse>;
3968
+ static warn(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
3834
3969
  }
3835
- type EventHandlerTypes = PeerInfoResponse | GetWaitingRoomRequests | RecordingEvent | UpdatePeersPresetResponse | PeerJoinBroadcastResponse | PeerJoinCompleteResponse | GlobalPeerPinningBroadcastResponse | PeerLeaveResponse | SelectedPeersResponse | SelectedPeersDiffResponse;
3836
- declare class RoomSocketHandler {
3837
- socket: SocketService;
3838
- static create(socket: SocketService): RoomSocketHandler;
3839
- static cleanup(): void;
3840
- constructor(socketService: SocketService);
3841
- joinRoom(displayName: string, peerId: string, userId: string, viewType: ViewType): Promise<{
3842
- peer: Peer;
3843
- }>;
3844
- getAllAddedParticipants(): Promise<RTKBasicParticipant[]>;
3845
- getRoomPeers(searchQuery: string, limit: number, offset: number): Promise<RoomPeersInfoResponse>;
3846
- getRoomPeersNonPaginated(): Promise<RoomPeersInfoResponse>;
3847
- getStagePeers(): Promise<RoomPeersInfoResponse>;
3848
- getPeerInfo(peerId: string): Promise<PeerInfoResponse>;
3849
- getRoomState(): Promise<RoomInfoResponse>;
3850
- getRoomStageState(): Promise<GetRoomStageStateResponse>;
3851
- broadcastMessage(type: string, payload: BroadcastMessagePayload): Promise<{
3852
- id: string;
3853
- payload: Uint8Array;
3854
- }>;
3855
- broadcastToPeers(type: string, peerIds: string[], payload: BroadcastMessagePayload): Promise<boolean>;
3856
- leaveRoom(): Promise<void>;
3857
- kick(peerId: string): Promise<void>;
3858
- kickAll(): Promise<void>;
3859
- getWaitingRoomRequests(): void;
3860
- acceptWaitingRoomRequest(userIds: string[]): void;
3861
- rejectWaitingRoomRequest(userIds: string[]): void;
3862
- updatePermissions(userIds: string[], patch: PresetUpdates): Promise<{
3863
- id: string;
3864
- payload: Uint8Array;
3865
- }>;
3866
- private handleSocketEvents;
3867
- on(event: number, handler: (message: EventHandlerTypes) => void): void;
3868
- getUserPermissions(userId: string): Promise<Pick<PresetTypeV2['permissions'], 'chat' | 'polls' | 'plugins'>>;
3970
+ declare class RTKInternals {
3971
+ logger: typeof RTKLogger$1;
3972
+ features: typeof RTKFeatures;
3973
+ browserSpecs: BrowserCapabilities;
3974
+ callStats: any;
3975
+ constructor(logger: typeof RTKLogger$1, features: typeof RTKFeatures, callStats: any);
3976
+ static init(callstats: any): RTKInternals;
3869
3977
  }
3870
- interface DeviceConfig {
3871
- browserName: string;
3872
- browserVersion: string;
3873
- isMobile: boolean;
3874
- engineName: string;
3875
- osName: string;
3978
+ type StoreData = {
3979
+ [type: string]: any;
3980
+ };
3981
+ declare class RTKStore$1 {
3982
+ private "RTKStore$1.#private";
3983
+ name: string;
3984
+ rateLimitConfig: {
3985
+ maxInvocations: number;
3986
+ period: number;
3987
+ };
3988
+ bulkRateLimitConfig: {
3989
+ maxInvocations: number;
3990
+ period: number;
3991
+ };
3992
+ private listeners;
3993
+ constructor({ name, socketHandler, meetingId }: {
3994
+ name: string;
3995
+ socketHandler: PluginSocketHandler;
3996
+ meetingId: string;
3997
+ });
3998
+ set(key: string, value: any, sync?: boolean, emit?: boolean): Promise<void>;
3999
+ private remoteSet;
4000
+ bulkSet(data: {
4001
+ key: string;
4002
+ payload: any;
4003
+ }[]): Promise<void>;
4004
+ update(key: string, value: any, sync?: boolean): Promise<void>;
4005
+ delete(key: string, sync?: boolean, emit?: boolean): Promise<void>;
4006
+ bulkDelete(data: {
4007
+ key: string;
4008
+ }[]): Promise<void>;
4009
+ get(key: string): any;
4010
+ getAll(): StoreData;
4011
+ readonly rateLimits: {
4012
+ maxInvocations: number;
4013
+ period: number;
4014
+ };
4015
+ updateRateLimits(num: number, period: number): void;
4016
+ readonly bulkRateLimits: {
4017
+ maxInvocations: number;
4018
+ period: number;
4019
+ };
4020
+ updateBulkRateLimits(num: number, period: number): void;
4021
+ subscribe(key: string | '*', cb: (value: any) => any): void;
4022
+ unsubscribe(key: string | '*', cb?: (value: any) => any): void;
4023
+ populate(data: StoreData): void;
3876
4024
  }
3877
- interface ProducerState {
3878
- producerId: string;
3879
- kind: 'audio' | 'video';
3880
- pause: boolean;
3881
- screenShare: boolean;
3882
- producingTransportId: string;
4025
+ declare class RTKStoreManager {
4026
+ private "RTKStoreManager.#private";
4027
+ stores: Map<String, RTKStore$1>;
4028
+ constructor(context: Context<RTKContextState>, handler: PluginSocketHandler);
4029
+ create(name: string): Promise<RTKStore$1>;
3883
4030
  }
3884
- interface Participant {
3885
- id: string;
3886
- userId: string;
3887
- displayName: string;
3888
- device?: DeviceConfig;
3889
- picture?: string;
3890
- isHost: boolean;
3891
- flags: {
3892
- [key: string]: string | boolean;
4031
+ interface Modules {
4032
+ pip?: boolean;
4033
+ chat?: boolean;
4034
+ poll?: boolean;
4035
+ theme?: boolean;
4036
+ stage?: boolean;
4037
+ plugin?: boolean;
4038
+ tracing?: boolean;
4039
+ internals?: boolean;
4040
+ recording?: boolean;
4041
+ livestream?: boolean;
4042
+ participant?: boolean;
4043
+ connectedMeetings?: boolean;
4044
+ e2ee?: {
4045
+ manager: any;
4046
+ enabled: boolean;
3893
4047
  };
3894
- clientSpecificId?: string;
3895
- customParticipantId?: string;
3896
- stageStatus?: StageStatus;
3897
- audioMuted: boolean;
3898
- audioTrack: MediaStreamTrack;
3899
- videoTrack: MediaStreamTrack;
3900
- videoEnabled: boolean;
3901
- producers?: ProducerState[];
3902
- metadata?: {
3903
- preset_name?: string;
4048
+ devTools?: {
4049
+ logs: boolean;
4050
+ plugins?: {
4051
+ id: string;
4052
+ name: string;
4053
+ port: number;
4054
+ picture?: string;
4055
+ description?: string;
4056
+ staggered?: boolean;
4057
+ }[];
3904
4058
  };
3905
- recorderType?: string;
3906
4059
  }
3907
- declare class RTKParticipant$1 extends RTKTypedEventEmitter<ParticipantEvents> {
3908
- private "RTKParticipant$1.#private";
3909
- id: string;
3910
- userId: string;
3911
- name: string;
3912
- picture: string;
3913
- isHost: boolean;
3914
- customParticipantId?: string;
3915
- readonly clientSpecificId: string;
3916
- flags: {
3917
- [key: string]: string | boolean;
3918
- };
3919
- device: DeviceConfig;
3920
- videoTrack: MediaStreamTrack;
3921
- audioTrack: MediaStreamTrack;
3922
- screenShareTracks: {
3923
- audio: MediaStreamTrack;
3924
- video: MediaStreamTrack;
4060
+ interface DefaultOptions {
4061
+ video?: boolean;
4062
+ audio?: boolean;
4063
+ recording?: RecordingConfig;
4064
+ mediaHandler?: RTKSelfMedia;
4065
+ autoSwitchAudioDevice?: boolean;
4066
+ mediaConfiguration?: {
4067
+ video?: VideoQualityConstraints;
4068
+ audio?: AudioQualityConstraints;
4069
+ screenshare?: ScreenshareQualityConstraints;
3925
4070
  };
3926
- videoEnabled: boolean;
3927
- audioEnabled: boolean;
3928
- screenShareEnabled: boolean;
3929
- producers: ProducerState[];
3930
- manualProducerConfig: PeerProducerConfig;
3931
- supportsRemoteControl: boolean;
3932
- presetName?: string;
3933
- readonly stageStatus: StageStatus;
3934
- private readonly roomJoined: any;
3935
- constructor(context: Context<RTKContextState>, participant: Participant, self: RTKSelf, roomSocket: RoomSocketHandler);
3936
- setVideoEnabled(videoEnabled: boolean, emitEvent?: boolean): void;
3937
- setAudioEnabled(audioEnabled: boolean, emitEvent?: boolean): void;
3938
- setScreenShareEnabled(screenShareEnabled: boolean, emitEvent?: boolean): void;
3939
- private setupEvents;
3940
- pin(): Promise<unknown>;
3941
- unpin(): Promise<unknown>;
3942
- setIsPinned(isPinned: boolean, emitEvent?: boolean): void;
3943
- disableAudio(): Promise<void>;
3944
- kick(): Promise<void>;
3945
- disableVideo(): Promise<void>;
3946
- getPermissions(): Promise<Pick<Permissions, "polls" | "plugins" | "chat">>;
3947
- setStageStatus(stageStatus: StageStatus): void;
3948
- readonly isPinned: boolean;
3949
- registerVideoElement(videoElem: HTMLVideoElement): void;
3950
- deregisterVideoElement(videoElem: HTMLVideoElement): void;
4071
+ isNonPreferredDevice?: (device: MediaDeviceInfo) => boolean;
3951
4072
  }
3952
- declare abstract class RoomNodeClient {
3953
- private "RoomNodeClient.#private";
3954
- meetingTitle: string;
3955
- roomName: string;
3956
- roomUUID: string;
3957
- context: Context<RTKContextState>;
3958
- readonly peerId: string;
3959
- authToken: string;
3960
- maxPreferredStreams: number;
3961
- roomJoined: boolean;
3962
- readonly sfuHandler: any;
3963
- readonly socketState: SocketConnectionState;
3964
- readonly mediaState: MediaConnectionState;
3965
- reconnect(): void;
3966
- partialJoinRoom(displayName: string, roomUuid: string, rejoining?: boolean, loc?: GeoLocation): Promise<void>;
3967
- joinRoom(displayName: string, roomUUID: string, currentUserSharedMediaStates?: {
3968
- audio?: boolean;
3969
- video?: boolean;
3970
- screen?: boolean;
3971
- }, forceFullReset?: boolean, rejoining?: boolean): Promise<{
3972
- roomJoined: boolean;
3973
- }>;
3974
- leaveRoom(): Promise<void>;
3975
- reset(full?: boolean): void;
3976
- handleSocketCallbacks(message: any): Promise<void>;
3977
- handleSockets(message: any, callBack: (arg?: string) => void): Promise<void>;
3978
- shareMic(audioTrack: MediaStreamTrack): Promise<void>;
3979
- shareWebcam(videoTrack: MediaStreamTrack): Promise<MediaStreamTrack | null>;
3980
- shareScreen(screenShareTracks: {
3981
- audio?: MediaStreamTrack;
3982
- video?: MediaStreamTrack;
3983
- }): Promise<void>;
3984
- unmuteSelf(): Promise<void>;
3985
- muteSelf(): Promise<void>;
3986
- pauseWebcam(): Promise<void>;
3987
- disableScreenShare(): Promise<void>;
3988
- acceptWaitingRequest(id: string): Promise<void>;
3989
- rejectWaitingRequest(id: string): Promise<void>;
3990
- muteAll(allowUnMute: boolean): Promise<void>;
3991
- muteAllVideo(): Promise<void>;
3992
- disableAudio(peerId: string): Promise<void>;
3993
- disableVideo(peerId: string): Promise<void>;
3994
- kickAll(): Promise<void>;
3995
- kick(peerId: string): Promise<void>;
3996
- pinPeer(id: string): Promise<unknown>;
3997
- getConsumers(): any;
3998
- stopAllProducers(): void;
3999
- activatePeers(producerInfos: {
4000
- peerId: string;
4001
- producers: ProducerState[];
4002
- force?: boolean;
4003
- }[]): Promise<void>;
4004
- deactivatePeers(producerInfo: {
4005
- peerId: string;
4006
- producers: ProducerState[];
4007
- }): Promise<void>;
4008
- switchConsumersToLayer(consumerIds: string[], layer: number): Promise<void>;
4073
+ interface RoomDetails {
4074
+ sfu: MediaNodeType;
4075
+ roomNodeUrl: string;
4076
+ meetingTitle: string;
4077
+ useHiveMedia: boolean;
4078
+ }
4079
+ declare class ConnectionHandler {
4080
+ mediaJoined: boolean;
4081
+ socketJoined: boolean;
4082
+ socketJoinAttempted: boolean;
4083
+ mediaJoinAttempted: boolean;
4084
+ socketState: SocketConnectionState;
4085
+ mediaState: MediaConnectionState;
4086
+ readonly joinAttempted: boolean;
4087
+ readonly roomJoined: boolean;
4088
+ constructor();
4089
+ updateSocketConnectionState(state: SocketStateEvent, attempt?: number): void;
4090
+ }
4091
+ declare const ERROR_CODES: {
4092
+ '0000': string;
4093
+ '0001': string;
4094
+ '0002': string;
4095
+ '0003': string;
4096
+ '0004': string;
4097
+ '0010': string;
4098
+ '0011': string;
4099
+ '0012': string;
4100
+ '0013': string;
4101
+ '0100': string;
4102
+ '0101': string;
4103
+ '0102': string;
4104
+ '0200': string;
4105
+ '0300': string;
4106
+ '0400': string;
4107
+ '0404': string;
4108
+ '0500': string;
4109
+ '0501': string;
4110
+ '0502': string;
4111
+ '0503': string;
4112
+ '0504': string;
4113
+ '0505': string;
4114
+ '0506': string;
4115
+ '0510': string;
4116
+ '0600': string;
4117
+ '0601': string;
4118
+ '0602': string;
4119
+ '0603': string;
4120
+ '0700': string;
4121
+ '0705': string;
4122
+ '0800': string;
4123
+ '0801': string;
4124
+ '0900': string;
4125
+ '0904': string;
4126
+ '1000': string;
4127
+ '1001': string;
4128
+ '1004': string;
4129
+ '1005': string;
4130
+ '1100': string;
4131
+ '1101': string;
4132
+ '1102': string;
4133
+ '1103': string;
4134
+ '1104': string;
4135
+ '1105': string;
4136
+ '1106': string;
4137
+ '1200': string;
4138
+ '1201': string;
4139
+ '1202': string;
4140
+ '1203': string;
4141
+ '1204': string;
4142
+ '1205': string;
4143
+ '1206': string;
4144
+ '1207': string;
4145
+ '1208': string;
4146
+ '1209': string;
4147
+ '1300': string;
4148
+ '1400': string;
4149
+ '1402': string;
4150
+ '1403': string;
4151
+ '1500': string;
4152
+ '1600': string;
4153
+ '1601': string;
4154
+ '1602': string;
4155
+ '1603': string;
4156
+ '1604': string;
4157
+ '1605': string;
4158
+ '1606': string;
4159
+ '1607': string;
4160
+ '1608': string;
4161
+ '1609': string;
4162
+ '1610': string;
4163
+ '1611': string;
4164
+ '1612': string;
4165
+ '1701': string;
4166
+ '1800': string;
4167
+ '1801': string;
4168
+ '1900': string;
4169
+ '1901': string;
4170
+ '1902': string;
4171
+ '2000': string;
4172
+ '2001': string;
4173
+ '2002': string;
4174
+ '2003': string;
4175
+ '2004': string;
4176
+ '2005': string;
4177
+ '2006': string;
4178
+ '9900': string;
4179
+ };
4180
+ declare class RTKError extends Error {
4181
+ code: keyof typeof ERROR_CODES;
4182
+ constructor(message: string, code?: keyof typeof ERROR_CODES, log?: boolean);
4009
4183
  }
4010
4184
  type RTKContextState = {
4011
4185
  authToken: string;
4012
4186
  peerId?: string;
4013
4187
  apiBase?: string;
4014
4188
  baseURI?: string;
4189
+ onError?: (error: RTKError) => void;
4015
4190
  stageStatus?: StageStatus;
4016
4191
  organizationId?: string;
4192
+ maxPreferredStreams?: number;
4017
4193
  defaults?: DefaultOptions;
4018
4194
  modules?: Modules;
4019
- overrides?: {
4020
- [key: string]: boolean | string;
4021
- };
4195
+ overrides?: Overrides;
4022
4196
  apiClient?: BaseAPIClient;
4023
4197
  userId?: string;
4024
4198
  meetingId?: string;
4025
4199
  roomName?: string;
4026
4200
  socketService?: SocketService;
4201
+ pip?: RTKPip;
4027
4202
  roomNodeOptions?: {
4028
4203
  meetingTitle: string;
4029
4204
  roomNodeUrl: string;
@@ -4034,6 +4209,7 @@ type RTKContextState = {
4034
4209
  env?: ClientEnvTypeAll;
4035
4210
  sdkVersion?: string;
4036
4211
  sdkName?: 'web-core';
4212
+ connectionHandler?: ConnectionHandler;
4037
4213
  cachedUserDetails?: CachedUserDetails;
4038
4214
  };
4039
4215
  interface Context<T extends Record<string, any>> {
@@ -4057,7 +4233,7 @@ declare class SocketService {
4057
4233
  readonly roomName: string;
4058
4234
  readonly authToken: string;
4059
4235
  readonly capabilities: SocketServiceCapabilities;
4060
- connectionState: SocketConnectionState;
4236
+ joinAttempted: boolean;
4061
4237
  readonly peerId: string;
4062
4238
  constructor(context: Context<RTKContextState>, { peerId, meetingId, authToken, capabilities, }: {
4063
4239
  peerId: string;
@@ -4069,7 +4245,7 @@ declare class SocketService {
4069
4245
  private static getSocketEdgeDomain;
4070
4246
  readonly url: string;
4071
4247
  connect(): Promise<void>;
4072
- disconnect(): void;
4248
+ disconnect(): Promise<void>;
4073
4249
  readonly isConnected: boolean;
4074
4250
  sendMessage(event: number, protobuf?: Uint8Array, messageId?: string): boolean;
4075
4251
  sendMessagePromise(event: number, protobuf?: Uint8Array, messageId?: string, resp?: number): Promise<{
@@ -4091,7 +4267,13 @@ declare class SocketService {
4091
4267
  payload?: Uint8Array;
4092
4268
  }) => void): void;
4093
4269
  onStateEvent(event: SocketStateEvent, listener: (...args: any) => void): void;
4270
+ removeListener(event: number, listener: (message: {
4271
+ id?: string;
4272
+ payload?: Uint8Array;
4273
+ }) => void): void;
4274
+ removeListeners(event: number): void;
4094
4275
  flush(): any;
4276
+ handleSocketConnectionEvents(): void;
4095
4277
  }
4096
4278
  type StageSocketMessage = GetStageRequestsResponse | GetStagePeersResponse | DenyStageAccessRequest | PeerStatusUpdate;
4097
4279
  declare class StageSocketHandler {
@@ -4174,12 +4356,14 @@ declare class RTKSelf$1 extends RTKSelfMedia {
4174
4356
  organizationId: string;
4175
4357
  supportsRemoteControl: boolean;
4176
4358
  device: DeviceConfig;
4359
+ hidden: boolean;
4177
4360
  readonly stageStatus: StageStatus;
4178
4361
  readonly id: string;
4179
4362
  presetName: string;
4180
4363
  roomState: 'init' | 'joined' | 'waitlisted' | leaveRoomState;
4181
4364
  private constructor();
4182
4365
  static __init__(context: Context<RTKContextState>, details: UserDetailsResponse, permissions: RTKPermissionsPreset$1, theme: RTKThemePreset$1, presetName: string, skipAwaits?: boolean): Promise<RTKSelf$1>;
4366
+ cleanupEvents(): void;
4183
4367
  private setupEvents;
4184
4368
  readonly permissions: RTKPermissionsPreset$1;
4185
4369
  readonly config: RTKThemePreset$1;
@@ -4205,11 +4389,13 @@ declare class RTKSelf$1 extends RTKSelfMedia {
4205
4389
  readonly isPinned: boolean;
4206
4390
  pin(): Promise<unknown>;
4207
4391
  unpin(): Promise<unknown>;
4392
+ hide(): Promise<void>;
4393
+ show(): void;
4208
4394
  setDevice(device: MediaDeviceInfo): Promise<void>;
4209
4395
  cleanUpTracks(): void;
4210
- registerVideoElement(videoElem: HTMLVideoElement): void;
4211
- deregisterVideoElement(videoElem: HTMLVideoElement): void;
4212
- updateVideo(e: HTMLVideoElement): void;
4396
+ registerVideoElement(videoElem: HTMLVideoElement, isPreview?: boolean): void;
4397
+ deregisterVideoElement(videoElem?: HTMLVideoElement, isPreview?: boolean): void;
4398
+ private updateVideo;
4213
4399
  }
4214
4400
  interface RTKPluginResponse {
4215
4401
  baseURL: string;
@@ -4438,14 +4624,17 @@ declare class RTKConnectedMeetings$1 extends RTKTypedEventEmitter<ConnectedMeeti
4438
4624
  }>;
4439
4625
  private moveSuccessHandler;
4440
4626
  }
4627
+ interface Overrides {
4628
+ disableSimulcast?: boolean;
4629
+ [key: string]: boolean | string | number;
4630
+ }
4441
4631
  interface RealtimeKitClientOptions {
4442
4632
  authToken: string;
4443
4633
  defaults?: DefaultOptions;
4444
4634
  modules?: Modules;
4445
- overrides?: {
4446
- [key: string]: boolean | string;
4447
- };
4635
+ overrides?: Overrides;
4448
4636
  baseURI?: string;
4637
+ onError?: (error: RTKError) => void;
4449
4638
  cachedUserDetails?: CachedUserDetails;
4450
4639
  }
4451
4640
  declare class RealtimeKitClient {
@@ -4474,7 +4663,10 @@ declare class RealtimeKitClient {
4474
4663
  type RTKParticipant = Readonly<RTKParticipant$1>;
4475
4664
  type RTKParticipants = Readonly<RTKParticipants$1>;
4476
4665
  type RTKParticipantMap = Readonly<RTKParticipantMap$1>;
4666
+ type RTKPlugin = Readonly<RTKPlugin$1>;
4477
4667
  type RTKSelf = Readonly<RTKSelf$1>;
4668
+ type RTKConnectedMeetings = Readonly<RTKConnectedMeetings$1>;
4669
+ type RTKPermissionsPreset = Readonly<RTKPermissionsPreset$1>;
4478
4670
  type RTKType = {
4479
4671
  callStats?: unknown;
4480
4672
  RTKTelemetry?: typeof RTKTelemetry;
@@ -4492,4 +4684,4 @@ declare global {
4492
4684
  TransformStream?: any;
4493
4685
  }
4494
4686
  }
4495
- export { RealtimeKitClientOptions, RTKParticipant, RTKParticipantMap, RTKSelf, RTKSelfMedia, RealtimeKitClient as default };
4687
+ export { ActiveTabType, CustomMessage, DeviceConfig, RTKBasicParticipant, RealtimeKitClientOptions, RTKConnectedMeetings, RTKParticipant, RTKParticipantMap, RTKParticipants, RTKPermissionsPreset, RTKPlugin, RTKSelf, RTKSelfMedia, FileMessage, ImageMessage, LivestreamState, MediaConnectionState, MediaKind$1 as MediaKind, Message, ProducerScoreStats, SocketConnectionState, StageStatus, TextMessage, VideoProducerScoreStats, RealtimeKitClient as default, leaveRoomState };