@cometchat/calls-sdk-react-native 5.0.0 → 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/android/src/main/java/com/callingv5/AudioModeModule.java +3 -0
- package/dist/index.d.mts +568 -26
- package/dist/index.d.ts +568 -26
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/ios/Audio/CometChatAudioSession.h +28 -0
- package/ios/Audio/CometChatAudioSession.m +27 -2
- package/ios/Modules/AudioMode.m +13 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as zustand0 from "zustand";
|
|
2
2
|
import * as zustand_middleware0 from "zustand/middleware";
|
|
3
3
|
import { AppStateStatus } from "react-native";
|
|
4
4
|
import JitsiMeetJS from "@cometchat/calls-lib-webrtc";
|
|
@@ -51,6 +51,9 @@ declare function waitForStoreState<T>(store: {
|
|
|
51
51
|
subscribe: (listener: (state: T) => void) => () => void;
|
|
52
52
|
}, predicate: (state: T) => boolean, timeoutMs?: number): Promise<void>;
|
|
53
53
|
//#endregion
|
|
54
|
+
//#region calls-sdk-core/utils/connection-error.d.ts
|
|
55
|
+
declare function isFatalConnectionError(error: ConnectionError): boolean;
|
|
56
|
+
//#endregion
|
|
54
57
|
//#region calls-sdk-core/utils/constants.d.ts
|
|
55
58
|
declare const MIN_ASPECT_RATIO: number;
|
|
56
59
|
declare const MAX_ASPECT_RATIO: number;
|
|
@@ -111,7 +114,10 @@ declare const EVENT_LISTENER_METHODS: {
|
|
|
111
114
|
readonly onSessionLeft: "onSessionLeft";
|
|
112
115
|
readonly onConnectionLost: "onConnectionLost";
|
|
113
116
|
readonly onConnectionRestored: "onConnectionRestored";
|
|
117
|
+
readonly onRemoteConnectionLost: "onRemoteConnectionLost";
|
|
118
|
+
readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
|
|
114
119
|
readonly onConnectionClosed: "onConnectionClosed";
|
|
120
|
+
readonly onConnectionFailed: "onConnectionFailed";
|
|
115
121
|
readonly onSessionTimedOut: "onSessionTimedOut";
|
|
116
122
|
};
|
|
117
123
|
readonly MediaEventsListener: {
|
|
@@ -180,7 +186,10 @@ declare const EVENT_LISTENER_METHODS_WEB: {
|
|
|
180
186
|
readonly onSessionLeft: "onSessionLeft";
|
|
181
187
|
readonly onConnectionLost: "onConnectionLost";
|
|
182
188
|
readonly onConnectionRestored: "onConnectionRestored";
|
|
189
|
+
readonly onRemoteConnectionLost: "onRemoteConnectionLost";
|
|
190
|
+
readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
|
|
183
191
|
readonly onConnectionClosed: "onConnectionClosed";
|
|
192
|
+
readonly onConnectionFailed: "onConnectionFailed";
|
|
184
193
|
readonly onSessionTimedOut: "onSessionTimedOut";
|
|
185
194
|
};
|
|
186
195
|
readonly ParticipantEventsListner: {
|
|
@@ -220,6 +229,7 @@ declare const EVENT_LISTENER_METHODS_WEB: {
|
|
|
220
229
|
declare const EVENT_LISTENER_METHODS_MOBILE: {
|
|
221
230
|
readonly MediaEventsListener: {
|
|
222
231
|
readonly onAudioModeChanged: "onAudioModeChanged";
|
|
232
|
+
readonly onAudioModesChanged: "onAudioModesChanged";
|
|
223
233
|
readonly onCameraFacingChanged: "onCameraFacingChanged";
|
|
224
234
|
readonly onAudioMuted: "onAudioMuted";
|
|
225
235
|
readonly onAudioUnMuted: "onAudioUnMuted";
|
|
@@ -255,7 +265,10 @@ declare const EVENT_LISTENER_METHODS_MOBILE: {
|
|
|
255
265
|
readonly onSessionLeft: "onSessionLeft";
|
|
256
266
|
readonly onConnectionLost: "onConnectionLost";
|
|
257
267
|
readonly onConnectionRestored: "onConnectionRestored";
|
|
268
|
+
readonly onRemoteConnectionLost: "onRemoteConnectionLost";
|
|
269
|
+
readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
|
|
258
270
|
readonly onConnectionClosed: "onConnectionClosed";
|
|
271
|
+
readonly onConnectionFailed: "onConnectionFailed";
|
|
259
272
|
readonly onSessionTimedOut: "onSessionTimedOut";
|
|
260
273
|
};
|
|
261
274
|
readonly ParticipantEventsListner: {
|
|
@@ -287,6 +300,64 @@ declare const INTERNAL_EVENTS: {
|
|
|
287
300
|
readonly SDKInitialized: "internal.SDKInitialized";
|
|
288
301
|
};
|
|
289
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
|
+
}];
|
|
290
361
|
//#endregion
|
|
291
362
|
//#region calls-sdk-core/utils/debounce.d.ts
|
|
292
363
|
declare function debounce<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
|
|
@@ -304,6 +375,7 @@ type VideoInputDevice = MediaDeviceInfo & {
|
|
|
304
375
|
type Subscription = (() => void) | {
|
|
305
376
|
remove: () => void;
|
|
306
377
|
};
|
|
378
|
+
type SettingsDialogTab = 'audio' | 'video' | 'closedCaption';
|
|
307
379
|
type BaseState = {
|
|
308
380
|
participantListVisible: boolean;
|
|
309
381
|
moreMenuVisible: boolean;
|
|
@@ -328,6 +400,7 @@ type BaseState = {
|
|
|
328
400
|
cameraFacing: CameraFacingInternal;
|
|
329
401
|
connectionRetryCount: number;
|
|
330
402
|
settingsDialogVisible: boolean;
|
|
403
|
+
settingsDialogTab: SettingsDialogTab;
|
|
331
404
|
virtualBackgroundDialogVisible: boolean;
|
|
332
405
|
idealTimeoutTimer?: NodeJS.Timeout;
|
|
333
406
|
idleTimeoutModalVisible: boolean;
|
|
@@ -375,7 +448,7 @@ type Actions$5 = {
|
|
|
375
448
|
isMobileSDK: () => boolean;
|
|
376
449
|
isMobile: () => boolean;
|
|
377
450
|
};
|
|
378
|
-
declare const useBaseStore:
|
|
451
|
+
declare const useBaseStore: zustand0.UseBoundStore<Omit<Omit<zustand0.StoreApi<BaseState & Actions$5>, "subscribe"> & {
|
|
379
452
|
subscribe: {
|
|
380
453
|
(listener: (selectedState: BaseState & Actions$5, previousSelectedState: BaseState & Actions$5) => void): () => void;
|
|
381
454
|
<U>(selector: (state: BaseState & Actions$5) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -414,7 +487,7 @@ declare const setLayout: (layout: Layout, sidebarLayoutSetProgrammatically?: boo
|
|
|
414
487
|
declare const hideAllBottomSheets: () => void;
|
|
415
488
|
declare const enablePictureInPictureLayout: () => void;
|
|
416
489
|
declare const disablePictureInPictureLayout: () => void;
|
|
417
|
-
declare const showSettingsDialog: () => void;
|
|
490
|
+
declare const showSettingsDialog: (tab?: SettingsDialogTab) => void;
|
|
418
491
|
declare const hideSettingsDialog: () => void;
|
|
419
492
|
declare const toggleSettingsDialog: () => void;
|
|
420
493
|
declare const showVirtualBackgroundDialog: () => void;
|
|
@@ -422,7 +495,7 @@ declare const hideVirtualBackgroundDialog: () => void;
|
|
|
422
495
|
declare const toggleMirrorLocalVideo: () => void;
|
|
423
496
|
declare const toggleEnableNoiseReduction: () => void;
|
|
424
497
|
declare const setChatButtonUnreadCount: (count: number) => void;
|
|
425
|
-
declare const
|
|
498
|
+
declare const setAudioModes: (modes: AudioMode[]) => void;
|
|
426
499
|
declare const getLayout: () => Layout;
|
|
427
500
|
declare function initBaseStoreSubscriptions(): void;
|
|
428
501
|
//#endregion
|
|
@@ -436,6 +509,12 @@ type ConferenceState = {
|
|
|
436
509
|
p2p: boolean;
|
|
437
510
|
conferenceStatus: 'initial' | 'joining' | 'joined' | 'error' | 'interrupted' | 'left' | 'restored' | 'reconnecting';
|
|
438
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>;
|
|
439
518
|
raiseHandMap: Map<string, number>;
|
|
440
519
|
recording: {
|
|
441
520
|
status: ValueOf<typeof JitsiMeetJS.constants.recording.status>;
|
|
@@ -455,7 +534,7 @@ type Actions$4 = {
|
|
|
455
534
|
endConference: () => Promise<void>;
|
|
456
535
|
stopRecording: () => Promise<void>;
|
|
457
536
|
};
|
|
458
|
-
declare const useConferenceStore:
|
|
537
|
+
declare const useConferenceStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
|
|
459
538
|
subscribe: {
|
|
460
539
|
(listener: (selectedState: ConferenceState & Actions$4, previousSelectedState: ConferenceState & Actions$4) => void): () => void;
|
|
461
540
|
<U>(selector: (state: ConferenceState & Actions$4) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -484,63 +563,365 @@ type ConfigStateInternal = {
|
|
|
484
563
|
enableCompanionMode: boolean;
|
|
485
564
|
sdkPlatform?: SDKPlatform;
|
|
486
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
|
+
*/
|
|
487
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
|
+
*/
|
|
488
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
|
+
*/
|
|
489
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;
|
|
490
599
|
};
|
|
600
|
+
/**
|
|
601
|
+
* Configuration that only applies on the web platform.
|
|
602
|
+
* These options are ignored on mobile.
|
|
603
|
+
*/
|
|
491
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
|
+
*/
|
|
492
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
|
+
*/
|
|
493
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
|
+
*/
|
|
494
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
|
+
*/
|
|
495
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
|
+
*/
|
|
496
643
|
hideScreenSharingButton: boolean;
|
|
497
|
-
hideVirtualBackgroundButton: boolean;
|
|
498
644
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
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
|
|
504
650
|
*/
|
|
505
|
-
|
|
651
|
+
hideVirtualBackgroundButton: boolean;
|
|
506
652
|
};
|
|
653
|
+
/**
|
|
654
|
+
* Configuration that applies on both web and mobile platforms.
|
|
655
|
+
*/
|
|
507
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
|
+
*/
|
|
508
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
|
+
*/
|
|
509
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
|
+
*/
|
|
510
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
|
+
*/
|
|
511
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
|
+
*/
|
|
512
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
|
+
*/
|
|
513
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
|
+
*/
|
|
514
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
|
+
*/
|
|
515
726
|
hideHeaderPanel: boolean;
|
|
727
|
+
/**
|
|
728
|
+
* Hides the "raise hand" button from the call controls.
|
|
729
|
+
*
|
|
730
|
+
* @default false
|
|
731
|
+
*/
|
|
516
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
|
+
*/
|
|
517
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
|
+
*/
|
|
518
746
|
hideChangeLayoutButton: boolean;
|
|
747
|
+
/**
|
|
748
|
+
* Hides the microphone mute/unmute button from the call controls.
|
|
749
|
+
*
|
|
750
|
+
* @default false
|
|
751
|
+
*/
|
|
519
752
|
hideToggleAudioButton: boolean;
|
|
753
|
+
/**
|
|
754
|
+
* Hides the camera on/off button from the call controls.
|
|
755
|
+
*
|
|
756
|
+
* @default false
|
|
757
|
+
*/
|
|
520
758
|
hideToggleVideoButton: boolean;
|
|
759
|
+
/**
|
|
760
|
+
* Hides the button that opens the participant list panel.
|
|
761
|
+
*
|
|
762
|
+
* @default false
|
|
763
|
+
*/
|
|
521
764
|
hideParticipantListButton: boolean;
|
|
765
|
+
/**
|
|
766
|
+
* Hides the in-call chat button.
|
|
767
|
+
*
|
|
768
|
+
* @default true
|
|
769
|
+
*/
|
|
522
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
|
+
*/
|
|
523
777
|
hideSessionTimer: boolean;
|
|
778
|
+
/**
|
|
779
|
+
* Hides the network-quality indicator that reflects each participant's
|
|
780
|
+
* connection strength.
|
|
781
|
+
*
|
|
782
|
+
* @default true
|
|
783
|
+
*/
|
|
524
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
|
+
*/
|
|
525
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
|
+
*/
|
|
526
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
|
+
*/
|
|
527
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
|
+
*/
|
|
528
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
|
+
*/
|
|
529
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
|
+
*/
|
|
530
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
|
+
*/
|
|
531
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
|
+
*/
|
|
532
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
|
+
*/
|
|
533
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
|
+
*/
|
|
534
882
|
enableSpotlightDrag: boolean;
|
|
535
|
-
|
|
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
|
+
*/
|
|
536
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
|
+
*/
|
|
537
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;
|
|
538
919
|
};
|
|
539
920
|
type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth;
|
|
540
921
|
type Actions$3 = {
|
|
541
922
|
reset: () => void;
|
|
542
923
|
};
|
|
543
|
-
declare const useConfigStore:
|
|
924
|
+
declare const useConfigStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
|
|
544
925
|
subscribe: {
|
|
545
926
|
(listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
|
|
546
927
|
<U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -662,6 +1043,7 @@ declare const InternalSettingSchema: v.ObjectSchema<{
|
|
|
662
1043
|
readonly minHeightForQualityLvl: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
663
1044
|
readonly mobileCodecPreferenceOrder: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
664
1045
|
}, undefined>, undefined>;
|
|
1046
|
+
readonly pcStatsInterval: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
665
1047
|
}, undefined>;
|
|
666
1048
|
}, undefined>;
|
|
667
1049
|
readonly sessionId: v.StringSchema<undefined>;
|
|
@@ -679,7 +1061,7 @@ type InternalSetting = v.InferOutput<typeof InternalSettingSchema>;
|
|
|
679
1061
|
//#region calls-sdk-core/store/connection.d.ts
|
|
680
1062
|
type ConnectionState = {
|
|
681
1063
|
connection: any;
|
|
682
|
-
error:
|
|
1064
|
+
error: ConnectionError | undefined;
|
|
683
1065
|
timeEstablished: number | undefined;
|
|
684
1066
|
jwt?: string;
|
|
685
1067
|
connectionConfig?: InternalSetting['settings']['connectionConfig'];
|
|
@@ -688,11 +1070,11 @@ type ConnectionState = {
|
|
|
688
1070
|
type Actions$2 = {
|
|
689
1071
|
connectionWillConnect: (connection: any) => void;
|
|
690
1072
|
connectionEstablished: (connection: any) => void;
|
|
691
|
-
connectionFailed: (error:
|
|
1073
|
+
connectionFailed: (error: ConnectionError) => void;
|
|
692
1074
|
disconnect: () => Promise<void>;
|
|
693
1075
|
reset: () => void;
|
|
694
1076
|
};
|
|
695
|
-
declare const useConnectionStore:
|
|
1077
|
+
declare const useConnectionStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
|
|
696
1078
|
subscribe: {
|
|
697
1079
|
(listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
|
|
698
1080
|
<U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -743,7 +1125,7 @@ type Actions$1 = {
|
|
|
743
1125
|
getParticipantById: (pid: string) => HumanParticipant | undefined;
|
|
744
1126
|
reset: () => void;
|
|
745
1127
|
};
|
|
746
|
-
declare const useParticipantStore:
|
|
1128
|
+
declare const useParticipantStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
|
|
747
1129
|
subscribe: {
|
|
748
1130
|
(listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
|
|
749
1131
|
<U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -783,13 +1165,16 @@ interface ToastState {
|
|
|
783
1165
|
toasts: ToastItem[];
|
|
784
1166
|
}
|
|
785
1167
|
interface ToastActions {
|
|
786
|
-
addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>
|
|
1168
|
+
addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'> & {
|
|
1169
|
+
id?: string;
|
|
1170
|
+
}) => string;
|
|
787
1171
|
removeToast: (id: string) => void;
|
|
788
1172
|
clearAll: () => void;
|
|
789
1173
|
reset: () => void;
|
|
790
1174
|
}
|
|
791
|
-
declare const useToastStore:
|
|
1175
|
+
declare const useToastStore: zustand0.UseBoundStore<zustand0.StoreApi<ToastState & ToastActions>>;
|
|
792
1176
|
declare function showToast(params: {
|
|
1177
|
+
id?: string;
|
|
793
1178
|
message: string;
|
|
794
1179
|
type?: NotificationType;
|
|
795
1180
|
duration?: number;
|
|
@@ -798,11 +1183,13 @@ declare function showToast(params: {
|
|
|
798
1183
|
}): string;
|
|
799
1184
|
//#endregion
|
|
800
1185
|
//#region calls-sdk-core/store/tracks.d.ts
|
|
1186
|
+
type StreamingStatus = 'active' | 'interrupted' | 'restoring' | 'inactive';
|
|
801
1187
|
type Track = {
|
|
802
1188
|
local: boolean;
|
|
803
1189
|
mediaType: MediaType;
|
|
804
1190
|
muted: number;
|
|
805
1191
|
pid: string;
|
|
1192
|
+
streamingStatus: StreamingStatus;
|
|
806
1193
|
videoType: 'desktop' | 'camera' | null;
|
|
807
1194
|
originalTrack?: any;
|
|
808
1195
|
};
|
|
@@ -821,7 +1208,7 @@ type Actions = {
|
|
|
821
1208
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
822
1209
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
823
1210
|
};
|
|
824
|
-
declare const useTracksStore:
|
|
1211
|
+
declare const useTracksStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
825
1212
|
subscribe: {
|
|
826
1213
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
827
1214
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -842,6 +1229,109 @@ declare const pauseVideoTrack: (authority?: number) => void;
|
|
|
842
1229
|
declare const resumeVideoTrack: (authority?: number) => Promise<void>;
|
|
843
1230
|
declare const toggleVideoTrack: () => void;
|
|
844
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
|
|
845
1335
|
//#region calls-sdk-core/store/utils/hooks.d.ts
|
|
846
1336
|
declare const useHideMuteAudioButton: () => boolean;
|
|
847
1337
|
declare const useHideToggleVideoButton: () => boolean;
|
|
@@ -849,6 +1339,8 @@ declare const useIsConferenceJoined: () => boolean;
|
|
|
849
1339
|
declare const useHideScreenSharingButton: () => boolean;
|
|
850
1340
|
declare const useHideSwitchCameraButton: () => boolean;
|
|
851
1341
|
declare const useHideChatButton: () => boolean;
|
|
1342
|
+
declare const useHideClosedCaptionButton: () => boolean;
|
|
1343
|
+
declare const useHideTranscriptionButton: () => boolean;
|
|
852
1344
|
declare const useLocalParticipant: <T = HumanParticipant>(selector?: (local: HumanParticipant) => T) => T;
|
|
853
1345
|
declare const useScreenShareRunning: () => any;
|
|
854
1346
|
declare const useTrackMuted: (mediaType: MediaType, participantId?: string) => boolean;
|
|
@@ -862,7 +1354,7 @@ declare const useEnableParticipantContextMenu: () => boolean;
|
|
|
862
1354
|
declare const useRaisedHandTimestamp: (participantId?: string, type?: Participant$2["type"]) => number | undefined;
|
|
863
1355
|
declare const useIsParticipantPinned: (participantId: string, type: Participant$2["type"]) => boolean;
|
|
864
1356
|
declare const useOrderedParticipants: () => Participant$2[];
|
|
865
|
-
declare const useNonRecoverableError: () =>
|
|
1357
|
+
declare const useNonRecoverableError: () => string | undefined;
|
|
866
1358
|
declare const useIsSwitchCameraEnabledBrowser: () => any;
|
|
867
1359
|
declare const useIsAudioInputSelectionSupported: () => boolean;
|
|
868
1360
|
declare const useIsVideoInputSelectionSupported: () => boolean;
|
|
@@ -946,6 +1438,14 @@ declare class SessionMethodsCore {
|
|
|
946
1438
|
* If recording is active, it will be stopped, and vice versa.
|
|
947
1439
|
*/
|
|
948
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;
|
|
949
1449
|
/**
|
|
950
1450
|
* Pins a participant's video to focus on them.
|
|
951
1451
|
* @param participantId - The ID of the participant to pin.
|
|
@@ -1034,6 +1534,7 @@ type ValueOf<T> = T[keyof T];
|
|
|
1034
1534
|
type ParticipantRole = ValueOf<typeof PARTICIPANT_ROLE>;
|
|
1035
1535
|
type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
1036
1536
|
type SDKPlatform = ValueOf<typeof SDK_PLATFORM>;
|
|
1537
|
+
type CaptionLanguageCode = (typeof CAPTION_LANGUAGES)[number]['code'] | (string & {});
|
|
1037
1538
|
interface ITrackOptions {
|
|
1038
1539
|
cameraDeviceId?: string | null;
|
|
1039
1540
|
constraints?: {
|
|
@@ -1055,6 +1556,12 @@ interface ITrackOptions {
|
|
|
1055
1556
|
}
|
|
1056
1557
|
type Prettify<T> = { [K in keyof T]: T[K] } & unknown;
|
|
1057
1558
|
type Paths<T> = T extends object ? { [K in keyof T]: T[K] extends object ? `${K & string}.${Paths<T[K]>}` : `${K & string}` }[keyof T] : never;
|
|
1559
|
+
type ConnectionError = {
|
|
1560
|
+
name: string;
|
|
1561
|
+
message?: string;
|
|
1562
|
+
details?: Record<string, unknown>;
|
|
1563
|
+
recoverable?: boolean;
|
|
1564
|
+
};
|
|
1058
1565
|
//#endregion
|
|
1059
1566
|
//#region calls-sdk-core/types/union-to-array.d.ts
|
|
1060
1567
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
@@ -1072,14 +1579,22 @@ declare const ParticipantSchema: v.ObjectSchema<{
|
|
|
1072
1579
|
}, undefined>;
|
|
1073
1580
|
type Participant$1 = v.InferOutput<typeof ParticipantSchema>;
|
|
1074
1581
|
type _SDKEvents = { [k in ValueOf<typeof EVENT_LISTENER_METHODS.SessionStatusListener>]: () => void } & { [k in ValueOf<typeof EVENT_LISTENER_METHODS.MediaEventsListener>]: () => void } & { [k in ValueOf<typeof EVENT_LISTENER_METHODS.ParticipantEventsListner>]: (payload: Participant$1) => void } & { [k in ValueOf<typeof EVENT_LISTENER_METHODS.ButtonClickListener>]: () => void };
|
|
1075
|
-
type SDKEvents = Omit<_SDKEvents, 'onParticipantListChanged'> & {
|
|
1582
|
+
type SDKEvents = Omit<_SDKEvents, 'onParticipantListChanged' | 'onConnectionFailed'> & {
|
|
1076
1583
|
onCallLayoutChanged: (payload: Layout) => void;
|
|
1584
|
+
onConnectionFailed: (payload: ConnectionError) => void;
|
|
1077
1585
|
onParticipantListVisible: () => void;
|
|
1078
1586
|
onParticipantListHidden: () => void;
|
|
1079
1587
|
onParticipantListChanged: (payload: Participant$1[]) => void;
|
|
1080
1588
|
};
|
|
1081
1589
|
type MobileSDKEvents = SDKEvents & {
|
|
1082
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;
|
|
1083
1598
|
onCameraFacingChanged: (payload: CameraFacing) => void;
|
|
1084
1599
|
onSwitchCameraButtonClicked: () => void;
|
|
1085
1600
|
onPictureInPictureLayoutEnabled: () => void;
|
|
@@ -1209,6 +1724,7 @@ declare namespace controlPanel {
|
|
|
1209
1724
|
export namespace tabs {
|
|
1210
1725
|
let audio: string;
|
|
1211
1726
|
let video: string;
|
|
1727
|
+
let closedCaption: string;
|
|
1212
1728
|
}
|
|
1213
1729
|
export namespace deviceLabels {
|
|
1214
1730
|
let microphone: string;
|
|
@@ -1225,6 +1741,10 @@ declare namespace controlPanel {
|
|
|
1225
1741
|
let enableNoiseReduction: string;
|
|
1226
1742
|
}
|
|
1227
1743
|
export { audioSettings_1 as audioSettings };
|
|
1744
|
+
export namespace closedCaptionSettings {
|
|
1745
|
+
let language: string;
|
|
1746
|
+
let enableClosedCaptions: string;
|
|
1747
|
+
}
|
|
1228
1748
|
export namespace videoSettings_1 {
|
|
1229
1749
|
let mirrorMyVideo: string;
|
|
1230
1750
|
let selectCameraToSeePreview: string;
|
|
@@ -1300,12 +1820,16 @@ declare namespace virtualBackground {
|
|
|
1300
1820
|
}
|
|
1301
1821
|
export { buttons_2 as buttons };
|
|
1302
1822
|
}
|
|
1823
|
+
declare namespace closedCaptions {
|
|
1824
|
+
let emptyState_1: string;
|
|
1825
|
+
export { emptyState_1 as emptyState };
|
|
1826
|
+
}
|
|
1303
1827
|
declare namespace general {
|
|
1304
1828
|
let error: string;
|
|
1305
1829
|
}
|
|
1306
1830
|
declare let other: {};
|
|
1307
1831
|
declare namespace __json_default_export {
|
|
1308
|
-
export { header, controlPanel, idealTimeout, participantList, virtualBackground, general, other };
|
|
1832
|
+
export { header, controlPanel, idealTimeout, participantList, virtualBackground, closedCaptions, general, other };
|
|
1309
1833
|
}
|
|
1310
1834
|
//#endregion
|
|
1311
1835
|
//#region calls-sdk-core/i18n/state.d.ts
|
|
@@ -1315,7 +1839,7 @@ interface TranslationState {
|
|
|
1315
1839
|
translations: Record<string, typeof __json_default_export>;
|
|
1316
1840
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1317
1841
|
}
|
|
1318
|
-
declare const useTranslationStore:
|
|
1842
|
+
declare const useTranslationStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1319
1843
|
reset: () => void;
|
|
1320
1844
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1321
1845
|
}>, "subscribe"> & {
|
|
@@ -1368,6 +1892,7 @@ declare const useTranslation: () => {
|
|
|
1368
1892
|
tabs: {
|
|
1369
1893
|
audio: string;
|
|
1370
1894
|
video: string;
|
|
1895
|
+
closedCaption: string;
|
|
1371
1896
|
};
|
|
1372
1897
|
deviceLabels: {
|
|
1373
1898
|
microphone: string;
|
|
@@ -1383,6 +1908,10 @@ declare const useTranslation: () => {
|
|
|
1383
1908
|
audioSettings: {
|
|
1384
1909
|
enableNoiseReduction: string;
|
|
1385
1910
|
};
|
|
1911
|
+
closedCaptionSettings: {
|
|
1912
|
+
language: string;
|
|
1913
|
+
enableClosedCaptions: string;
|
|
1914
|
+
};
|
|
1386
1915
|
videoSettings: {
|
|
1387
1916
|
mirrorMyVideo: string;
|
|
1388
1917
|
selectCameraToSeePreview: string;
|
|
@@ -1446,6 +1975,9 @@ declare const useTranslation: () => {
|
|
|
1446
1975
|
done: string;
|
|
1447
1976
|
};
|
|
1448
1977
|
};
|
|
1978
|
+
closedCaptions: {
|
|
1979
|
+
emptyState: string;
|
|
1980
|
+
};
|
|
1449
1981
|
general: {
|
|
1450
1982
|
error: string;
|
|
1451
1983
|
};
|
|
@@ -4160,9 +4692,19 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
4160
4692
|
}): () => void;
|
|
4161
4693
|
/**
|
|
4162
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.
|
|
4163
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.
|
|
4164
4706
|
*/
|
|
4165
|
-
static setAudioMode(mode: AudioMode['type']): void
|
|
4707
|
+
static setAudioMode(mode: AudioMode['type']): Promise<void>;
|
|
4166
4708
|
/**
|
|
4167
4709
|
* Enables Picture-in-Picture (PIP) layout during the call.
|
|
4168
4710
|
*/
|