@cometchat/calls-sdk-javascript 4.2.3 → 5.0.0-beta.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/README.md +29 -16
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2017 -0
- package/dist/index.es.js +39122 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +320 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +42 -23
- package/LICENSE.md +0 -3
- package/pack/index.js +0 -2
- package/pack/src/Helper.d.ts +0 -5
- package/pack/src/api/APIHandler.d.ts +0 -39
- package/pack/src/api/endpoints.d.ts +0 -7
- package/pack/src/api/helper.d.ts +0 -69
- package/pack/src/api/index.d.ts +0 -2
- package/pack/src/constants/CallConstants.d.ts +0 -218
- package/pack/src/constants/index.d.ts +0 -1
- package/pack/src/defaultCallsettings.d.ts +0 -2
- package/pack/src/index.d.ts +0 -7
- package/pack/src/models/CallGroup.d.ts +0 -14
- package/pack/src/models/CallLog.d.ts +0 -276
- package/pack/src/models/CallSettings.d.ts +0 -396
- package/pack/src/models/CallUser.d.ts +0 -14
- package/pack/src/models/CallsAppSettings.d.ts +0 -41
- package/pack/src/models/CometChatCallLogs.d.ts +0 -189
- package/pack/src/models/CometChatCalls.d.ts +0 -181
- package/pack/src/models/CometChatCallsException.d.ts +0 -8
- package/pack/src/models/ErrorModel.d.ts +0 -12
- package/pack/src/models/Listener.d.ts +0 -91
- package/pack/src/models/ListnerHandler.d.ts +0 -10
- package/pack/src/models/Participant.d.ts +0 -184
- package/pack/src/models/PresenterSettings.d.ts +0 -279
- package/pack/src/models/RTCUser.d.ts +0 -18
- package/pack/src/models/Recording.d.ts +0 -86
- package/pack/src/models/index.d.ts +0 -10
- package/pack/src/types/ICallSettings.d.ts +0 -62
- package/pack/src/types/ICallsAppSettings.d.ts +0 -6
- package/pack/src/types/RTCUser.d.ts +0 -6
- package/pack/src/types/callEvents.d.ts +0 -84
- package/pack/src/types/common.d.ts +0 -14
- package/pack/src/types/index.d.ts +0 -2
- package/pack/src/util/parseJwt.d.ts +0 -1
- package/pack/src/util/verifyCallSettings.d.ts +0 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2017 @@
|
|
|
1
|
+
import { AudioInputDevice } from '../../../calls-sdk-core';
|
|
2
|
+
import { AudioOutputDevice } from '../../../calls-sdk-core';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
import { VideoInputDevice } from '../../../calls-sdk-core';
|
|
5
|
+
|
|
6
|
+
declare interface AnyProperties {
|
|
7
|
+
[prop: string]: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare type AudioInputDevice_2 = MediaDeviceInfo & {
|
|
11
|
+
kind: Extract<MediaDeviceKind, 'audioinput'>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
declare type AudioMode = {
|
|
15
|
+
type: AudioModeType;
|
|
16
|
+
selected: boolean;
|
|
17
|
+
uid?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare type AudioModeType = 'BLUETOOTH' | 'EARPIECE' | 'HEADPHONES' | 'SPEAKER';
|
|
21
|
+
|
|
22
|
+
declare type AudioOutputDevice_2 = MediaDeviceInfo & {
|
|
23
|
+
kind: Extract<MediaDeviceKind, 'audiooutput'>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare class CallAppSettings {
|
|
27
|
+
private appId;
|
|
28
|
+
private region;
|
|
29
|
+
private host?;
|
|
30
|
+
constructor(builder?: CallAppSettingsBuilder);
|
|
31
|
+
setAppId(appId: string): this;
|
|
32
|
+
setRegion(region: Region): this;
|
|
33
|
+
setHost(host: Host): this;
|
|
34
|
+
getAppId(): string;
|
|
35
|
+
getRegion(): Region;
|
|
36
|
+
getHost(): Host | undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare type CallAppSettings_2 = v.InferOutput<typeof CallAppSettingsSchema>;
|
|
40
|
+
|
|
41
|
+
declare class CallAppSettingsBuilder {
|
|
42
|
+
appId: string;
|
|
43
|
+
region: Region;
|
|
44
|
+
host?: Host;
|
|
45
|
+
/**
|
|
46
|
+
* Method to set appId of the app.
|
|
47
|
+
* @param {string} appId appId of the app
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
setAppId(appId: string): this;
|
|
51
|
+
/**
|
|
52
|
+
* Method to set region of the app.
|
|
53
|
+
* @param {Region} region region of the app.
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
setRegion(region: Region): this;
|
|
57
|
+
/**
|
|
58
|
+
* Method to set host/domain of the app.
|
|
59
|
+
* @param {string} host host/domain of the app.
|
|
60
|
+
* @returns {void}
|
|
61
|
+
*/
|
|
62
|
+
setHost(host: Host): this;
|
|
63
|
+
/**
|
|
64
|
+
* This method will return an object of the CallsAppSettings class.
|
|
65
|
+
* @returns {CallAppSettings} Returns the CallsAppSettings instance
|
|
66
|
+
*/
|
|
67
|
+
build(): CallAppSettings;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare const CallAppSettingsSchema: v.ObjectSchema<{
|
|
71
|
+
readonly appId: v.StringSchema<undefined>;
|
|
72
|
+
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>]>;
|
|
73
|
+
readonly authKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
74
|
+
readonly adminHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
+
readonly clientHost: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
76
|
+
readonly host: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
77
|
+
}, undefined>;
|
|
78
|
+
|
|
79
|
+
declare const CallConstants: {
|
|
80
|
+
readonly MODE: {
|
|
81
|
+
readonly DEFAULT: "DEFAULT";
|
|
82
|
+
readonly SPOTLIGHT: "SPOTLIGHT";
|
|
83
|
+
readonly GRID: "TILE";
|
|
84
|
+
};
|
|
85
|
+
readonly CALL_TYPE: {
|
|
86
|
+
readonly AUDIO: "audio";
|
|
87
|
+
readonly VIDEO: "video";
|
|
88
|
+
};
|
|
89
|
+
readonly RECEIVER_TYPE_GROUP: "group";
|
|
90
|
+
readonly RECEIVER_TYPE_USER: "user";
|
|
91
|
+
readonly CALL_KEYS: {
|
|
92
|
+
readonly CALL_DATA: "data";
|
|
93
|
+
readonly CALL_ID: "id";
|
|
94
|
+
readonly CALL_SESSION_ID: "sessionid";
|
|
95
|
+
readonly CALL_RECEIVER: "receiver";
|
|
96
|
+
readonly CALL_INITIATOR: "initiator";
|
|
97
|
+
readonly CALL_SENDER: "sender";
|
|
98
|
+
readonly CALL_RECEIVER_TYPE: "receiverType";
|
|
99
|
+
readonly CALL_STATUS: "status";
|
|
100
|
+
readonly CALL_TYPE: "type";
|
|
101
|
+
readonly CALL_INITIATED_AT: "initiatedAt";
|
|
102
|
+
readonly CALL_JOINED_AT: "joinedAt";
|
|
103
|
+
readonly CALL_LEFT_AT: "leftAt";
|
|
104
|
+
readonly CALL_METADATA: "metadata";
|
|
105
|
+
readonly CALL_ENTITIES: "entities";
|
|
106
|
+
readonly CALL_ENTITY_TYPE: "entityType";
|
|
107
|
+
readonly CALL_ENTITY: "entity";
|
|
108
|
+
readonly CALL_ENTITY_USER: "user";
|
|
109
|
+
readonly CALL_ENTITY_GROUP: "group";
|
|
110
|
+
};
|
|
111
|
+
readonly CALL_STATUS: {
|
|
112
|
+
readonly INITIATED: "initiated";
|
|
113
|
+
readonly ONGOING: "ongoing";
|
|
114
|
+
readonly UNANSWERED: "unanswered";
|
|
115
|
+
readonly REJECTED: "rejected";
|
|
116
|
+
readonly BUSY: "busy";
|
|
117
|
+
readonly CANCELLED: "cancelled";
|
|
118
|
+
readonly ENDED: "ended";
|
|
119
|
+
};
|
|
120
|
+
readonly AUDIO_INPUT_DEVICES: "audioInputDevices";
|
|
121
|
+
readonly AUDIO_OUTPUT_DEVICES: "audioOutputDevices";
|
|
122
|
+
readonly VIDEO_INPUT_DEVICES: "videoInputDevices";
|
|
123
|
+
readonly POST_MESSAGES: {
|
|
124
|
+
readonly TYPES: {
|
|
125
|
+
readonly ACTION_MESSAGE: "cometchat_action_message";
|
|
126
|
+
readonly HANGUP: "hangup";
|
|
127
|
+
readonly COMETCHAT_RTC_SETTINGS: "cometchat_rtc_settings";
|
|
128
|
+
};
|
|
129
|
+
readonly ACTIONS: {
|
|
130
|
+
readonly USER_JOINED: "onUserJoined";
|
|
131
|
+
readonly USER_LEFT: "onUserLeft";
|
|
132
|
+
readonly USER_LIST_CHANGED: "onUserListChanged";
|
|
133
|
+
readonly INITIAL_DEVICE_LIST: "initialDeviceList";
|
|
134
|
+
readonly DEVICE_CHANGE: "onDeviceChange";
|
|
135
|
+
readonly LOAD: "LOAD";
|
|
136
|
+
readonly CHANGE_AUDIO_INPUT: "changeAudioInput";
|
|
137
|
+
readonly CHANGE_AUDIO_OUTPUT: "changeAudioOutput";
|
|
138
|
+
readonly CHANGE_VIDEO_INPUT: "changeVideoInput";
|
|
139
|
+
readonly MUTE_AUDIO: "muteAudio";
|
|
140
|
+
readonly UNMUTE_AUDIO: "unmuteAudio";
|
|
141
|
+
readonly PAUSE_VIDEO: "pauseVideo";
|
|
142
|
+
readonly UNPAUSE_VIDEO: "unPauseVideo";
|
|
143
|
+
readonly SWITCH_MODE: "switchMode";
|
|
144
|
+
readonly START_SCREENSHARE: "startScreenShare";
|
|
145
|
+
readonly STOP_SCREENSHARE: "stopScreenShare";
|
|
146
|
+
readonly END_CALL: "endCall";
|
|
147
|
+
readonly START_RECORDING: "startRecording";
|
|
148
|
+
readonly STOP_RECORDING: "stopRecording";
|
|
149
|
+
readonly RECORDING_TOGGLED: "onRecordingToggled";
|
|
150
|
+
readonly USER_MUTED: "onUserMuted";
|
|
151
|
+
readonly ON_USER_UNMUTED: "onUserUnMuted";
|
|
152
|
+
readonly SCREEN_SHARE_STARTED: "SCREEN_SHARE_STARTED";
|
|
153
|
+
readonly SCREEN_SHARE_STOPPED: "SCREEN_SHARE_ENDED";
|
|
154
|
+
readonly SWITCH_TO_VIDEO_CALL: "switchedToVideo";
|
|
155
|
+
readonly SWITCHED_TO_VIDEO_CALL: "onCallSwitchedToVideo";
|
|
156
|
+
readonly OPEN_VIRTUAL_BACKGROUND: "openVirtualBackgroundMenu";
|
|
157
|
+
readonly SET_BACKGROUND_BLUR: "setBackgroundBlur";
|
|
158
|
+
readonly SET_BACKGROUND_IMAGE: "setBackgroundImage";
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
readonly MEDIA_DEVICE: {
|
|
162
|
+
readonly ID: "id";
|
|
163
|
+
readonly NAME: "name";
|
|
164
|
+
readonly ACTIVE: "active";
|
|
165
|
+
};
|
|
166
|
+
readonly ZOOM_BUTTON_DEFAULT_PARAMS: {
|
|
167
|
+
readonly position: "bottom-right";
|
|
168
|
+
readonly visible: true;
|
|
169
|
+
};
|
|
170
|
+
readonly NAME_LABEL_DEFAULT_PARAMS: {
|
|
171
|
+
readonly position: "bottom-left";
|
|
172
|
+
readonly visible: true;
|
|
173
|
+
readonly color: "rgba(27, 27, 27, 0.4)";
|
|
174
|
+
};
|
|
175
|
+
readonly NETWORK_LABEL_DEFAULT_PARAMS: {
|
|
176
|
+
readonly position: "bottom-right";
|
|
177
|
+
readonly visible: true;
|
|
178
|
+
};
|
|
179
|
+
readonly MAIN_VIDEO_CONTAINER_SETTINGS: {
|
|
180
|
+
readonly KEYS: {
|
|
181
|
+
readonly POSITION: "position";
|
|
182
|
+
readonly VISIBILITY: "visible";
|
|
183
|
+
readonly LEGACY_VISIBILITY: "visibility";
|
|
184
|
+
readonly COLOR: "color";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
declare class CallGroup {
|
|
190
|
+
protected guid: string;
|
|
191
|
+
protected name: string;
|
|
192
|
+
protected icon: string;
|
|
193
|
+
constructor(object: any);
|
|
194
|
+
getGuid(): string;
|
|
195
|
+
setGuid(guid: string): void;
|
|
196
|
+
getName(): string;
|
|
197
|
+
setName(name: string): void;
|
|
198
|
+
getIcon(): string;
|
|
199
|
+
setIcon(icon: string): void;
|
|
200
|
+
toString(): string;
|
|
201
|
+
static getGroupFromJson(object: any): CallGroup;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Represents a call log.
|
|
206
|
+
*/
|
|
207
|
+
export declare class CallLog {
|
|
208
|
+
/**
|
|
209
|
+
* The session ID of the call log.
|
|
210
|
+
*/
|
|
211
|
+
private sessionId;
|
|
212
|
+
/**
|
|
213
|
+
* The total audio minutes of the call log.
|
|
214
|
+
*/
|
|
215
|
+
private totalAudioMinutes;
|
|
216
|
+
/**
|
|
217
|
+
* The total video minutes of the call log.
|
|
218
|
+
*/
|
|
219
|
+
private totalVideoMinutes;
|
|
220
|
+
/**
|
|
221
|
+
* The total duration of the call log.
|
|
222
|
+
*/
|
|
223
|
+
private totalDuration;
|
|
224
|
+
/**
|
|
225
|
+
* Whether the call log has a recording.
|
|
226
|
+
*/
|
|
227
|
+
private hasRecording;
|
|
228
|
+
/**
|
|
229
|
+
* The time the call was initiated at.
|
|
230
|
+
*/
|
|
231
|
+
private initiatedAt;
|
|
232
|
+
/**
|
|
233
|
+
* The call category of the call log.
|
|
234
|
+
*/
|
|
235
|
+
private callCategory;
|
|
236
|
+
/**
|
|
237
|
+
* @type {CallUser}
|
|
238
|
+
* The initiator of the call log.
|
|
239
|
+
*/
|
|
240
|
+
private initiator;
|
|
241
|
+
/**
|
|
242
|
+
* @type {CallUser | CallGroup}
|
|
243
|
+
* The receiver of the call log.
|
|
244
|
+
*/
|
|
245
|
+
private receiver;
|
|
246
|
+
/**
|
|
247
|
+
* The receiver type of the call log.
|
|
248
|
+
*/
|
|
249
|
+
private receiverType;
|
|
250
|
+
/**
|
|
251
|
+
* The status of the call log.
|
|
252
|
+
*/
|
|
253
|
+
private status;
|
|
254
|
+
/**
|
|
255
|
+
* The total duration in minutes of the call log.
|
|
256
|
+
*/
|
|
257
|
+
private totalDurationInMinutes;
|
|
258
|
+
/**
|
|
259
|
+
* The total number of participants in the call log.
|
|
260
|
+
*/
|
|
261
|
+
private totalParticipants;
|
|
262
|
+
/**
|
|
263
|
+
* The type of the call log.
|
|
264
|
+
*/
|
|
265
|
+
private type;
|
|
266
|
+
/**
|
|
267
|
+
* The message ID of the call log.
|
|
268
|
+
*/
|
|
269
|
+
private mid;
|
|
270
|
+
/**
|
|
271
|
+
* The time the call ended at.
|
|
272
|
+
*/
|
|
273
|
+
private endedAt;
|
|
274
|
+
/**
|
|
275
|
+
* @type {Participant[]}
|
|
276
|
+
* The participants of the call log.
|
|
277
|
+
*/
|
|
278
|
+
private participants;
|
|
279
|
+
/**
|
|
280
|
+
* @type {Recording[]}
|
|
281
|
+
* The recordings of the call log.
|
|
282
|
+
*/
|
|
283
|
+
private recordings;
|
|
284
|
+
/**
|
|
285
|
+
* Creates a new instance of CallLog.
|
|
286
|
+
* @param data - The data to initialize the call log with.
|
|
287
|
+
*/
|
|
288
|
+
constructor(data: any);
|
|
289
|
+
/**
|
|
290
|
+
* Gets the session ID of the call log.
|
|
291
|
+
* @returns The session ID of the call log.
|
|
292
|
+
*/
|
|
293
|
+
getSessionID(): string;
|
|
294
|
+
/**
|
|
295
|
+
* Sets the session ID of the call log.
|
|
296
|
+
* @param value - The session ID to set.
|
|
297
|
+
*/
|
|
298
|
+
setSessionID(value: string): void;
|
|
299
|
+
/**
|
|
300
|
+
* Gets the total audio minutes of the call log.
|
|
301
|
+
* @returns The total audio minutes of the call log.
|
|
302
|
+
*/
|
|
303
|
+
getTotalAudioMinutes(): number;
|
|
304
|
+
/**
|
|
305
|
+
* Sets the total audio minutes of the call log.
|
|
306
|
+
* @param value - The total audio minutes to set.
|
|
307
|
+
*/
|
|
308
|
+
setTotalAudioMinutes(value: number): void;
|
|
309
|
+
/**
|
|
310
|
+
* Gets the total video minutes of the call log.
|
|
311
|
+
* @returns The total video minutes of the call log.
|
|
312
|
+
*/
|
|
313
|
+
getTotalVideoMinutes(): number;
|
|
314
|
+
/**
|
|
315
|
+
* Sets the total video minutes of the call log.
|
|
316
|
+
* @param value - The total video minutes to set.
|
|
317
|
+
*/
|
|
318
|
+
setTotalVideoMinutes(value: number): void;
|
|
319
|
+
/**
|
|
320
|
+
* Gets the total duration of the call log.
|
|
321
|
+
* @returns The total duration of the call log.
|
|
322
|
+
*/
|
|
323
|
+
getTotalDuration(): string;
|
|
324
|
+
/**
|
|
325
|
+
* Sets the total duration of the call log.
|
|
326
|
+
* @param value - The total duration to set.
|
|
327
|
+
*/
|
|
328
|
+
setTotalDuration(value: string): void;
|
|
329
|
+
/**
|
|
330
|
+
* Gets whether the call log has a recording.
|
|
331
|
+
* @returns Whether the call log has a recording.
|
|
332
|
+
*/
|
|
333
|
+
getHasRecording(): boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Sets whether the call log has a recording.
|
|
336
|
+
* @param value - Whether the call log has a recording.
|
|
337
|
+
*/
|
|
338
|
+
setHasRecording(value: boolean): void;
|
|
339
|
+
/**
|
|
340
|
+
* Gets the time the call was initiated at.
|
|
341
|
+
* @returns The time the call was initiated at.
|
|
342
|
+
*/
|
|
343
|
+
getInitiatedAt(): number;
|
|
344
|
+
/**
|
|
345
|
+
* Sets the time the call was initiated at.
|
|
346
|
+
* @param value - The time the call was initiated at.
|
|
347
|
+
*/
|
|
348
|
+
setInitiatedAt(value: number): void;
|
|
349
|
+
/**
|
|
350
|
+
* Gets the call category of the call log.
|
|
351
|
+
* @returns The call category of the call log.
|
|
352
|
+
*/
|
|
353
|
+
getCallCategory(): string;
|
|
354
|
+
/**
|
|
355
|
+
* Sets the call category of the call log.
|
|
356
|
+
* @param value - The call category to set.
|
|
357
|
+
*/
|
|
358
|
+
setCallCategory(value: string): void;
|
|
359
|
+
/**
|
|
360
|
+
* Gets the initiator of the call log.
|
|
361
|
+
* @returns The initiator of the call log.
|
|
362
|
+
*/
|
|
363
|
+
getInitiator(): CallUser;
|
|
364
|
+
/**
|
|
365
|
+
* Sets the initiator of the call log.
|
|
366
|
+
* @param value - The initiator to set.
|
|
367
|
+
*/
|
|
368
|
+
setInitiator(value: CallUser): void;
|
|
369
|
+
/**
|
|
370
|
+
* Gets the receiver of the call log.
|
|
371
|
+
* @returns The receiver of the call log.
|
|
372
|
+
*/
|
|
373
|
+
getReceiver(): CallUser | CallGroup;
|
|
374
|
+
/**
|
|
375
|
+
* Sets the receiver of the call log.
|
|
376
|
+
* @param value - The receiver to set.
|
|
377
|
+
*/
|
|
378
|
+
setReceiver(value: CallUser | CallGroup): void;
|
|
379
|
+
/**
|
|
380
|
+
* Gets the receiver type of the call log.
|
|
381
|
+
* @returns The receiver type of the call log.
|
|
382
|
+
*/
|
|
383
|
+
getReceiverType(): string;
|
|
384
|
+
/**
|
|
385
|
+
* Sets the receiver type of the call log.
|
|
386
|
+
* @param value - The receiver type to set.
|
|
387
|
+
*/
|
|
388
|
+
setReceiverType(value: string): void;
|
|
389
|
+
/**
|
|
390
|
+
* Gets the status of the call log.
|
|
391
|
+
* @returns The status of the call log.
|
|
392
|
+
*/
|
|
393
|
+
getStatus(): string;
|
|
394
|
+
/**
|
|
395
|
+
* Sets the status of the call log.
|
|
396
|
+
* @param value - The status to set.
|
|
397
|
+
*/
|
|
398
|
+
setStatus(value: string): void;
|
|
399
|
+
/**
|
|
400
|
+
* Gets the total duration in minutes of the call log.
|
|
401
|
+
* @returns The total duration in minutes of the call log.
|
|
402
|
+
*/
|
|
403
|
+
getTotalDurationInMinutes(): number;
|
|
404
|
+
/**
|
|
405
|
+
* Sets the total duration in minutes of the call log.
|
|
406
|
+
* @param value - The total duration in minutes to set.
|
|
407
|
+
*/
|
|
408
|
+
setTotalDurationInMinutes(value: number): void;
|
|
409
|
+
/**
|
|
410
|
+
* Gets the total number of participants in the call log.
|
|
411
|
+
* @returns The total number of participants in the call log.
|
|
412
|
+
*/
|
|
413
|
+
getTotalParticipants(): number;
|
|
414
|
+
/**
|
|
415
|
+
* Sets the total number of participants in the call log.
|
|
416
|
+
* @param value - The total number of participants to set.
|
|
417
|
+
*/
|
|
418
|
+
setTotalParticipants(value: number): void;
|
|
419
|
+
/**
|
|
420
|
+
* Gets the type of the call log.
|
|
421
|
+
* @returns The type of the call log.
|
|
422
|
+
*/
|
|
423
|
+
getType(): string;
|
|
424
|
+
/**
|
|
425
|
+
* Sets the type of the call log.
|
|
426
|
+
* @param value - The type to set.
|
|
427
|
+
*/
|
|
428
|
+
setType(value: string): void;
|
|
429
|
+
/**
|
|
430
|
+
* Gets the message ID of the call log.
|
|
431
|
+
* @returns The message ID of the call log.
|
|
432
|
+
*/
|
|
433
|
+
getMid(): string;
|
|
434
|
+
/**
|
|
435
|
+
* Sets the message ID of the call log.
|
|
436
|
+
* @param value - The message ID to set.
|
|
437
|
+
*/
|
|
438
|
+
setMid(value: string): void;
|
|
439
|
+
/**
|
|
440
|
+
* Gets the time the call ended at.
|
|
441
|
+
* @returns The time the call ended at.
|
|
442
|
+
*/
|
|
443
|
+
getEndedAt(): number;
|
|
444
|
+
/**
|
|
445
|
+
* Sets the time the call ended at.
|
|
446
|
+
* @param value - The time the call ended at.
|
|
447
|
+
*/
|
|
448
|
+
setEndedAt(value: number): void;
|
|
449
|
+
/**
|
|
450
|
+
* Gets the participants of the call log.
|
|
451
|
+
* @returns The participants of the call log.
|
|
452
|
+
*/
|
|
453
|
+
getParticipants(): Participant_2[];
|
|
454
|
+
/**
|
|
455
|
+
* Sets the participants of the call log.
|
|
456
|
+
* @param value - The participants to set.
|
|
457
|
+
*/
|
|
458
|
+
setParticipants(value: Participant_2[]): void;
|
|
459
|
+
/**
|
|
460
|
+
* Gets the recordings of the call log.
|
|
461
|
+
* @returns The recordings of the call log.
|
|
462
|
+
*/
|
|
463
|
+
getRecordings(): Recording[];
|
|
464
|
+
/**
|
|
465
|
+
* Sets the recordings of the call log.
|
|
466
|
+
* @param value - The recordings to set.
|
|
467
|
+
*/
|
|
468
|
+
setRecordings(value: Recording[]): void;
|
|
469
|
+
/**
|
|
470
|
+
* Creates a new instance of CallLog from JSON data.
|
|
471
|
+
* @param data - The JSON data to create the call log from.
|
|
472
|
+
* @returns A new instance of CallLog created from the JSON data.
|
|
473
|
+
*/
|
|
474
|
+
static callLogFromJson(data: any): CallLog;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Represents a request to fetch call logs.
|
|
479
|
+
*/
|
|
480
|
+
declare class CallLogRequest {
|
|
481
|
+
/**
|
|
482
|
+
* The maximum number of call logs to fetch.
|
|
483
|
+
*/
|
|
484
|
+
private limit;
|
|
485
|
+
/**
|
|
486
|
+
* The total number of pages of call logs.
|
|
487
|
+
*/
|
|
488
|
+
private totalPages;
|
|
489
|
+
/**
|
|
490
|
+
* The current page of call logs.
|
|
491
|
+
*/
|
|
492
|
+
private currentPage;
|
|
493
|
+
/**
|
|
494
|
+
* The type of call to filter by.
|
|
495
|
+
*/
|
|
496
|
+
private callType;
|
|
497
|
+
/**
|
|
498
|
+
* The status of call to filter by.
|
|
499
|
+
*/
|
|
500
|
+
private callStatus;
|
|
501
|
+
/**
|
|
502
|
+
* Whether the call has a recording or not.
|
|
503
|
+
*/
|
|
504
|
+
private hasRecording;
|
|
505
|
+
/**
|
|
506
|
+
* The category of call to filter by.
|
|
507
|
+
*/
|
|
508
|
+
private callCategory;
|
|
509
|
+
/**
|
|
510
|
+
* The direction of call to filter by.
|
|
511
|
+
*/
|
|
512
|
+
private callDirection;
|
|
513
|
+
/**
|
|
514
|
+
* The user ID to filter by.
|
|
515
|
+
*/
|
|
516
|
+
private uid;
|
|
517
|
+
/**
|
|
518
|
+
* The group ID to filter by.
|
|
519
|
+
*/
|
|
520
|
+
private guid;
|
|
521
|
+
/**
|
|
522
|
+
* The authentication token to use for the API call.
|
|
523
|
+
*/
|
|
524
|
+
private authToken;
|
|
525
|
+
/**
|
|
526
|
+
* Whether an API call is currently in progress.
|
|
527
|
+
*/
|
|
528
|
+
private inProgress;
|
|
529
|
+
/**
|
|
530
|
+
* Creates a new CallLogRequest instance.
|
|
531
|
+
* @param builder The builder object to use for constructing the request.
|
|
532
|
+
*/
|
|
533
|
+
constructor(builder: CallLogRequestBuilder);
|
|
534
|
+
/**
|
|
535
|
+
* Fetches the next page of call logs.
|
|
536
|
+
* @returns A promise that resolves to an array of CallLog objects, or rejects with a CometChatCallsException if there was an error.
|
|
537
|
+
*/
|
|
538
|
+
fetchNext(): Promise<CallLog[]>;
|
|
539
|
+
/**
|
|
540
|
+
* Fetches the previous page of call logs.
|
|
541
|
+
* @returns A promise that resolves to an array of CallLog objects, or an empty array if there are no previous pages, or rejects with a CometChatCallsException if there was an error..
|
|
542
|
+
*/
|
|
543
|
+
fetchPrevious(): Promise<CallLog[] | []>;
|
|
544
|
+
/**
|
|
545
|
+
* Makes an API call to fetch call logs.
|
|
546
|
+
* @param isFetchNext Whether to fetch the next page of call logs.
|
|
547
|
+
* @returns A promise that resolves to an array of CallLog objects, or rejects with a CometChatCallsException if there was an error.
|
|
548
|
+
*/
|
|
549
|
+
private makeAPICall;
|
|
550
|
+
/**
|
|
551
|
+
* Gets the filter parameters for the API call.
|
|
552
|
+
* @param isNext Whether to fetch the next page of call logs.
|
|
553
|
+
* @returns The filter parameters object.
|
|
554
|
+
*/
|
|
555
|
+
private getParams;
|
|
556
|
+
/**
|
|
557
|
+
* Parses the API response and returns an array of CallLog objects.
|
|
558
|
+
* @param response The API response string.
|
|
559
|
+
* @returns An array of CallLog objects.
|
|
560
|
+
*/
|
|
561
|
+
private getCallLogList;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* A builder class for creating a request to fetch call logs.
|
|
566
|
+
*/
|
|
567
|
+
declare class CallLogRequestBuilder {
|
|
568
|
+
/** @private */ limit: number;
|
|
569
|
+
/** @private */ callType: string;
|
|
570
|
+
/** @private */ callStatus: string;
|
|
571
|
+
/** @private */ hasRecording: boolean;
|
|
572
|
+
/** @private */ callCategory: string;
|
|
573
|
+
/** @private */ callDirection: string;
|
|
574
|
+
/** @private */ uid: string;
|
|
575
|
+
/** @private */ guid: string;
|
|
576
|
+
/** @private */ authToken: string;
|
|
577
|
+
/**
|
|
578
|
+
* Sets the limit of call logs to be fetched.
|
|
579
|
+
* @param limit - The number of call logs to be fetched.
|
|
580
|
+
* @returns The CallLogRequestBuilder object.
|
|
581
|
+
*/
|
|
582
|
+
setLimit(limit: number): this;
|
|
583
|
+
/**
|
|
584
|
+
* Sets the type of call to be fetched.
|
|
585
|
+
* @param callType - The type of call to be fetched. Can be either 'video' or 'audio'.
|
|
586
|
+
* @returns The CallLogRequestBuilder object.
|
|
587
|
+
*/
|
|
588
|
+
setCallType(callType: 'video' | 'audio'): this;
|
|
589
|
+
/**
|
|
590
|
+
* Sets the status of call to be fetched.
|
|
591
|
+
* @param callStatus - The status of call to be fetched. Can be either 'ongoing', 'busy', 'rejected', 'cancelled', 'ended' or 'missed'.
|
|
592
|
+
* @returns The CallLogRequestBuilder object.
|
|
593
|
+
*/
|
|
594
|
+
setCallStatus(callStatus: 'ongoing' | 'busy' | 'rejected' | 'cancelled' | 'ended' | 'missed'): this;
|
|
595
|
+
/**
|
|
596
|
+
* Sets whether the call has recording or not.
|
|
597
|
+
* @param hasRecording - Whether the call has recording or not.
|
|
598
|
+
* @returns The CallLogRequestBuilder object.
|
|
599
|
+
*/
|
|
600
|
+
setHasRecording(hasRecording: boolean): this;
|
|
601
|
+
/**
|
|
602
|
+
* Sets the category of call to be fetched.
|
|
603
|
+
* @param callCategory - The category of call to be fetched. Can be either 'call' or 'meet'.
|
|
604
|
+
* @returns The CallLogRequestBuilder object.
|
|
605
|
+
*/
|
|
606
|
+
setCallCategory(callCategory: 'call' | 'meet'): this;
|
|
607
|
+
/**
|
|
608
|
+
* Sets the direction of call to be fetched.
|
|
609
|
+
* @param callDirection - The direction of call to be fetched. Can be either 'incoming' or 'outgoing'.
|
|
610
|
+
* @returns The CallLogRequestBuilder object.
|
|
611
|
+
*/
|
|
612
|
+
setCallDirection(callDirection: 'incoming' | 'outgoing'): this;
|
|
613
|
+
/**
|
|
614
|
+
* Sets the user ID of the call logs to be fetched.
|
|
615
|
+
* @param uid - The user ID of the call logs to be fetched.
|
|
616
|
+
* @returns The CallLogRequestBuilder object.
|
|
617
|
+
*/
|
|
618
|
+
setUid(uid: string): this;
|
|
619
|
+
/**
|
|
620
|
+
* Sets the group ID of the call logs to be fetched.
|
|
621
|
+
* @param guid - The group ID of the call logs to be fetched.
|
|
622
|
+
* @returns The CallLogRequestBuilder object.
|
|
623
|
+
*/
|
|
624
|
+
setGuid(guid: string): this;
|
|
625
|
+
/**
|
|
626
|
+
* Sets the authorization token for the request.
|
|
627
|
+
* @param authToken - The authorization token for the request.
|
|
628
|
+
* @returns The CallLogRequestBuilder object.
|
|
629
|
+
*/
|
|
630
|
+
setAuthToken(authToken: string): this;
|
|
631
|
+
/**
|
|
632
|
+
* Builds and returns the CallLogRequest object.
|
|
633
|
+
* @returns The CallLogRequest object.
|
|
634
|
+
*/
|
|
635
|
+
build(): CallLogRequest;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export declare class CallSession {
|
|
639
|
+
addEventListener<T extends keyof MobileSDKEvents>(event: T, callback: MobileSDKEvents[T]): {
|
|
640
|
+
remove: () => void;
|
|
641
|
+
};
|
|
642
|
+
getInstance(): CallSession;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
declare class CallSettings {
|
|
646
|
+
static POSITION_TOP_LEFT: string;
|
|
647
|
+
static POSITION_TOP_RIGHT: string;
|
|
648
|
+
static POSITION_BOTTOM_LEFT: string;
|
|
649
|
+
static POSITION_BOTTOM_RIGHT: string;
|
|
650
|
+
static POSITION: {
|
|
651
|
+
readonly TOP_LEFT: "top-left";
|
|
652
|
+
readonly TOP_RIGHT: "top-right";
|
|
653
|
+
readonly BOTTOM_LEFT: "bottom-left";
|
|
654
|
+
readonly BOTTOM_RIGHT: "bottom-right";
|
|
655
|
+
};
|
|
656
|
+
static ASPECT_RATIO_DEFAULT: string;
|
|
657
|
+
static ASPECT_RATIO_CONTAIN: string;
|
|
658
|
+
static ASPECT_RATIO_COVER: string;
|
|
659
|
+
static ASPECT_RATIO: {
|
|
660
|
+
readonly DEFAULT: "default";
|
|
661
|
+
readonly CONTAIN: "contain";
|
|
662
|
+
readonly COVER: "cover";
|
|
663
|
+
};
|
|
664
|
+
private defaultLayout;
|
|
665
|
+
private isAudioOnly;
|
|
666
|
+
private mode;
|
|
667
|
+
private ShowEndCallButton;
|
|
668
|
+
private ShowMuteAudioButton;
|
|
669
|
+
private ShowPauseVideoButton;
|
|
670
|
+
private ShowScreenShareButton;
|
|
671
|
+
private ShowSwitchModeButton;
|
|
672
|
+
private StartAudioMuted;
|
|
673
|
+
private StartVideoMuted;
|
|
674
|
+
private localizedObject;
|
|
675
|
+
private ShowRecordingButton;
|
|
676
|
+
private idleTimeoutPeriod;
|
|
677
|
+
private StartRecordingOnCallStart;
|
|
678
|
+
private callListener;
|
|
679
|
+
private ShowSwitchToVideoCallButton;
|
|
680
|
+
private VirtualBackground;
|
|
681
|
+
private ShowVirtualBackgroundSetting;
|
|
682
|
+
constructor(builder?: CallSettingsBuilder);
|
|
683
|
+
getCallListener(): OngoingCallListener;
|
|
684
|
+
isRecordingButtonEnabled(): boolean;
|
|
685
|
+
getIdleTimeoutPeriod(): number;
|
|
686
|
+
shouldStartRecordingOnCallStart(): boolean;
|
|
687
|
+
isAudioOnlyCall(): boolean;
|
|
688
|
+
isDefaultLayoutEnabled(): boolean;
|
|
689
|
+
getMode(): "TILE" | "SPOTLIGHT" | "DEFAULT" | undefined;
|
|
690
|
+
getStartWithAudioMuted(): boolean;
|
|
691
|
+
getStartWithVideoMuted(): boolean;
|
|
692
|
+
isEndCallButtonEnabled(): boolean;
|
|
693
|
+
isMuteAudioButtonEnabled(): boolean;
|
|
694
|
+
isPauseVideoButtonEnabled(): boolean;
|
|
695
|
+
isScreenShareButtonEnabled(): boolean;
|
|
696
|
+
isModeButtonEnabled(): boolean;
|
|
697
|
+
getLocalizedStringObject(): Object;
|
|
698
|
+
isAudioToVideoButtonEnabled(): boolean;
|
|
699
|
+
getVirtualBackground(): VirtualBackground;
|
|
700
|
+
isVirtualBackgroundSettingEnabled(): boolean;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
declare class CallSettingsBuilder {
|
|
704
|
+
/** @private */ defaultLayout: boolean;
|
|
705
|
+
/** @private */ isAudioOnly: boolean;
|
|
706
|
+
/** @private */ mode: ICallsettings['mode'];
|
|
707
|
+
/** @private */ ShowEndCallButton: boolean;
|
|
708
|
+
/** @private */ ShowMuteAudioButton: boolean;
|
|
709
|
+
/** @private */ ShowPauseVideoButton: boolean;
|
|
710
|
+
/** @private */ ShowScreenShareButton: boolean;
|
|
711
|
+
/** @private */ ShowSwitchModeButton: boolean;
|
|
712
|
+
/** @private */ StartAudioMuted: boolean;
|
|
713
|
+
/** @private */ StartVideoMuted: boolean;
|
|
714
|
+
/** @private */ localizedObject: Object;
|
|
715
|
+
/** @private */ ShowRecordingButton: boolean;
|
|
716
|
+
/** @private */ idleTimeoutPeriod: number;
|
|
717
|
+
/** @private */ StartRecordingOnCallStart: boolean;
|
|
718
|
+
/** @private */ ShowSwitchToVideoCallButton: boolean;
|
|
719
|
+
/** @private */ virtualBackground: VirtualBackground;
|
|
720
|
+
/** @private */ ShowVirtualBackgroundSetting: boolean;
|
|
721
|
+
/** @private */ callListener: OngoingCallListener;
|
|
722
|
+
/**
|
|
723
|
+
*
|
|
724
|
+
* @param {boolean} defaultLayout
|
|
725
|
+
* This methods shows/hides the default button layout.
|
|
726
|
+
* If set to true the default button layout will be shown.
|
|
727
|
+
* If set to false the default button layout will be hidden.
|
|
728
|
+
* Default value is true
|
|
729
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
730
|
+
*/
|
|
731
|
+
enableDefaultLayout(defaultLayout: boolean): this;
|
|
732
|
+
/**
|
|
733
|
+
*
|
|
734
|
+
* @param {boolean} isAudioOnly
|
|
735
|
+
* This methods sets the type(audio/video) of the call.
|
|
736
|
+
* If set to true, the call will be strictly an audio call.
|
|
737
|
+
* If set to false, the call will be an audio-video call.
|
|
738
|
+
* Default value is false
|
|
739
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
740
|
+
*/
|
|
741
|
+
setIsAudioOnlyCall(isAudioOnly: boolean): this;
|
|
742
|
+
/**
|
|
743
|
+
*
|
|
744
|
+
* @param {string} mode
|
|
745
|
+
* This method sets the mode of the call.
|
|
746
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
747
|
+
*/
|
|
748
|
+
setMode(mode: ICallsettings['mode']): this;
|
|
749
|
+
/**
|
|
750
|
+
*
|
|
751
|
+
* @param {boolean} showEndCallButton
|
|
752
|
+
* This method shows/hides the end call button.
|
|
753
|
+
* If set to true it will display the end call button.
|
|
754
|
+
* If set to false it will hide the end call button.
|
|
755
|
+
* Default value is true.
|
|
756
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
757
|
+
*/
|
|
758
|
+
showEndCallButton(showEndCallButton: boolean): this;
|
|
759
|
+
/**
|
|
760
|
+
*
|
|
761
|
+
* @param {boolean} showMuteAudioButton
|
|
762
|
+
* This method shows/hides the mute audio button.
|
|
763
|
+
* If set to true it will display the mute audio button.
|
|
764
|
+
* If set to false it will hide the mute audio button.
|
|
765
|
+
* Default value is true.
|
|
766
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
767
|
+
*/
|
|
768
|
+
showMuteAudioButton(showMuteAudioButton: boolean): this;
|
|
769
|
+
/**
|
|
770
|
+
*
|
|
771
|
+
* @param {boolean} showPauseVideoButton
|
|
772
|
+
* This method shows/hides the pause video button.
|
|
773
|
+
* If set to true it will display the pause video button.
|
|
774
|
+
* If set to false it will hide the pause video button.
|
|
775
|
+
* Default value is true.
|
|
776
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
777
|
+
*/
|
|
778
|
+
showPauseVideoButton(showPauseVideoButton: boolean): this;
|
|
779
|
+
/**
|
|
780
|
+
*
|
|
781
|
+
* @param {boolean} showScreenShareButton
|
|
782
|
+
* This method shows/hides the screen share button.
|
|
783
|
+
* If set to true it will display the screen share button.
|
|
784
|
+
* If set to false it will hide the screen share button.
|
|
785
|
+
* Default value is true.
|
|
786
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
787
|
+
*/
|
|
788
|
+
showScreenShareButton(showScreenShareButton: boolean): this;
|
|
789
|
+
/**
|
|
790
|
+
*
|
|
791
|
+
* @param {boolean} showModeButton
|
|
792
|
+
* This method shows/hides the switch mode button.
|
|
793
|
+
* If set to true it will display the switch mode button.
|
|
794
|
+
* If set to false it will hide the switch mode button.
|
|
795
|
+
* Default value is true.
|
|
796
|
+
* @returns
|
|
797
|
+
*/
|
|
798
|
+
showModeButton(showModeButton: boolean): this;
|
|
799
|
+
/**
|
|
800
|
+
*
|
|
801
|
+
* @param {Object} localizedStringObject
|
|
802
|
+
* This method will set the localized text in the call screen.
|
|
803
|
+
* @returns
|
|
804
|
+
*/
|
|
805
|
+
setLocalizedStringObject(localizedStringObject: Object): this;
|
|
806
|
+
/**
|
|
807
|
+
*
|
|
808
|
+
* @param {boolean} audioMuted
|
|
809
|
+
* This method allows the call to be started with audio muted.
|
|
810
|
+
* If set to true, the call will start with audio muted.
|
|
811
|
+
* Default value is false.
|
|
812
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
813
|
+
*/
|
|
814
|
+
startWithAudioMuted(audioMuted: boolean): this;
|
|
815
|
+
/**
|
|
816
|
+
*
|
|
817
|
+
* @param {boolean} videoMuted
|
|
818
|
+
* This method allows the call to be started with video muted.
|
|
819
|
+
* If set to true, the call will start with video muted.
|
|
820
|
+
* Default value is false.
|
|
821
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
822
|
+
*/
|
|
823
|
+
startWithVideoMuted(videoMuted: boolean): this;
|
|
824
|
+
/**
|
|
825
|
+
*
|
|
826
|
+
* @param {boolean} customCSS
|
|
827
|
+
* This method will set the custom CSS of the call screen.
|
|
828
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
829
|
+
*/
|
|
830
|
+
setCustomCSS(_: string): this;
|
|
831
|
+
/**
|
|
832
|
+
*
|
|
833
|
+
* @param {boolean} showRecordingButton
|
|
834
|
+
* This method shows/hides the recording button.
|
|
835
|
+
* If set to true it will display the recording button.
|
|
836
|
+
* If set to false it will hide the recording button.
|
|
837
|
+
* Default value is false.
|
|
838
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
839
|
+
*/
|
|
840
|
+
showRecordingButton(showRecordingButton: boolean): this;
|
|
841
|
+
/**
|
|
842
|
+
*
|
|
843
|
+
* @param {number} idleTimeoutPeriod
|
|
844
|
+
* This method sets the idle timeout period for the call.
|
|
845
|
+
* If set and you are the only one in call, the call will end
|
|
846
|
+
* after the idle timeout period, giving you the option to
|
|
847
|
+
* extend the call 60 seconds before the call ends.
|
|
848
|
+
* Default value is 180 seconds.
|
|
849
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
850
|
+
*/
|
|
851
|
+
setIdleTimeoutPeriod(idleTimeoutPeriod: number): this;
|
|
852
|
+
/**
|
|
853
|
+
*
|
|
854
|
+
* @param {boolean} startRecordingOnCallStart
|
|
855
|
+
* This method starts the recording as soon as the call start.
|
|
856
|
+
* If set to true it will start the recording as soon as the call start.
|
|
857
|
+
* Default value is false.
|
|
858
|
+
* @returns {CallSettingsBuilder} Returns the CallSettingsBuilder instance
|
|
859
|
+
*/
|
|
860
|
+
startRecordingOnCallStart(startRecordingOnCallStart: boolean): this;
|
|
861
|
+
/**
|
|
862
|
+
*
|
|
863
|
+
* @param {boolean} _showAudioToVideoSwitchButton
|
|
864
|
+
* This method shows/hides the switch to video call button.
|
|
865
|
+
* If set to true it will display the switch to video call button.
|
|
866
|
+
* If set to false it will hide the switch to video call button.
|
|
867
|
+
* Default value is true.
|
|
868
|
+
* @returns
|
|
869
|
+
*/
|
|
870
|
+
showSwitchToVideoCallButton(_showAudioToVideoSwitchButton: boolean): this;
|
|
871
|
+
/**
|
|
872
|
+
*
|
|
873
|
+
* @param {VirtualBackground} virtualBackground
|
|
874
|
+
* This method will set the virtual background setting.
|
|
875
|
+
* This methods takes an Object of VirtualBackground Class.
|
|
876
|
+
* @deprecated Virtual background feature is deprecated and it has no effect.
|
|
877
|
+
* @returns
|
|
878
|
+
*/
|
|
879
|
+
setVirtualBackground(virtualBackground: VirtualBackground): this;
|
|
880
|
+
/**
|
|
881
|
+
*
|
|
882
|
+
* @param {boolean} showVirtualBackgroundSetting
|
|
883
|
+
* This method shows/hides the virtual background setting button.
|
|
884
|
+
* If set to true it will display the virtual background setting button.
|
|
885
|
+
* If set to false it will hide the virtual background setting button.
|
|
886
|
+
* Default value is true.
|
|
887
|
+
* @returns
|
|
888
|
+
*/
|
|
889
|
+
showVirtualBackgroundSetting(showVirtualBackgroundSetting: boolean): this;
|
|
890
|
+
/**
|
|
891
|
+
*
|
|
892
|
+
* @param {OngoingCallListener} callListener
|
|
893
|
+
* This method can be used to subscribe to available callings events
|
|
894
|
+
* @returns
|
|
895
|
+
*/
|
|
896
|
+
setCallListener(callListener: OngoingCallListener): this;
|
|
897
|
+
/**
|
|
898
|
+
* This method will return an object of the CallSettings class.
|
|
899
|
+
* @returns {CallSettings} Returns the CallSettings instance
|
|
900
|
+
*/
|
|
901
|
+
build(): CallSettings;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
declare class CallUser {
|
|
905
|
+
protected uid: string;
|
|
906
|
+
protected name: string;
|
|
907
|
+
protected avatar: string;
|
|
908
|
+
constructor(object: any);
|
|
909
|
+
getUid(): string;
|
|
910
|
+
setUid(uid: string): void;
|
|
911
|
+
getName(): string;
|
|
912
|
+
setName(name: string): void;
|
|
913
|
+
getAvatar(): string;
|
|
914
|
+
setAvatar(avatar: string): void;
|
|
915
|
+
toString(): string;
|
|
916
|
+
static getUserFromJson(object: any): CallUser;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
declare const CAMERA_FACING: {
|
|
920
|
+
readonly FRONT: "FRONT";
|
|
921
|
+
readonly REAR: "REAR";
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
declare type CameraFacing = ValueOf<typeof CAMERA_FACING>;
|
|
925
|
+
|
|
926
|
+
declare interface CometChatAPIException extends Error {
|
|
927
|
+
readonly name: 'COMET_CHAT_API_ERROR' | 'NETWORK_ERROR' | 'VALIDATION_ERROR' | 'BAD_RESPONSE' | 'UNKNOWN_ERROR';
|
|
928
|
+
readonly details?: unknown;
|
|
929
|
+
readonly timestamp: number;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export declare class CometChatCalls extends SessionMethods {
|
|
933
|
+
private static loggedInUser;
|
|
934
|
+
private static isInitialized;
|
|
935
|
+
private static loginInProgress;
|
|
936
|
+
private static appSettings;
|
|
937
|
+
private static loginListeners;
|
|
938
|
+
static constants: {
|
|
939
|
+
LAYOUT: {
|
|
940
|
+
readonly TILE: "TILE";
|
|
941
|
+
readonly SIDEBAR: "SIDEBAR";
|
|
942
|
+
readonly SPOTLIGHT: "SPOTLIGHT";
|
|
943
|
+
};
|
|
944
|
+
TYPE: {
|
|
945
|
+
readonly VOICE: "VOICE";
|
|
946
|
+
readonly VIDEO: "VIDEO";
|
|
947
|
+
};
|
|
948
|
+
CAMERA_FACING: {
|
|
949
|
+
readonly FRONT: "FRONT";
|
|
950
|
+
readonly REAR: "REAR";
|
|
951
|
+
};
|
|
952
|
+
};
|
|
953
|
+
static CallLogRequestBuilder: typeof CallLogRequestBuilder;
|
|
954
|
+
static CallLog: typeof CallLog;
|
|
955
|
+
/**
|
|
956
|
+
* @deprecated Use CometChatCalls.init passing object directly.
|
|
957
|
+
*/
|
|
958
|
+
static CallAppSettingsBuilder: typeof CallAppSettingsBuilder;
|
|
959
|
+
/**
|
|
960
|
+
* @deprecated Use CometChatCalls.joinSession passing object directly.
|
|
961
|
+
*/
|
|
962
|
+
static CallSettingsBuilder: typeof CallSettingsBuilder;
|
|
963
|
+
/**
|
|
964
|
+
* @deprecated Use CometChatCalls.addEventListener
|
|
965
|
+
*/
|
|
966
|
+
static OngoingCallListener: typeof OngoingCallListener;
|
|
967
|
+
static init(appSettings: CallAppSettings_2 | CallAppSettings): Promise<{
|
|
968
|
+
readonly success: false;
|
|
969
|
+
readonly error: {
|
|
970
|
+
readonly name: "VALIDATION_ERROR";
|
|
971
|
+
readonly message: `Invalid app settings: ${string}`;
|
|
972
|
+
readonly timestamp: number;
|
|
973
|
+
};
|
|
974
|
+
} | {
|
|
975
|
+
readonly success: true;
|
|
976
|
+
readonly error: null;
|
|
977
|
+
}>;
|
|
978
|
+
static login(uid: string, authKey?: string): Promise<User_2>;
|
|
979
|
+
static loginWithAuthToken(authToken: string): Promise<User_2>;
|
|
980
|
+
static logout(): Promise<string>;
|
|
981
|
+
static getLoggedInUser(): User_2 | null;
|
|
982
|
+
static getUserAuthToken(): string | null;
|
|
983
|
+
static isUserLoggedIn(): boolean;
|
|
984
|
+
static addLoginListener(listenerId: string, listener: LoginListener): void;
|
|
985
|
+
static removeLoginListener(listenerId: string): void;
|
|
986
|
+
static generateToken(sessionId: string, authToken?: string): Promise<{
|
|
987
|
+
token: string;
|
|
988
|
+
}>;
|
|
989
|
+
private static getBaseURL;
|
|
990
|
+
private static loginWithUID;
|
|
991
|
+
private static authenticateWithToken;
|
|
992
|
+
private static logoutInternal;
|
|
993
|
+
private static callGenerateTokenAPI;
|
|
994
|
+
private static callVerifyTokenAPI;
|
|
995
|
+
private static saveUser;
|
|
996
|
+
private static getSavedUser;
|
|
997
|
+
private static clearSavedUser;
|
|
998
|
+
private static generateDeviceId;
|
|
999
|
+
private static createError;
|
|
1000
|
+
private static notifyLoginSuccess;
|
|
1001
|
+
private static notifyLoginFailure;
|
|
1002
|
+
private static notifyLogoutSuccess;
|
|
1003
|
+
private static notifyLogoutFailure;
|
|
1004
|
+
static addEventListener<K extends keyof WebSDKEvents>(eventType: K, listener: WebSDKEvents[K], options?: {
|
|
1005
|
+
signal?: AbortSignal;
|
|
1006
|
+
}): () => void;
|
|
1007
|
+
/**
|
|
1008
|
+
* @deprecated Use CometChatCalls.joinSession instead.
|
|
1009
|
+
*/
|
|
1010
|
+
static startSession(callToken: string, callSettings: CallSettings, container: HTMLElement): Promise<Result<void, VerifyTokenException>>;
|
|
1011
|
+
private static _connectToRoom;
|
|
1012
|
+
private static connectToRoom;
|
|
1013
|
+
static joinSession(callToken: string, callSettings: SessionSettings, container: HTMLElement): Promise<Result<void, VerifyTokenException>>;
|
|
1014
|
+
static getAudioInputDevices(): AudioInputDevice_2[];
|
|
1015
|
+
static getVideoInputDevices(): VideoInputDevice_2[];
|
|
1016
|
+
static getAudioOutputDevices(): AudioOutputDevice_2[];
|
|
1017
|
+
static getCurrentAudioInputDevice(): AudioInputDevice_2 | undefined;
|
|
1018
|
+
static getCurrentVideoInputDevice(): VideoInputDevice_2 | undefined;
|
|
1019
|
+
static getCurrentAudioOutputDevice(): AudioOutputDevice_2 | undefined;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
declare namespace CometChatCallsDefault {
|
|
1023
|
+
export {
|
|
1024
|
+
SessionSettings,
|
|
1025
|
+
CometChatCalls
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
export default CometChatCallsDefault;
|
|
1029
|
+
|
|
1030
|
+
declare class CometChatCallsException {
|
|
1031
|
+
code?: ErrorModel['code'];
|
|
1032
|
+
name?: ErrorModel['name'];
|
|
1033
|
+
message?: ErrorModel['message'];
|
|
1034
|
+
details?: ErrorModel['details'];
|
|
1035
|
+
constructor(errorModel: ErrorModel);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
declare interface CometChatException {
|
|
1039
|
+
errorCode: string;
|
|
1040
|
+
errorDescription: string;
|
|
1041
|
+
message?: string;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
declare type ConfigStateBoth = {
|
|
1045
|
+
sessionType: SessionType;
|
|
1046
|
+
layout: Layout;
|
|
1047
|
+
initialCameraFacing?: CameraFacing;
|
|
1048
|
+
autoStartRecording: boolean;
|
|
1049
|
+
hideRecordingButton: boolean;
|
|
1050
|
+
hideControlPanel: boolean;
|
|
1051
|
+
hideLeaveSessionButton: boolean;
|
|
1052
|
+
hideHeaderPanel: boolean;
|
|
1053
|
+
hideRaiseHandButton: boolean;
|
|
1054
|
+
hideShareInviteButton: boolean;
|
|
1055
|
+
hideChangeLayoutButton: boolean;
|
|
1056
|
+
hideToggleAudioButton: boolean;
|
|
1057
|
+
hideToggleVideoButton: boolean;
|
|
1058
|
+
hideParticipantListButton: boolean;
|
|
1059
|
+
hideChatButton: boolean;
|
|
1060
|
+
hideScreenSharingButton: boolean;
|
|
1061
|
+
hideSessionTimer: boolean;
|
|
1062
|
+
hideNetworkIndicator: boolean;
|
|
1063
|
+
hideRecordingStatusIndicator: boolean;
|
|
1064
|
+
hideSwitchCameraButton: boolean;
|
|
1065
|
+
enableParticipantContextMenu: boolean;
|
|
1066
|
+
displayName: string;
|
|
1067
|
+
startAudioMuted: boolean;
|
|
1068
|
+
startVideoPaused: boolean;
|
|
1069
|
+
title: string;
|
|
1070
|
+
idleTimeoutPeriodBeforePrompt: number;
|
|
1071
|
+
idleTimeoutPeriodAfterPrompt: number;
|
|
1072
|
+
enableSpotlightDrag: boolean;
|
|
1073
|
+
enableSpotlightSwap: boolean;
|
|
1074
|
+
isPeerCall: boolean;
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1077
|
+
declare type ConfigStateWeb = {
|
|
1078
|
+
enableNoiseReduction: boolean;
|
|
1079
|
+
audioInputDeviceId?: string;
|
|
1080
|
+
audioOutputDeviceId?: string;
|
|
1081
|
+
videoInputDeviceId?: string;
|
|
1082
|
+
hideVirtualBackgroundButton: boolean;
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
*
|
|
1087
|
+
*
|
|
1088
|
+
* @export
|
|
1089
|
+
* @interface ErrorModel
|
|
1090
|
+
*/
|
|
1091
|
+
declare interface ErrorModel {
|
|
1092
|
+
code?: string | number;
|
|
1093
|
+
name?: string;
|
|
1094
|
+
message?: string;
|
|
1095
|
+
details?: string;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
declare const EVENT_LISTENER_METHODS: {
|
|
1099
|
+
readonly SessionStatusListener: {
|
|
1100
|
+
readonly onSessionJoined: "onSessionJoined";
|
|
1101
|
+
readonly onSessionLeft: "onSessionLeft";
|
|
1102
|
+
readonly onConnectionLost: "onConnectionLost";
|
|
1103
|
+
readonly onConnectionRestored: "onConnectionRestored";
|
|
1104
|
+
readonly onConnectionClosed: "onConnectionClosed";
|
|
1105
|
+
readonly onSessionTimedOut: "onSessionTimedOut";
|
|
1106
|
+
};
|
|
1107
|
+
readonly MediaEventsListener: {
|
|
1108
|
+
readonly onAudioMuted: "onAudioMuted";
|
|
1109
|
+
readonly onAudioUnMuted: "onAudioUnMuted";
|
|
1110
|
+
readonly onVideoPaused: "onVideoPaused";
|
|
1111
|
+
readonly onVideoResumed: "onVideoResumed";
|
|
1112
|
+
readonly onRecordingStarted: "onRecordingStarted";
|
|
1113
|
+
readonly onRecordingStopped: "onRecordingStopped";
|
|
1114
|
+
readonly onScreenShareStarted: "onScreenShareStarted";
|
|
1115
|
+
readonly onScreenShareStopped: "onScreenShareStopped";
|
|
1116
|
+
};
|
|
1117
|
+
readonly ParticipantEventsListner: {
|
|
1118
|
+
readonly onParticipantJoined: "onParticipantJoined";
|
|
1119
|
+
readonly onParticipantLeft: "onParticipantLeft";
|
|
1120
|
+
readonly onParticipantAudioMuted: "onParticipantAudioMuted";
|
|
1121
|
+
readonly onParticipantAudioUnmuted: "onParticipantAudioUnmuted";
|
|
1122
|
+
readonly onParticipantVideoPaused: "onParticipantVideoPaused";
|
|
1123
|
+
readonly onParticipantVideoResumed: "onParticipantVideoResumed";
|
|
1124
|
+
readonly onParticipantHandRaised: "onParticipantHandRaised";
|
|
1125
|
+
readonly onParticipantHandLowered: "onParticipantHandLowered";
|
|
1126
|
+
readonly onParticipantStartedScreenShare: "onParticipantStartedScreenShare";
|
|
1127
|
+
readonly onParticipantStoppedScreenShare: "onParticipantStoppedScreenShare";
|
|
1128
|
+
readonly onParticipantStartedRecording: "onParticipantStartedRecording";
|
|
1129
|
+
readonly onParticipantStoppedRecording: "onParticipantStoppedRecording";
|
|
1130
|
+
readonly onDominantSpeakerChanged: "onDominantSpeakerChanged";
|
|
1131
|
+
readonly onParticipantListChanged: "onParticipantListChanged";
|
|
1132
|
+
};
|
|
1133
|
+
readonly ButtonClickListener: {
|
|
1134
|
+
readonly onLeaveSessionButtonClicked: "onLeaveSessionButtonClicked";
|
|
1135
|
+
readonly onRaiseHandButtonClicked: "onRaiseHandButtonClicked";
|
|
1136
|
+
readonly onShareInviteButtonClicked: "onShareInviteButtonClicked";
|
|
1137
|
+
readonly onChangeLayoutButtonClicked: "onChangeLayoutButtonClicked";
|
|
1138
|
+
readonly onParticipantListButtonClicked: "onParticipantListButtonClicked";
|
|
1139
|
+
readonly onToggleAudioButtonClicked: "onToggleAudioButtonClicked";
|
|
1140
|
+
readonly onToggleVideoButtonClicked: "onToggleVideoButtonClicked";
|
|
1141
|
+
readonly onRecordingToggleButtonClicked: "onRecordingToggleButtonClicked";
|
|
1142
|
+
readonly onScreenShareButtonClicked: "onScreenShareButtonClicked";
|
|
1143
|
+
readonly onChatButtonClicked: "onChatButtonClicked";
|
|
1144
|
+
};
|
|
1145
|
+
readonly CallLayoutListener: {
|
|
1146
|
+
readonly onCallLayoutChanged: "onCallLayoutChanged";
|
|
1147
|
+
readonly onParticipantListVisible: "onParticipantListVisible";
|
|
1148
|
+
readonly onParticipantListHidden: "onParticipantListHidden";
|
|
1149
|
+
};
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
declare type Host = _TDomain | Omit<string, _TDomain>;
|
|
1153
|
+
|
|
1154
|
+
declare type HumanParticipant = v.InferInput<typeof HumanParticipantSchema>;
|
|
1155
|
+
|
|
1156
|
+
declare const HumanParticipantSchema: v.ObjectSchema<{
|
|
1157
|
+
readonly name: v.StringSchema<undefined>;
|
|
1158
|
+
readonly pid: v.StringSchema<undefined>;
|
|
1159
|
+
readonly ruid: v.StringSchema<undefined>;
|
|
1160
|
+
readonly role: v.PicklistSchema<("moderator" | "none")[], undefined>;
|
|
1161
|
+
readonly uid: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1162
|
+
readonly avatar: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1163
|
+
readonly isLocal: v.BooleanSchema<undefined>;
|
|
1164
|
+
readonly sources: v.OptionalSchema<v.MapSchema<v.UnionSchema<[v.LiteralSchema<"video", undefined>, v.LiteralSchema<"audio", undefined>], undefined>, v.MapSchema<v.StringSchema<undefined>, v.AnySchema, undefined>, undefined>, undefined>;
|
|
1165
|
+
readonly type: v.LiteralSchema<"human", undefined>;
|
|
1166
|
+
}, undefined>;
|
|
1167
|
+
|
|
1168
|
+
declare interface IAVDevice {
|
|
1169
|
+
deviceId: string;
|
|
1170
|
+
kind: string;
|
|
1171
|
+
label: string;
|
|
1172
|
+
groupId: string;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
declare interface ICallEventsData {
|
|
1176
|
+
onUserJoined: User;
|
|
1177
|
+
onUserLeft: User;
|
|
1178
|
+
onUserUnMuted: User;
|
|
1179
|
+
onUserMuted: {
|
|
1180
|
+
muted: {
|
|
1181
|
+
name: string;
|
|
1182
|
+
avatar?: string;
|
|
1183
|
+
isVideoMuted: boolean;
|
|
1184
|
+
isAudioMuted: boolean;
|
|
1185
|
+
uid: string;
|
|
1186
|
+
joinedAt: string;
|
|
1187
|
+
};
|
|
1188
|
+
mutedBy: {
|
|
1189
|
+
name: string;
|
|
1190
|
+
avatar?: string;
|
|
1191
|
+
isAudioMuted: boolean;
|
|
1192
|
+
isVideoMuted: boolean;
|
|
1193
|
+
uid: string;
|
|
1194
|
+
joinedAt: string;
|
|
1195
|
+
};
|
|
1196
|
+
};
|
|
1197
|
+
onUserListUpdated: Array<User>;
|
|
1198
|
+
onScreenShareStarted: {};
|
|
1199
|
+
onScreenShareStopped: {};
|
|
1200
|
+
onRecordingStarted: {
|
|
1201
|
+
user: Pick<IUserWithExtraData, 'name' | 'uid'>;
|
|
1202
|
+
};
|
|
1203
|
+
onMediaDeviceListUpdated: {
|
|
1204
|
+
videoInputDevices: IAVDevice[];
|
|
1205
|
+
audioInputDevices: IAVDevice[];
|
|
1206
|
+
audioOutputDevices: IAVDevice[];
|
|
1207
|
+
};
|
|
1208
|
+
onCallEnded: {};
|
|
1209
|
+
onSessionTimeout: {};
|
|
1210
|
+
onCallSwitchedToVideo: {
|
|
1211
|
+
sessionId: string;
|
|
1212
|
+
initiator: {
|
|
1213
|
+
name: string;
|
|
1214
|
+
avatar?: string;
|
|
1215
|
+
isVideoMuted: boolean;
|
|
1216
|
+
isAudioMuted: boolean;
|
|
1217
|
+
uid: string;
|
|
1218
|
+
joinedAt: string;
|
|
1219
|
+
};
|
|
1220
|
+
responder: {
|
|
1221
|
+
name: string;
|
|
1222
|
+
avatar?: string;
|
|
1223
|
+
isVideoMuted: boolean;
|
|
1224
|
+
isAudioMuted: boolean;
|
|
1225
|
+
uid: string;
|
|
1226
|
+
joinedAt: string;
|
|
1227
|
+
};
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
declare interface ICallsettings {
|
|
1232
|
+
screenShareMode?: 'default' | 'presenter';
|
|
1233
|
+
ShowEndCallButton?: boolean;
|
|
1234
|
+
ShowRecordingButton?: boolean;
|
|
1235
|
+
idleTimeoutPeriod?: number;
|
|
1236
|
+
StartRecordingOnCallStart?: boolean;
|
|
1237
|
+
ShowMuteAudioButton?: boolean;
|
|
1238
|
+
ShowPauseVideoButton?: boolean;
|
|
1239
|
+
ShowScreenShareButton?: boolean;
|
|
1240
|
+
ShowSwitchToVideoCallButton?: boolean;
|
|
1241
|
+
defaultLayout?: boolean;
|
|
1242
|
+
isAudioCall?: boolean;
|
|
1243
|
+
isAudioOnly?: boolean;
|
|
1244
|
+
user?: {
|
|
1245
|
+
name: string;
|
|
1246
|
+
avatar?: string;
|
|
1247
|
+
uid: string;
|
|
1248
|
+
jwt?: string;
|
|
1249
|
+
};
|
|
1250
|
+
mode?: (typeof CallConstants.MODE)[keyof typeof CallConstants.MODE];
|
|
1251
|
+
StartAudioMuted?: boolean;
|
|
1252
|
+
StartVideoMuted?: boolean;
|
|
1253
|
+
ShowSwitchModeButton?: boolean;
|
|
1254
|
+
ShowVirtualBackgroundSetting?: boolean;
|
|
1255
|
+
VirtualBackground?: {
|
|
1256
|
+
AllowBackgroundBlur?: boolean;
|
|
1257
|
+
AllowUserImages?: boolean;
|
|
1258
|
+
ShowDefaultImages?: boolean;
|
|
1259
|
+
SetImages?: string[];
|
|
1260
|
+
EnforceBackgroundBlur?: 0 | 1 | 2;
|
|
1261
|
+
EnforceBackgroundImage?: string;
|
|
1262
|
+
};
|
|
1263
|
+
AvatarMode?: 'circle';
|
|
1264
|
+
MainVideoContainerSetting?: {
|
|
1265
|
+
videoFit?: 'contain' | 'cover';
|
|
1266
|
+
zoomButton?: {
|
|
1267
|
+
visible?: boolean;
|
|
1268
|
+
visibility?: boolean;
|
|
1269
|
+
position?: TPosition;
|
|
1270
|
+
};
|
|
1271
|
+
nameLabel?: {
|
|
1272
|
+
visible?: boolean;
|
|
1273
|
+
visibility?: boolean;
|
|
1274
|
+
position?: TPosition;
|
|
1275
|
+
color?: TColor;
|
|
1276
|
+
};
|
|
1277
|
+
network?: {
|
|
1278
|
+
visible?: boolean;
|
|
1279
|
+
visibility?: boolean;
|
|
1280
|
+
position?: TPosition;
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
customCSS?: string;
|
|
1284
|
+
analyticsSettings?: {
|
|
1285
|
+
ANALYTICS_HOST?: string;
|
|
1286
|
+
ANALYTICS_VERSION?: string;
|
|
1287
|
+
ANALYTICS_PING_DISABLED?: boolean;
|
|
1288
|
+
ANALYTICS_USE_SSL?: boolean;
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
declare interface IOngoingCallListener {
|
|
1293
|
+
onUserJoined: (user: Partial<ICallEventsData['onUserJoined']>) => void;
|
|
1294
|
+
onUserLeft: (user: Partial<ICallEventsData['onUserJoined']>) => void;
|
|
1295
|
+
onUserListUpdated: (userList: Partial<ICallEventsData['onUserListUpdated']>) => void;
|
|
1296
|
+
onMediaDeviceListUpdated: (devices: Partial<ICallEventsData['onMediaDeviceListUpdated']>) => void;
|
|
1297
|
+
onRecordingStarted: (event: Partial<ICallEventsData['onRecordingStarted']>) => void;
|
|
1298
|
+
onRecordingStopped: () => void;
|
|
1299
|
+
onScreenShareStarted: () => void;
|
|
1300
|
+
onScreenShareStopped: () => void;
|
|
1301
|
+
onUserMuted: (event: Partial<ICallEventsData['onUserMuted']>) => void;
|
|
1302
|
+
onUserUnMuted: (event: Partial<ICallEventsData['onUserUnMuted']>) => void;
|
|
1303
|
+
onCallSwitchedToVideo: (event: Partial<ICallEventsData['onCallSwitchedToVideo']>) => void;
|
|
1304
|
+
onCallEnded: () => void;
|
|
1305
|
+
onSessionTimeout: () => void;
|
|
1306
|
+
onCallEndButtonPressed: () => void;
|
|
1307
|
+
onError: (error: CometChatCallsException) => void;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
declare interface IUserWithExtraData {
|
|
1311
|
+
name: string;
|
|
1312
|
+
avatar: string;
|
|
1313
|
+
status: string;
|
|
1314
|
+
isVideoMuted: string;
|
|
1315
|
+
isAudioMuted: string;
|
|
1316
|
+
showVideo: string;
|
|
1317
|
+
isLocalUser: string;
|
|
1318
|
+
audioTrack: string;
|
|
1319
|
+
id: string;
|
|
1320
|
+
uid: string;
|
|
1321
|
+
joinedAt: string;
|
|
1322
|
+
videoTrack: string;
|
|
1323
|
+
stats: string;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
declare const LAYOUT: {
|
|
1327
|
+
readonly TILE: "TILE";
|
|
1328
|
+
readonly SIDEBAR: "SIDEBAR";
|
|
1329
|
+
readonly SPOTLIGHT: "SPOTLIGHT";
|
|
1330
|
+
};
|
|
1331
|
+
|
|
1332
|
+
declare type Layout = ValueOf<typeof LAYOUT>;
|
|
1333
|
+
|
|
1334
|
+
declare interface LoginListener {
|
|
1335
|
+
onLoginSuccess?: (user: User_2) => void;
|
|
1336
|
+
onLoginFailure?: (error: CometChatException) => void;
|
|
1337
|
+
onLogoutSuccess?: () => void;
|
|
1338
|
+
onLogoutFailure?: (error: CometChatException) => void;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
declare type MobileSDKEvents = SDKEvents & {
|
|
1342
|
+
onAudioModeChanged: (payload: AudioMode['type']) => void;
|
|
1343
|
+
onCameraFacingChanged: (payload: CameraFacing) => void;
|
|
1344
|
+
onSwitchCameraButtonClicked: () => void;
|
|
1345
|
+
onPictureInPictureLayoutEnabled: () => void;
|
|
1346
|
+
onPictureInPictureLayoutDisabled: () => void;
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
declare class OngoingCallListener {
|
|
1350
|
+
/* Excluded from this release type: onYouLeft */
|
|
1351
|
+
/* Excluded from this release type: onYouJoined */
|
|
1352
|
+
/**
|
|
1353
|
+
* This event is triggered when a user joins the call.
|
|
1354
|
+
*/
|
|
1355
|
+
onUserJoined?: IOngoingCallListener['onUserJoined'];
|
|
1356
|
+
/**
|
|
1357
|
+
* This event is triggered when a user leaves the call.
|
|
1358
|
+
*/
|
|
1359
|
+
onUserLeft?: IOngoingCallListener['onUserLeft'];
|
|
1360
|
+
/**
|
|
1361
|
+
* This event is triggered when the participant list of the call changes.
|
|
1362
|
+
*/
|
|
1363
|
+
onUserListUpdated?: IOngoingCallListener['onUserListUpdated'];
|
|
1364
|
+
/**
|
|
1365
|
+
* This event is triggered when the media device list changes.
|
|
1366
|
+
*/
|
|
1367
|
+
onMediaDeviceListUpdated?: IOngoingCallListener['onMediaDeviceListUpdated'];
|
|
1368
|
+
/**
|
|
1369
|
+
* This event is triggered when someone starts recording the call.
|
|
1370
|
+
*/
|
|
1371
|
+
onRecordingStarted?: IOngoingCallListener['onRecordingStarted'];
|
|
1372
|
+
/**
|
|
1373
|
+
* This event is triggered when someone stops recording the call.
|
|
1374
|
+
*/
|
|
1375
|
+
onRecordingStopped?: IOngoingCallListener['onRecordingStopped'];
|
|
1376
|
+
/**
|
|
1377
|
+
* This event is triggered when someone starts sharing their screen in the call.
|
|
1378
|
+
*/
|
|
1379
|
+
onScreenShareStarted?: IOngoingCallListener['onScreenShareStarted'];
|
|
1380
|
+
/**
|
|
1381
|
+
* This event is triggered when someone stops sharing their screen in the call.
|
|
1382
|
+
*/
|
|
1383
|
+
onScreenShareStopped?: IOngoingCallListener['onScreenShareStopped'];
|
|
1384
|
+
/**
|
|
1385
|
+
* This event is triggered when a user is muted.
|
|
1386
|
+
*/
|
|
1387
|
+
onUserMuted?: IOngoingCallListener['onUserMuted'];
|
|
1388
|
+
/**
|
|
1389
|
+
* This event is triggered when a user is unmuted.
|
|
1390
|
+
*/
|
|
1391
|
+
onUserUnMuted?: IOngoingCallListener['onUserUnMuted'];
|
|
1392
|
+
/**
|
|
1393
|
+
* This event is triggered when an audio call is switched to a video call.
|
|
1394
|
+
*/
|
|
1395
|
+
onCallSwitchedToVideo?: IOngoingCallListener['onCallSwitchedToVideo'];
|
|
1396
|
+
/**
|
|
1397
|
+
* This event is triggered when the call is ended.
|
|
1398
|
+
*/
|
|
1399
|
+
onCallEnded?: IOngoingCallListener['onCallEnded'];
|
|
1400
|
+
/**
|
|
1401
|
+
* This event is triggered when the call is ended due to session timeout.
|
|
1402
|
+
*/
|
|
1403
|
+
onSessionTimeout?: IOngoingCallListener['onSessionTimeout'];
|
|
1404
|
+
/**
|
|
1405
|
+
* This event is triggered when an error occurs.
|
|
1406
|
+
*/
|
|
1407
|
+
onError?: IOngoingCallListener['onError'];
|
|
1408
|
+
/**
|
|
1409
|
+
* This event is triggered when user presses end call button.
|
|
1410
|
+
*/
|
|
1411
|
+
onCallEndButtonPressed?: IOngoingCallListener['onCallEndButtonPressed'];
|
|
1412
|
+
constructor(eventObj: Partial<IOngoingCallListener>);
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
declare type Participant = HumanParticipant | VirtualParticipant;
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* Represents a participant in a call.
|
|
1419
|
+
*/
|
|
1420
|
+
declare class Participant_2 {
|
|
1421
|
+
/**
|
|
1422
|
+
* The unique identifier of the participant.
|
|
1423
|
+
*/
|
|
1424
|
+
private uid;
|
|
1425
|
+
/**
|
|
1426
|
+
* The name of the participant.
|
|
1427
|
+
*/
|
|
1428
|
+
private name;
|
|
1429
|
+
/**
|
|
1430
|
+
* The avatar of the participant.
|
|
1431
|
+
*/
|
|
1432
|
+
private avatar;
|
|
1433
|
+
/**
|
|
1434
|
+
* The total audio minutes of the participant.
|
|
1435
|
+
*/
|
|
1436
|
+
private totalAudioMinutes;
|
|
1437
|
+
/**
|
|
1438
|
+
* The total video minutes of the participant.
|
|
1439
|
+
*/
|
|
1440
|
+
private totalVideoMinutes;
|
|
1441
|
+
/**
|
|
1442
|
+
* The total duration in minutes of the participant.
|
|
1443
|
+
*/
|
|
1444
|
+
private totalDurationInMinutes;
|
|
1445
|
+
/**
|
|
1446
|
+
* The device ID of the participant.
|
|
1447
|
+
*/
|
|
1448
|
+
private deviceID;
|
|
1449
|
+
/**
|
|
1450
|
+
* Whether the participant has joined the call or not.
|
|
1451
|
+
*/
|
|
1452
|
+
private hasJoined;
|
|
1453
|
+
/**
|
|
1454
|
+
* The timestamp when the participant joined the call.
|
|
1455
|
+
*/
|
|
1456
|
+
private joinedAt;
|
|
1457
|
+
/**
|
|
1458
|
+
* The timestamp when the participant left the call.
|
|
1459
|
+
*/
|
|
1460
|
+
private leftAt;
|
|
1461
|
+
/**
|
|
1462
|
+
* The media ID of the participant.
|
|
1463
|
+
*/
|
|
1464
|
+
private mid;
|
|
1465
|
+
/**
|
|
1466
|
+
* The state of the participant.
|
|
1467
|
+
*/
|
|
1468
|
+
private state;
|
|
1469
|
+
/**
|
|
1470
|
+
* Creates a new instance of Participant.
|
|
1471
|
+
* @param object - The object containing the participant data.
|
|
1472
|
+
*/
|
|
1473
|
+
constructor(object: any);
|
|
1474
|
+
/**
|
|
1475
|
+
* Gets the unique identifier of the participant.
|
|
1476
|
+
* @returns The unique identifier of the participant.
|
|
1477
|
+
*/
|
|
1478
|
+
getUid(): string;
|
|
1479
|
+
/**
|
|
1480
|
+
* Sets the unique identifier of the participant.
|
|
1481
|
+
* @param value - The unique identifier of the participant.
|
|
1482
|
+
*/
|
|
1483
|
+
setUid(value: string): void;
|
|
1484
|
+
/**
|
|
1485
|
+
* Gets the name of the participant.
|
|
1486
|
+
* @returns The name of the participant.
|
|
1487
|
+
*/
|
|
1488
|
+
getName(): string;
|
|
1489
|
+
/**
|
|
1490
|
+
* Sets the name of the participant.
|
|
1491
|
+
* @param value - The name of the participant.
|
|
1492
|
+
*/
|
|
1493
|
+
setName(value: string): void;
|
|
1494
|
+
/**
|
|
1495
|
+
* Gets the avatar of the participant.
|
|
1496
|
+
* @returns The avatar of the participant.
|
|
1497
|
+
*/
|
|
1498
|
+
getAvatar(): string;
|
|
1499
|
+
/**
|
|
1500
|
+
* Sets the avatar of the participant.
|
|
1501
|
+
* @param value - The avatar of the participant.
|
|
1502
|
+
*/
|
|
1503
|
+
setAvatar(value: string): void;
|
|
1504
|
+
/**
|
|
1505
|
+
* Gets the total audio minutes of the participant.
|
|
1506
|
+
* @returns The total audio minutes of the participant.
|
|
1507
|
+
*/
|
|
1508
|
+
getTotalAudioMinutes(): number;
|
|
1509
|
+
/**
|
|
1510
|
+
* Sets the total audio minutes of the participant.
|
|
1511
|
+
* @param value - The total audio minutes of the participant.
|
|
1512
|
+
*/
|
|
1513
|
+
setTotalAudioMinutes(value: number): void;
|
|
1514
|
+
/**
|
|
1515
|
+
* Gets the total video minutes of the participant.
|
|
1516
|
+
* @returns The total video minutes of the participant.
|
|
1517
|
+
*/
|
|
1518
|
+
getTotalVideoMinutes(): number;
|
|
1519
|
+
/**
|
|
1520
|
+
* Sets the total video minutes of the participant.
|
|
1521
|
+
* @param value - The total video minutes of the participant.
|
|
1522
|
+
*/
|
|
1523
|
+
setTotalVideoMinutes(value: number): void;
|
|
1524
|
+
/**
|
|
1525
|
+
* Gets the total duration in minutes of the participant.
|
|
1526
|
+
* @returns The total duration in minutes of the participant.
|
|
1527
|
+
*/
|
|
1528
|
+
getTotalDurationInMinutes(): number;
|
|
1529
|
+
/**
|
|
1530
|
+
* Sets the total duration in minutes of the participant.
|
|
1531
|
+
* @param value - The total duration in minutes of the participant.
|
|
1532
|
+
*/
|
|
1533
|
+
setTotalDurationInMinutes(value: number): void;
|
|
1534
|
+
/**
|
|
1535
|
+
* Gets the device ID of the participant.
|
|
1536
|
+
* @returns The device ID of the participant.
|
|
1537
|
+
*/
|
|
1538
|
+
getDeviceID(): string;
|
|
1539
|
+
/**
|
|
1540
|
+
* Sets the device ID of the participant.
|
|
1541
|
+
* @param value - The device ID of the participant.
|
|
1542
|
+
*/
|
|
1543
|
+
setDeviceID(value: string): void;
|
|
1544
|
+
/**
|
|
1545
|
+
* Gets whether the participant has joined the call or not.
|
|
1546
|
+
* @returns Whether the participant has joined the call or not.
|
|
1547
|
+
*/
|
|
1548
|
+
getHasJoined(): boolean;
|
|
1549
|
+
/**
|
|
1550
|
+
* Sets whether the participant has joined the call or not.
|
|
1551
|
+
* @param value - Whether the participant has joined the call or not.
|
|
1552
|
+
*/
|
|
1553
|
+
setHasJoined(value: boolean): void;
|
|
1554
|
+
/**
|
|
1555
|
+
* Gets the timestamp when the participant joined the call.
|
|
1556
|
+
* @returns The timestamp when the participant joined the call.
|
|
1557
|
+
*/
|
|
1558
|
+
getJoinedAt(): number;
|
|
1559
|
+
/**
|
|
1560
|
+
* Sets the timestamp when the participant joined the call.
|
|
1561
|
+
* @param value - The timestamp when the participant joined the call.
|
|
1562
|
+
*/
|
|
1563
|
+
setJoinedAt(value: number): void;
|
|
1564
|
+
/**
|
|
1565
|
+
* Gets the timestamp when the participant left the call.
|
|
1566
|
+
* @returns The timestamp when the participant left the call.
|
|
1567
|
+
*/
|
|
1568
|
+
getLeftAt(): number;
|
|
1569
|
+
/**
|
|
1570
|
+
* Sets the timestamp when the participant left the call.
|
|
1571
|
+
* @param value - The timestamp when the participant left the call.
|
|
1572
|
+
*/
|
|
1573
|
+
setLeftAt(value: number): void;
|
|
1574
|
+
/**
|
|
1575
|
+
* Gets the media ID of the participant.
|
|
1576
|
+
* @returns The media ID of the participant.
|
|
1577
|
+
*/
|
|
1578
|
+
getMid(): string;
|
|
1579
|
+
/**
|
|
1580
|
+
* Sets the media ID of the participant.
|
|
1581
|
+
* @param value - The media ID of the participant.
|
|
1582
|
+
*/
|
|
1583
|
+
setMid(value: string): void;
|
|
1584
|
+
/**
|
|
1585
|
+
* Gets the state of the participant.
|
|
1586
|
+
* @returns The state of the participant.
|
|
1587
|
+
*/
|
|
1588
|
+
getState(): string;
|
|
1589
|
+
/**
|
|
1590
|
+
* Sets the state of the participant.
|
|
1591
|
+
* @param value - The state of the participant.
|
|
1592
|
+
*/
|
|
1593
|
+
setState(value: string): void;
|
|
1594
|
+
/**
|
|
1595
|
+
* Creates a new instance of Participant from a JSON object.
|
|
1596
|
+
* @param object - The JSON object containing the participant data.
|
|
1597
|
+
* @returns A new instance of Participant.
|
|
1598
|
+
*/
|
|
1599
|
+
static getParticipantFromJson(object: any): Participant_2;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
declare type Participant_3 = v.InferOutput<typeof ParticipantSchema>;
|
|
1603
|
+
|
|
1604
|
+
declare const ParticipantSchema: v.ObjectSchema<{
|
|
1605
|
+
readonly pid: v.StringSchema<undefined>;
|
|
1606
|
+
readonly name: v.StringSchema<undefined>;
|
|
1607
|
+
readonly uid: v.StringSchema<undefined>;
|
|
1608
|
+
readonly avatar: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1609
|
+
}, undefined>;
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Represents a recording object.
|
|
1613
|
+
*/
|
|
1614
|
+
declare class Recording {
|
|
1615
|
+
/**
|
|
1616
|
+
* The recording ID.
|
|
1617
|
+
*/
|
|
1618
|
+
private rid;
|
|
1619
|
+
/**
|
|
1620
|
+
* The URL of the recording.
|
|
1621
|
+
*/
|
|
1622
|
+
private recording_url;
|
|
1623
|
+
/**
|
|
1624
|
+
* The start time of the recording.
|
|
1625
|
+
*/
|
|
1626
|
+
private startTime;
|
|
1627
|
+
/**
|
|
1628
|
+
* The end time of the recording.
|
|
1629
|
+
*/
|
|
1630
|
+
private endTime;
|
|
1631
|
+
/**
|
|
1632
|
+
* The duration of the recording.
|
|
1633
|
+
*/
|
|
1634
|
+
private duration;
|
|
1635
|
+
/**
|
|
1636
|
+
* Creates a new instance of the Recording class.
|
|
1637
|
+
* @param data - The data to initialize the recording object.
|
|
1638
|
+
*/
|
|
1639
|
+
constructor(data: any);
|
|
1640
|
+
/**
|
|
1641
|
+
* Gets the recording ID.
|
|
1642
|
+
* @returns The recording ID.
|
|
1643
|
+
*/
|
|
1644
|
+
getRid(): string;
|
|
1645
|
+
/**
|
|
1646
|
+
* Sets the recording ID.
|
|
1647
|
+
* @param value - The recording ID to set.
|
|
1648
|
+
*/
|
|
1649
|
+
setRid(value: string): void;
|
|
1650
|
+
/**
|
|
1651
|
+
* Gets the recording URL.
|
|
1652
|
+
* @returns The recording URL.
|
|
1653
|
+
*/
|
|
1654
|
+
getRecordingURL(): string;
|
|
1655
|
+
/**
|
|
1656
|
+
* Sets the recording URL.
|
|
1657
|
+
* @param value - The recording URL to set.
|
|
1658
|
+
*/
|
|
1659
|
+
setRecordingURL(value: string): void;
|
|
1660
|
+
/**
|
|
1661
|
+
* Gets the start time of the recording.
|
|
1662
|
+
* @returns The start time of the recording.
|
|
1663
|
+
*/
|
|
1664
|
+
getStartTime(): number;
|
|
1665
|
+
/**
|
|
1666
|
+
* Sets the start time of the recording.
|
|
1667
|
+
* @param value - The start time of the recording to set.
|
|
1668
|
+
*/
|
|
1669
|
+
setStartTime(value: number): void;
|
|
1670
|
+
/**
|
|
1671
|
+
* Gets the end time of the recording.
|
|
1672
|
+
* @returns The end time of the recording.
|
|
1673
|
+
*/
|
|
1674
|
+
getEndTime(): number;
|
|
1675
|
+
/**
|
|
1676
|
+
* Sets the end time of the recording.
|
|
1677
|
+
* @param value - The end time of the recording to set.
|
|
1678
|
+
*/
|
|
1679
|
+
setEndTime(value: number): void;
|
|
1680
|
+
/**
|
|
1681
|
+
* Gets the duration of the recording.
|
|
1682
|
+
* @returns The duration of the recording.
|
|
1683
|
+
*/
|
|
1684
|
+
getDuration(): number;
|
|
1685
|
+
/**
|
|
1686
|
+
* Sets the duration of the recording.
|
|
1687
|
+
* @param value - The duration of the recording to set.
|
|
1688
|
+
*/
|
|
1689
|
+
setDuration(value: number): void;
|
|
1690
|
+
/**
|
|
1691
|
+
* Creates a new Recording object from the given JSON data.
|
|
1692
|
+
* @param data - The JSON data to create the Recording object from.
|
|
1693
|
+
* @returns A new Recording object.
|
|
1694
|
+
*/
|
|
1695
|
+
static getRecordingFromJson(data: any): Recording;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
declare type Region = _TRegion | Omit<string, _TRegion>;
|
|
1699
|
+
|
|
1700
|
+
declare type Result<T, E = Error> = {
|
|
1701
|
+
data: T;
|
|
1702
|
+
error: null;
|
|
1703
|
+
} | {
|
|
1704
|
+
data: null;
|
|
1705
|
+
error: E;
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
declare type SDKEvents = Omit<_SDKEvents, 'onParticipantListChanged'> & {
|
|
1709
|
+
onCallLayoutChanged: (payload: Layout) => void;
|
|
1710
|
+
onParticipantListVisible: () => void;
|
|
1711
|
+
onParticipantListHidden: () => void;
|
|
1712
|
+
onParticipantListChanged: (payload: Participant_3[]) => void;
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1715
|
+
declare type _SDKEvents = {
|
|
1716
|
+
[k in ValueOf<typeof EVENT_LISTENER_METHODS.SessionStatusListener>]: () => void;
|
|
1717
|
+
} & {
|
|
1718
|
+
[k in ValueOf<typeof EVENT_LISTENER_METHODS.MediaEventsListener>]: () => void;
|
|
1719
|
+
} & {
|
|
1720
|
+
[k in ValueOf<typeof EVENT_LISTENER_METHODS.ParticipantEventsListner>]: (payload: Participant_3) => void;
|
|
1721
|
+
} & {
|
|
1722
|
+
[k in ValueOf<typeof EVENT_LISTENER_METHODS.ButtonClickListener>]: () => void;
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
declare const SESSION_TYPE: {
|
|
1726
|
+
readonly VOICE: "VOICE";
|
|
1727
|
+
readonly VIDEO: "VIDEO";
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
declare class SessionMethods extends SessionMethodsCore {
|
|
1731
|
+
static startScreenSharing(): void;
|
|
1732
|
+
static stopScreenSharing(): void;
|
|
1733
|
+
static showSettingsDialog(): void;
|
|
1734
|
+
static hideSettingsDialog(): void;
|
|
1735
|
+
static showVirtualBackgroundDialog(): void;
|
|
1736
|
+
static hideVirtualBackgroundDialog(): void;
|
|
1737
|
+
static enablePictureInPictureLayout(): void;
|
|
1738
|
+
static disablePictureInPictureLayout(): void;
|
|
1739
|
+
static getAudioInputDevices(): AudioInputDevice[];
|
|
1740
|
+
static getAudioOutputDevices(): AudioOutputDevice[];
|
|
1741
|
+
static getVideoInputDevices(): VideoInputDevice[];
|
|
1742
|
+
static setAudioInputDevice(deviceId: string): void;
|
|
1743
|
+
static setAudioOutputDevice(deviceId: string): void;
|
|
1744
|
+
static setVideoInputDevice(deviceId: string): void;
|
|
1745
|
+
static clearVirtualBackground(): void;
|
|
1746
|
+
static setVirtualBackgroundBlurLevel(blurLevel: number): void;
|
|
1747
|
+
static setVirtualBackgroundImage(imageUrl: string): void;
|
|
1748
|
+
/**
|
|
1749
|
+
* @deprecated use startScreenSharing() instead
|
|
1750
|
+
*/
|
|
1751
|
+
static startScreenShare(): void;
|
|
1752
|
+
/**
|
|
1753
|
+
* @deprecated use stopScreenSharing() instead
|
|
1754
|
+
*/
|
|
1755
|
+
static stopScreenShare(): void;
|
|
1756
|
+
/**
|
|
1757
|
+
* @deprecated use setLayout() instead
|
|
1758
|
+
*/
|
|
1759
|
+
static setMode(mode: (typeof CallConstants.MODE)[keyof typeof CallConstants.MODE]): void;
|
|
1760
|
+
/**
|
|
1761
|
+
* @deprecated use showVirtualBackgroundDialog() instead
|
|
1762
|
+
*/
|
|
1763
|
+
static openVirtualBackground(): void;
|
|
1764
|
+
/**
|
|
1765
|
+
* @deprecated use hideVirtualBackgroundDialog() instead
|
|
1766
|
+
*/
|
|
1767
|
+
static closeVirtualBackground(): void;
|
|
1768
|
+
/**
|
|
1769
|
+
* @deprecated use setVirtualBackgroundBlurLevel() instead
|
|
1770
|
+
*/
|
|
1771
|
+
static setBackgroundBlur(blurLevel: number): void;
|
|
1772
|
+
/**
|
|
1773
|
+
* @deprecated use setVirtualBackgroundImage() instead
|
|
1774
|
+
*/
|
|
1775
|
+
static setBackgroundImage(imageUrl: string): void;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
declare class SessionMethodsCore {
|
|
1779
|
+
/**
|
|
1780
|
+
* Mutes the local user's audio during the call.
|
|
1781
|
+
*/
|
|
1782
|
+
static muteAudio(): void;
|
|
1783
|
+
/**
|
|
1784
|
+
* Unmutes the local user's audio during the call.
|
|
1785
|
+
*/
|
|
1786
|
+
static unmuteAudio(): void;
|
|
1787
|
+
/**
|
|
1788
|
+
* Pauses the local user's video stream.
|
|
1789
|
+
*/
|
|
1790
|
+
static pauseVideo(): void;
|
|
1791
|
+
/**
|
|
1792
|
+
* Resumes the local user's video stream.
|
|
1793
|
+
*/
|
|
1794
|
+
static resumeVideo(): void;
|
|
1795
|
+
/**
|
|
1796
|
+
* Local user leaves the current session.
|
|
1797
|
+
*/
|
|
1798
|
+
static leaveSession(): void;
|
|
1799
|
+
/**
|
|
1800
|
+
* Raises the user's virtual hand in the call.
|
|
1801
|
+
*/
|
|
1802
|
+
static raiseHand(): void;
|
|
1803
|
+
/**
|
|
1804
|
+
* Lowers the user's virtual hand in the call.
|
|
1805
|
+
*/
|
|
1806
|
+
static lowerHand(): void;
|
|
1807
|
+
/**
|
|
1808
|
+
* Switches between the front and rear camera.
|
|
1809
|
+
*/
|
|
1810
|
+
static switchCamera(): void;
|
|
1811
|
+
/**
|
|
1812
|
+
* Sets the layout type for the call.
|
|
1813
|
+
* @param layout - The type of layout to set (tile, sidebar or spotlight).
|
|
1814
|
+
*/
|
|
1815
|
+
static setLayout(layout: Layout): void;
|
|
1816
|
+
/**
|
|
1817
|
+
* Starts recording the call.
|
|
1818
|
+
*/
|
|
1819
|
+
static startRecording(): void;
|
|
1820
|
+
/**
|
|
1821
|
+
* Stops the ongoing call recording.
|
|
1822
|
+
*/
|
|
1823
|
+
static stopRecording(): void;
|
|
1824
|
+
/**
|
|
1825
|
+
* Pins a participant's video to focus on them.
|
|
1826
|
+
* @param participantId - The ID of the participant to pin.
|
|
1827
|
+
* @param type - The type of the participant.
|
|
1828
|
+
*/
|
|
1829
|
+
static pinParticipant(participantId: string, type: Participant['type']): void;
|
|
1830
|
+
/**
|
|
1831
|
+
* Unpins a participant's video.
|
|
1832
|
+
*/
|
|
1833
|
+
static unpinParticipant(): void;
|
|
1834
|
+
/**
|
|
1835
|
+
* Mutes the audio of a specific participant.
|
|
1836
|
+
* @param participantId - The ID of the participant to mute.
|
|
1837
|
+
*/
|
|
1838
|
+
static muteParticipant(participantId: string): void;
|
|
1839
|
+
/**
|
|
1840
|
+
* Pauses the video stream of a specific participant.
|
|
1841
|
+
* @param participantId - The ID of the participant whose video to pause.
|
|
1842
|
+
*/
|
|
1843
|
+
static pauseParticipantVideo(participantId: string): void;
|
|
1844
|
+
/**
|
|
1845
|
+
* Sets the unread message count displayed on the chat button.
|
|
1846
|
+
* @param count - The number of unread messages.
|
|
1847
|
+
*/
|
|
1848
|
+
static setChatButtonUnreadCount(count: number): void;
|
|
1849
|
+
/**
|
|
1850
|
+
* @deprecated switchToVideoCall is deprecated and not supported.
|
|
1851
|
+
*/
|
|
1852
|
+
static switchToVideoCall(): void;
|
|
1853
|
+
/**
|
|
1854
|
+
* @deprecated use leaveSession() instead
|
|
1855
|
+
*/
|
|
1856
|
+
static endSession(): void;
|
|
1857
|
+
/**
|
|
1858
|
+
* Retrieves call details for a given session ID and auth token.
|
|
1859
|
+
* @param sessionID - The session ID of the call.
|
|
1860
|
+
* @param authToken - The authentication token required to make the API call.
|
|
1861
|
+
* @returns A Promise that resolves to a CallLog object containing the call details.
|
|
1862
|
+
* @throws {CometChatCallsException} If there is an error retrieving the call details.
|
|
1863
|
+
* @deprecated This method is deprecated and not supported.
|
|
1864
|
+
*/
|
|
1865
|
+
static getCallDetails(_sessionID: string, _authToken: string): void;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
export declare type SessionSettings = Partial<ConfigStateWeb & ConfigStateBoth>;
|
|
1869
|
+
|
|
1870
|
+
declare type SessionType = ValueOf<typeof SESSION_TYPE>;
|
|
1871
|
+
|
|
1872
|
+
declare type TColor = _TColor | Omit<string, _TColor>;
|
|
1873
|
+
|
|
1874
|
+
declare type _TColor = TRGB | TRGBA | THEX;
|
|
1875
|
+
|
|
1876
|
+
declare type _TDomain = `${string}.call-${_TRegion}.cometchat.io/v3.0/`;
|
|
1877
|
+
|
|
1878
|
+
declare type THEX = `#${string}`;
|
|
1879
|
+
|
|
1880
|
+
declare type TPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
1881
|
+
|
|
1882
|
+
declare type _TRegion = 'eu' | 'us' | 'in';
|
|
1883
|
+
|
|
1884
|
+
declare type TRGB = `rgb(${number}, ${number}, ${number})`;
|
|
1885
|
+
|
|
1886
|
+
declare type TRGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
|
|
1887
|
+
|
|
1888
|
+
declare interface User extends AnyProperties {
|
|
1889
|
+
name: string;
|
|
1890
|
+
avatar?: string;
|
|
1891
|
+
uid: string;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
declare interface User_2 {
|
|
1895
|
+
uid: string;
|
|
1896
|
+
name: string;
|
|
1897
|
+
status?: string;
|
|
1898
|
+
authToken?: string;
|
|
1899
|
+
lastActiveAt?: number;
|
|
1900
|
+
avatar?: string;
|
|
1901
|
+
role?: string;
|
|
1902
|
+
hasBlockedMe?: boolean;
|
|
1903
|
+
blockedByMe?: boolean;
|
|
1904
|
+
deactivatedAt?: number;
|
|
1905
|
+
wsChannel?: {
|
|
1906
|
+
identity: string;
|
|
1907
|
+
};
|
|
1908
|
+
jwt?: string;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
declare type ValueOf<T> = T[keyof T];
|
|
1912
|
+
|
|
1913
|
+
declare interface VerifyTokenException extends Error {
|
|
1914
|
+
name: CometChatAPIException['name'];
|
|
1915
|
+
details?: unknown;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
declare type VideoInputDevice_2 = MediaDeviceInfo & {
|
|
1919
|
+
kind: Extract<MediaDeviceKind, 'videoinput'>;
|
|
1920
|
+
};
|
|
1921
|
+
|
|
1922
|
+
declare class VirtualBackground {
|
|
1923
|
+
private AllowBackgroundBlur;
|
|
1924
|
+
private AllowUserImages;
|
|
1925
|
+
private ShowDefaultImages;
|
|
1926
|
+
private SetImages;
|
|
1927
|
+
private EnforceBackgroundBlur;
|
|
1928
|
+
private EnforceBackgroundImage;
|
|
1929
|
+
constructor(builder?: VirtualBackgroundBuilder);
|
|
1930
|
+
shouldAllowBackgroundBlur(): boolean;
|
|
1931
|
+
shouldAllowUserImages(): boolean;
|
|
1932
|
+
shouldShowDefaultImages(): boolean;
|
|
1933
|
+
getImages(): Array<String>;
|
|
1934
|
+
isBackgroundBlurEnforced(): number;
|
|
1935
|
+
getEnforcedBackgroundImage(): string;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
declare class VirtualBackgroundBuilder {
|
|
1939
|
+
/** @private */ AllowBackgroundBlur: boolean;
|
|
1940
|
+
/** @private */ AllowUserImages: boolean;
|
|
1941
|
+
/** @private */ ShowDefaultImages: boolean;
|
|
1942
|
+
/** @private */ SetImages: string[];
|
|
1943
|
+
/** @private */ EnforceBackgroundBlur: number;
|
|
1944
|
+
/** @private */ EnforceBackgroundImage: string;
|
|
1945
|
+
/**
|
|
1946
|
+
*
|
|
1947
|
+
* @param {boolean} AllowBackgroundBlur
|
|
1948
|
+
* This method will show the background blur option in Virtual Background.
|
|
1949
|
+
* If set to true it will show the background blur option.
|
|
1950
|
+
* Default value is true.
|
|
1951
|
+
* @returns
|
|
1952
|
+
*/
|
|
1953
|
+
allowBackgroundBlur(AllowBackgroundBlur: boolean): this;
|
|
1954
|
+
/**
|
|
1955
|
+
*
|
|
1956
|
+
* @param {boolean} AllowUserImage
|
|
1957
|
+
* This method will allow the user to add custom images as background.
|
|
1958
|
+
* If set to true it will allow the user to add custom images as background.
|
|
1959
|
+
* Default value is true.
|
|
1960
|
+
* @returns
|
|
1961
|
+
*/
|
|
1962
|
+
allowUserImages(AllowUserImages: boolean): this;
|
|
1963
|
+
/**
|
|
1964
|
+
*
|
|
1965
|
+
* @param {boolean} ShowDefaultImages
|
|
1966
|
+
* This method will show the default images to be used as background.
|
|
1967
|
+
* If set to true it will show the default images to be used as background.
|
|
1968
|
+
* Default value is true.
|
|
1969
|
+
* @returns
|
|
1970
|
+
*/
|
|
1971
|
+
showDefaultImages(ShowDefaultImages: boolean): this;
|
|
1972
|
+
/**
|
|
1973
|
+
*
|
|
1974
|
+
* @param {boolean} SetImages
|
|
1975
|
+
* This method will allow user to add custom Images to be used as background. It takes in an array of URLs.
|
|
1976
|
+
* @returns
|
|
1977
|
+
*/
|
|
1978
|
+
setImages(SetImages: string[]): this;
|
|
1979
|
+
/**
|
|
1980
|
+
*
|
|
1981
|
+
* @param {number} EnforceBackgroundBlur
|
|
1982
|
+
* This method will enforce background blur.
|
|
1983
|
+
* This method takes number as input which decides the blur level of the background.
|
|
1984
|
+
* Default value is 0.
|
|
1985
|
+
* @returns
|
|
1986
|
+
*/
|
|
1987
|
+
enforceBackgroundBlur(EnforceBackgroundBlur: number): this;
|
|
1988
|
+
/**
|
|
1989
|
+
*
|
|
1990
|
+
* @param {string} EnforceBackgroundImage
|
|
1991
|
+
* This method will enforce background image.
|
|
1992
|
+
* If an URL of the image is sent then that image will be set as background.
|
|
1993
|
+
* By default no image is set.
|
|
1994
|
+
* @returns
|
|
1995
|
+
*/
|
|
1996
|
+
enforceBackgroundImage(EnforceBackgroundImage: string): this;
|
|
1997
|
+
/**
|
|
1998
|
+
* This method will return an object of the VirtualBackground class.
|
|
1999
|
+
* @returns {VirtualBackground}
|
|
2000
|
+
*/
|
|
2001
|
+
build(): VirtualBackground;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
declare interface VirtualParticipant extends Omit<HumanParticipant, 'role' | 'type'> {
|
|
2005
|
+
type: 'screen-share';
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
declare type WebSDKEvents = SDKEvents & {
|
|
2009
|
+
onAudioInputDeviceChanged: (device: MediaDeviceInfo) => void;
|
|
2010
|
+
onVideoInputDeviceChanged: (device: MediaDeviceInfo) => void;
|
|
2011
|
+
onAudioOutputDeviceChanged: (device: MediaDeviceInfo) => void;
|
|
2012
|
+
onAudioInputDevicesChanged: (device: MediaDeviceInfo[]) => void;
|
|
2013
|
+
onVideoInputDevicesChanged: (device: MediaDeviceInfo[]) => void;
|
|
2014
|
+
onAudioOutputDevicesChanged: (device: MediaDeviceInfo[]) => void;
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
export { }
|