@cometchat/calls-sdk-react-native 4.0.0-beta1

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.
Files changed (50) hide show
  1. package/README.md +27 -0
  2. package/android/build.gradle +20 -0
  3. package/android/src/main/AndroidManifest.xml +8 -0
  4. package/android/src/main/java/com/CometChatCalls/AudioDeviceHandlerGeneric.java +213 -0
  5. package/android/src/main/java/com/CometChatCalls/AudioDeviceHandlerLegacy.java +213 -0
  6. package/android/src/main/java/com/CometChatCalls/AudioModeModule.java +456 -0
  7. package/android/src/main/java/com/CometChatCalls/BluetoothHeadsetMonitor.java +174 -0
  8. package/android/src/main/java/com/CometChatCalls/CometChatCallsPackage.java +45 -0
  9. package/cometchat-calls-sdk-react-native.podspec +21 -0
  10. package/dist/CometChatErrorConstants.d.ts +124 -0
  11. package/dist/Constants.d.ts +720 -0
  12. package/dist/Helper copy.d.ts +1 -0
  13. package/dist/Helper.d.ts +7 -0
  14. package/dist/api/APIHandler.d.ts +6 -0
  15. package/dist/api/endpoints.d.ts +6 -0
  16. package/dist/api/helper.d.ts +63 -0
  17. package/dist/api/index.d.ts +2 -0
  18. package/dist/constants/CallConstants.d.ts +136 -0
  19. package/dist/constants/index.d.ts +1 -0
  20. package/dist/defaultCallsettings.d.ts +2 -0
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.js +128 -0
  23. package/dist/models/CallAppSettings.d.ts +42 -0
  24. package/dist/models/CallSettings.d.ts +316 -0
  25. package/dist/models/CometChatCalls.d.ts +89 -0
  26. package/dist/models/CometChatCallsComponent.d.ts +13 -0
  27. package/dist/models/CometChatCallsComponentCore.d.ts +18 -0
  28. package/dist/models/CometChatCallsException.d.ts +7 -0
  29. package/dist/models/CometChatPresenterComponent.d.ts +13 -0
  30. package/dist/models/ErrorModel.d.ts +11 -0
  31. package/dist/models/Listner.d.ts +64 -0
  32. package/dist/models/ListnerHandler.d.ts +10 -0
  33. package/dist/models/MessageComponent.d.ts +7 -0
  34. package/dist/models/PresenterSettings.d.ts +194 -0
  35. package/dist/models/RTCUser.d.ts +18 -0
  36. package/dist/models/index.d.ts +7 -0
  37. package/dist/types/ICallAppSettings.d.ts +6 -0
  38. package/dist/types/ICallSettings.d.ts +60 -0
  39. package/dist/types/RTCUser.d.ts +6 -0
  40. package/dist/types/callEvents.d.ts +53 -0
  41. package/dist/types/common.d.ts +17 -0
  42. package/dist/types/index.d.ts +2 -0
  43. package/ios/AudioMode.h +11 -0
  44. package/ios/AudioMode.m +403 -0
  45. package/ios/JitsiAudioSession+Private.h +25 -0
  46. package/ios/JitsiAudioSession.h +17 -0
  47. package/ios/JitsiAudioSession.m +34 -0
  48. package/ios/LogUtils.h +23 -0
  49. package/ios/react-native-calls2.xcodeproj/project.pbxproj +269 -0
  50. package/package.json +122 -0
@@ -0,0 +1,42 @@
1
+ import { Host, Region } from '../types/common';
2
+ export declare class CallAppSettings {
3
+ private appId;
4
+ private region;
5
+ private host?;
6
+ constructor(builder?: CallAppSettingsBuilder);
7
+ setAppId(appId: string): this;
8
+ setRegion(region: Region): this;
9
+ setHost(host: Host): this;
10
+ getAppId(): string;
11
+ getRegion(): Region;
12
+ getHost(): Host;
13
+ }
14
+ export declare class CallAppSettingsBuilder {
15
+ appId: string;
16
+ region: Region;
17
+ host?: Host;
18
+ /**
19
+ * Method to set appId of the app.
20
+ * @param {string} appId appId of the app
21
+ * @returns
22
+ */
23
+ setAppId(appId: string): this;
24
+ /**
25
+ * Method to set region of the app.
26
+ * @param {Region} region region of the app.
27
+ * @returns {void}
28
+ */
29
+ setRegion(region: Region): this;
30
+ /**
31
+ * Method to set host/domain of the app.
32
+ * @param {string} host host/domain of the app.
33
+ * @returns {void}
34
+ */
35
+ setHost(host: Host): this;
36
+ /**
37
+ * This method will return an object of the CallsAppSettings class.
38
+ * @returns {CallAppSettings} Returns the CallsAppSettings instance
39
+ */
40
+ build(): CallAppSettings;
41
+ }
42
+ export declare function validateCallAppSettings(appSettings: CallAppSettings): Promise<true>;
@@ -0,0 +1,316 @@
1
+ import { OngoingCallListener } from './Listner';
2
+ import { CallConstants } from '../Constants';
3
+ import { AspectRatio, Position } from '../types/common';
4
+ export declare class CallSettings {
5
+ static readonly POSITION_TOP_LEFT = "top-left";
6
+ static readonly POSITION_TOP_RIGHT = "top-right";
7
+ static readonly POSITION_BOTTOM_LEFT = "bottom-left";
8
+ static readonly POSITION_BOTTOM_RIGHT = "bottom-right";
9
+ static readonly ASPECT_RATIO_DEFAULT = "default";
10
+ static readonly ASPECT_RATIO_CONTAIN = "contain";
11
+ static readonly ASPECT_RATIO_COVER = "cover";
12
+ static readonly POSITION: {
13
+ readonly TOP_LEFT: "top-left";
14
+ readonly TOP_RIGHT: "top-right";
15
+ readonly BOTTOM_LEFT: "bottom-left";
16
+ readonly BOTTOM_RIGHT: "bottom-right";
17
+ };
18
+ static readonly ASPECT_RATIO: {
19
+ readonly DEFAULT: "default";
20
+ readonly CONTAIN: "contain";
21
+ readonly COVER: "cover";
22
+ };
23
+ private defaultLayout;
24
+ private isAudioOnly;
25
+ private listener;
26
+ private mode;
27
+ private ShowEndCallButton;
28
+ private ShowSwitchCameraButton;
29
+ private ShowMuteAudioButton;
30
+ private ShowPauseVideoButton;
31
+ private ShowAudioModeButton;
32
+ private StartAudioMuted;
33
+ private StartVideoMuted;
34
+ private defaultAudioMode;
35
+ private ShowSwitchToVideoCallButton;
36
+ private AvatarMode;
37
+ private ShowRecordingButton;
38
+ private StartRecordingOnCallStart;
39
+ private MainVideoContainerSetting;
40
+ private EnableVideoTileClick;
41
+ private enableDraggableVideoTile;
42
+ constructor(builder: CallSettingsBuilder);
43
+ isAudioOnlyCall(): boolean;
44
+ isDefaultLayoutEnabled(): boolean;
45
+ getCallEventListener(): OngoingCallListener;
46
+ getMode(): string;
47
+ isEndCallButtonEnabled(): boolean;
48
+ isSwitchCameraButtonEnabled(): boolean;
49
+ isMuteAudioButtonEnabled(): boolean;
50
+ isPauseVideoButtonEnabled(): boolean;
51
+ isAudioModeButtonEnabled(): boolean;
52
+ getStartWithAudioMuted(): boolean;
53
+ getStartWithVideoMuted(): boolean;
54
+ getDefaultAudioMode(): string;
55
+ isAudioToVideoButtonEnabled(): boolean;
56
+ getAvatarMode(): string;
57
+ isRecordingButtonEnabled(): boolean;
58
+ shouldStartRecordingOnCallStart(): boolean;
59
+ getMainVideoContainerSetting(): MainVideoContainerSetting;
60
+ isVideoTileClickEnabled(): boolean;
61
+ isVideoTileDragEnabled(): boolean;
62
+ }
63
+ type CallModes = typeof CallConstants.CALL_MODE[keyof typeof CallConstants.CALL_MODE];
64
+ export declare class CallSettingsBuilder {
65
+ /** @private */ defaultLayout: boolean;
66
+ /** @private */ isAudioOnly: boolean;
67
+ /** @private */ listener: OngoingCallListener;
68
+ /** @private */ mode: CallModes;
69
+ /** @private */ ShowEndCallButton: boolean;
70
+ /** @private */ ShowSwitchCameraButton: boolean;
71
+ /** @private */ ShowMuteAudioButton: boolean;
72
+ /** @private */ ShowPauseVideoButton: boolean;
73
+ /** @private */ ShowAudioModeButton: boolean;
74
+ /** @private */ StartAudioMuted: boolean;
75
+ /** @private */ StartVideoMuted: boolean;
76
+ /** @private */ defaultAudioMode: typeof CallConstants.AUDIO_MODE[keyof typeof CallConstants.AUDIO_MODE];
77
+ /** @private */ ShowSwitchToVideoCallButton: boolean;
78
+ /** @private */ AvatarMode: string;
79
+ /** @private */ ShowRecordingButton: boolean;
80
+ /** @private */ StartRecordingOnCallStart: boolean;
81
+ /** @private */ MainVideoContainerSetting: MainVideoContainerSetting;
82
+ /** @private */ EnableVideoTileClick: boolean;
83
+ /** @private */ enableDraggableVideoTile: boolean;
84
+ /**
85
+ *
86
+ * @param {boolean} defaultLayout
87
+ * This methods shows/hides the default button layout.
88
+ * If set to true the default button layout will be shown.
89
+ * If set to false the default button layout will be hidden.
90
+ * Default value is true
91
+ * @returns
92
+ */
93
+ enableDefaultLayout(defaultLayout: boolean): this;
94
+ /**
95
+ *
96
+ * @param {boolean} isAudioOnly
97
+ * This methods sets the type(audio/video) of the call.
98
+ * If set to true, the call will be strictly an audio call.
99
+ * If set to false, the call will be an audio-video call.
100
+ * Default value is false
101
+ * @returns
102
+ */
103
+ setIsAudioOnlyCall(isAudioOnly: boolean): this;
104
+ /**
105
+ *
106
+ * @param {OngoingCallListener} listener
107
+ * This method sets the call event listener.
108
+ * @returns
109
+ */
110
+ setCallEventListener(listener: OngoingCallListener): this;
111
+ /**
112
+ *
113
+ * @param {string} mode
114
+ * This method sets the mode of the call.
115
+ * @returns
116
+ */
117
+ setMode(mode: CallModes): this;
118
+ /**
119
+ *
120
+ * @param {boolean} showEndCallButton
121
+ * This method shows/hides the end call button.
122
+ * If set to true it will display the end call button.
123
+ * If set to false it will hide the end call button.
124
+ * Default value is true.
125
+ * @returns
126
+ */
127
+ showEndCallButton(showEndCallButton?: boolean): this;
128
+ /**
129
+ *
130
+ * @param {boolean} showSwitchCameraButton
131
+ * This method shows/hides the switch camera button.
132
+ * If set to true it will display the switch camera button.
133
+ * If set to false it will hide the switch camera button.
134
+ * Note: For video call it remains hidden regardless of its value.
135
+ * Default value is true.
136
+ * @returns
137
+ */
138
+ showSwitchCameraButton(showSwitchCameraButton?: boolean): this;
139
+ /**
140
+ *
141
+ * @param {boolean} showMuteAudioButton
142
+ * This method shows/hides the mute audio button.
143
+ * If set to true it will display the mute audio button.
144
+ * If set to false it will hide the mute audio button.
145
+ * Default value is true.
146
+ * @returns
147
+ */
148
+ showMuteAudioButton(showMuteAudioButton?: boolean): this;
149
+ /**
150
+ *
151
+ * @param {boolean} showPauseVideoButton
152
+ * This method shows/hides the pause video button.
153
+ * If set to true it will display the pause video button.
154
+ * If set to false it will hide the pause video button.
155
+ * Note: For video call it remains hidden regardless of its value.
156
+ * Default value is true.
157
+ * @returns
158
+ */
159
+ showPauseVideoButton(showPauseVideoButton?: boolean): this;
160
+ /**
161
+ *
162
+ * @param {boolean} showAudioModeButton
163
+ * This method shows/hides the audio mode button.
164
+ * If set to true it will display the audio mode button.
165
+ * If set to false it will hide the audio mode button.
166
+ * Default value is true.
167
+ * @returns
168
+ */
169
+ showAudioModeButton(showAudioModeButton?: boolean): this;
170
+ /**
171
+ *
172
+ * @param {boolean} audioMuted
173
+ * This method allows the call to be started with audio muted.
174
+ * If set to true, the call will start with audio muted.
175
+ * Default value is false.
176
+ * @returns
177
+ */
178
+ startWithAudioMuted(audioMuted?: boolean): this;
179
+ /**
180
+ *
181
+ * @param {boolean} videoMuted
182
+ * This method allows the call to be started with video muted.
183
+ * If set to true, the call will start with video muted.
184
+ * Note: This method has no effect for audio calls.
185
+ * Default value is false.
186
+ * @returns
187
+ */
188
+ startWithVideoMuted(videoMuted?: boolean): this;
189
+ /**
190
+ *
191
+ * @param {string} audioMode
192
+ * This method will set the default audio mode.
193
+ * @returns
194
+ */
195
+ setDefaultAudioMode(audioMode: typeof CallConstants.AUDIO_MODE[keyof typeof CallConstants.AUDIO_MODE]): this;
196
+ /**
197
+ *
198
+ * @param {boolean} showAudioToVideoSwitchButton
199
+ * This method shows/hides the switch to video call button.
200
+ * If set to true it will display the switch to video call button.
201
+ * If set to false it will hide the switch to video call button.
202
+ * Note: For video call it remains hidden regardless of its value.
203
+ * Default value is true.
204
+ * @returns
205
+ */
206
+ showSwitchToVideoCallButton(showAudioToVideoSwitchButton?: boolean): this;
207
+ /**
208
+ *
209
+ * @param {string} mode
210
+ * This method sets the mode of avatar.
211
+ * The avatar mode can be circle, square or fullscreen.
212
+ * Default value is circle.
213
+ * @returns
214
+ */
215
+ setAvatarMode(mode?: 'circle' | 'square' | 'fullscreen'): this;
216
+ /**
217
+ *
218
+ * @param {boolean} showRecordingButton
219
+ * This method shows/hides the recording button.
220
+ * If set to true it will display the recording button.
221
+ * If set to false it will hide the recording button.
222
+ * Default value is false.
223
+ * @returns
224
+ */
225
+ showRecordingButton(showRecordingButton?: boolean): this;
226
+ /**
227
+ *
228
+ * @param {boolean} startRecordingOnCallStart
229
+ * This method starts the recording as soon as the call start.
230
+ * If set to true it will start the recording as soon as the call start.
231
+ * Default value is false.
232
+ * @returns
233
+ */
234
+ startRecordingOnCallStart(startRecordingOnCallStart?: boolean): this;
235
+ /**
236
+ *
237
+ * @param {MainVideoContainerSetting} mainVideoContainerSetting
238
+ * This method can be used to customize the main video container.
239
+ * @returns
240
+ */
241
+ setMainVideoContainerSetting(mainVideoContainerSetting: MainVideoContainerSetting): this;
242
+ /**
243
+ *
244
+ * @param {boolean} enableVideoTileClick
245
+ * This method can be used to enable/disable video tile click functionality in Spotlight mode.
246
+ * By default the video tile is clickable.
247
+ * @returns
248
+ */
249
+ enableVideoTileClick(enableVideoTileClick?: boolean): this;
250
+ /**
251
+ *
252
+ * @param {boolean} enableVideoTileDrag
253
+ * This method can be used to enable/disable video tile drag functionality in Spotlight mode.
254
+ * By default the video tile is draggable.
255
+ * @returns
256
+ */
257
+ enableVideoTileDrag(enableVideoTileDrag?: boolean): this;
258
+ /**
259
+ * This method will return an object of the CallSettings class.
260
+ * @returns {CallSettings}
261
+ */
262
+ build(): CallSettings;
263
+ }
264
+ export declare class MainVideoContainerSetting {
265
+ private videoFit;
266
+ private zoomButton;
267
+ private fullScreenButton;
268
+ private userListButton;
269
+ private nameLabel;
270
+ /**
271
+ *
272
+ * @param {string} mainVideoAspectRatio
273
+ * This method is used to set the aspect ratio of main video.
274
+ * The default value is `contain`.
275
+ * @returns
276
+ */
277
+ setMainVideoAspectRatio(mainVideoAspectRatio?: AspectRatio): void;
278
+ /**
279
+ *
280
+ * @param {Position} position
281
+ * @param {boolean} visibility
282
+ * This method is used to set the position & visibility parameter of the full screen button.
283
+ * By default the full screen button is visible in the `bottom-right` position.
284
+ * @returns
285
+ */
286
+ setFullScreenButtonParams(position?: Position, visibility?: boolean): void;
287
+ /**
288
+ *
289
+ * @param {Position} position
290
+ * @param {boolean} visibility
291
+ * @param {string} backgroundColor
292
+ * This method is used to set the position, visibility & background color of the name label.
293
+ * By default the name label is visible in the `bottom-left` position with a background-color `#333333`
294
+ * @returns
295
+ */
296
+ setNameLabelParams(position?: Position, visibility?: boolean, backgroundColor?: string): void;
297
+ /**
298
+ *
299
+ * @param {Position} position
300
+ * @param {boolean} visibility
301
+ * This method is used to set the position & visibility parameter of the zoom button.
302
+ * By default the zoom button is visible in the `bottom-right` position.
303
+ * @returns
304
+ */
305
+ setZoomButtonParams(position?: Position, visibility?: boolean): void;
306
+ /**
307
+ *
308
+ * @param {Position} position
309
+ * @param {boolean} visibility
310
+ * This method is used to set the position & visibility parameter of the user list button.
311
+ * By default the user list button is visible in the `bottom-right` position.
312
+ * @returns
313
+ */
314
+ setUserListButtonParams(position?: Position, visibility?: boolean): void;
315
+ }
316
+ export {};
@@ -0,0 +1,89 @@
1
+ import { ListenerHandlers } from './ListnerHandler';
2
+ import { AudioMode } from '../types/common';
3
+ import { CallAppSettings, CallAppSettingsBuilder } from './CallAppSettings';
4
+ import { CallSettings, CallSettingsBuilder } from './CallSettings';
5
+ import { CometChatCallsComponentCore as CometChatCallsComponent } from './CometChatCallsComponentCore';
6
+ import { CometChatPresenterComponent } from './CometChatPresenterComponent';
7
+ import { OngoingCallListener } from './Listner';
8
+ import { PresenterSettings, PresenterSettingsBuilder } from './PresenterSettings';
9
+ export declare class CometChatCalls {
10
+ private static appSettings;
11
+ static CALL_MODE: {
12
+ readonly DEFAULT: "DEFAULT";
13
+ readonly SPOTLIGHT: "SPOTLIGHT";
14
+ };
15
+ static AUDIO_MODE: {
16
+ readonly SPEAKER: "SPEAKER";
17
+ readonly EARPIECE: "EARPIECE";
18
+ readonly BLUETOOTH: "BLUETOOTH";
19
+ readonly HEADPHONES: "HEADPHONES";
20
+ };
21
+ static addCallEventListener: typeof ListenerHandlers.addCallEventListener;
22
+ static removeCallEventListener: typeof ListenerHandlers.removeCallEventListener;
23
+ static OngoingCallListener: typeof OngoingCallListener;
24
+ static CallSettingsBuilder: typeof CallSettingsBuilder;
25
+ static CallSettings: typeof CallSettings;
26
+ static PresenterSettingsBuilder: typeof PresenterSettingsBuilder;
27
+ static PresenterSettings: typeof PresenterSettings;
28
+ static CallAppSettingsBuilder: typeof CallAppSettingsBuilder;
29
+ static CallAppSettings: typeof CallAppSettings;
30
+ static Component: typeof CometChatCallsComponent;
31
+ static PresenterComponent: typeof CometChatPresenterComponent;
32
+ static generateToken(sessionID: string, authToken: string): Promise<{
33
+ token: string;
34
+ }>;
35
+ static init(appSettings: CallAppSettings): Promise<void>;
36
+ /**
37
+ * Method end on-going call.
38
+ * @returns {void}
39
+ */
40
+ static endCall(): void;
41
+ /**
42
+ * Method to mute/unmute audio stream.
43
+ * @param {boolean} muteAudio
44
+ * @returns {void}
45
+ */
46
+ static muteAudio(muteAudio: boolean): void;
47
+ /**
48
+ * Method to pause/unpause video stream.
49
+ * @param {boolean} pauseVideo
50
+ * @returns {void}
51
+ */
52
+ static pauseVideo(pauseVideo: boolean): void;
53
+ /**
54
+ * Method to resume video stream.
55
+ * @returns {void}
56
+ */
57
+ static resumeVideo(): void;
58
+ /**
59
+ * Method to set audio mode.
60
+ * @param {string} mode
61
+ * @returns {void}
62
+ */
63
+ static setAudioMode(mode: string): void;
64
+ /**
65
+ * Method to switch camera.
66
+ * @returns {void}
67
+ */
68
+ static switchCamera(): void;
69
+ /**
70
+ * Method to get all the available audio output devices.
71
+ * @returns {Promise<AudioMode[]>}
72
+ */
73
+ static getAudioOutputModes(): Promise<AudioMode[]>;
74
+ /**
75
+ * Method to switch from audio call to video call.
76
+ * @returns {void}
77
+ */
78
+ static switchToVideoCall(): void;
79
+ /**
80
+ * Method to Start Call Recording.
81
+ * @returns {void}
82
+ */
83
+ static startRecording(): void;
84
+ /**
85
+ * Method to Stop Call Recording.
86
+ * @returns {void}
87
+ */
88
+ static stopRecording(): void;
89
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { CallSettings } from './CallSettings';
3
+ type MyState = {
4
+ errored: boolean;
5
+ };
6
+ export declare class CometChatCallsComponent extends React.Component<{
7
+ callSettings: CallSettings;
8
+ callToken: string;
9
+ }, MyState> {
10
+ constructor(props: any);
11
+ render(): JSX.Element;
12
+ }
13
+ export {};
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { CallSettings } from './CallSettings';
3
+ import { PresenterSettings } from './PresenterSettings';
4
+ type MyState = {
5
+ shouldLoad: boolean;
6
+ errored: boolean;
7
+ };
8
+ export declare class CometChatCallsComponentCore extends React.Component<{
9
+ callSettings: CallSettings | PresenterSettings;
10
+ callToken: string;
11
+ presenterMode?: boolean;
12
+ }, MyState> {
13
+ static ref: any;
14
+ callsettings: CallSettings | PresenterSettings;
15
+ constructor(props: any);
16
+ render(): JSX.Element;
17
+ }
18
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ErrorModel } from "./ErrorModel";
2
+ export declare class CometChatCallsException {
3
+ code: ErrorModel["code"];
4
+ message?: ErrorModel["message"];
5
+ details?: ErrorModel["details"];
6
+ constructor(errorModel: ErrorModel);
7
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { PresenterSettings } from './PresenterSettings';
3
+ type MyState = {
4
+ errored: boolean;
5
+ };
6
+ export declare class CometChatPresenterComponent extends React.Component<{
7
+ presenterSettings: PresenterSettings;
8
+ callToken: string;
9
+ }, MyState> {
10
+ constructor(props: any);
11
+ render(): JSX.Element;
12
+ }
13
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ *
3
+ *
4
+ * @export
5
+ * @interface ErrorModel
6
+ */
7
+ export interface ErrorModel {
8
+ code: string | number;
9
+ message?: string;
10
+ details?: string;
11
+ }
@@ -0,0 +1,64 @@
1
+ import { ICallEventsData } from '../types/callEvents';
2
+ import { CometChatCallsException } from './CometChatCallsException';
3
+ interface IOngoingCallListener {
4
+ onUserJoined: (user: Partial<ICallEventsData['onUserJoined']>) => void;
5
+ onUserLeft: (user: Partial<ICallEventsData['onUserLeft']>) => void;
6
+ onUserListUpdated: (userList: Partial<ICallEventsData['onUserListUpdated']>) => void;
7
+ onMediaDeviceListUpdated: (devices: Partial<ICallEventsData['onMediaDeviceListUpdated']>) => void;
8
+ onRecordingStarted: (data: Partial<ICallEventsData['onRecordingStarted']>) => void;
9
+ onRecordingStopped: (data: Partial<ICallEventsData['onRecordingStopped']>) => void;
10
+ onUserMuted: (test: Partial<ICallEventsData["onUserMuted"]>) => void;
11
+ onCallSwitchedToVideo: (data: Partial<ICallEventsData['onCallSwitchedToVideo']>) => void;
12
+ onCallEnded: () => void;
13
+ onCallEndButtonPressed: () => void;
14
+ onAudioModesUpdated: (any: any) => void;
15
+ onError: (error: CometChatCallsException) => void;
16
+ }
17
+ export declare class OngoingCallListener {
18
+ /**
19
+ * This event is triggered when a user joins the call.
20
+ */
21
+ onUserJoined?: IOngoingCallListener["onUserJoined"];
22
+ /**
23
+ * This event is triggered when a user leaves the call.
24
+ */
25
+ onUserLeft?: IOngoingCallListener["onUserLeft"];
26
+ /**
27
+ * This event is triggered when the participant list of the call changes.
28
+ */
29
+ onUserListUpdated?: IOngoingCallListener["onUserListUpdated"];
30
+ /**
31
+ * This event is triggered when an audio mode is updated.
32
+ */
33
+ onAudioModesUpdated?: IOngoingCallListener["onAudioModesUpdated"];
34
+ /**
35
+ * This event is triggered when the call is ended.
36
+ */
37
+ onCallEnded?: IOngoingCallListener["onCallEnded"];
38
+ /**
39
+ * This event is triggered when end call button is pressed.
40
+ */
41
+ onCallEndButtonPressed?: IOngoingCallListener["onCallEndButtonPressed"];
42
+ /**
43
+ * This event is triggered when an error occurs.
44
+ */
45
+ onError?: IOngoingCallListener["onError"];
46
+ /**
47
+ * This event is triggered when someone starts recording the call.
48
+ */
49
+ onRecordingStarted?: IOngoingCallListener["onRecordingStarted"];
50
+ /**
51
+ * This event is triggered when someone stops recording the call.
52
+ */
53
+ onRecordingStopped?: IOngoingCallListener["onRecordingStopped"];
54
+ /**
55
+ * This event is triggered when a user is muted.
56
+ */
57
+ onUserMuted?: IOngoingCallListener["onUserMuted"];
58
+ /**
59
+ * This event is triggered when an audio call is switched to a video call.
60
+ */
61
+ onCallSwitchedToVideo?: IOngoingCallListener["onCallSwitchedToVideo"];
62
+ constructor(eventObj: Partial<IOngoingCallListener>);
63
+ }
64
+ export {};
@@ -0,0 +1,10 @@
1
+ import { OngoingCallListener } from './Listner';
2
+ interface IMultiOngoingCallListener extends OngoingCallListener {
3
+ _name: string;
4
+ }
5
+ export declare class ListenerHandlers {
6
+ static callHandlers?: IMultiOngoingCallListener[];
7
+ static addCallEventListener(name: string, callListener: OngoingCallListener): void;
8
+ static removeCallEventListener(handler: string): void;
9
+ }
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare class MessageComponent extends React.Component<{
3
+ message: string;
4
+ }> {
5
+ constructor(props: any);
6
+ render(): JSX.Element;
7
+ }