@cometchat/calls-sdk-javascript 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.
- package/README.md +27 -0
- package/pack/Helper.d.ts +5 -0
- package/pack/api/APIHandler.d.ts +6 -0
- package/pack/api/endpoints.d.ts +6 -0
- package/pack/api/helper.d.ts +63 -0
- package/pack/api/index.d.ts +2 -0
- package/pack/constants/CallConstants.d.ts +215 -0
- package/pack/constants/index.d.ts +1 -0
- package/pack/defaultCallsettings.d.ts +2 -0
- package/pack/index.d.ts +1 -0
- package/pack/index.js +2 -0
- package/pack/index.js.LICENSE.txt +1 -0
- package/pack/models/CallSettings.d.ts +382 -0
- package/pack/models/CallsAppSettings.d.ts +41 -0
- package/pack/models/CometChatCalls.d.ts +159 -0
- package/pack/models/CometChatCallsException.d.ts +8 -0
- package/pack/models/ErrorModel.d.ts +12 -0
- package/pack/models/Listener.d.ts +81 -0
- package/pack/models/ListnerHandler.d.ts +10 -0
- package/pack/models/PresenterSettings.d.ts +265 -0
- package/pack/models/RTCUser.d.ts +18 -0
- package/pack/models/index.d.ts +9 -0
- package/pack/types/ICallSettings.d.ts +61 -0
- package/pack/types/ICallsAppSettings.d.ts +6 -0
- package/pack/types/RTCUser.d.ts +6 -0
- package/pack/types/callEvents.d.ts +87 -0
- package/pack/types/common.d.ts +14 -0
- package/pack/types/index.d.ts +2 -0
- package/pack/util/parseJwt.d.ts +1 -0
- package/pack/util/verifyCallSettings.d.ts +4 -0
- package/package.json +31 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { ICallsettings } from "../types";
|
|
2
|
+
import { OngoingCallListener } from "./Listener";
|
|
3
|
+
export declare class CallSettings {
|
|
4
|
+
static POSITION_TOP_LEFT: string;
|
|
5
|
+
static POSITION_TOP_RIGHT: string;
|
|
6
|
+
static POSITION_BOTTOM_LEFT: string;
|
|
7
|
+
static POSITION_BOTTOM_RIGHT: string;
|
|
8
|
+
static POSITION: {
|
|
9
|
+
readonly TOP_LEFT: "top-left";
|
|
10
|
+
readonly TOP_RIGHT: "top-right";
|
|
11
|
+
readonly BOTTOM_LEFT: "bottom-left";
|
|
12
|
+
readonly BOTTOM_RIGHT: "bottom-right";
|
|
13
|
+
};
|
|
14
|
+
static ASPECT_RATIO_DEFAULT: string;
|
|
15
|
+
static ASPECT_RATIO_CONTAIN: string;
|
|
16
|
+
static ASPECT_RATIO_COVER: string;
|
|
17
|
+
static ASPECT_RATIO: {
|
|
18
|
+
readonly DEFAULT: "default";
|
|
19
|
+
readonly CONTAIN: "contain";
|
|
20
|
+
readonly COVER: "cover";
|
|
21
|
+
};
|
|
22
|
+
private defaultLayout;
|
|
23
|
+
private isAudioOnly;
|
|
24
|
+
private mode;
|
|
25
|
+
private ShowEndCallButton;
|
|
26
|
+
private ShowMuteAudioButton;
|
|
27
|
+
private ShowPauseVideoButton;
|
|
28
|
+
private ShowScreenShareButton;
|
|
29
|
+
private ShowSwitchModeButton;
|
|
30
|
+
private StartAudioMuted;
|
|
31
|
+
private StartVideoMuted;
|
|
32
|
+
private localizedObject;
|
|
33
|
+
private analyticsSettings;
|
|
34
|
+
private customCSS;
|
|
35
|
+
private ShowRecordingButton;
|
|
36
|
+
private StartRecordingOnCallStart;
|
|
37
|
+
private callListener;
|
|
38
|
+
private ShowSwitchToVideoCallButton;
|
|
39
|
+
private VirtualBackground;
|
|
40
|
+
private ShowVirtualBackgroundSetting;
|
|
41
|
+
private MainVideoContainerSetting;
|
|
42
|
+
constructor(builder?: CallSettingsBuilder);
|
|
43
|
+
getCallListener(): OngoingCallListener;
|
|
44
|
+
isRecordingButtonEnabled(): boolean;
|
|
45
|
+
shouldStartRecordingOnCallStart(): boolean;
|
|
46
|
+
getCustomCSS(): string;
|
|
47
|
+
isAudioOnlyCall(): boolean;
|
|
48
|
+
isDefaultLayoutEnabled(): boolean;
|
|
49
|
+
getMode(): "DEFAULT" | "SPOTLIGHT" | "TILE";
|
|
50
|
+
getStartWithAudioMuted(): boolean;
|
|
51
|
+
getStartWithVideoMuted(): boolean;
|
|
52
|
+
isEndCallButtonEnabled(): boolean;
|
|
53
|
+
isMuteAudioButtonEnabled(): boolean;
|
|
54
|
+
isPauseVideoButtonEnabled(): boolean;
|
|
55
|
+
isScreenShareButtonEnabled(): boolean;
|
|
56
|
+
isModeButtonEnabled(): boolean;
|
|
57
|
+
getLocalizedStringObject(): Object;
|
|
58
|
+
getAnalyticsSettings(): Object;
|
|
59
|
+
isAudioToVideoButtonEnabled(): boolean;
|
|
60
|
+
getVirtualBackground(): VirtualBackground;
|
|
61
|
+
isVirtualBackgroundSettingEnabled(): boolean;
|
|
62
|
+
getMainVideoContainerSetting(): MainVideoContainerSetting;
|
|
63
|
+
}
|
|
64
|
+
export declare class CallSettingsBuilder {
|
|
65
|
+
/** @private */ defaultLayout: boolean;
|
|
66
|
+
/** @private */ isAudioOnly: boolean;
|
|
67
|
+
/** @private */ mode: ICallsettings["mode"];
|
|
68
|
+
/** @private */ ShowEndCallButton: boolean;
|
|
69
|
+
/** @private */ ShowMuteAudioButton: boolean;
|
|
70
|
+
/** @private */ ShowPauseVideoButton: boolean;
|
|
71
|
+
/** @private */ ShowScreenShareButton: boolean;
|
|
72
|
+
/** @private */ ShowSwitchModeButton: boolean;
|
|
73
|
+
/** @private */ StartAudioMuted: boolean;
|
|
74
|
+
/** @private */ StartVideoMuted: boolean;
|
|
75
|
+
/** @private */ localizedObject: Object;
|
|
76
|
+
/** @private */ analyticsSettings: Object;
|
|
77
|
+
/** @private */ customCSS: string;
|
|
78
|
+
/** @private */ ShowRecordingButton: boolean;
|
|
79
|
+
/** @private */ StartRecordingOnCallStart: boolean;
|
|
80
|
+
/** @private */ ShowSwitchToVideoCallButton: boolean;
|
|
81
|
+
/** @private */ virtualBackground: VirtualBackground;
|
|
82
|
+
/** @private */ ShowVirtualBackgroundSetting: boolean;
|
|
83
|
+
/** @private */ MainVideoContainerSetting: MainVideoContainerSetting;
|
|
84
|
+
/** @private */ callListener: OngoingCallListener;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param {boolean} defaultLayout
|
|
88
|
+
* This methods shows/hides the default button layout.
|
|
89
|
+
* If set to true the default button layout will be shown.
|
|
90
|
+
* If set to false the default button layout will be hidden.
|
|
91
|
+
* Default value is true
|
|
92
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
93
|
+
*/
|
|
94
|
+
enableDefaultLayout(defaultLayout: boolean): this;
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @param {boolean} isAudioOnly
|
|
98
|
+
* This methods sets the type(audio/video) of the call.
|
|
99
|
+
* If set to true, the call will be strictly an audio call.
|
|
100
|
+
* If set to false, the call will be an audio-video call.
|
|
101
|
+
* Default value is false
|
|
102
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
103
|
+
*/
|
|
104
|
+
setIsAudioOnlyCall(isAudioOnly: boolean): this;
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
* @param {string} mode
|
|
108
|
+
* This method sets the mode of the call.
|
|
109
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
110
|
+
*/
|
|
111
|
+
setMode(mode: ICallsettings["mode"]): this;
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param {boolean} showEndCallButton
|
|
115
|
+
* This method shows/hides the end call button.
|
|
116
|
+
* If set to true it will display the end call button.
|
|
117
|
+
* If set to false it will hide the end call button.
|
|
118
|
+
* Default value is true.
|
|
119
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
120
|
+
*/
|
|
121
|
+
showEndCallButton(showEndCallButton: boolean): this;
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param {boolean} showMuteAudioButton
|
|
125
|
+
* This method shows/hides the mute audio button.
|
|
126
|
+
* If set to true it will display the mute audio button.
|
|
127
|
+
* If set to false it will hide the mute audio button.
|
|
128
|
+
* Default value is true.
|
|
129
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
130
|
+
*/
|
|
131
|
+
showMuteAudioButton(showMuteAudioButton: boolean): this;
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* @param {boolean} showPauseVideoButton
|
|
135
|
+
* This method shows/hides the pause video button.
|
|
136
|
+
* If set to true it will display the pause video button.
|
|
137
|
+
* If set to false it will hide the pause video button.
|
|
138
|
+
* Default value is true.
|
|
139
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
140
|
+
*/
|
|
141
|
+
showPauseVideoButton(showPauseVideoButton: boolean): this;
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
* @param {boolean} showScreenShareButton
|
|
145
|
+
* This method shows/hides the screen share button.
|
|
146
|
+
* If set to true it will display the screen share button.
|
|
147
|
+
* If set to false it will hide the screen share button.
|
|
148
|
+
* Default value is true.
|
|
149
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
150
|
+
*/
|
|
151
|
+
showScreenShareButton(showScreenShareButton: boolean): this;
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
* @param {boolean} showModeButton
|
|
155
|
+
* This method shows/hides the switch mode button.
|
|
156
|
+
* If set to true it will display the switch mode button.
|
|
157
|
+
* If set to false it will hide the switch mode button.
|
|
158
|
+
* Default value is true.
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
showModeButton(showModeButton: boolean): this;
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @param {Object} localizedStringObject
|
|
165
|
+
* This method will set the localized text in the call screen.
|
|
166
|
+
* @returns
|
|
167
|
+
*/
|
|
168
|
+
setLocalizedStringObject(localizedStringObject: Object): this;
|
|
169
|
+
/**
|
|
170
|
+
* @private
|
|
171
|
+
* @param {Object} analyticsSettings
|
|
172
|
+
* This method will set the settings required for analytics.
|
|
173
|
+
* @returns
|
|
174
|
+
*/
|
|
175
|
+
setAnalyticsSettings(analyticsSettings: Object): this;
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* @param {boolean} audioMuted
|
|
179
|
+
* This method allows the call to be started with audio muted.
|
|
180
|
+
* If set to true, the call will start with audio muted.
|
|
181
|
+
* Default value is false.
|
|
182
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
183
|
+
*/
|
|
184
|
+
startWithAudioMuted(audioMuted: boolean): this;
|
|
185
|
+
/**
|
|
186
|
+
*
|
|
187
|
+
* @param {boolean} videoMuted
|
|
188
|
+
* This method allows the call to be started with video muted.
|
|
189
|
+
* If set to true, the call will start with video muted.
|
|
190
|
+
* Default value is false.
|
|
191
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
192
|
+
*/
|
|
193
|
+
startWithVideoMuted(videoMuted: boolean): this;
|
|
194
|
+
/**
|
|
195
|
+
*
|
|
196
|
+
* @param {boolean} showRecordingButton
|
|
197
|
+
* This method shows/hides the recording button.
|
|
198
|
+
* If set to true it will display the recording button.
|
|
199
|
+
* If set to false it will hide the recording button.
|
|
200
|
+
* Default value is false.
|
|
201
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
202
|
+
*/
|
|
203
|
+
showRecordingButton(showRecordingButton: boolean): this;
|
|
204
|
+
/**
|
|
205
|
+
*
|
|
206
|
+
* @param {boolean} startRecordingOnCallStart
|
|
207
|
+
* This method starts the recording as soon as the call start.
|
|
208
|
+
* If set to true it will start the recording as soon as the call start.
|
|
209
|
+
* Default value is false.
|
|
210
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
211
|
+
*/
|
|
212
|
+
startRecordingOnCallStart(startRecordingOnCallStart: boolean): this;
|
|
213
|
+
/**
|
|
214
|
+
*
|
|
215
|
+
* @param {boolean} showAudioToVideoSwitchButton
|
|
216
|
+
* This method shows/hides the switch to video call button.
|
|
217
|
+
* If set to true it will display the switch to video call button.
|
|
218
|
+
* If set to false it will hide the switch to video call button.
|
|
219
|
+
* Default value is true.
|
|
220
|
+
* @returns
|
|
221
|
+
*/
|
|
222
|
+
showSwitchToVideoCallButton(showAudioToVideoSwitchButton: boolean): this;
|
|
223
|
+
/**
|
|
224
|
+
*
|
|
225
|
+
* @param {VirtualBackground} virtualBackground
|
|
226
|
+
* This method will set the virtual background setting.
|
|
227
|
+
* This methods takes an Object of VirtualBackground Class.
|
|
228
|
+
* @returns
|
|
229
|
+
*/
|
|
230
|
+
setVirtualBackground(virtualBackground: VirtualBackground): this;
|
|
231
|
+
/**
|
|
232
|
+
*
|
|
233
|
+
* @param {boolean} showVirtualBackgroundSetting
|
|
234
|
+
* This method shows/hides the virtual background setting button.
|
|
235
|
+
* If set to true it will display the virtual background setting button.
|
|
236
|
+
* If set to false it will hide the virtual background setting button.
|
|
237
|
+
* Default value is true.
|
|
238
|
+
* @returns
|
|
239
|
+
*/
|
|
240
|
+
showVirtualBackgroundSetting(showVirtualBackgroundSetting: boolean): this;
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
* @param {MainVideoContainerSetting} mainVideoContainerSetting
|
|
244
|
+
* This method can be used to customize the main video container.
|
|
245
|
+
* @returns
|
|
246
|
+
*/
|
|
247
|
+
setMainVideoContainerSetting(mainVideoContainerSetting: MainVideoContainerSetting): this;
|
|
248
|
+
/**
|
|
249
|
+
*
|
|
250
|
+
* @param {OngoingCallListener} callListener
|
|
251
|
+
* This method can be used to subscribe to available callings events
|
|
252
|
+
* @returns
|
|
253
|
+
*/
|
|
254
|
+
setCallListener(callListener: OngoingCallListener): this;
|
|
255
|
+
/**
|
|
256
|
+
* This method will return an object of the CallSettings class.
|
|
257
|
+
* @returns {CallSettings} Returns the CallSettings instance
|
|
258
|
+
*/
|
|
259
|
+
build(): CallSettings;
|
|
260
|
+
}
|
|
261
|
+
export declare class VirtualBackground {
|
|
262
|
+
private AllowBackgroundBlur;
|
|
263
|
+
private AllowUserImages;
|
|
264
|
+
private ShowDefaultImages;
|
|
265
|
+
private SetImages;
|
|
266
|
+
private EnforceBackgroundBlur;
|
|
267
|
+
private EnforceBackgroundImage;
|
|
268
|
+
constructor(builder?: VirtualBackgroundBuilder);
|
|
269
|
+
shouldAllowBackgroundBlur(): boolean;
|
|
270
|
+
shouldAllowUserImages(): boolean;
|
|
271
|
+
shouldShowDefaultImages(): boolean;
|
|
272
|
+
getImages(): Array<String>;
|
|
273
|
+
isBackgroundBlurEnforced(): number;
|
|
274
|
+
getEnforcedBackgroundImage(): string;
|
|
275
|
+
}
|
|
276
|
+
export declare class VirtualBackgroundBuilder {
|
|
277
|
+
/** @private */ AllowBackgroundBlur: boolean;
|
|
278
|
+
/** @private */ AllowUserImages: boolean;
|
|
279
|
+
/** @private */ ShowDefaultImages: boolean;
|
|
280
|
+
/** @private */ SetImages: string[];
|
|
281
|
+
/** @private */ EnforceBackgroundBlur: number;
|
|
282
|
+
/** @private */ EnforceBackgroundImage: string;
|
|
283
|
+
/**
|
|
284
|
+
*
|
|
285
|
+
* @param {boolean} AllowBackgroundBlur
|
|
286
|
+
* This method will show the background blur option in Virtual Background.
|
|
287
|
+
* If set to true it will show the background blur option.
|
|
288
|
+
* Default value is true.
|
|
289
|
+
* @returns
|
|
290
|
+
*/
|
|
291
|
+
allowBackgroundBlur(AllowBackgroundBlur: boolean): this;
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
* @param {boolean} AllowUserImage
|
|
295
|
+
* This method will allow the user to add custom images as background.
|
|
296
|
+
* If set to true it will allow the user to add custom images as background.
|
|
297
|
+
* Default value is true.
|
|
298
|
+
* @returns
|
|
299
|
+
*/
|
|
300
|
+
allowUserImages(AllowUserImages: boolean): this;
|
|
301
|
+
/**
|
|
302
|
+
*
|
|
303
|
+
* @param {boolean} ShowDefaultImages
|
|
304
|
+
* This method will show the default images to be used as background.
|
|
305
|
+
* If set to true it will show the default images to be used as background.
|
|
306
|
+
* Default value is true.
|
|
307
|
+
* @returns
|
|
308
|
+
*/
|
|
309
|
+
showDefaultImages(ShowDefaultImages: boolean): this;
|
|
310
|
+
/**
|
|
311
|
+
*
|
|
312
|
+
* @param {boolean} SetImages
|
|
313
|
+
* This method will allow user to add custom Images to be used as background. It takes in an array of URLs.
|
|
314
|
+
* @returns
|
|
315
|
+
*/
|
|
316
|
+
setImages(SetImages: string[]): this;
|
|
317
|
+
/**
|
|
318
|
+
*
|
|
319
|
+
* @param {number} EnforceBackgroundBlur
|
|
320
|
+
* This method will enforce background blur.
|
|
321
|
+
* This method takes number as input which decides the blur level of the background.
|
|
322
|
+
* Default value is 0.
|
|
323
|
+
* @returns
|
|
324
|
+
*/
|
|
325
|
+
enforceBackgroundBlur(EnforceBackgroundBlur: number): this;
|
|
326
|
+
/**
|
|
327
|
+
*
|
|
328
|
+
* @param {string} EnforceBackgroundImage
|
|
329
|
+
* This method will enforce background image.
|
|
330
|
+
* If an URL of the image is sent then that image will be set as background.
|
|
331
|
+
* By default no image is set.
|
|
332
|
+
* @returns
|
|
333
|
+
*/
|
|
334
|
+
enforceBackgroundImage(EnforceBackgroundImage: string): this;
|
|
335
|
+
/**
|
|
336
|
+
* This method will return an object of the VirtualBackground class.
|
|
337
|
+
* @returns {VirtualBackground}
|
|
338
|
+
*/
|
|
339
|
+
build(): VirtualBackground;
|
|
340
|
+
}
|
|
341
|
+
export declare class MainVideoContainerSetting {
|
|
342
|
+
private videoFit;
|
|
343
|
+
private zoomButton;
|
|
344
|
+
private nameLabel;
|
|
345
|
+
private network;
|
|
346
|
+
/**
|
|
347
|
+
*
|
|
348
|
+
* @param {string} mainVideoAspectRatio
|
|
349
|
+
* This method is used to set the aspect ratio of main video.
|
|
350
|
+
* The default value is `contain`
|
|
351
|
+
* @returns
|
|
352
|
+
*/
|
|
353
|
+
setMainVideoAspectRatio(mainVideoAspectRatio: typeof CallSettings.ASPECT_RATIO[keyof typeof CallSettings.ASPECT_RATIO]): void;
|
|
354
|
+
/**
|
|
355
|
+
*
|
|
356
|
+
* @param {string} position
|
|
357
|
+
* @param {boolean} visibility
|
|
358
|
+
* This method is used to set the position & visibility parameter of the full screen button.
|
|
359
|
+
* By default the full screen button is visible in the `bottom-right` position.
|
|
360
|
+
* @returns
|
|
361
|
+
*/
|
|
362
|
+
setFullScreenButtonParams(position: typeof CallSettings.POSITION[keyof typeof CallSettings.POSITION], visibility: boolean): void;
|
|
363
|
+
/**
|
|
364
|
+
*
|
|
365
|
+
* @param {string} position
|
|
366
|
+
* @param {boolean} visibility
|
|
367
|
+
* @param {string} backgroundColor
|
|
368
|
+
* This method is used to set the position, visibility & background color of the name label.
|
|
369
|
+
* By default the name label is visible in the `bottom-left` position with a background-color `rgba(27, 27, 27, 0.4)`
|
|
370
|
+
* @returns
|
|
371
|
+
*/
|
|
372
|
+
setNameLabelParams(position: typeof CallSettings.POSITION[keyof typeof CallSettings.POSITION], visibility: boolean, backgroundColor: string): void;
|
|
373
|
+
/**
|
|
374
|
+
*
|
|
375
|
+
* @param {string} position
|
|
376
|
+
* @param {boolean} visibility
|
|
377
|
+
* This method is used to set the position, visibility of the network label.
|
|
378
|
+
* By default the network label is visible in the `bottom-right` position.
|
|
379
|
+
* @returns
|
|
380
|
+
*/
|
|
381
|
+
setNetworkLabelParams(position: typeof CallSettings.POSITION[keyof typeof CallSettings.POSITION], visibility: boolean): void;
|
|
382
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { CallSettings, CallSettingsBuilder, MainVideoContainerSetting } from "./CallSettings";
|
|
2
|
+
import { CallAppSettings, CallAppSettingsBuilder } from "./CallsAppSettings";
|
|
3
|
+
import { OngoingCallListener } from "./Listener";
|
|
4
|
+
import { CallConstants } from "../constants";
|
|
5
|
+
import { PresenterSettings, PresenterSettingsBuilder } from "./PresenterSettings";
|
|
6
|
+
import { ListenerHandlers } from "./ListnerHandler";
|
|
7
|
+
export declare class CometChatCalls {
|
|
8
|
+
private static appSettings;
|
|
9
|
+
private static callEventListener;
|
|
10
|
+
private static debounceDeviceChange;
|
|
11
|
+
private static deviceList;
|
|
12
|
+
static CALL_MODE: {
|
|
13
|
+
readonly DEFAULT: "DEFAULT";
|
|
14
|
+
readonly SPOTLIGHT: "SPOTLIGHT";
|
|
15
|
+
readonly GRID: "TILE";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Alias to CometChatCalls.CALL_MODE
|
|
19
|
+
*/
|
|
20
|
+
static MODE: {
|
|
21
|
+
readonly DEFAULT: "DEFAULT";
|
|
22
|
+
readonly SPOTLIGHT: "SPOTLIGHT";
|
|
23
|
+
readonly GRID: "TILE";
|
|
24
|
+
};
|
|
25
|
+
static addCallEventListener: typeof ListenerHandlers.addCallEventListener;
|
|
26
|
+
static removeCallEventListener: typeof ListenerHandlers.removeCallEventListener;
|
|
27
|
+
static OngoingCallListener: typeof OngoingCallListener;
|
|
28
|
+
static CallSettingsBuilder: typeof CallSettingsBuilder;
|
|
29
|
+
static CallSettings: typeof CallSettings;
|
|
30
|
+
static PresenterSettingsBuilder: typeof PresenterSettingsBuilder;
|
|
31
|
+
static PresenterSettings: typeof PresenterSettings;
|
|
32
|
+
static CallAppSettingsBuilder: typeof CallAppSettingsBuilder;
|
|
33
|
+
static CallAppSettings: typeof CallAppSettings;
|
|
34
|
+
static MainVideoContainerSetting: typeof MainVideoContainerSetting;
|
|
35
|
+
private static isPresenterMode;
|
|
36
|
+
static joinPresentation(callToken: string, presenterSettings: PresenterSettings, htmlElement: HTMLElement): Promise<void>;
|
|
37
|
+
static startSession(callToken: string, callSettings: CallSettings, htmlElement: HTMLElement): Promise<void>;
|
|
38
|
+
private static startSessionCore;
|
|
39
|
+
private static startTheSession;
|
|
40
|
+
static generateToken(sessionID: string, authToken: string): Promise<{
|
|
41
|
+
token: string;
|
|
42
|
+
}>;
|
|
43
|
+
static init(appSettings: CallAppSettings): Promise<void>;
|
|
44
|
+
private static getRef;
|
|
45
|
+
/**
|
|
46
|
+
* Method to pause/unpause video stream.
|
|
47
|
+
* @param {boolean} pauseVideo Defaults to true
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
static pauseVideo(pauseVideo?: boolean): void;
|
|
51
|
+
/**
|
|
52
|
+
* Method to resume video stream. Alias to resumeVideo.
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
55
|
+
static unPauseVideo(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Method to resume video stream.
|
|
58
|
+
* @returns {void}
|
|
59
|
+
*/
|
|
60
|
+
static resumeVideo(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Method to set mode.
|
|
63
|
+
* @param mode
|
|
64
|
+
* @returns {void}
|
|
65
|
+
*/
|
|
66
|
+
static setMode(mode: (typeof CallConstants.MODE)[keyof typeof CallConstants.MODE]): void;
|
|
67
|
+
/**
|
|
68
|
+
* Method to mute/unmute audio stream.
|
|
69
|
+
* @param {boolean} muteAudio Defaults to true
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
static muteAudio(muteAudio?: boolean): void;
|
|
73
|
+
/**
|
|
74
|
+
* Method to unmute audio stream.
|
|
75
|
+
* @returns {void}
|
|
76
|
+
*/
|
|
77
|
+
static unMuteAudio(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Method to start screen share.
|
|
80
|
+
* @returns {void}
|
|
81
|
+
*/
|
|
82
|
+
static startScreenShare(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Method to stop screen share.
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
static stopScreenShare(): void;
|
|
88
|
+
static endCall(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Method to start call recording.
|
|
91
|
+
* @returns {void}
|
|
92
|
+
*/
|
|
93
|
+
static startRecording(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Method to stop call recording.
|
|
96
|
+
* @returns {void}
|
|
97
|
+
*/
|
|
98
|
+
static stopRecording(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Method to switch an audio call to video call.
|
|
101
|
+
* @returns {void}
|
|
102
|
+
*/
|
|
103
|
+
static switchToVideoCall(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Method to open the virtual background settings.
|
|
106
|
+
* @returns {void}
|
|
107
|
+
*/
|
|
108
|
+
static openVirtualBackground(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Method to close the virtual background settings.
|
|
111
|
+
* @returns {void}
|
|
112
|
+
*/
|
|
113
|
+
static closeVirtualBackground(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Method to set the background blur. This method takes number as input which decides the blur level of the background.
|
|
116
|
+
* @param {number} blurLevel The blur level of the background
|
|
117
|
+
* @returns {void}
|
|
118
|
+
*/
|
|
119
|
+
static setBackgroundBlur(blurLevel: number): void;
|
|
120
|
+
/**
|
|
121
|
+
* Method to set the background image. This method takes either a URL or file Object & sets that image as the background.
|
|
122
|
+
* @param image image URL or file Object
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
125
|
+
static setBackgroundImage(image: string | Blob | Object): void;
|
|
126
|
+
/**
|
|
127
|
+
* Method to get all the available audio input devices.
|
|
128
|
+
* @returns {MediaDeviceInfo[]}
|
|
129
|
+
*/
|
|
130
|
+
static getAudioInputDevices(): InputDeviceInfo[];
|
|
131
|
+
/**
|
|
132
|
+
* Method to get all the available audio output devices.
|
|
133
|
+
* @returns {MediaDeviceInfo[]}
|
|
134
|
+
*/
|
|
135
|
+
static getAudioOutputDevices(): MediaDeviceInfo[];
|
|
136
|
+
/**
|
|
137
|
+
* Method to get all the available video input devices.
|
|
138
|
+
* @returns {MediaDeviceInfo[]}
|
|
139
|
+
*/
|
|
140
|
+
static getVideoInputDevices(): MediaDeviceInfo[];
|
|
141
|
+
/**
|
|
142
|
+
* Method to change the audio input device.
|
|
143
|
+
* @param {string} deviceId
|
|
144
|
+
* @returns {void}
|
|
145
|
+
*/
|
|
146
|
+
static setAudioInputDevice(deviceId: string): void;
|
|
147
|
+
/**
|
|
148
|
+
* Method to change the audio output device.
|
|
149
|
+
* @param {string} deviceId
|
|
150
|
+
* @returns {void}
|
|
151
|
+
*/
|
|
152
|
+
static setAudioOutputDevice(deviceId: string): void;
|
|
153
|
+
/**
|
|
154
|
+
* Method to change the video input device.
|
|
155
|
+
* @param {string} deviceId
|
|
156
|
+
* @returns {void}
|
|
157
|
+
*/
|
|
158
|
+
static setVideoInputDevice(deviceId: string): void;
|
|
159
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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["onUserJoined"]>) => void;
|
|
6
|
+
onUserListUpdated: (userList: Partial<ICallEventsData["onUserListUpdated"]>) => void;
|
|
7
|
+
onMediaDeviceListUpdated: (devices: Partial<ICallEventsData["onMediaDeviceListUpdated"]>) => void;
|
|
8
|
+
onRecordingStarted: (event: Partial<ICallEventsData["onRecordingStarted"]>) => void;
|
|
9
|
+
onRecordingStopped: (event: Partial<ICallEventsData["onRecordingStopped"]>) => void;
|
|
10
|
+
onScreenShareStarted: () => void;
|
|
11
|
+
onScreenShareStopped: () => void;
|
|
12
|
+
onUserMuted: (event: Partial<ICallEventsData["onUserMuted"]>) => void;
|
|
13
|
+
onCallSwitchedToVideo: (event: Partial<ICallEventsData["onCallSwitchedToVideo"]>) => void;
|
|
14
|
+
onCallEnded: () => void;
|
|
15
|
+
onCallEndButtonPressed: () => void;
|
|
16
|
+
onError: (error: CometChatCallsException) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare class OngoingCallListener {
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
onYouLeft?: Function;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
onYouJoined?: Function;
|
|
27
|
+
/**
|
|
28
|
+
* This event is triggered when a user joins the call.
|
|
29
|
+
*/
|
|
30
|
+
onUserJoined?: IOngoingCallListener["onUserJoined"];
|
|
31
|
+
/**
|
|
32
|
+
* This event is triggered when a user leaves the call.
|
|
33
|
+
*/
|
|
34
|
+
onUserLeft?: IOngoingCallListener["onUserLeft"];
|
|
35
|
+
/**
|
|
36
|
+
* This event is triggered when the participant list of the call changes.
|
|
37
|
+
*/
|
|
38
|
+
onUserListUpdated?: IOngoingCallListener["onUserListUpdated"];
|
|
39
|
+
/**
|
|
40
|
+
* This event is triggered when the media device list changes.
|
|
41
|
+
*/
|
|
42
|
+
onMediaDeviceListUpdated?: IOngoingCallListener["onMediaDeviceListUpdated"];
|
|
43
|
+
/**
|
|
44
|
+
* This event is triggered when someone starts recording the call.
|
|
45
|
+
*/
|
|
46
|
+
onRecordingStarted?: IOngoingCallListener["onRecordingStarted"];
|
|
47
|
+
/**
|
|
48
|
+
* This event is triggered when someone stops recording the call.
|
|
49
|
+
*/
|
|
50
|
+
onRecordingStopped?: IOngoingCallListener["onRecordingStopped"];
|
|
51
|
+
/**
|
|
52
|
+
* This event is triggered when someone starts sharing their screen in the call.
|
|
53
|
+
*/
|
|
54
|
+
onScreenShareStarted?: IOngoingCallListener["onScreenShareStarted"];
|
|
55
|
+
/**
|
|
56
|
+
* This event is triggered when someone stops sharing their screen in the call.
|
|
57
|
+
*/
|
|
58
|
+
onScreenShareStopped?: IOngoingCallListener["onScreenShareStopped"];
|
|
59
|
+
/**
|
|
60
|
+
* This event is triggered when a user is muted.
|
|
61
|
+
*/
|
|
62
|
+
onUserMuted?: IOngoingCallListener["onUserMuted"];
|
|
63
|
+
/**
|
|
64
|
+
* This event is triggered when an audio call is switched to a video call.
|
|
65
|
+
*/
|
|
66
|
+
onCallSwitchedToVideo?: IOngoingCallListener["onCallSwitchedToVideo"];
|
|
67
|
+
/**
|
|
68
|
+
* This event is triggered when the call is ended.
|
|
69
|
+
*/
|
|
70
|
+
onCallEnded?: IOngoingCallListener["onCallEnded"];
|
|
71
|
+
/**
|
|
72
|
+
* This event is triggered when an error occurs.
|
|
73
|
+
*/
|
|
74
|
+
onError?: IOngoingCallListener["onError"];
|
|
75
|
+
/**
|
|
76
|
+
* This event is triggered when user presses end call button.
|
|
77
|
+
*/
|
|
78
|
+
onCallEndButtonPressed?: IOngoingCallListener["onCallEndButtonPressed"];
|
|
79
|
+
constructor(eventObj: Partial<IOngoingCallListener>);
|
|
80
|
+
}
|
|
81
|
+
export {};
|