@cometchat/calls-sdk-react-native 5.0.0-beta.1 → 5.0.0-beta.3
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/cometchat-calls-sdk-react-native.podspec +20 -0
- package/dist/index.d.mts +164 -43
- package/dist/index.d.ts +164 -43
- package/dist/index.js +275 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +275 -85
- package/dist/index.mjs.map +1 -1
- 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 +10 -3
|
@@ -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
|
|
2
|
+
import * as zustand3 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";
|
|
@@ -354,7 +354,7 @@ type Actions$5 = {
|
|
|
354
354
|
isMobileSDK: () => boolean;
|
|
355
355
|
isMobile: () => boolean;
|
|
356
356
|
};
|
|
357
|
-
declare const useBaseStore:
|
|
357
|
+
declare const useBaseStore: zustand3.UseBoundStore<Omit<Omit<zustand3.StoreApi<BaseState & Actions$5>, "subscribe"> & {
|
|
358
358
|
subscribe: {
|
|
359
359
|
(listener: (selectedState: BaseState & Actions$5, previousSelectedState: BaseState & Actions$5) => void): () => void;
|
|
360
360
|
<U>(selector: (state: BaseState & Actions$5) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -429,9 +429,10 @@ type Actions$4 = {
|
|
|
429
429
|
raiseHand: (participantId: string, timestamp: number) => void;
|
|
430
430
|
lowerHand: (participantId: string) => void;
|
|
431
431
|
leaveConference: () => Promise<void>;
|
|
432
|
+
endConference: () => Promise<void>;
|
|
432
433
|
stopRecording: () => Promise<void>;
|
|
433
434
|
};
|
|
434
|
-
declare const useConferenceStore:
|
|
435
|
+
declare const useConferenceStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
|
|
435
436
|
subscribe: {
|
|
436
437
|
(listener: (selectedState: ConferenceState & Actions$4, previousSelectedState: ConferenceState & Actions$4) => void): () => void;
|
|
437
438
|
<U>(selector: (state: ConferenceState & Actions$4) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -457,6 +458,7 @@ type ConfigStateInternal = {
|
|
|
457
458
|
sessionId?: string;
|
|
458
459
|
iAmRecorder: boolean;
|
|
459
460
|
showFrameRate: boolean;
|
|
461
|
+
enableCompanionMode: boolean;
|
|
460
462
|
};
|
|
461
463
|
type ConfigStateMobile = {
|
|
462
464
|
audioMode?: AudioMode$1['type'];
|
|
@@ -484,7 +486,6 @@ type ConfigStateBoth = {
|
|
|
484
486
|
hideToggleAudioButton: boolean;
|
|
485
487
|
hideToggleVideoButton: boolean;
|
|
486
488
|
hideParticipantListButton: boolean;
|
|
487
|
-
hideSwitchLayoutButton: boolean;
|
|
488
489
|
hideChatButton: boolean;
|
|
489
490
|
hideScreenSharingButton: boolean;
|
|
490
491
|
hideSessionTimer: boolean;
|
|
@@ -500,12 +501,13 @@ type ConfigStateBoth = {
|
|
|
500
501
|
idleTimeoutPeriodAfterPrompt: number;
|
|
501
502
|
enableSpotlightDrag: boolean;
|
|
502
503
|
enableSpotlightSwap: boolean;
|
|
504
|
+
isPeerCall: boolean;
|
|
503
505
|
};
|
|
504
506
|
type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth;
|
|
505
507
|
type Actions$3 = {
|
|
506
508
|
reset: () => void;
|
|
507
509
|
};
|
|
508
|
-
declare const useConfigStore:
|
|
510
|
+
declare const useConfigStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
|
|
509
511
|
subscribe: {
|
|
510
512
|
(listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
|
|
511
513
|
<U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -657,7 +659,7 @@ type Actions$2 = {
|
|
|
657
659
|
disconnect: () => Promise<void>;
|
|
658
660
|
reset: () => void;
|
|
659
661
|
};
|
|
660
|
-
declare const useConnectionStore:
|
|
662
|
+
declare const useConnectionStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
|
|
661
663
|
subscribe: {
|
|
662
664
|
(listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
|
|
663
665
|
<U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -666,6 +668,7 @@ declare const useConnectionStore: zustand9.UseBoundStore<Omit<zustand9.StoreApi<
|
|
|
666
668
|
} | undefined): () => void;
|
|
667
669
|
};
|
|
668
670
|
}>;
|
|
671
|
+
declare function waitForConnection(): Promise<void>;
|
|
669
672
|
//#endregion
|
|
670
673
|
//#region calls-sdk-core/utils/schema/human-participant.d.ts
|
|
671
674
|
declare const HumanParticipantSchema: v.ObjectSchema<{
|
|
@@ -707,7 +710,7 @@ type Actions$1 = {
|
|
|
707
710
|
getParticipantById: (pid: string) => HumanParticipant | undefined;
|
|
708
711
|
reset: () => void;
|
|
709
712
|
};
|
|
710
|
-
declare const useParticipantStore:
|
|
713
|
+
declare const useParticipantStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
|
|
711
714
|
subscribe: {
|
|
712
715
|
(listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
|
|
713
716
|
<U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -753,7 +756,7 @@ type Actions = {
|
|
|
753
756
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
754
757
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
755
758
|
};
|
|
756
|
-
declare const useTracksStore:
|
|
759
|
+
declare const useTracksStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
757
760
|
subscribe: {
|
|
758
761
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
759
762
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -804,36 +807,78 @@ declare const switchCamera: () => void;
|
|
|
804
807
|
//#endregion
|
|
805
808
|
//#region calls-sdk-core/utils/session-methods-core.d.ts
|
|
806
809
|
declare class SessionMethodsCore {
|
|
810
|
+
/**
|
|
811
|
+
* Mutes the local user's audio during the call.
|
|
812
|
+
*/
|
|
807
813
|
static muteAudio(): void;
|
|
814
|
+
/**
|
|
815
|
+
* Unmutes the local user's audio during the call.
|
|
816
|
+
*/
|
|
808
817
|
static unmuteAudio(): void;
|
|
818
|
+
/**
|
|
819
|
+
* Pauses the local user's video stream.
|
|
820
|
+
*/
|
|
809
821
|
static pauseVideo(): void;
|
|
822
|
+
/**
|
|
823
|
+
* Resumes the local user's video stream.
|
|
824
|
+
*/
|
|
810
825
|
static resumeVideo(): void;
|
|
826
|
+
/**
|
|
827
|
+
* Local user leaves the current session.
|
|
828
|
+
*/
|
|
811
829
|
static leaveSession(): void;
|
|
812
|
-
|
|
813
|
-
|
|
830
|
+
/**
|
|
831
|
+
* Raises the user's virtual hand in the call.
|
|
832
|
+
*/
|
|
814
833
|
static raiseHand(): void;
|
|
834
|
+
/**
|
|
835
|
+
* Lowers the user's virtual hand in the call.
|
|
836
|
+
*/
|
|
815
837
|
static lowerHand(): void;
|
|
838
|
+
/**
|
|
839
|
+
* Switches between the front and rear camera.
|
|
840
|
+
*/
|
|
816
841
|
static switchCamera(): void;
|
|
842
|
+
/**
|
|
843
|
+
* Sets the layout type for the call.
|
|
844
|
+
* @param layout - The type of layout to set (tile, sidebar or spotlight).
|
|
845
|
+
*/
|
|
817
846
|
static setLayout(layout: Layout): void;
|
|
847
|
+
/**
|
|
848
|
+
* Starts recording the call.
|
|
849
|
+
*/
|
|
818
850
|
static startRecording(): void;
|
|
851
|
+
/**
|
|
852
|
+
* Stops the ongoing call recording.
|
|
853
|
+
*/
|
|
819
854
|
static stopRecording(): void;
|
|
820
|
-
|
|
821
|
-
|
|
855
|
+
/**
|
|
856
|
+
* Pins a participant's video to focus on them.
|
|
857
|
+
* @param participantId - The ID of the participant to pin.
|
|
858
|
+
* @param type - The type of the participant.
|
|
859
|
+
*/
|
|
822
860
|
static pinParticipant(participantId: string, type: Participant$2['type']): void;
|
|
861
|
+
/**
|
|
862
|
+
* Unpins a participant's video.
|
|
863
|
+
*/
|
|
823
864
|
static unpinParticipant(): void;
|
|
865
|
+
/**
|
|
866
|
+
* Mutes the audio of a specific participant.
|
|
867
|
+
* @param participantId - The ID of the participant to mute.
|
|
868
|
+
*/
|
|
824
869
|
static muteParticipant(participantId: string): void;
|
|
825
|
-
static pauseParticipantVideo(participantId: string): void;
|
|
826
|
-
static setChatButtonUnreadCount(count: number): void;
|
|
827
870
|
/**
|
|
828
|
-
*
|
|
871
|
+
* Pauses the video stream of a specific participant.
|
|
872
|
+
* @param participantId - The ID of the participant whose video to pause.
|
|
829
873
|
*/
|
|
830
|
-
static
|
|
874
|
+
static pauseParticipantVideo(participantId: string): void;
|
|
831
875
|
/**
|
|
832
|
-
*
|
|
876
|
+
* Sets the unread message count displayed on the chat button.
|
|
877
|
+
* @param count - The number of unread messages.
|
|
833
878
|
*/
|
|
834
|
-
static
|
|
879
|
+
static setChatButtonUnreadCount(count: number): void;
|
|
835
880
|
/**
|
|
836
|
-
* @deprecated switchToVideoCall is deprecated and not supported
|
|
881
|
+
* @deprecated switchToVideoCall is deprecated and not supported.
|
|
837
882
|
*/
|
|
838
883
|
static switchToVideoCall(): void;
|
|
839
884
|
/**
|
|
@@ -861,7 +906,7 @@ type Failure<E> = {
|
|
|
861
906
|
error: E;
|
|
862
907
|
};
|
|
863
908
|
type Result<T, E = Error> = Success<T> | Failure<E>;
|
|
864
|
-
declare function tryCatch<T, E = Error>(promise: Promise<T
|
|
909
|
+
declare function tryCatch<T, E = Error>(promise: Promise<T>, timeoutMs?: number): Promise<Result<T, E>>;
|
|
865
910
|
declare function tryCatchSync<T, E = Error>(fn: () => T): Result<T, E>;
|
|
866
911
|
//#endregion
|
|
867
912
|
//#region calls-sdk-core/utils/update-config.d.ts
|
|
@@ -985,17 +1030,20 @@ declare class EventBus {
|
|
|
985
1030
|
startEmitting(): void;
|
|
986
1031
|
stopEmitting(): void;
|
|
987
1032
|
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]
|
|
1033
|
+
subscribe<K$1 extends keyof AllEvents>(actionType: K$1, listener: AllEvents[K$1], options?: {
|
|
1034
|
+
signal?: AbortSignal;
|
|
1035
|
+
}): () => void;
|
|
989
1036
|
}
|
|
990
1037
|
declare const eventBus: EventBus;
|
|
991
1038
|
//#endregion
|
|
992
1039
|
//#region calls-sdk-core/handlers/conference.d.ts
|
|
993
|
-
declare function
|
|
1040
|
+
declare function _createConference(): Promise<void>;
|
|
1041
|
+
declare function createConference(): Promise<void>;
|
|
994
1042
|
declare function muteParticipant(participantId: string): void;
|
|
995
1043
|
declare function pauseParticipantVideo(participantId: string): void;
|
|
996
1044
|
//#endregion
|
|
997
1045
|
//#region calls-sdk-core/handlers/connection.d.ts
|
|
998
|
-
declare function connect(
|
|
1046
|
+
declare function connect(autoJoinConference?: boolean): Promise<void>;
|
|
999
1047
|
//#endregion
|
|
1000
1048
|
//#region calls-sdk-core/handlers/devices.d.ts
|
|
1001
1049
|
declare function areDevicesDifferent(existingDevices?: MediaDeviceInfo[], newDevices?: MediaDeviceInfo[]): boolean;
|
|
@@ -1011,7 +1059,9 @@ declare function removeScreenShareParticipant(participantId: string): void;
|
|
|
1011
1059
|
//#endregion
|
|
1012
1060
|
//#region calls-sdk-core/handlers/session.d.ts
|
|
1013
1061
|
declare function startSession(): void;
|
|
1014
|
-
declare function leaveSession(
|
|
1062
|
+
declare function leaveSession(options?: {
|
|
1063
|
+
forceLeave?: boolean;
|
|
1064
|
+
}): Promise<void>;
|
|
1015
1065
|
declare function leaveSessionDueToIdleTimeout(): Promise<void>;
|
|
1016
1066
|
declare function reconnectSession(): Promise<void>;
|
|
1017
1067
|
declare function cancelPendingReconnect(): void;
|
|
@@ -1019,6 +1069,7 @@ declare function cancelPendingReconnect(): void;
|
|
|
1019
1069
|
//#region calls-sdk-core/handlers/track.d.ts
|
|
1020
1070
|
declare function createLocalTrackF(type: 'audio' | 'video', deviceId?: string | null, timeout?: number | null, additionalOptions?: ITrackOptions): Promise<any>;
|
|
1021
1071
|
declare function createLocalTrack(type: 'audio' | 'video', deviceId?: string | null, cameraFacing?: CameraFacingInternal): Promise<void>;
|
|
1072
|
+
declare function createLocalTracks(): void;
|
|
1022
1073
|
declare function updateAudioInputDevice(deviceId: string): void;
|
|
1023
1074
|
declare function updateAudioInputDeviceState(device?: AudioInputDevice, skipSubscribe?: boolean): void;
|
|
1024
1075
|
declare function updateVideoInputDevice(deviceId: string | null, cameraFacing?: CameraFacingInternal): Promise<void>;
|
|
@@ -1158,7 +1209,7 @@ interface TranslationState {
|
|
|
1158
1209
|
translations: Record<string, typeof __json_default_export>;
|
|
1159
1210
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1160
1211
|
}
|
|
1161
|
-
declare const useTranslationStore:
|
|
1212
|
+
declare const useTranslationStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1162
1213
|
reset: () => void;
|
|
1163
1214
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1164
1215
|
}>, "subscribe"> & {
|
|
@@ -1296,6 +1347,18 @@ declare const useTranslation: () => {
|
|
|
1296
1347
|
}>;
|
|
1297
1348
|
};
|
|
1298
1349
|
//#endregion
|
|
1350
|
+
//#region src/app-settings.d.ts
|
|
1351
|
+
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>]>;
|
|
1352
|
+
declare const CallAppSettingsSchema: v.ObjectSchema<{
|
|
1353
|
+
readonly appId: v.StringSchema<undefined>;
|
|
1354
|
+
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>]>;
|
|
1355
|
+
readonly authKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1356
|
+
readonly adminHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1357
|
+
readonly clientHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1358
|
+
readonly host: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1359
|
+
}, undefined>;
|
|
1360
|
+
type CallAppSettings = v.InferOutput<typeof CallAppSettingsSchema>;
|
|
1361
|
+
//#endregion
|
|
1299
1362
|
//#region src/native-communication/native-to-js.native.d.ts
|
|
1300
1363
|
declare function setupNativeEventListeners(): void;
|
|
1301
1364
|
//#endregion
|
|
@@ -2530,25 +2593,12 @@ declare class MainVideoContainerSetting {
|
|
|
2530
2593
|
setUserListButtonParams(position?: Position, visibility?: boolean): void;
|
|
2531
2594
|
}
|
|
2532
2595
|
//#endregion
|
|
2533
|
-
//#region src/
|
|
2596
|
+
//#region src/AppReactNativeSDK.d.ts
|
|
2534
2597
|
interface AppProps extends Partial<ConfigStateMobile & ConfigStateBoth> {
|
|
2535
2598
|
callToken: string;
|
|
2536
|
-
|
|
2599
|
+
sessionSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
|
|
2537
2600
|
}
|
|
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>;
|
|
2601
|
+
declare function AppReactNativeSDK(props: AppProps): React.JSX.Element;
|
|
2552
2602
|
//#endregion
|
|
2553
2603
|
//#region src/v4/models/ListnerHandler.d.ts
|
|
2554
2604
|
interface IMultiOngoingCallListener extends OngoingCallListener {
|
|
@@ -3895,7 +3945,13 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
3895
3945
|
static OngoingCallListener: typeof OngoingCallListener;
|
|
3896
3946
|
static CallSettingsBuilder: typeof CallSettingsBuilder;
|
|
3897
3947
|
static CallAppSettingsBuilder: typeof CallAppSettingsBuilder;
|
|
3898
|
-
static Component: typeof
|
|
3948
|
+
static Component: typeof AppReactNativeSDK;
|
|
3949
|
+
/**
|
|
3950
|
+
* Initializes the CometChat Calls SDK with the provided app settings.
|
|
3951
|
+
* Must be called before any other SDK methods.
|
|
3952
|
+
* @param appSettings - The application settings for configuring the SDK.
|
|
3953
|
+
* @returns An object indicating success or failure with error details.
|
|
3954
|
+
*/
|
|
3899
3955
|
static init(appSettings: CallAppSettings | CallAppSettings$1): Promise<{
|
|
3900
3956
|
readonly success: false;
|
|
3901
3957
|
readonly error: {
|
|
@@ -3907,14 +3963,62 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
3907
3963
|
readonly success: true;
|
|
3908
3964
|
readonly error: null;
|
|
3909
3965
|
}>;
|
|
3966
|
+
/**
|
|
3967
|
+
* Logs in a user with their UID and an optional auth key.
|
|
3968
|
+
* If no auth key is provided, the one from app settings is used.
|
|
3969
|
+
* @param uid - The unique identifier of the user.
|
|
3970
|
+
* @param authKey - The authentication key. Falls back to the key provided in app settings.
|
|
3971
|
+
* @returns A Promise that resolves to the logged-in User object.
|
|
3972
|
+
* @throws {CometChatException} If login fails or validation errors occur.
|
|
3973
|
+
*/
|
|
3910
3974
|
static login(uid: string, authKey?: string): Promise<User>;
|
|
3975
|
+
/**
|
|
3976
|
+
* Logs in a user directly with an auth token.
|
|
3977
|
+
* @param authToken - The authentication token for the user.
|
|
3978
|
+
* @returns A Promise that resolves to the logged-in User object.
|
|
3979
|
+
* @throws {CometChatException} If login fails or the token is invalid.
|
|
3980
|
+
*/
|
|
3911
3981
|
static loginWithAuthToken(authToken: string): Promise<User>;
|
|
3982
|
+
/**
|
|
3983
|
+
* Logs out the currently logged-in user and clears local session data.
|
|
3984
|
+
* @returns A Promise that resolves to a success message string.
|
|
3985
|
+
* @throws {CometChatException} If no user is logged in or logout fails.
|
|
3986
|
+
*/
|
|
3912
3987
|
static logout(): Promise<string>;
|
|
3988
|
+
/**
|
|
3989
|
+
* Retrieves the currently logged-in user.
|
|
3990
|
+
* @returns The logged-in User object, or null if no user is logged in.
|
|
3991
|
+
*/
|
|
3913
3992
|
static getLoggedInUser(): User | null;
|
|
3993
|
+
/**
|
|
3994
|
+
* Retrieves the auth token of the currently logged-in user.
|
|
3995
|
+
* @returns The auth token string, or null if no user is logged in.
|
|
3996
|
+
*/
|
|
3914
3997
|
static getUserAuthToken(): string | null;
|
|
3998
|
+
/**
|
|
3999
|
+
* Checks whether a user is currently logged in.
|
|
4000
|
+
* @returns True if a user is logged in with a valid auth token, false otherwise.
|
|
4001
|
+
*/
|
|
3915
4002
|
static isUserLoggedIn(): boolean;
|
|
4003
|
+
/**
|
|
4004
|
+
* Registers a login listener to receive login/logout lifecycle callbacks.
|
|
4005
|
+
* @param listenerId - A unique identifier for the listener.
|
|
4006
|
+
* @param listener - The listener object with callback methods.
|
|
4007
|
+
*/
|
|
3916
4008
|
static addLoginListener(listenerId: string, listener: LoginListener): void;
|
|
4009
|
+
/**
|
|
4010
|
+
* Removes a previously registered login listener.
|
|
4011
|
+
* @param listenerId - The unique identifier of the listener to remove.
|
|
4012
|
+
*/
|
|
3917
4013
|
static removeLoginListener(listenerId: string): void;
|
|
4014
|
+
/**
|
|
4015
|
+
* Generates a call token for the given session.
|
|
4016
|
+
* Uses the provided auth token or falls back to the logged-in user's token.
|
|
4017
|
+
* @param sessionId - The session ID to generate a token for.
|
|
4018
|
+
* @param authToken - Optional auth token. If omitted, the logged-in user's token is used.
|
|
4019
|
+
* @returns A Promise that resolves to an object containing the generated token.
|
|
4020
|
+
* @throws {CometChatException} If the session ID is missing, no auth token is available, or the SDK is not initialized.
|
|
4021
|
+
*/
|
|
3918
4022
|
static generateToken(sessionId: string, authToken?: string): Promise<{
|
|
3919
4023
|
token: string;
|
|
3920
4024
|
}>;
|
|
@@ -3933,7 +4037,24 @@ declare class CometChatCalls extends SessionMethodsCore {
|
|
|
3933
4037
|
private static notifyLoginFailure;
|
|
3934
4038
|
private static notifyLogoutSuccess;
|
|
3935
4039
|
private static notifyLogoutFailure;
|
|
3936
|
-
|
|
4040
|
+
/**
|
|
4041
|
+
* Adds an event listener for SDK events.
|
|
4042
|
+
* @param eventType - The type of event to listen for.
|
|
4043
|
+
* @param listener - The callback function to invoke when the event fires.
|
|
4044
|
+
* @param options - Optional configuration including an AbortSignal for automatic cleanup.
|
|
4045
|
+
* @returns An unsubscribe function to remove the listener.
|
|
4046
|
+
*/
|
|
4047
|
+
static addEventListener<K$1 extends keyof MobileSDKEvents>(eventType: K$1, listener: MobileSDKEvents[K$1], options?: {
|
|
4048
|
+
signal?: AbortSignal;
|
|
4049
|
+
}): () => void;
|
|
4050
|
+
/**
|
|
4051
|
+
* Enables Picture-in-Picture (PIP) layout during the call.
|
|
4052
|
+
*/
|
|
4053
|
+
static enablePictureInPictureLayout(): void;
|
|
4054
|
+
/**
|
|
4055
|
+
* Disables Picture-in-Picture (PIP) layout.
|
|
4056
|
+
*/
|
|
4057
|
+
static disablePictureInPictureLayout(): void;
|
|
3937
4058
|
}
|
|
3938
4059
|
//#endregion
|
|
3939
4060
|
export { CometChatCalls };
|