@cometchat/calls-sdk-react-native 5.0.0-beta.1 → 5.0.0-beta.11
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/MyAppPackage.java +0 -1
- package/cometchat-calls-sdk-react-native.podspec +20 -0
- package/dist/index.d.mts +291 -58
- package/dist/index.d.ts +283 -50
- package/dist/index.js +795 -341
- package/dist/index.mjs +742 -289
- package/ios/Audio/CometChatAudioSession+Private.h +24 -0
- package/ios/Audio/CometChatAudioSession.h +26 -0
- package/ios/Audio/CometChatAudioSession.m +35 -0
- package/ios/Modules/AudioMode.m +384 -0
- package/ios/Modules/KeepAwake.h +4 -0
- package/ios/Modules/KeepAwake.m +29 -0
- package/package.json +12 -5
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/src/main/java/com/callingv5/ToastModule.java +0 -29
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import * as
|
|
2
|
+
import * as zustand1 from "zustand";
|
|
3
3
|
import * as zustand_middleware0 from "zustand/middleware";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import JitsiMeetJS from "lib-
|
|
5
|
+
import JitsiMeetJS from "@cometchat/calls-lib-webrtc";
|
|
6
6
|
import { AppStateStatus } from "react-native";
|
|
7
7
|
|
|
8
8
|
//#region calls-sdk-core/event-listeners/onTrack.d.ts
|
|
@@ -40,6 +40,16 @@ declare function sleep(ms?: number): Promise<void>;
|
|
|
40
40
|
declare function isArrayOfObjEqual(arr1: any[], arr2: any[]): boolean;
|
|
41
41
|
declare function isDeviceEqual(device1: MediaDeviceInfo | undefined, device2: MediaDeviceInfo | undefined): boolean;
|
|
42
42
|
declare function getDefaultDevice<T extends MediaDeviceInfo>(devices: T[]): T;
|
|
43
|
+
/**
|
|
44
|
+
* Returns a promise that resolves when the given Zustand store
|
|
45
|
+
* satisfies the provided predicate. Resolves immediately if the
|
|
46
|
+
* condition is already met. Includes a timeout to avoid hanging
|
|
47
|
+
* forever (defaults to 5 000 ms).
|
|
48
|
+
*/
|
|
49
|
+
declare function waitForStoreState<T>(store: {
|
|
50
|
+
getState: () => T;
|
|
51
|
+
subscribe: (listener: (state: T) => void) => () => void;
|
|
52
|
+
}, predicate: (state: T) => boolean, timeoutMs?: number): Promise<void>;
|
|
43
53
|
//#endregion
|
|
44
54
|
//#region calls-sdk-core/utils/constants.d.ts
|
|
45
55
|
declare const MIN_ASPECT_RATIO: number;
|
|
@@ -79,6 +89,7 @@ declare const VIDEO_PAUSE_AUTHORITY: {
|
|
|
79
89
|
};
|
|
80
90
|
declare const CONFERENCE_COMMANDS: {
|
|
81
91
|
userInfo: string;
|
|
92
|
+
initialConfig: string;
|
|
82
93
|
};
|
|
83
94
|
declare const VIDEO_QUALITY_LEVELS: {
|
|
84
95
|
ULTRA: number;
|
|
@@ -87,10 +98,12 @@ declare const VIDEO_QUALITY_LEVELS: {
|
|
|
87
98
|
LOW: number;
|
|
88
99
|
NONE: number;
|
|
89
100
|
};
|
|
90
|
-
declare const
|
|
101
|
+
declare const SDK_PLATFORM: {
|
|
91
102
|
readonly WEB: "web";
|
|
92
103
|
readonly ANDROID: "android";
|
|
93
104
|
readonly IOS: "ios";
|
|
105
|
+
readonly REACT_NATIVE_ANDROID: "react-native-android";
|
|
106
|
+
readonly REACT_NATIVE_IOS: "react-native-ios";
|
|
94
107
|
};
|
|
95
108
|
declare const EVENT_LISTENER_METHODS: {
|
|
96
109
|
readonly SessionStatusListener: {
|
|
@@ -288,12 +301,15 @@ type AudioOutputDevice = MediaDeviceInfo & {
|
|
|
288
301
|
type VideoInputDevice = MediaDeviceInfo & {
|
|
289
302
|
kind: Extract<MediaDeviceKind, 'videoinput'>;
|
|
290
303
|
};
|
|
304
|
+
type Subscription = (() => void) | {
|
|
305
|
+
remove: () => void;
|
|
306
|
+
};
|
|
291
307
|
type BaseState = {
|
|
292
308
|
participantListVisible: boolean;
|
|
293
309
|
moreMenuVisible: boolean;
|
|
294
|
-
subscriptions:
|
|
310
|
+
subscriptions: Subscription[];
|
|
295
311
|
isPIPLayoutEnabled: boolean;
|
|
296
|
-
audioModes: AudioMode
|
|
312
|
+
audioModes: AudioMode[];
|
|
297
313
|
audioInputDevices: AudioInputDevice[];
|
|
298
314
|
audioOutputDevices: AudioOutputDevice[];
|
|
299
315
|
videoInputDevices: VideoInputDevice[];
|
|
@@ -305,7 +321,7 @@ type BaseState = {
|
|
|
305
321
|
skipSubscribe: boolean;
|
|
306
322
|
};
|
|
307
323
|
previewVideoInputDevice?: VideoInputDevice;
|
|
308
|
-
selectedAudioModeType?: AudioMode
|
|
324
|
+
selectedAudioModeType?: AudioMode['type'];
|
|
309
325
|
audioModeMenuVisible: boolean;
|
|
310
326
|
layout: Layout;
|
|
311
327
|
sidebarLayoutSetProgrammatically: boolean;
|
|
@@ -322,8 +338,9 @@ type BaseState = {
|
|
|
322
338
|
desktopSharingFrameRate: 5 | 15 | 30;
|
|
323
339
|
chatButtonUnreadCount: number;
|
|
324
340
|
enableNoiseReduction: boolean;
|
|
325
|
-
sdkPlatform:
|
|
326
|
-
|
|
341
|
+
sdkPlatform: SDKPlatform;
|
|
342
|
+
platformVersion?: string | number;
|
|
343
|
+
userAgent?: string;
|
|
327
344
|
previewVideoTrack?: any;
|
|
328
345
|
isMobileBrowser: boolean;
|
|
329
346
|
mainAreaDimension: {
|
|
@@ -342,19 +359,23 @@ type BaseState = {
|
|
|
342
359
|
startIndex: number;
|
|
343
360
|
endIndex: number;
|
|
344
361
|
};
|
|
362
|
+
sidebarVisibleParticipants: {
|
|
363
|
+
startIndex: number;
|
|
364
|
+
endIndex: number;
|
|
365
|
+
};
|
|
345
366
|
};
|
|
346
367
|
type Actions$5 = {
|
|
347
368
|
toggleParticipantListVisible: () => void;
|
|
348
369
|
reset: () => void;
|
|
349
370
|
toggleMoreMenuVisible: () => void;
|
|
350
|
-
addSubscriptions: (subscriptions:
|
|
371
|
+
addSubscriptions: (subscriptions: Subscription[]) => void;
|
|
351
372
|
incrementConnectionRetryCount: () => void;
|
|
352
373
|
clearIdealTimeoutTimer: () => void;
|
|
353
374
|
restartIdealTimeoutTimer: () => void;
|
|
354
375
|
isMobileSDK: () => boolean;
|
|
355
376
|
isMobile: () => boolean;
|
|
356
377
|
};
|
|
357
|
-
declare const useBaseStore:
|
|
378
|
+
declare const useBaseStore: zustand1.UseBoundStore<Omit<Omit<zustand1.StoreApi<BaseState & Actions$5>, "subscribe"> & {
|
|
358
379
|
subscribe: {
|
|
359
380
|
(listener: (selectedState: BaseState & Actions$5, previousSelectedState: BaseState & Actions$5) => void): () => void;
|
|
360
381
|
<U>(selector: (state: BaseState & Actions$5) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -386,6 +407,7 @@ declare const useBaseStore: zustand9.UseBoundStore<Omit<Omit<zustand9.StoreApi<B
|
|
|
386
407
|
declare const toggleParticipantListVisible: () => void;
|
|
387
408
|
declare const hideParticipantList: () => void;
|
|
388
409
|
declare const showParticipantList: () => void;
|
|
410
|
+
declare const toggleParticipantList: () => void;
|
|
389
411
|
declare const toggleMoreMenuVisible: () => void;
|
|
390
412
|
declare const toggleAudioModeMenuVisible: () => void;
|
|
391
413
|
declare const setLayout: (layout: Layout, sidebarLayoutSetProgrammatically?: boolean) => void;
|
|
@@ -400,6 +422,7 @@ declare const hideVirtualBackgroundDialog: () => void;
|
|
|
400
422
|
declare const toggleMirrorLocalVideo: () => void;
|
|
401
423
|
declare const toggleEnableNoiseReduction: () => void;
|
|
402
424
|
declare const setChatButtonUnreadCount: (count: number) => void;
|
|
425
|
+
declare const setAudioMode: (mode: AudioMode["type"]) => void;
|
|
403
426
|
declare const getLayout: () => Layout;
|
|
404
427
|
declare function initBaseStoreSubscriptions(): void;
|
|
405
428
|
//#endregion
|
|
@@ -429,9 +452,10 @@ type Actions$4 = {
|
|
|
429
452
|
raiseHand: (participantId: string, timestamp: number) => void;
|
|
430
453
|
lowerHand: (participantId: string) => void;
|
|
431
454
|
leaveConference: () => Promise<void>;
|
|
455
|
+
endConference: () => Promise<void>;
|
|
432
456
|
stopRecording: () => Promise<void>;
|
|
433
457
|
};
|
|
434
|
-
declare const useConferenceStore:
|
|
458
|
+
declare const useConferenceStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
|
|
435
459
|
subscribe: {
|
|
436
460
|
(listener: (selectedState: ConferenceState & Actions$4, previousSelectedState: ConferenceState & Actions$4) => void): () => void;
|
|
437
461
|
<U>(selector: (state: ConferenceState & Actions$4) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -457,9 +481,11 @@ type ConfigStateInternal = {
|
|
|
457
481
|
sessionId?: string;
|
|
458
482
|
iAmRecorder: boolean;
|
|
459
483
|
showFrameRate: boolean;
|
|
484
|
+
enableCompanionMode: boolean;
|
|
485
|
+
sdkPlatform?: SDKPlatform;
|
|
460
486
|
};
|
|
461
487
|
type ConfigStateMobile = {
|
|
462
|
-
audioMode?: AudioMode
|
|
488
|
+
audioMode?: AudioMode['type'];
|
|
463
489
|
hideAudioModeButton: boolean;
|
|
464
490
|
};
|
|
465
491
|
type ConfigStateWeb = {
|
|
@@ -467,7 +493,16 @@ type ConfigStateWeb = {
|
|
|
467
493
|
audioInputDeviceId?: string;
|
|
468
494
|
audioOutputDeviceId?: string;
|
|
469
495
|
videoInputDeviceId?: string;
|
|
496
|
+
hideScreenSharingButton: boolean;
|
|
470
497
|
hideVirtualBackgroundButton: boolean;
|
|
498
|
+
/**
|
|
499
|
+
* @unstable This API may change or be removed in a future release.
|
|
500
|
+
* When enabled, the SDK renders only remote audio elements without any
|
|
501
|
+
* visual UI (no video tiles, controls, or overlays). This allows the
|
|
502
|
+
* host app to provide its own custom UI while the SDK handles the
|
|
503
|
+
* underlying call connection and audio playback.
|
|
504
|
+
*/
|
|
505
|
+
unstable_renderAudioOnly: boolean;
|
|
471
506
|
};
|
|
472
507
|
type ConfigStateBoth = {
|
|
473
508
|
sessionType: SessionType;
|
|
@@ -484,9 +519,7 @@ type ConfigStateBoth = {
|
|
|
484
519
|
hideToggleAudioButton: boolean;
|
|
485
520
|
hideToggleVideoButton: boolean;
|
|
486
521
|
hideParticipantListButton: boolean;
|
|
487
|
-
hideSwitchLayoutButton: boolean;
|
|
488
522
|
hideChatButton: boolean;
|
|
489
|
-
hideScreenSharingButton: boolean;
|
|
490
523
|
hideSessionTimer: boolean;
|
|
491
524
|
hideNetworkIndicator: boolean;
|
|
492
525
|
hideRecordingStatusIndicator: boolean;
|
|
@@ -500,12 +533,14 @@ type ConfigStateBoth = {
|
|
|
500
533
|
idleTimeoutPeriodAfterPrompt: number;
|
|
501
534
|
enableSpotlightDrag: boolean;
|
|
502
535
|
enableSpotlightSwap: boolean;
|
|
536
|
+
isPeerCall: boolean;
|
|
537
|
+
enableNotifications: boolean;
|
|
503
538
|
};
|
|
504
539
|
type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth;
|
|
505
540
|
type Actions$3 = {
|
|
506
541
|
reset: () => void;
|
|
507
542
|
};
|
|
508
|
-
declare const useConfigStore:
|
|
543
|
+
declare const useConfigStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
|
|
509
544
|
subscribe: {
|
|
510
545
|
(listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
|
|
511
546
|
<U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -657,7 +692,7 @@ type Actions$2 = {
|
|
|
657
692
|
disconnect: () => Promise<void>;
|
|
658
693
|
reset: () => void;
|
|
659
694
|
};
|
|
660
|
-
declare const useConnectionStore:
|
|
695
|
+
declare const useConnectionStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
|
|
661
696
|
subscribe: {
|
|
662
697
|
(listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
|
|
663
698
|
<U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -666,6 +701,7 @@ declare const useConnectionStore: zustand9.UseBoundStore<Omit<zustand9.StoreApi<
|
|
|
666
701
|
} | undefined): () => void;
|
|
667
702
|
};
|
|
668
703
|
}>;
|
|
704
|
+
declare function waitForConnection(): Promise<void>;
|
|
669
705
|
//#endregion
|
|
670
706
|
//#region calls-sdk-core/utils/schema/human-participant.d.ts
|
|
671
707
|
declare const HumanParticipantSchema: v.ObjectSchema<{
|
|
@@ -707,7 +743,7 @@ type Actions$1 = {
|
|
|
707
743
|
getParticipantById: (pid: string) => HumanParticipant | undefined;
|
|
708
744
|
reset: () => void;
|
|
709
745
|
};
|
|
710
|
-
declare const useParticipantStore:
|
|
746
|
+
declare const useParticipantStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
|
|
711
747
|
subscribe: {
|
|
712
748
|
(listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
|
|
713
749
|
<U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -729,6 +765,38 @@ declare const getMainParticipantFromState: (state: {
|
|
|
729
765
|
localParticipant: HumanParticipant;
|
|
730
766
|
}) => Participant$2;
|
|
731
767
|
//#endregion
|
|
768
|
+
//#region calls-sdk-core/store/toast.d.ts
|
|
769
|
+
interface ToastAction {
|
|
770
|
+
label: string;
|
|
771
|
+
onPress: () => void;
|
|
772
|
+
}
|
|
773
|
+
interface ToastItem {
|
|
774
|
+
id: string;
|
|
775
|
+
message: string;
|
|
776
|
+
type: NotificationType;
|
|
777
|
+
duration: number;
|
|
778
|
+
position: 'top' | 'bottom';
|
|
779
|
+
action?: ToastAction;
|
|
780
|
+
createdAt: number;
|
|
781
|
+
}
|
|
782
|
+
interface ToastState {
|
|
783
|
+
toasts: ToastItem[];
|
|
784
|
+
}
|
|
785
|
+
interface ToastActions {
|
|
786
|
+
addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => string;
|
|
787
|
+
removeToast: (id: string) => void;
|
|
788
|
+
clearAll: () => void;
|
|
789
|
+
reset: () => void;
|
|
790
|
+
}
|
|
791
|
+
declare const useToastStore: zustand1.UseBoundStore<zustand1.StoreApi<ToastState & ToastActions>>;
|
|
792
|
+
declare function showToast(params: {
|
|
793
|
+
message: string;
|
|
794
|
+
type?: NotificationType;
|
|
795
|
+
duration?: number;
|
|
796
|
+
position?: 'top' | 'bottom';
|
|
797
|
+
action?: ToastAction;
|
|
798
|
+
}): string;
|
|
799
|
+
//#endregion
|
|
732
800
|
//#region calls-sdk-core/store/tracks.d.ts
|
|
733
801
|
type Track = {
|
|
734
802
|
local: boolean;
|
|
@@ -753,7 +821,7 @@ type Actions = {
|
|
|
753
821
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
754
822
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
755
823
|
};
|
|
756
|
-
declare const useTracksStore:
|
|
824
|
+
declare const useTracksStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
757
825
|
subscribe: {
|
|
758
826
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
759
827
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -798,42 +866,122 @@ declare const useNonRecoverableError: () => any;
|
|
|
798
866
|
declare const useIsSwitchCameraEnabledBrowser: () => any;
|
|
799
867
|
declare const useIsAudioInputSelectionSupported: () => boolean;
|
|
800
868
|
declare const useIsVideoInputSelectionSupported: () => boolean;
|
|
869
|
+
declare const useShouldMirrorLocalVideo: () => boolean;
|
|
801
870
|
//#endregion
|
|
802
871
|
//#region calls-sdk-core/store/utils/switch-camera.d.ts
|
|
803
872
|
declare const switchCamera: () => void;
|
|
804
873
|
//#endregion
|
|
805
874
|
//#region calls-sdk-core/utils/session-methods-core.d.ts
|
|
806
875
|
declare class SessionMethodsCore {
|
|
876
|
+
/**
|
|
877
|
+
* Mutes the local user's audio during the call.
|
|
878
|
+
*/
|
|
807
879
|
static muteAudio(): void;
|
|
880
|
+
/**
|
|
881
|
+
* Unmutes the local user's audio during the call.
|
|
882
|
+
*/
|
|
808
883
|
static unmuteAudio(): void;
|
|
884
|
+
/**
|
|
885
|
+
* Toggles the local user's audio mute state.
|
|
886
|
+
* If audio is muted, it will be unmuted, and vice versa.
|
|
887
|
+
*/
|
|
888
|
+
static toggleAudio(): void;
|
|
889
|
+
/**
|
|
890
|
+
* Pauses the local user's video stream.
|
|
891
|
+
*/
|
|
809
892
|
static pauseVideo(): void;
|
|
893
|
+
/**
|
|
894
|
+
* Resumes the local user's video stream.
|
|
895
|
+
*/
|
|
810
896
|
static resumeVideo(): void;
|
|
897
|
+
/**
|
|
898
|
+
* Toggles the local user's video stream.
|
|
899
|
+
* If video is paused, it will be resumed, and vice versa.
|
|
900
|
+
*/
|
|
901
|
+
static toggleVideo(): void;
|
|
902
|
+
/**
|
|
903
|
+
* Local user leaves the current session.
|
|
904
|
+
*/
|
|
811
905
|
static leaveSession(): void;
|
|
812
|
-
|
|
813
|
-
|
|
906
|
+
/**
|
|
907
|
+
* Ends the current session for all participants.
|
|
908
|
+
* This will terminate the conference and disconnect everyone.
|
|
909
|
+
*/
|
|
910
|
+
static endSessionForAll(): void;
|
|
911
|
+
/**
|
|
912
|
+
* Raises the user's virtual hand in the call.
|
|
913
|
+
*/
|
|
814
914
|
static raiseHand(): void;
|
|
915
|
+
/**
|
|
916
|
+
* Lowers the user's virtual hand in the call.
|
|
917
|
+
*/
|
|
815
918
|
static lowerHand(): void;
|
|
919
|
+
/**
|
|
920
|
+
* Toggles the user's virtual hand state.
|
|
921
|
+
* If the hand is raised, it will be lowered, and vice versa.
|
|
922
|
+
*/
|
|
923
|
+
static toggleHand(): void;
|
|
924
|
+
/**
|
|
925
|
+
* Switches between the front and rear camera.
|
|
926
|
+
*/
|
|
816
927
|
static switchCamera(): void;
|
|
928
|
+
/**
|
|
929
|
+
* Sets the layout type for the call.
|
|
930
|
+
* @param layout - The type of layout to set (tile, sidebar or spotlight).
|
|
931
|
+
*/
|
|
817
932
|
static setLayout(layout: Layout): void;
|
|
933
|
+
/**
|
|
934
|
+
* Starts recording the call.
|
|
935
|
+
*/
|
|
818
936
|
static startRecording(): void;
|
|
937
|
+
/**
|
|
938
|
+
* Stops the ongoing call recording.
|
|
939
|
+
*/
|
|
819
940
|
static stopRecording(): void;
|
|
820
|
-
|
|
821
|
-
|
|
941
|
+
/**
|
|
942
|
+
* Toggles the call recording state.
|
|
943
|
+
* If recording is active, it will be stopped, and vice versa.
|
|
944
|
+
*/
|
|
945
|
+
static toggleRecording(): void;
|
|
946
|
+
/**
|
|
947
|
+
* Pins a participant's video to focus on them.
|
|
948
|
+
* @param participantId - The ID of the participant to pin.
|
|
949
|
+
* @param type - The type of the participant.
|
|
950
|
+
*/
|
|
822
951
|
static pinParticipant(participantId: string, type: Participant$2['type']): void;
|
|
952
|
+
/**
|
|
953
|
+
* Unpins a participant's video.
|
|
954
|
+
*/
|
|
823
955
|
static unpinParticipant(): void;
|
|
956
|
+
/**
|
|
957
|
+
* Mutes the audio of a specific participant.
|
|
958
|
+
* @param participantId - The ID of the participant to mute.
|
|
959
|
+
*/
|
|
824
960
|
static muteParticipant(participantId: string): void;
|
|
961
|
+
/**
|
|
962
|
+
* Pauses the video stream of a specific participant.
|
|
963
|
+
* @param participantId - The ID of the participant whose video to pause.
|
|
964
|
+
*/
|
|
825
965
|
static pauseParticipantVideo(participantId: string): void;
|
|
966
|
+
/**
|
|
967
|
+
* Sets the unread message count displayed on the chat button.
|
|
968
|
+
* @param count - The number of unread messages.
|
|
969
|
+
*/
|
|
826
970
|
static setChatButtonUnreadCount(count: number): void;
|
|
827
971
|
/**
|
|
828
|
-
*
|
|
972
|
+
* Toggles the visibility of the participant list panel.
|
|
973
|
+
*/
|
|
974
|
+
static toggleParticipantList(): void;
|
|
975
|
+
/**
|
|
976
|
+
* Shows the participant list panel.
|
|
829
977
|
*/
|
|
830
|
-
static
|
|
978
|
+
static showParticipantList(): void;
|
|
831
979
|
/**
|
|
832
|
-
*
|
|
980
|
+
* Hides the participant list panel.
|
|
833
981
|
*/
|
|
834
|
-
static
|
|
982
|
+
static hideParticipantList(): void;
|
|
835
983
|
/**
|
|
836
|
-
* @deprecated switchToVideoCall is deprecated and not supported
|
|
984
|
+
* @deprecated switchToVideoCall is deprecated and not supported.
|
|
837
985
|
*/
|
|
838
986
|
static switchToVideoCall(): void;
|
|
839
987
|
/**
|
|
@@ -861,7 +1009,7 @@ type Failure<E> = {
|
|
|
861
1009
|
error: E;
|
|
862
1010
|
};
|
|
863
1011
|
type Result<T, E = Error> = Success<T> | Failure<E>;
|
|
864
|
-
declare function tryCatch<T, E = Error>(promise: Promise<T
|
|
1012
|
+
declare function tryCatch<T, E = Error>(promise: Promise<T>, timeoutMs?: number): Promise<Result<T, E>>;
|
|
865
1013
|
declare function tryCatchSync<T, E = Error>(fn: () => T): Result<T, E>;
|
|
866
1014
|
//#endregion
|
|
867
1015
|
//#region calls-sdk-core/utils/update-config.d.ts
|
|
@@ -869,7 +1017,7 @@ declare function updateConfig(config: Partial<ConfigState>): void;
|
|
|
869
1017
|
//#endregion
|
|
870
1018
|
//#region calls-sdk-core/types/common.d.ts
|
|
871
1019
|
type AudioModeType = 'BLUETOOTH' | 'EARPIECE' | 'HEADPHONES' | 'SPEAKER';
|
|
872
|
-
type AudioMode
|
|
1020
|
+
type AudioMode = {
|
|
873
1021
|
type: AudioModeType;
|
|
874
1022
|
selected: boolean;
|
|
875
1023
|
uid?: string;
|
|
@@ -882,8 +1030,7 @@ type MediaType = ValueOf<typeof MEDIA_TYPE>;
|
|
|
882
1030
|
type ValueOf<T> = T[keyof T];
|
|
883
1031
|
type ParticipantRole = ValueOf<typeof PARTICIPANT_ROLE>;
|
|
884
1032
|
type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
885
|
-
type
|
|
886
|
-
type WebOSName = 'android' | 'ios' | 'macos' | 'windows' | 'linux' | 'unknown';
|
|
1033
|
+
type SDKPlatform = ValueOf<typeof SDK_PLATFORM>;
|
|
887
1034
|
interface ITrackOptions {
|
|
888
1035
|
cameraDeviceId?: string | null;
|
|
889
1036
|
constraints?: {
|
|
@@ -929,7 +1076,7 @@ type SDKEvents = Omit<_SDKEvents, 'onParticipantListChanged'> & {
|
|
|
929
1076
|
onParticipantListChanged: (payload: Participant$1[]) => void;
|
|
930
1077
|
};
|
|
931
1078
|
type MobileSDKEvents = SDKEvents & {
|
|
932
|
-
onAudioModeChanged: (payload: AudioMode
|
|
1079
|
+
onAudioModeChanged: (payload: AudioMode['type']) => void;
|
|
933
1080
|
onCameraFacingChanged: (payload: CameraFacing) => void;
|
|
934
1081
|
onSwitchCameraButtonClicked: () => void;
|
|
935
1082
|
onPictureInPictureLayoutEnabled: () => void;
|
|
@@ -985,17 +1132,20 @@ declare class EventBus {
|
|
|
985
1132
|
startEmitting(): void;
|
|
986
1133
|
stopEmitting(): void;
|
|
987
1134
|
publish<K$1 extends keyof AllEvents>(action: EventBusAction<K$1>, forceEmit?: boolean): void;
|
|
988
|
-
subscribe<K$1 extends keyof AllEvents>(actionType: K$1, listener: AllEvents[K$1]
|
|
1135
|
+
subscribe<K$1 extends keyof AllEvents>(actionType: K$1, listener: AllEvents[K$1], options?: {
|
|
1136
|
+
signal?: AbortSignal;
|
|
1137
|
+
}): () => void;
|
|
989
1138
|
}
|
|
990
1139
|
declare const eventBus: EventBus;
|
|
991
1140
|
//#endregion
|
|
992
1141
|
//#region calls-sdk-core/handlers/conference.d.ts
|
|
993
|
-
declare function
|
|
1142
|
+
declare function _createConference(): Promise<void>;
|
|
1143
|
+
declare function createConference(): Promise<void>;
|
|
994
1144
|
declare function muteParticipant(participantId: string): void;
|
|
995
1145
|
declare function pauseParticipantVideo(participantId: string): void;
|
|
996
1146
|
//#endregion
|
|
997
1147
|
//#region calls-sdk-core/handlers/connection.d.ts
|
|
998
|
-
declare function connect(
|
|
1148
|
+
declare function connect(autoJoinConference?: boolean): Promise<void>;
|
|
999
1149
|
//#endregion
|
|
1000
1150
|
//#region calls-sdk-core/handlers/devices.d.ts
|
|
1001
1151
|
declare function areDevicesDifferent(existingDevices?: MediaDeviceInfo[], newDevices?: MediaDeviceInfo[]): boolean;
|
|
@@ -1011,7 +1161,10 @@ declare function removeScreenShareParticipant(participantId: string): void;
|
|
|
1011
1161
|
//#endregion
|
|
1012
1162
|
//#region calls-sdk-core/handlers/session.d.ts
|
|
1013
1163
|
declare function startSession(): void;
|
|
1014
|
-
declare function leaveSession(
|
|
1164
|
+
declare function leaveSession(options?: {
|
|
1165
|
+
forceLeave?: boolean;
|
|
1166
|
+
shouldEndSession?: boolean;
|
|
1167
|
+
}): Promise<void>;
|
|
1015
1168
|
declare function leaveSessionDueToIdleTimeout(): Promise<void>;
|
|
1016
1169
|
declare function reconnectSession(): Promise<void>;
|
|
1017
1170
|
declare function cancelPendingReconnect(): void;
|
|
@@ -1019,6 +1172,7 @@ declare function cancelPendingReconnect(): void;
|
|
|
1019
1172
|
//#region calls-sdk-core/handlers/track.d.ts
|
|
1020
1173
|
declare function createLocalTrackF(type: 'audio' | 'video', deviceId?: string | null, timeout?: number | null, additionalOptions?: ITrackOptions): Promise<any>;
|
|
1021
1174
|
declare function createLocalTrack(type: 'audio' | 'video', deviceId?: string | null, cameraFacing?: CameraFacingInternal): Promise<void>;
|
|
1175
|
+
declare function createLocalTracks(): void;
|
|
1022
1176
|
declare function updateAudioInputDevice(deviceId: string): void;
|
|
1023
1177
|
declare function updateAudioInputDeviceState(device?: AudioInputDevice, skipSubscribe?: boolean): void;
|
|
1024
1178
|
declare function updateVideoInputDevice(deviceId: string | null, cameraFacing?: CameraFacingInternal): Promise<void>;
|
|
@@ -1158,7 +1312,7 @@ interface TranslationState {
|
|
|
1158
1312
|
translations: Record<string, typeof __json_default_export>;
|
|
1159
1313
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1160
1314
|
}
|
|
1161
|
-
declare const useTranslationStore:
|
|
1315
|
+
declare const useTranslationStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1162
1316
|
reset: () => void;
|
|
1163
1317
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1164
1318
|
}>, "subscribe"> & {
|
|
@@ -1296,6 +1450,18 @@ declare const useTranslation: () => {
|
|
|
1296
1450
|
}>;
|
|
1297
1451
|
};
|
|
1298
1452
|
//#endregion
|
|
1453
|
+
//#region src/app-settings.d.ts
|
|
1454
|
+
declare const RegionSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>, v.UnionSchema<[v.LiteralSchema<"eu", undefined>, v.LiteralSchema<"us", undefined>, v.LiteralSchema<"in", undefined>, v.LiteralSchema<"EU", undefined>, v.LiteralSchema<"US", undefined>, v.LiteralSchema<"IN", undefined>], undefined>]>;
|
|
1455
|
+
declare const CallAppSettingsSchema: v.ObjectSchema<{
|
|
1456
|
+
readonly appId: v.StringSchema<undefined>;
|
|
1457
|
+
readonly region: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>, v.UnionSchema<[v.LiteralSchema<"eu", undefined>, v.LiteralSchema<"us", undefined>, v.LiteralSchema<"in", undefined>, v.LiteralSchema<"EU", undefined>, v.LiteralSchema<"US", undefined>, v.LiteralSchema<"IN", undefined>], undefined>]>;
|
|
1458
|
+
readonly authKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1459
|
+
readonly adminHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1460
|
+
readonly clientHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1461
|
+
readonly host: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1462
|
+
}, undefined>;
|
|
1463
|
+
type CallAppSettings = v.InferOutput<typeof CallAppSettingsSchema>;
|
|
1464
|
+
//#endregion
|
|
1299
1465
|
//#region src/native-communication/native-to-js.native.d.ts
|
|
1300
1466
|
declare function setupNativeEventListeners(): void;
|
|
1301
1467
|
//#endregion
|
|
@@ -2037,7 +2203,7 @@ type _Region = keyof typeof REGION;
|
|
|
2037
2203
|
type Region = _Region | Omit<string, _Region>;
|
|
2038
2204
|
type _THost = `rtc-${_Region}.cometchat.io`;
|
|
2039
2205
|
type Host = _THost | Omit<string, _THost>;
|
|
2040
|
-
interface AudioMode {
|
|
2206
|
+
interface AudioMode$1 {
|
|
2041
2207
|
isSelected: boolean;
|
|
2042
2208
|
mode: string;
|
|
2043
2209
|
}
|
|
@@ -2530,25 +2696,16 @@ declare class MainVideoContainerSetting {
|
|
|
2530
2696
|
setUserListButtonParams(position?: Position, visibility?: boolean): void;
|
|
2531
2697
|
}
|
|
2532
2698
|
//#endregion
|
|
2533
|
-
//#region src/
|
|
2699
|
+
//#region src/AppReactNativeSDK.d.ts
|
|
2534
2700
|
interface AppProps extends Partial<ConfigStateMobile & ConfigStateBoth> {
|
|
2535
2701
|
callToken: string;
|
|
2702
|
+
/**
|
|
2703
|
+
* @deprecated Use `sessionSettings` instead.
|
|
2704
|
+
*/
|
|
2536
2705
|
callSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
|
|
2706
|
+
sessionSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
|
|
2537
2707
|
}
|
|
2538
|
-
declare function
|
|
2539
|
-
declare const AppComponent: typeof App;
|
|
2540
|
-
//#endregion
|
|
2541
|
-
//#region src/app-settings.d.ts
|
|
2542
|
-
declare const RegionSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>, v.UnionSchema<[v.LiteralSchema<"eu", undefined>, v.LiteralSchema<"us", undefined>, v.LiteralSchema<"in", undefined>, v.LiteralSchema<"EU", undefined>, v.LiteralSchema<"US", undefined>, v.LiteralSchema<"IN", undefined>], undefined>]>;
|
|
2543
|
-
declare const CallAppSettingsSchema: v.ObjectSchema<{
|
|
2544
|
-
readonly appId: v.StringSchema<undefined>;
|
|
2545
|
-
readonly region: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>, v.UnionSchema<[v.LiteralSchema<"eu", undefined>, v.LiteralSchema<"us", undefined>, v.LiteralSchema<"in", undefined>, v.LiteralSchema<"EU", undefined>, v.LiteralSchema<"US", undefined>, v.LiteralSchema<"IN", undefined>], undefined>]>;
|
|
2546
|
-
readonly authKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2547
|
-
readonly adminHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2548
|
-
readonly clientHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2549
|
-
readonly host: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2550
|
-
}, undefined>;
|
|
2551
|
-
type CallAppSettings = v.InferOutput<typeof CallAppSettingsSchema>;
|
|
2708
|
+
declare function AppReactNativeSDK(props: AppProps): React.JSX.Element;
|
|
2552
2709
|
//#endregion
|
|
2553
2710
|
//#region src/v4/models/ListnerHandler.d.ts
|
|
2554
2711
|
interface IMultiOngoingCallListener extends OngoingCallListener {
|
|
@@ -3697,7 +3854,7 @@ declare class CometChatCalls$1 {
|
|
|
3697
3854
|
* Method to get all the available audio output devices.
|
|
3698
3855
|
* @returns {Promise<AudioMode[]>}
|
|
3699
3856
|
*/
|
|
3700
|
-
static getAudioOutputModes(): Promise<AudioMode[]>;
|
|
3857
|
+
static getAudioOutputModes(): Promise<AudioMode$1[]>;
|
|
3701
3858
|
/**
|
|
3702
3859
|
* Method to switch from audio call to video call.
|
|
3703
3860
|
* @returns {void}
|
|
@@ -3895,7 +4052,13 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
3895
4052
|
static OngoingCallListener: typeof OngoingCallListener;
|
|
3896
4053
|
static CallSettingsBuilder: typeof CallSettingsBuilder;
|
|
3897
4054
|
static CallAppSettingsBuilder: typeof CallAppSettingsBuilder;
|
|
3898
|
-
static Component: typeof
|
|
4055
|
+
static Component: typeof AppReactNativeSDK;
|
|
4056
|
+
/**
|
|
4057
|
+
* Initializes the CometChat Calls SDK with the provided app settings.
|
|
4058
|
+
* Must be called before any other SDK methods.
|
|
4059
|
+
* @param appSettings - The application settings for configuring the SDK.
|
|
4060
|
+
* @returns An object indicating success or failure with error details.
|
|
4061
|
+
*/
|
|
3899
4062
|
static init(appSettings: CallAppSettings | CallAppSettings$1): Promise<{
|
|
3900
4063
|
readonly success: false;
|
|
3901
4064
|
readonly error: {
|
|
@@ -3907,14 +4070,62 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
3907
4070
|
readonly success: true;
|
|
3908
4071
|
readonly error: null;
|
|
3909
4072
|
}>;
|
|
4073
|
+
/**
|
|
4074
|
+
* Logs in a user with their UID and an optional auth key.
|
|
4075
|
+
* If no auth key is provided, the one from app settings is used.
|
|
4076
|
+
* @param uid - The unique identifier of the user.
|
|
4077
|
+
* @param authKey - The authentication key. Falls back to the key provided in app settings.
|
|
4078
|
+
* @returns A Promise that resolves to the logged-in User object.
|
|
4079
|
+
* @throws {CometChatException} If login fails or validation errors occur.
|
|
4080
|
+
*/
|
|
3910
4081
|
static login(uid: string, authKey?: string): Promise<User>;
|
|
4082
|
+
/**
|
|
4083
|
+
* Logs in a user directly with an auth token.
|
|
4084
|
+
* @param authToken - The authentication token for the user.
|
|
4085
|
+
* @returns A Promise that resolves to the logged-in User object.
|
|
4086
|
+
* @throws {CometChatException} If login fails or the token is invalid.
|
|
4087
|
+
*/
|
|
3911
4088
|
static loginWithAuthToken(authToken: string): Promise<User>;
|
|
4089
|
+
/**
|
|
4090
|
+
* Logs out the currently logged-in user and clears local session data.
|
|
4091
|
+
* @returns A Promise that resolves to a success message string.
|
|
4092
|
+
* @throws {CometChatException} If no user is logged in or logout fails.
|
|
4093
|
+
*/
|
|
3912
4094
|
static logout(): Promise<string>;
|
|
4095
|
+
/**
|
|
4096
|
+
* Retrieves the currently logged-in user.
|
|
4097
|
+
* @returns The logged-in User object, or null if no user is logged in.
|
|
4098
|
+
*/
|
|
3913
4099
|
static getLoggedInUser(): User | null;
|
|
4100
|
+
/**
|
|
4101
|
+
* Retrieves the auth token of the currently logged-in user.
|
|
4102
|
+
* @returns The auth token string, or null if no user is logged in.
|
|
4103
|
+
*/
|
|
3914
4104
|
static getUserAuthToken(): string | null;
|
|
4105
|
+
/**
|
|
4106
|
+
* Checks whether a user is currently logged in.
|
|
4107
|
+
* @returns True if a user is logged in with a valid auth token, false otherwise.
|
|
4108
|
+
*/
|
|
3915
4109
|
static isUserLoggedIn(): boolean;
|
|
4110
|
+
/**
|
|
4111
|
+
* Registers a login listener to receive login/logout lifecycle callbacks.
|
|
4112
|
+
* @param listenerId - A unique identifier for the listener.
|
|
4113
|
+
* @param listener - The listener object with callback methods.
|
|
4114
|
+
*/
|
|
3916
4115
|
static addLoginListener(listenerId: string, listener: LoginListener): void;
|
|
4116
|
+
/**
|
|
4117
|
+
* Removes a previously registered login listener.
|
|
4118
|
+
* @param listenerId - The unique identifier of the listener to remove.
|
|
4119
|
+
*/
|
|
3917
4120
|
static removeLoginListener(listenerId: string): void;
|
|
4121
|
+
/**
|
|
4122
|
+
* Generates a call token for the given session.
|
|
4123
|
+
* Uses the provided auth token or falls back to the logged-in user's token.
|
|
4124
|
+
* @param sessionId - The session ID to generate a token for.
|
|
4125
|
+
* @param authToken - Optional auth token. If omitted, the logged-in user's token is used.
|
|
4126
|
+
* @returns A Promise that resolves to an object containing the generated token.
|
|
4127
|
+
* @throws {CometChatException} If the session ID is missing, no auth token is available, or the SDK is not initialized.
|
|
4128
|
+
*/
|
|
3918
4129
|
static generateToken(sessionId: string, authToken?: string): Promise<{
|
|
3919
4130
|
token: string;
|
|
3920
4131
|
}>;
|
|
@@ -3924,6 +4135,7 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
3924
4135
|
private static logoutInternal;
|
|
3925
4136
|
private static callGenerateTokenAPI;
|
|
3926
4137
|
private static callVerifyTokenAPI;
|
|
4138
|
+
private static getStorageKey;
|
|
3927
4139
|
private static saveUser;
|
|
3928
4140
|
private static getSavedUser;
|
|
3929
4141
|
private static clearSavedUser;
|
|
@@ -3933,8 +4145,29 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
3933
4145
|
private static notifyLoginFailure;
|
|
3934
4146
|
private static notifyLogoutSuccess;
|
|
3935
4147
|
private static notifyLogoutFailure;
|
|
3936
|
-
|
|
4148
|
+
/**
|
|
4149
|
+
* Adds an event listener for SDK events.
|
|
4150
|
+
* @param eventType - The type of event to listen for.
|
|
4151
|
+
* @param listener - The callback function to invoke when the event fires.
|
|
4152
|
+
* @param options - Optional configuration including an AbortSignal for automatic cleanup.
|
|
4153
|
+
* @returns An unsubscribe function to remove the listener.
|
|
4154
|
+
*/
|
|
4155
|
+
static addEventListener<K$1 extends keyof MobileSDKEvents>(eventType: K$1, listener: MobileSDKEvents[K$1], options?: {
|
|
4156
|
+
signal?: AbortSignal;
|
|
4157
|
+
}): () => void;
|
|
4158
|
+
/**
|
|
4159
|
+
* Sets the audio output mode (mobile only).
|
|
4160
|
+
* @param mode - The audio mode to set (e.g., 'SPEAKER', 'EARPIECE', 'BLUETOOTH', 'HEADPHONES').
|
|
4161
|
+
*/
|
|
4162
|
+
static setAudioMode(mode: AudioMode['type']): void;
|
|
4163
|
+
/**
|
|
4164
|
+
* Enables Picture-in-Picture (PIP) layout during the call.
|
|
4165
|
+
*/
|
|
4166
|
+
static enablePictureInPictureLayout(): void;
|
|
4167
|
+
/**
|
|
4168
|
+
* Disables Picture-in-Picture (PIP) layout.
|
|
4169
|
+
*/
|
|
4170
|
+
static disablePictureInPictureLayout(): void;
|
|
3937
4171
|
}
|
|
3938
4172
|
//#endregion
|
|
3939
|
-
export { CometChatCalls };
|
|
3940
|
-
//# sourceMappingURL=index.d.mts.map
|
|
4173
|
+
export { CometChatCalls };
|