@cometchat/calls-sdk-react-native 5.0.1 → 5.0.2-beta.1

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.
package/dist/index.d.ts CHANGED
@@ -114,6 +114,8 @@ declare const EVENT_LISTENER_METHODS: {
114
114
  readonly onSessionLeft: "onSessionLeft";
115
115
  readonly onConnectionLost: "onConnectionLost";
116
116
  readonly onConnectionRestored: "onConnectionRestored";
117
+ readonly onRemoteConnectionLost: "onRemoteConnectionLost";
118
+ readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
117
119
  readonly onConnectionClosed: "onConnectionClosed";
118
120
  readonly onConnectionFailed: "onConnectionFailed";
119
121
  readonly onSessionTimedOut: "onSessionTimedOut";
@@ -184,6 +186,8 @@ declare const EVENT_LISTENER_METHODS_WEB: {
184
186
  readonly onSessionLeft: "onSessionLeft";
185
187
  readonly onConnectionLost: "onConnectionLost";
186
188
  readonly onConnectionRestored: "onConnectionRestored";
189
+ readonly onRemoteConnectionLost: "onRemoteConnectionLost";
190
+ readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
187
191
  readonly onConnectionClosed: "onConnectionClosed";
188
192
  readonly onConnectionFailed: "onConnectionFailed";
189
193
  readonly onSessionTimedOut: "onSessionTimedOut";
@@ -225,6 +229,7 @@ declare const EVENT_LISTENER_METHODS_WEB: {
225
229
  declare const EVENT_LISTENER_METHODS_MOBILE: {
226
230
  readonly MediaEventsListener: {
227
231
  readonly onAudioModeChanged: "onAudioModeChanged";
232
+ readonly onAudioModesChanged: "onAudioModesChanged";
228
233
  readonly onCameraFacingChanged: "onCameraFacingChanged";
229
234
  readonly onAudioMuted: "onAudioMuted";
230
235
  readonly onAudioUnMuted: "onAudioUnMuted";
@@ -260,6 +265,8 @@ declare const EVENT_LISTENER_METHODS_MOBILE: {
260
265
  readonly onSessionLeft: "onSessionLeft";
261
266
  readonly onConnectionLost: "onConnectionLost";
262
267
  readonly onConnectionRestored: "onConnectionRestored";
268
+ readonly onRemoteConnectionLost: "onRemoteConnectionLost";
269
+ readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
263
270
  readonly onConnectionClosed: "onConnectionClosed";
264
271
  readonly onConnectionFailed: "onConnectionFailed";
265
272
  readonly onSessionTimedOut: "onSessionTimedOut";
@@ -293,6 +300,64 @@ declare const INTERNAL_EVENTS: {
293
300
  readonly SDKInitialized: "internal.SDKInitialized";
294
301
  };
295
302
  };
303
+ declare const CAPTION_LANGUAGES: readonly [{
304
+ readonly code: "en-US";
305
+ readonly label: "English (United States)";
306
+ }, {
307
+ readonly code: "de-DE";
308
+ readonly label: "German (Germany)";
309
+ }, {
310
+ readonly code: "en-GB";
311
+ readonly label: "English (United Kingdom)";
312
+ }, {
313
+ readonly code: "es-ES";
314
+ readonly label: "Spanish (Spain)";
315
+ }, {
316
+ readonly code: "fr-FR";
317
+ readonly label: "French (France)";
318
+ }, {
319
+ readonly code: "hi-IN";
320
+ readonly label: "Hindi (India)";
321
+ }, {
322
+ readonly code: "hu-HU";
323
+ readonly label: "Hungarian (Hungary)";
324
+ }, {
325
+ readonly code: "it-IT";
326
+ readonly label: "Italian (Italy)";
327
+ }, {
328
+ readonly code: "ja-JP";
329
+ readonly label: "Japanese (Japan)";
330
+ }, {
331
+ readonly code: "ko-KR";
332
+ readonly label: "Korean (South Korea)";
333
+ }, {
334
+ readonly code: "lt-LT";
335
+ readonly label: "Lithuanian (Lithuania)";
336
+ }, {
337
+ readonly code: "ms-MY";
338
+ readonly label: "Malay (Malaysia)";
339
+ }, {
340
+ readonly code: "nl-NL";
341
+ readonly label: "Dutch (Netherlands)";
342
+ }, {
343
+ readonly code: "pt-PT";
344
+ readonly label: "Portuguese (Portugal)";
345
+ }, {
346
+ readonly code: "ru-RU";
347
+ readonly label: "Russian (Russia)";
348
+ }, {
349
+ readonly code: "sv-SE";
350
+ readonly label: "Swedish (Sweden)";
351
+ }, {
352
+ readonly code: "tr-TR";
353
+ readonly label: "Turkish (Turkey)";
354
+ }, {
355
+ readonly code: "zh";
356
+ readonly label: "Chinese Mandarin (Simplified, China)";
357
+ }, {
358
+ readonly code: "zh-TW";
359
+ readonly label: "Chinese Mandarin (Traditional, Taiwan)";
360
+ }];
296
361
  //#endregion
297
362
  //#region calls-sdk-core/utils/debounce.d.ts
298
363
  declare function debounce<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
@@ -310,6 +375,7 @@ type VideoInputDevice = MediaDeviceInfo & {
310
375
  type Subscription = (() => void) | {
311
376
  remove: () => void;
312
377
  };
378
+ type SettingsDialogTab = 'audio' | 'video' | 'closedCaption';
313
379
  type BaseState = {
314
380
  participantListVisible: boolean;
315
381
  moreMenuVisible: boolean;
@@ -334,6 +400,7 @@ type BaseState = {
334
400
  cameraFacing: CameraFacingInternal;
335
401
  connectionRetryCount: number;
336
402
  settingsDialogVisible: boolean;
403
+ settingsDialogTab: SettingsDialogTab;
337
404
  virtualBackgroundDialogVisible: boolean;
338
405
  idealTimeoutTimer?: NodeJS.Timeout;
339
406
  idleTimeoutModalVisible: boolean;
@@ -420,7 +487,7 @@ declare const setLayout: (layout: Layout, sidebarLayoutSetProgrammatically?: boo
420
487
  declare const hideAllBottomSheets: () => void;
421
488
  declare const enablePictureInPictureLayout: () => void;
422
489
  declare const disablePictureInPictureLayout: () => void;
423
- declare const showSettingsDialog: () => void;
490
+ declare const showSettingsDialog: (tab?: SettingsDialogTab) => void;
424
491
  declare const hideSettingsDialog: () => void;
425
492
  declare const toggleSettingsDialog: () => void;
426
493
  declare const showVirtualBackgroundDialog: () => void;
@@ -428,7 +495,7 @@ declare const hideVirtualBackgroundDialog: () => void;
428
495
  declare const toggleMirrorLocalVideo: () => void;
429
496
  declare const toggleEnableNoiseReduction: () => void;
430
497
  declare const setChatButtonUnreadCount: (count: number) => void;
431
- declare const setAudioMode: (mode: AudioMode["type"]) => void;
498
+ declare const setAudioModes: (modes: AudioMode[]) => void;
432
499
  declare const getLayout: () => Layout;
433
500
  declare function initBaseStoreSubscriptions(): void;
434
501
  //#endregion
@@ -442,6 +509,12 @@ type ConferenceState = {
442
509
  p2p: boolean;
443
510
  conferenceStatus: 'initial' | 'joining' | 'joined' | 'error' | 'interrupted' | 'left' | 'restored' | 'reconnecting';
444
511
  connectionQuality: Map<string, number>;
512
+ /**
513
+ * pid → epoch ms of that participant's last remote stats update. Seeded
514
+ * when the participant joins; in peer calls, used to detect the remote
515
+ * peer's connection being lost (onRemoteConnectionLost).
516
+ */
517
+ remoteStatsTimestamps: Map<string, number>;
445
518
  raiseHandMap: Map<string, number>;
446
519
  recording: {
447
520
  status: ValueOf<typeof JitsiMeetJS.constants.recording.status>;
@@ -490,57 +563,359 @@ type ConfigStateInternal = {
490
563
  enableCompanionMode: boolean;
491
564
  sdkPlatform?: SDKPlatform;
492
565
  };
566
+ /**
567
+ * Configuration that only applies on mobile platforms
568
+ * (native iOS / Android and React Native). These options are ignored on the web.
569
+ */
493
570
  type ConfigStateMobile = {
571
+ /**
572
+ * The audio output route the call should use. One of:
573
+ * - `'SPEAKER'` — the loudspeaker.
574
+ * - `'EARPIECE'` — the phone's earpiece.
575
+ * - `'HEADPHONES'` — wired headphones.
576
+ * - `'BLUETOOTH'` — a connected Bluetooth audio device.
577
+ *
578
+ * When omitted, the SDK chooses a route automatically based on the devices
579
+ * currently connected and updates it as devices are plugged in or removed.
580
+ *
581
+ * @default undefined — chosen automatically by the SDK
582
+ */
494
583
  audioMode?: AudioMode['type'];
584
+ /**
585
+ * Hides the audio-output (route) selector button from the call controls,
586
+ * preventing the user from switching between speaker, earpiece, headphones,
587
+ * and Bluetooth from within the SDK UI.
588
+ *
589
+ * @default false
590
+ */
495
591
  hideAudioModeButton: boolean;
592
+ /**
593
+ * Allows the user to tap the picture-in-picture tile to swap who is shown in
594
+ * the main spotlight. Only applies when `layout` is `'SPOTLIGHT'`.
595
+ *
596
+ * @default true
597
+ */
598
+ enableSpotlightSwap: boolean;
496
599
  };
600
+ /**
601
+ * Configuration that only applies on the web platform.
602
+ * These options are ignored on mobile.
603
+ */
497
604
  type ConfigStateWeb = {
605
+ /**
606
+ * Applies background-noise suppression to the local microphone so that
607
+ * keyboard clicks, fans, and other ambient sounds are filtered out before
608
+ * your audio is sent to other participants.
609
+ *
610
+ * @default false
611
+ */
498
612
  enableNoiseReduction: boolean;
613
+ /**
614
+ * The `deviceId` of the microphone to capture audio from when the call
615
+ * starts. Use this to pre-select a specific input device instead of the
616
+ * system default. Device IDs come from the browser's
617
+ * `navigator.mediaDevices.enumerateDevices()`.
618
+ *
619
+ * @default undefined — uses the system default microphone
620
+ */
499
621
  audioInputDeviceId?: string;
622
+ /**
623
+ * The `deviceId` of the speaker / output device used to play remote
624
+ * participants' audio. Use this to pre-select a specific output device
625
+ * instead of the system default.
626
+ *
627
+ * @default undefined — uses the system default speaker
628
+ */
500
629
  audioOutputDeviceId?: string;
630
+ /**
631
+ * The `deviceId` of the camera to capture video from when the call starts.
632
+ * Use this to pre-select a specific camera instead of the system default.
633
+ *
634
+ * @default undefined — uses the system default camera
635
+ */
501
636
  videoInputDeviceId?: string;
637
+ /**
638
+ * Hides the screen-sharing button from the call controls, preventing the
639
+ * user from starting a screen share from within the SDK UI.
640
+ *
641
+ * @default false
642
+ */
502
643
  hideScreenSharingButton: boolean;
503
- hideVirtualBackgroundButton: boolean;
504
644
  /**
505
- * @unstable This API may change or be removed in a future release.
506
- * When enabled, the SDK renders only remote audio elements without any
507
- * visual UI (no video tiles, controls, or overlays). This allows the
508
- * host app to provide its own custom UI while the SDK handles the
509
- * underlying call connection and audio playback.
645
+ * Hides the virtual-background button from the call controls, preventing the
646
+ * user from blurring or replacing their camera background from within the
647
+ * SDK UI.
648
+ *
649
+ * @default false
510
650
  */
511
- unstable_renderAudioOnly: boolean;
651
+ hideVirtualBackgroundButton: boolean;
512
652
  };
653
+ /**
654
+ * Configuration that applies on both web and mobile platforms.
655
+ */
513
656
  type ConfigStateBoth = {
657
+ /**
658
+ * Whether the call starts as an audio-only (`'VOICE'`) call or a video
659
+ * (`'VIDEO'`) call. In a voice call no camera is acquired and no video
660
+ * tiles are shown.
661
+ *
662
+ * @default 'VIDEO'
663
+ */
514
664
  sessionType: SessionType;
665
+ /**
666
+ * The arrangement used to display participant video tiles:
667
+ * - `'TILE'` — an equal grid of all participants.
668
+ * - `'SIDEBAR'` — one main participant with the rest in a side strip.
669
+ * - `'SPOTLIGHT'` — a single full-screen participant with the local user
670
+ * shown in a small picture-in-picture tile.
671
+ *
672
+ * @default 'TILE'
673
+ */
515
674
  layout: Layout;
675
+ /**
676
+ * Which camera to use when the call starts: `'FRONT'` (selfie) or `'REAR'`
677
+ * (back). Primarily relevant on mobile devices with multiple cameras; the
678
+ * user can still switch afterwards.
679
+ *
680
+ * @default undefined — uses the SDK's current camera (front by default)
681
+ */
516
682
  initialCameraFacing?: CameraFacing;
683
+ /**
684
+ * Automatically starts recording the session as soon as the call begins,
685
+ * without the user pressing the record button. Recording must be enabled
686
+ * for your app for this to take effect.
687
+ *
688
+ * @default false
689
+ */
517
690
  autoStartRecording: boolean;
691
+ /**
692
+ * Automatically starts live transcription as soon as the call begins,
693
+ * without the user pressing the transcription button. Transcription must
694
+ * be enabled for your app for this to take effect.
695
+ *
696
+ * @default false
697
+ */
698
+ autoStartTranscription: boolean;
699
+ /**
700
+ * Hides the recording button from the call controls, preventing the user
701
+ * from manually starting or stopping recording from within the SDK UI.
702
+ *
703
+ * @default true
704
+ */
518
705
  hideRecordingButton: boolean;
706
+ /**
707
+ * Hides the entire bottom control bar (mic, camera, leave, and every other
708
+ * call control). Useful when the host app provides its own controls.
709
+ *
710
+ * @default false
711
+ */
519
712
  hideControlPanel: boolean;
713
+ /**
714
+ * Hides the "leave call" button from the call controls. The host app is
715
+ * then responsible for providing its own way to leave the session.
716
+ *
717
+ * @default false
718
+ */
520
719
  hideLeaveSessionButton: boolean;
720
+ /**
721
+ * Hides the top header bar of the call UI (which shows the call title,
722
+ * session timer, and similar information).
723
+ *
724
+ * @default false
725
+ */
521
726
  hideHeaderPanel: boolean;
727
+ /**
728
+ * Hides the "raise hand" button from the call controls.
729
+ *
730
+ * @default false
731
+ */
522
732
  hideRaiseHandButton: boolean;
733
+ /**
734
+ * Hides the "share / invite" button that lets the user invite others to
735
+ * join the call.
736
+ *
737
+ * @default true
738
+ */
523
739
  hideShareInviteButton: boolean;
740
+ /**
741
+ * Hides the layout-switcher button, preventing the user from changing
742
+ * between the tile, sidebar, and spotlight layouts at runtime.
743
+ *
744
+ * @default false
745
+ */
524
746
  hideChangeLayoutButton: boolean;
747
+ /**
748
+ * Hides the microphone mute/unmute button from the call controls.
749
+ *
750
+ * @default false
751
+ */
525
752
  hideToggleAudioButton: boolean;
753
+ /**
754
+ * Hides the camera on/off button from the call controls.
755
+ *
756
+ * @default false
757
+ */
526
758
  hideToggleVideoButton: boolean;
759
+ /**
760
+ * Hides the button that opens the participant list panel.
761
+ *
762
+ * @default false
763
+ */
527
764
  hideParticipantListButton: boolean;
765
+ /**
766
+ * Hides the in-call chat button.
767
+ *
768
+ * @default true
769
+ */
528
770
  hideChatButton: boolean;
771
+ /**
772
+ * Hides the elapsed-time timer that shows how long the call has been
773
+ * running.
774
+ *
775
+ * @default false
776
+ */
529
777
  hideSessionTimer: boolean;
778
+ /**
779
+ * Hides the network-quality indicator that reflects each participant's
780
+ * connection strength.
781
+ *
782
+ * @default true
783
+ */
530
784
  hideNetworkIndicator: boolean;
785
+ /**
786
+ * Hides the "recording in progress" badge shown while the session is being
787
+ * recorded. The recording itself is unaffected.
788
+ *
789
+ * @default false
790
+ */
531
791
  hideRecordingStatusIndicator: boolean;
792
+ /**
793
+ * Hides the button that switches between the front and rear cameras.
794
+ * Mainly relevant on mobile devices with more than one camera.
795
+ *
796
+ * @default false
797
+ */
532
798
  hideSwitchCameraButton: boolean;
799
+ /**
800
+ * Hides the closed-caption button that lets the user show or hide live
801
+ * captions on screen. Even when set to `false`, the button only appears
802
+ * while transcription is running, since captions are produced from the
803
+ * live transcript.
804
+ *
805
+ * @default true
806
+ */
807
+ hideClosedCaptionButton: boolean;
808
+ /**
809
+ * Hides the transcription button from the call controls, preventing the
810
+ * user from manually starting or stopping live transcription from within
811
+ * the SDK UI.
812
+ *
813
+ * @default true
814
+ */
815
+ hideTranscriptionButton: boolean;
816
+ /**
817
+ * The currently selected caption/transcription language code (e.g.
818
+ * `en-US`). Selected from the closed-caption settings dropdown.
819
+ */
820
+ captionLanguage: CaptionLanguageCode;
821
+ /**
822
+ * Enables the per-participant context menu — opened by right-clicking (web)
823
+ * or long-pressing (mobile) a participant's tile — that exposes actions such
824
+ * as pinning a participant.
825
+ *
826
+ * Note: this menu is automatically unavailable in the `'SPOTLIGHT'` and
827
+ * picture-in-picture layouts regardless of this setting.
828
+ *
829
+ * @default true
830
+ */
533
831
  enableParticipantContextMenu: boolean;
832
+ /**
833
+ * The display name to show for the local user in the call (participant
834
+ * tiles, participant list, etc.). When left empty, the name associated with
835
+ * the logged-in user is used.
836
+ *
837
+ * @default '' — falls back to the logged-in user's name
838
+ */
534
839
  displayName: string;
840
+ /**
841
+ * Joins the call with the microphone muted. The user can unmute manually
842
+ * afterwards (unless the toggle-audio button is hidden).
843
+ *
844
+ * @default false
845
+ */
535
846
  startAudioMuted: boolean;
847
+ /**
848
+ * Joins the call with the camera off. The user can turn the camera on
849
+ * manually afterwards (unless the toggle-video button is hidden).
850
+ *
851
+ * @default false
852
+ */
536
853
  startVideoPaused: boolean;
854
+ /**
855
+ * Title text shown in the call's header panel (for example, the meeting or
856
+ * room name).
857
+ *
858
+ * @default '' — no title shown
859
+ */
537
860
  title: string;
861
+ /**
862
+ * How long, in milliseconds, the local user may remain alone in the call
863
+ * (no other participants) before an "are you still there?" idle prompt is
864
+ * shown. The countdown only runs while you are the only participant.
865
+ *
866
+ * @default 60000 — 60 seconds
867
+ */
538
868
  idleTimeoutPeriodBeforePrompt: number;
869
+ /**
870
+ * How long, in milliseconds, the idle prompt stays on screen waiting for a
871
+ * response before the SDK automatically leaves the call on the user's behalf.
872
+ *
873
+ * @default 180000 — 3 minutes
874
+ */
539
875
  idleTimeoutPeriodAfterPrompt: number;
876
+ /**
877
+ * Allows the user to drag the local picture-in-picture tile to reposition
878
+ * it. Only applies when `layout` is `'SPOTLIGHT'`.
879
+ *
880
+ * @default true
881
+ */
540
882
  enableSpotlightDrag: boolean;
541
- enableSpotlightSwap: boolean;
883
+ /**
884
+ * Marks this as a one-to-one (peer) call. In a peer call, when one
885
+ * participant leaves the session ends for everyone rather than continuing
886
+ * without them (unless `forceLeave` is passed when leaving). The remote
887
+ * peer's connectivity is also watched: if no remote stats arrive for 10
888
+ * seconds onRemoteConnectionLost is published, and
889
+ * onRemoteConnectionRestored once they resume.
890
+ *
891
+ * @default false
892
+ */
542
893
  isPeerCall: boolean;
894
+ /**
895
+ * Enables the in-call toast notifications surfaced by the SDK (for example
896
+ * "X joined the call" or error messages). Set to `false` to suppress all
897
+ * SDK toasts.
898
+ *
899
+ * @default true
900
+ */
543
901
  enableNotifications: boolean;
902
+ /**
903
+ * @unstable This API may change or be removed in a future release.
904
+ * When enabled in a voice call (`sessionType: 'VOICE'`), the SDK renders
905
+ * no visible UI at all — no controls, header, modals, or toast
906
+ * notifications — while the call connection, media, and events continue
907
+ * to work normally. Remote participants' audio keeps playing. The host
908
+ * app is responsible for providing its own UI, including reacting to
909
+ * session end (the SDK's "session has ended" view and the idle-timeout
910
+ * prompt/auto-leave are not shown in this mode).
911
+ *
912
+ * Only supported in voice calls: for video calls (`sessionType:
913
+ * 'VIDEO'`) the flag is ignored with a console warning and the default
914
+ * UI is rendered.
915
+ *
916
+ * @default false
917
+ */
918
+ unstable_headlessMode: boolean;
544
919
  };
545
920
  type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth;
546
921
  type Actions$3 = {
@@ -668,6 +1043,7 @@ declare const InternalSettingSchema: v.ObjectSchema<{
668
1043
  readonly minHeightForQualityLvl: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
669
1044
  readonly mobileCodecPreferenceOrder: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
670
1045
  }, undefined>, undefined>;
1046
+ readonly pcStatsInterval: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
671
1047
  }, undefined>;
672
1048
  }, undefined>;
673
1049
  readonly sessionId: v.StringSchema<undefined>;
@@ -853,6 +1229,109 @@ declare const pauseVideoTrack: (authority?: number) => void;
853
1229
  declare const resumeVideoTrack: (authority?: number) => Promise<void>;
854
1230
  declare const toggleVideoTrack: () => void;
855
1231
  //#endregion
1232
+ //#region calls-sdk-core/store/transcription.d.ts
1233
+ /**
1234
+ * A single entry inside a transcription-result `transcript` array.
1235
+ */
1236
+ interface TranscriptSegment {
1237
+ confidence: number;
1238
+ text: string;
1239
+ }
1240
+ /**
1241
+ * The participant metadata attached to a transcription-result message.
1242
+ */
1243
+ interface TranscriptionParticipant {
1244
+ id: string;
1245
+ name: string;
1246
+ identity_name: string;
1247
+ identity_group_id: string;
1248
+ avatar_url?: string;
1249
+ }
1250
+ /**
1251
+ * Shape of the payload received in `onEndpointMessageReceived` when
1252
+ * `type === 'transcription-result'`. This is stored as the value of each
1253
+ * entry in `transcriptionsMessages`, keyed by `message_id`.
1254
+ */
1255
+ interface TranscriptionMessage {
1256
+ transcript: TranscriptSegment[];
1257
+ is_interim: boolean;
1258
+ language: string;
1259
+ message_id: string;
1260
+ event: string;
1261
+ type: 'transcription-result';
1262
+ participant: TranscriptionParticipant;
1263
+ stability: number;
1264
+ timestamp: number;
1265
+ }
1266
+ interface TranscriptionState {
1267
+ transcriptionsMessages: Map<string, TranscriptionMessage>;
1268
+ /**
1269
+ * Whether the live caption overlay should be shown. Toggled by the
1270
+ * closed-caption button in the control pane / more menu.
1271
+ */
1272
+ showLiveCaption: boolean;
1273
+ /**
1274
+ * Whether transcription is currently active for the session.
1275
+ */
1276
+ isTranscribing: boolean;
1277
+ /**
1278
+ * Whether the transcriber has joined the session.
1279
+ */
1280
+ transcriberJoined: boolean;
1281
+ /**
1282
+ * The currently selected caption/transcription language code (e.g.
1283
+ * `en-US`). Selected from the closed-caption settings dropdown.
1284
+ */
1285
+ captionLanguage: CaptionLanguageCode;
1286
+ }
1287
+ interface TranscriptionActions {
1288
+ /**
1289
+ * Insert or update a transcription message by key. Because a Map `set`
1290
+ * overwrites an existing key, this handles both "add" and "update".
1291
+ */
1292
+ setTranscriptionMessage: (key: string, value: TranscriptionMessage) => void;
1293
+ /**
1294
+ * Remove all transcription messages.
1295
+ */
1296
+ clearTranscriptionMessages: () => void;
1297
+ /**
1298
+ * Toggle the live caption overlay on/off.
1299
+ */
1300
+ toggleShowLiveCaption: () => void;
1301
+ reset: () => void;
1302
+ }
1303
+ declare const useTranscriptionStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<TranscriptionState & TranscriptionActions>, "subscribe"> & {
1304
+ subscribe: {
1305
+ (listener: (selectedState: TranscriptionState & TranscriptionActions, previousSelectedState: TranscriptionState & TranscriptionActions) => void): () => void;
1306
+ <U>(selector: (state: TranscriptionState & TranscriptionActions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
1307
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
1308
+ fireImmediately?: boolean;
1309
+ } | undefined): () => void;
1310
+ };
1311
+ }>;
1312
+ /**
1313
+ * Returns the transcription messages as an array, ordered by their arrival
1314
+ * (Map insertion order). Re-renders only when the underlying Map reference
1315
+ * changes, i.e. when a message is added, updated, or cleared.
1316
+ */
1317
+ declare function useTranscriptionMessages(): TranscriptionMessage[];
1318
+ /**
1319
+ * Returns whether the live caption overlay is currently shown.
1320
+ */
1321
+ declare function useShowLiveCaption(): boolean;
1322
+ /**
1323
+ * Toggle the live caption overlay. Safe to call from outside React (e.g.
1324
+ * button click handlers in the control pane).
1325
+ */
1326
+ declare function toggleShowLiveCaption(): void;
1327
+ /**
1328
+ * Returns whether transcription is currently active for the session.
1329
+ */
1330
+ declare const useIsTranscribing: () => boolean;
1331
+ declare function startTranscription(): Promise<void>;
1332
+ declare function stopTranscription(): Promise<void>;
1333
+ declare function toggleTranscription(): Promise<void>;
1334
+ //#endregion
856
1335
  //#region calls-sdk-core/store/utils/hooks.d.ts
857
1336
  declare const useHideMuteAudioButton: () => boolean;
858
1337
  declare const useHideToggleVideoButton: () => boolean;
@@ -860,6 +1339,8 @@ declare const useIsConferenceJoined: () => boolean;
860
1339
  declare const useHideScreenSharingButton: () => boolean;
861
1340
  declare const useHideSwitchCameraButton: () => boolean;
862
1341
  declare const useHideChatButton: () => boolean;
1342
+ declare const useHideClosedCaptionButton: () => boolean;
1343
+ declare const useHideTranscriptionButton: () => boolean;
863
1344
  declare const useLocalParticipant: <T = HumanParticipant>(selector?: (local: HumanParticipant) => T) => T;
864
1345
  declare const useScreenShareRunning: () => any;
865
1346
  declare const useTrackMuted: (mediaType: MediaType, participantId?: string) => boolean;
@@ -957,6 +1438,14 @@ declare class SessionMethodsCore {
957
1438
  * If recording is active, it will be stopped, and vice versa.
958
1439
  */
959
1440
  static toggleRecording(): void;
1441
+ /**
1442
+ * Starts transcription of the call.
1443
+ */
1444
+ static startTranscription(): void;
1445
+ /**
1446
+ * Stops the ongoing call transcription.
1447
+ */
1448
+ static stopTranscription(): void;
960
1449
  /**
961
1450
  * Pins a participant's video to focus on them.
962
1451
  * @param participantId - The ID of the participant to pin.
@@ -1045,6 +1534,7 @@ type ValueOf<T> = T[keyof T];
1045
1534
  type ParticipantRole = ValueOf<typeof PARTICIPANT_ROLE>;
1046
1535
  type NotificationType = 'info' | 'success' | 'warning' | 'error';
1047
1536
  type SDKPlatform = ValueOf<typeof SDK_PLATFORM>;
1537
+ type CaptionLanguageCode = (typeof CAPTION_LANGUAGES)[number]['code'] | (string & {});
1048
1538
  interface ITrackOptions {
1049
1539
  cameraDeviceId?: string | null;
1050
1540
  constraints?: {
@@ -1098,6 +1588,13 @@ type SDKEvents = Omit<_SDKEvents, 'onParticipantListChanged' | 'onConnectionFail
1098
1588
  };
1099
1589
  type MobileSDKEvents = SDKEvents & {
1100
1590
  onAudioModeChanged: (payload: AudioMode['type']) => void;
1591
+ /**
1592
+ * Fired when the list of available audio modes changes,
1593
+ * e.g. a Bluetooth device or headphones are connected/disconnected.
1594
+ *
1595
+ * @param payload - The updated list of available audio modes.
1596
+ */
1597
+ onAudioModesChanged: (payload: AudioMode[]) => void;
1101
1598
  onCameraFacingChanged: (payload: CameraFacing) => void;
1102
1599
  onSwitchCameraButtonClicked: () => void;
1103
1600
  onPictureInPictureLayoutEnabled: () => void;
@@ -1227,6 +1724,7 @@ declare namespace controlPanel {
1227
1724
  export namespace tabs {
1228
1725
  let audio: string;
1229
1726
  let video: string;
1727
+ let closedCaption: string;
1230
1728
  }
1231
1729
  export namespace deviceLabels {
1232
1730
  let microphone: string;
@@ -1243,6 +1741,10 @@ declare namespace controlPanel {
1243
1741
  let enableNoiseReduction: string;
1244
1742
  }
1245
1743
  export { audioSettings_1 as audioSettings };
1744
+ export namespace closedCaptionSettings {
1745
+ let language: string;
1746
+ let enableClosedCaptions: string;
1747
+ }
1246
1748
  export namespace videoSettings_1 {
1247
1749
  let mirrorMyVideo: string;
1248
1750
  let selectCameraToSeePreview: string;
@@ -1318,12 +1820,16 @@ declare namespace virtualBackground {
1318
1820
  }
1319
1821
  export { buttons_2 as buttons };
1320
1822
  }
1823
+ declare namespace closedCaptions {
1824
+ let emptyState_1: string;
1825
+ export { emptyState_1 as emptyState };
1826
+ }
1321
1827
  declare namespace general {
1322
1828
  let error: string;
1323
1829
  }
1324
1830
  declare let other: {};
1325
1831
  declare namespace __json_default_export {
1326
- export { header, controlPanel, idealTimeout, participantList, virtualBackground, general, other };
1832
+ export { header, controlPanel, idealTimeout, participantList, virtualBackground, closedCaptions, general, other };
1327
1833
  }
1328
1834
  //#endregion
1329
1835
  //#region calls-sdk-core/i18n/state.d.ts
@@ -1386,6 +1892,7 @@ declare const useTranslation: () => {
1386
1892
  tabs: {
1387
1893
  audio: string;
1388
1894
  video: string;
1895
+ closedCaption: string;
1389
1896
  };
1390
1897
  deviceLabels: {
1391
1898
  microphone: string;
@@ -1401,6 +1908,10 @@ declare const useTranslation: () => {
1401
1908
  audioSettings: {
1402
1909
  enableNoiseReduction: string;
1403
1910
  };
1911
+ closedCaptionSettings: {
1912
+ language: string;
1913
+ enableClosedCaptions: string;
1914
+ };
1404
1915
  videoSettings: {
1405
1916
  mirrorMyVideo: string;
1406
1917
  selectCameraToSeePreview: string;
@@ -1464,6 +1975,9 @@ declare const useTranslation: () => {
1464
1975
  done: string;
1465
1976
  };
1466
1977
  };
1978
+ closedCaptions: {
1979
+ emptyState: string;
1980
+ };
1467
1981
  general: {
1468
1982
  error: string;
1469
1983
  };
@@ -4178,9 +4692,19 @@ declare class CometChatCalls extends SessionMethodsCore {
4178
4692
  }): () => void;
4179
4693
  /**
4180
4694
  * Sets the audio output mode (mobile only).
4695
+ *
4696
+ * The returned promise rejects with a `{ errorCode, errorDescription }`
4697
+ * object when the mode is 'EARPIECE' during a video call
4698
+ * (ERROR_INVALID_AUDIO_MODE), when the mode is not currently available —
4699
+ * including when no call is active (ERROR_AUDIO_MODE_UNAVAILABLE), or when
4700
+ * the native route switch fails.
4701
+ *
4702
+ * The `onAudioModeChanged` event fires only after the audio route actually
4703
+ * changes, not when this method is called.
4181
4704
  * @param mode - The audio mode to set (e.g., 'SPEAKER', 'EARPIECE', 'BLUETOOTH', 'HEADPHONES').
4705
+ * @returns A Promise that resolves once the route change has been dispatched.
4182
4706
  */
4183
- static setAudioMode(mode: AudioMode['type']): void;
4707
+ static setAudioMode(mode: AudioMode['type']): Promise<void>;
4184
4708
  /**
4185
4709
  * Enables Picture-in-Picture (PIP) layout during the call.
4186
4710
  */