@cometchat/calls-sdk-react-native 5.0.0-beta.1 → 5.0.0-beta.10

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