@cometchat/calls-sdk-react-native 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -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;
@@ -112,6 +115,7 @@ declare const EVENT_LISTENER_METHODS: {
112
115
  readonly onConnectionLost: "onConnectionLost";
113
116
  readonly onConnectionRestored: "onConnectionRestored";
114
117
  readonly onConnectionClosed: "onConnectionClosed";
118
+ readonly onConnectionFailed: "onConnectionFailed";
115
119
  readonly onSessionTimedOut: "onSessionTimedOut";
116
120
  };
117
121
  readonly MediaEventsListener: {
@@ -181,6 +185,7 @@ declare const EVENT_LISTENER_METHODS_WEB: {
181
185
  readonly onConnectionLost: "onConnectionLost";
182
186
  readonly onConnectionRestored: "onConnectionRestored";
183
187
  readonly onConnectionClosed: "onConnectionClosed";
188
+ readonly onConnectionFailed: "onConnectionFailed";
184
189
  readonly onSessionTimedOut: "onSessionTimedOut";
185
190
  };
186
191
  readonly ParticipantEventsListner: {
@@ -256,6 +261,7 @@ declare const EVENT_LISTENER_METHODS_MOBILE: {
256
261
  readonly onConnectionLost: "onConnectionLost";
257
262
  readonly onConnectionRestored: "onConnectionRestored";
258
263
  readonly onConnectionClosed: "onConnectionClosed";
264
+ readonly onConnectionFailed: "onConnectionFailed";
259
265
  readonly onSessionTimedOut: "onSessionTimedOut";
260
266
  };
261
267
  readonly ParticipantEventsListner: {
@@ -679,7 +685,7 @@ type InternalSetting = v.InferOutput<typeof InternalSettingSchema>;
679
685
  //#region calls-sdk-core/store/connection.d.ts
680
686
  type ConnectionState = {
681
687
  connection: any;
682
- error: any;
688
+ error: ConnectionError | undefined;
683
689
  timeEstablished: number | undefined;
684
690
  jwt?: string;
685
691
  connectionConfig?: InternalSetting['settings']['connectionConfig'];
@@ -688,7 +694,7 @@ type ConnectionState = {
688
694
  type Actions$2 = {
689
695
  connectionWillConnect: (connection: any) => void;
690
696
  connectionEstablished: (connection: any) => void;
691
- connectionFailed: (error: any) => void;
697
+ connectionFailed: (error: ConnectionError) => void;
692
698
  disconnect: () => Promise<void>;
693
699
  reset: () => void;
694
700
  };
@@ -783,13 +789,16 @@ interface ToastState {
783
789
  toasts: ToastItem[];
784
790
  }
785
791
  interface ToastActions {
786
- addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => string;
792
+ addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'> & {
793
+ id?: string;
794
+ }) => string;
787
795
  removeToast: (id: string) => void;
788
796
  clearAll: () => void;
789
797
  reset: () => void;
790
798
  }
791
799
  declare const useToastStore: zustand0.UseBoundStore<zustand0.StoreApi<ToastState & ToastActions>>;
792
800
  declare function showToast(params: {
801
+ id?: string;
793
802
  message: string;
794
803
  type?: NotificationType;
795
804
  duration?: number;
@@ -798,11 +807,13 @@ declare function showToast(params: {
798
807
  }): string;
799
808
  //#endregion
800
809
  //#region calls-sdk-core/store/tracks.d.ts
810
+ type StreamingStatus = 'active' | 'interrupted' | 'restoring' | 'inactive';
801
811
  type Track = {
802
812
  local: boolean;
803
813
  mediaType: MediaType;
804
814
  muted: number;
805
815
  pid: string;
816
+ streamingStatus: StreamingStatus;
806
817
  videoType: 'desktop' | 'camera' | null;
807
818
  originalTrack?: any;
808
819
  };
@@ -862,7 +873,7 @@ declare const useEnableParticipantContextMenu: () => boolean;
862
873
  declare const useRaisedHandTimestamp: (participantId?: string, type?: Participant$2["type"]) => number | undefined;
863
874
  declare const useIsParticipantPinned: (participantId: string, type: Participant$2["type"]) => boolean;
864
875
  declare const useOrderedParticipants: () => Participant$2[];
865
- declare const useNonRecoverableError: () => any;
876
+ declare const useNonRecoverableError: () => string | undefined;
866
877
  declare const useIsSwitchCameraEnabledBrowser: () => any;
867
878
  declare const useIsAudioInputSelectionSupported: () => boolean;
868
879
  declare const useIsVideoInputSelectionSupported: () => boolean;
@@ -1055,6 +1066,12 @@ interface ITrackOptions {
1055
1066
  }
1056
1067
  type Prettify<T> = { [K in keyof T]: T[K] } & unknown;
1057
1068
  type Paths<T> = T extends object ? { [K in keyof T]: T[K] extends object ? `${K & string}.${Paths<T[K]>}` : `${K & string}` }[keyof T] : never;
1069
+ type ConnectionError = {
1070
+ name: string;
1071
+ message?: string;
1072
+ details?: Record<string, unknown>;
1073
+ recoverable?: boolean;
1074
+ };
1058
1075
  //#endregion
1059
1076
  //#region calls-sdk-core/types/union-to-array.d.ts
1060
1077
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
@@ -1072,8 +1089,9 @@ declare const ParticipantSchema: v.ObjectSchema<{
1072
1089
  }, undefined>;
1073
1090
  type Participant$1 = v.InferOutput<typeof ParticipantSchema>;
1074
1091
  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'> & {
1092
+ type SDKEvents = Omit<_SDKEvents, 'onParticipantListChanged' | 'onConnectionFailed'> & {
1076
1093
  onCallLayoutChanged: (payload: Layout) => void;
1094
+ onConnectionFailed: (payload: ConnectionError) => void;
1077
1095
  onParticipantListVisible: () => void;
1078
1096
  onParticipantListHidden: () => void;
1079
1097
  onParticipantListChanged: (payload: Participant$1[]) => void;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as zustand1 from "zustand";
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;
@@ -112,6 +115,7 @@ declare const EVENT_LISTENER_METHODS: {
112
115
  readonly onConnectionLost: "onConnectionLost";
113
116
  readonly onConnectionRestored: "onConnectionRestored";
114
117
  readonly onConnectionClosed: "onConnectionClosed";
118
+ readonly onConnectionFailed: "onConnectionFailed";
115
119
  readonly onSessionTimedOut: "onSessionTimedOut";
116
120
  };
117
121
  readonly MediaEventsListener: {
@@ -181,6 +185,7 @@ declare const EVENT_LISTENER_METHODS_WEB: {
181
185
  readonly onConnectionLost: "onConnectionLost";
182
186
  readonly onConnectionRestored: "onConnectionRestored";
183
187
  readonly onConnectionClosed: "onConnectionClosed";
188
+ readonly onConnectionFailed: "onConnectionFailed";
184
189
  readonly onSessionTimedOut: "onSessionTimedOut";
185
190
  };
186
191
  readonly ParticipantEventsListner: {
@@ -256,6 +261,7 @@ declare const EVENT_LISTENER_METHODS_MOBILE: {
256
261
  readonly onConnectionLost: "onConnectionLost";
257
262
  readonly onConnectionRestored: "onConnectionRestored";
258
263
  readonly onConnectionClosed: "onConnectionClosed";
264
+ readonly onConnectionFailed: "onConnectionFailed";
259
265
  readonly onSessionTimedOut: "onSessionTimedOut";
260
266
  };
261
267
  readonly ParticipantEventsListner: {
@@ -375,7 +381,7 @@ type Actions$5 = {
375
381
  isMobileSDK: () => boolean;
376
382
  isMobile: () => boolean;
377
383
  };
378
- declare const useBaseStore: zustand1.UseBoundStore<Omit<Omit<zustand1.StoreApi<BaseState & Actions$5>, "subscribe"> & {
384
+ declare const useBaseStore: zustand0.UseBoundStore<Omit<Omit<zustand0.StoreApi<BaseState & Actions$5>, "subscribe"> & {
379
385
  subscribe: {
380
386
  (listener: (selectedState: BaseState & Actions$5, previousSelectedState: BaseState & Actions$5) => void): () => void;
381
387
  <U>(selector: (state: BaseState & Actions$5) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -455,7 +461,7 @@ type Actions$4 = {
455
461
  endConference: () => Promise<void>;
456
462
  stopRecording: () => Promise<void>;
457
463
  };
458
- declare const useConferenceStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
464
+ declare const useConferenceStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
459
465
  subscribe: {
460
466
  (listener: (selectedState: ConferenceState & Actions$4, previousSelectedState: ConferenceState & Actions$4) => void): () => void;
461
467
  <U>(selector: (state: ConferenceState & Actions$4) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -540,7 +546,7 @@ type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & Co
540
546
  type Actions$3 = {
541
547
  reset: () => void;
542
548
  };
543
- declare const useConfigStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
549
+ declare const useConfigStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
544
550
  subscribe: {
545
551
  (listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
546
552
  <U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -679,7 +685,7 @@ type InternalSetting = v.InferOutput<typeof InternalSettingSchema>;
679
685
  //#region calls-sdk-core/store/connection.d.ts
680
686
  type ConnectionState = {
681
687
  connection: any;
682
- error: any;
688
+ error: ConnectionError | undefined;
683
689
  timeEstablished: number | undefined;
684
690
  jwt?: string;
685
691
  connectionConfig?: InternalSetting['settings']['connectionConfig'];
@@ -688,11 +694,11 @@ type ConnectionState = {
688
694
  type Actions$2 = {
689
695
  connectionWillConnect: (connection: any) => void;
690
696
  connectionEstablished: (connection: any) => void;
691
- connectionFailed: (error: any) => void;
697
+ connectionFailed: (error: ConnectionError) => void;
692
698
  disconnect: () => Promise<void>;
693
699
  reset: () => void;
694
700
  };
695
- declare const useConnectionStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
701
+ declare const useConnectionStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
696
702
  subscribe: {
697
703
  (listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
698
704
  <U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -743,7 +749,7 @@ type Actions$1 = {
743
749
  getParticipantById: (pid: string) => HumanParticipant | undefined;
744
750
  reset: () => void;
745
751
  };
746
- declare const useParticipantStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
752
+ declare const useParticipantStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
747
753
  subscribe: {
748
754
  (listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
749
755
  <U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -783,13 +789,16 @@ interface ToastState {
783
789
  toasts: ToastItem[];
784
790
  }
785
791
  interface ToastActions {
786
- addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => string;
792
+ addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'> & {
793
+ id?: string;
794
+ }) => string;
787
795
  removeToast: (id: string) => void;
788
796
  clearAll: () => void;
789
797
  reset: () => void;
790
798
  }
791
- declare const useToastStore: zustand1.UseBoundStore<zustand1.StoreApi<ToastState & ToastActions>>;
799
+ declare const useToastStore: zustand0.UseBoundStore<zustand0.StoreApi<ToastState & ToastActions>>;
792
800
  declare function showToast(params: {
801
+ id?: string;
793
802
  message: string;
794
803
  type?: NotificationType;
795
804
  duration?: number;
@@ -798,11 +807,13 @@ declare function showToast(params: {
798
807
  }): string;
799
808
  //#endregion
800
809
  //#region calls-sdk-core/store/tracks.d.ts
810
+ type StreamingStatus = 'active' | 'interrupted' | 'restoring' | 'inactive';
801
811
  type Track = {
802
812
  local: boolean;
803
813
  mediaType: MediaType;
804
814
  muted: number;
805
815
  pid: string;
816
+ streamingStatus: StreamingStatus;
806
817
  videoType: 'desktop' | 'camera' | null;
807
818
  originalTrack?: any;
808
819
  };
@@ -821,7 +832,7 @@ type Actions = {
821
832
  updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
822
833
  updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
823
834
  };
824
- declare const useTracksStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<TracksState & Actions>, "subscribe"> & {
835
+ declare const useTracksStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<TracksState & Actions>, "subscribe"> & {
825
836
  subscribe: {
826
837
  (listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
827
838
  <U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -862,7 +873,7 @@ declare const useEnableParticipantContextMenu: () => boolean;
862
873
  declare const useRaisedHandTimestamp: (participantId?: string, type?: Participant$2["type"]) => number | undefined;
863
874
  declare const useIsParticipantPinned: (participantId: string, type: Participant$2["type"]) => boolean;
864
875
  declare const useOrderedParticipants: () => Participant$2[];
865
- declare const useNonRecoverableError: () => any;
876
+ declare const useNonRecoverableError: () => string | undefined;
866
877
  declare const useIsSwitchCameraEnabledBrowser: () => any;
867
878
  declare const useIsAudioInputSelectionSupported: () => boolean;
868
879
  declare const useIsVideoInputSelectionSupported: () => boolean;
@@ -1055,6 +1066,12 @@ interface ITrackOptions {
1055
1066
  }
1056
1067
  type Prettify<T> = { [K in keyof T]: T[K] } & unknown;
1057
1068
  type Paths<T> = T extends object ? { [K in keyof T]: T[K] extends object ? `${K & string}.${Paths<T[K]>}` : `${K & string}` }[keyof T] : never;
1069
+ type ConnectionError = {
1070
+ name: string;
1071
+ message?: string;
1072
+ details?: Record<string, unknown>;
1073
+ recoverable?: boolean;
1074
+ };
1058
1075
  //#endregion
1059
1076
  //#region calls-sdk-core/types/union-to-array.d.ts
1060
1077
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
@@ -1072,8 +1089,9 @@ declare const ParticipantSchema: v.ObjectSchema<{
1072
1089
  }, undefined>;
1073
1090
  type Participant$1 = v.InferOutput<typeof ParticipantSchema>;
1074
1091
  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'> & {
1092
+ type SDKEvents = Omit<_SDKEvents, 'onParticipantListChanged' | 'onConnectionFailed'> & {
1076
1093
  onCallLayoutChanged: (payload: Layout) => void;
1094
+ onConnectionFailed: (payload: ConnectionError) => void;
1077
1095
  onParticipantListVisible: () => void;
1078
1096
  onParticipantListHidden: () => void;
1079
1097
  onParticipantListChanged: (payload: Participant$1[]) => void;
@@ -1315,7 +1333,7 @@ interface TranslationState {
1315
1333
  translations: Record<string, typeof __json_default_export>;
1316
1334
  currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
1317
1335
  }
1318
- declare const useTranslationStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
1336
+ declare const useTranslationStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
1319
1337
  reset: () => void;
1320
1338
  setLocale: (locale: CometChatSupportedLocale) => void;
1321
1339
  }>, "subscribe"> & {