@cometchat/chat-sdk-javascript 4.0.0-beta2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/CometChat.js +1 -1
  2. package/dist/index.d.ts +40 -0
  3. package/dist/type/lib/CometChat.d.ts +20 -0
  4. package/dist/type/lib/Constants.d.ts +20 -0
  5. package/dist/type/lib/Helper.d.ts +1 -0
  6. package/dist/type/lib/models/UserModel.d.ts +2 -0
  7. package/package.json +1 -1
  8. package/dist/.DS_Store +0 -0
  9. package/dist/javascript-chat-sdk/.git/COMMIT_EDITMSG +0 -1
  10. package/dist/javascript-chat-sdk/.git/FETCH_HEAD +0 -4
  11. package/dist/javascript-chat-sdk/.git/HEAD +0 -1
  12. package/dist/javascript-chat-sdk/.git/ORIG_HEAD +0 -1
  13. package/dist/javascript-chat-sdk/.git/config +0 -19
  14. package/dist/javascript-chat-sdk/.git/description +0 -1
  15. package/dist/javascript-chat-sdk/.git/hooks/applypatch-msg.sample +0 -15
  16. package/dist/javascript-chat-sdk/.git/hooks/commit-msg.sample +0 -24
  17. package/dist/javascript-chat-sdk/.git/hooks/fsmonitor-watchman.sample +0 -174
  18. package/dist/javascript-chat-sdk/.git/hooks/post-update.sample +0 -8
  19. package/dist/javascript-chat-sdk/.git/hooks/pre-applypatch.sample +0 -14
  20. package/dist/javascript-chat-sdk/.git/hooks/pre-commit.sample +0 -49
  21. package/dist/javascript-chat-sdk/.git/hooks/pre-merge-commit.sample +0 -13
  22. package/dist/javascript-chat-sdk/.git/hooks/pre-push.sample +0 -53
  23. package/dist/javascript-chat-sdk/.git/hooks/pre-rebase.sample +0 -169
  24. package/dist/javascript-chat-sdk/.git/hooks/pre-receive.sample +0 -24
  25. package/dist/javascript-chat-sdk/.git/hooks/prepare-commit-msg.sample +0 -42
  26. package/dist/javascript-chat-sdk/.git/hooks/push-to-checkout.sample +0 -78
  27. package/dist/javascript-chat-sdk/.git/hooks/update.sample +0 -128
  28. package/dist/javascript-chat-sdk/.git/index +0 -0
  29. package/dist/javascript-chat-sdk/.git/info/exclude +0 -6
  30. package/dist/javascript-chat-sdk/.git/logs/HEAD +0 -13
  31. package/dist/javascript-chat-sdk/.git/logs/refs/heads/master +0 -1
  32. package/dist/javascript-chat-sdk/.git/logs/refs/heads/master-v3 +0 -3
  33. package/dist/javascript-chat-sdk/.git/logs/refs/heads/master-v4 +0 -4
  34. package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/HEAD +0 -1
  35. package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/master-v3 +0 -2
  36. package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/master-v4 +0 -2
  37. package/dist/javascript-chat-sdk/.git/logs/refs/stash +0 -1
  38. package/dist/javascript-chat-sdk/.git/objects/09/b9e17d9a0acd55c3644f4cfa19b1c40a139018 +0 -0
  39. package/dist/javascript-chat-sdk/.git/objects/0f/2d8999b370e8ddb236f767aa565b2aa72a6b21 +0 -0
  40. package/dist/javascript-chat-sdk/.git/objects/15/7f5161e31be14c74df7907c9c5046fbbea4461 +0 -0
  41. package/dist/javascript-chat-sdk/.git/objects/17/89200f3f5621f9df6d08d1071c59557ce5a29d +0 -0
  42. package/dist/javascript-chat-sdk/.git/objects/26/1de108a0253f54cf37e8a072f7f5f0098c7e89 +0 -4
  43. package/dist/javascript-chat-sdk/.git/objects/43/7ffc94a259dcd818cca308ab60a2780714092d +0 -1
  44. package/dist/javascript-chat-sdk/.git/objects/4e/6ab6a981ea6dccdb60b6438d7ca142aef269fc +0 -0
  45. package/dist/javascript-chat-sdk/.git/objects/5e/04a3d79cebcc2b02c14ea807f839ea73d44461 +0 -0
  46. package/dist/javascript-chat-sdk/.git/objects/65/bbff4d1cccc12285ea1c59a6f2082552f0d034 +0 -0
  47. package/dist/javascript-chat-sdk/.git/objects/6a/a6ef178cb2e3775bb149aba99ace8399525da6 +0 -0
  48. package/dist/javascript-chat-sdk/.git/objects/6b/e1ffe406de9ebb698ea891315b2b1459160029 +0 -0
  49. package/dist/javascript-chat-sdk/.git/objects/6b/efb8e9de892be7ecee5d39c30c0aa17d43d727 +0 -2
  50. package/dist/javascript-chat-sdk/.git/objects/6e/f136ca41bbb5684639947fa121b7eebb795592 +0 -0
  51. package/dist/javascript-chat-sdk/.git/objects/87/96f6311621c3ee4fc8d37eeec64a6c94e3e6ca +0 -0
  52. package/dist/javascript-chat-sdk/.git/objects/8b/2d226d44814b7265b68ab7953a87cd44d77965 +0 -0
  53. package/dist/javascript-chat-sdk/.git/objects/9c/bc4afb06153fd276e240e709984bf1099386ba +0 -0
  54. package/dist/javascript-chat-sdk/.git/objects/a9/6c6710dfb57871b6eccda3a94d83990ba94d9f +0 -0
  55. package/dist/javascript-chat-sdk/.git/objects/ad/1b70a4bb12b3fe2e6306d2b0922582036f4e42 +0 -0
  56. package/dist/javascript-chat-sdk/.git/objects/c1/655387f263ec50dbef8042099eead57dfe00c2 +0 -0
  57. package/dist/javascript-chat-sdk/.git/objects/e0/ad85d968302e5447402ed4d0bc8ace931b9167 +0 -0
  58. package/dist/javascript-chat-sdk/.git/objects/e8/0b03094191c92690d5bb92b4271058f188efd1 +0 -1
  59. package/dist/javascript-chat-sdk/.git/objects/f0/cc86624ec0504ed24dcd6a7b2cdee917b73395 +0 -2
  60. package/dist/javascript-chat-sdk/.git/objects/f9/95e0e3dc98868eb6404f8cdd84632ae140e1ff +0 -2
  61. package/dist/javascript-chat-sdk/.git/objects/fb/d9b82e03d33337a8d2606fc9e2f1652ffda3de +0 -0
  62. package/dist/javascript-chat-sdk/.git/objects/pack/pack-efd6261f29a0c404693064c4a255aada38ddab72.idx +0 -0
  63. package/dist/javascript-chat-sdk/.git/objects/pack/pack-efd6261f29a0c404693064c4a255aada38ddab72.pack +0 -0
  64. package/dist/javascript-chat-sdk/.git/packed-refs +0 -107
  65. package/dist/javascript-chat-sdk/.git/refs/heads/master +0 -1
  66. package/dist/javascript-chat-sdk/.git/refs/heads/master-v3 +0 -1
  67. package/dist/javascript-chat-sdk/.git/refs/heads/master-v4 +0 -1
  68. package/dist/javascript-chat-sdk/.git/refs/remotes/origin/HEAD +0 -1
  69. package/dist/javascript-chat-sdk/.git/refs/remotes/origin/master-v3 +0 -1
  70. package/dist/javascript-chat-sdk/.git/refs/remotes/origin/master-v4 +0 -1
  71. package/dist/javascript-chat-sdk/.git/refs/stash +0 -1
  72. package/dist/javascript-chat-sdk/.gitignore +0 -2
  73. package/dist/javascript-chat-sdk/CometChat.d.ts +0 -4732
  74. package/dist/javascript-chat-sdk/CometChat.js +0 -1
  75. package/dist/javascript-chat-sdk/LICENSE.md +0 -3
  76. package/dist/javascript-chat-sdk/README.md +0 -189
  77. package/dist/javascript-chat-sdk/package.json +0 -36
@@ -1,4732 +0,0 @@
1
- export namespace CometChat {
2
- let USER_STATUS: {
3
- ONLINE: string;
4
- OFFLINE: string;
5
- };
6
- let MESSAGE_TYPE: {
7
- TEXT: string;
8
- MEDIA: string;
9
- IMAGE: string;
10
- VIDEO: string;
11
- AUDIO: string;
12
- FILE: string;
13
- CUSTOM: string;
14
- };
15
- let CATEGORY_MESSAGE: string;
16
- let CATEGORY_ACTION: string;
17
- let CATEGORY_CALL: string;
18
- let CATEGORY_CUSTOM: string;
19
- let ACTION_TYPE: {
20
- MEMBER_ADDED: string;
21
- MEMBER_JOINED: string;
22
- MEMBER_LEFT: string;
23
- MEMBER_KICKED: string;
24
- MEMBER_BANNED: string;
25
- MEMBER_UNBANNED: string;
26
- MEMBER_INVITED: string;
27
- MEMBER_SCOPE_CHANGED: string;
28
- MESSAGE_EDITED: string;
29
- MESSSAGE_DELETED: string;
30
- TYPE_USER: string;
31
- TYPE_GROUP: string;
32
- TYPE_GROUP_MEMBER: string;
33
- };
34
- let CALL_MODE: {
35
- DEFAULT: string,
36
- SPOTLIGHT: string,
37
- SINGLE: string,
38
- TILE: string,
39
- GRID: string
40
- };
41
- let CALL_TYPE: {
42
- AUDIO: string;
43
- VIDEO: string;
44
- };
45
- let RECEIVER_TYPE: {
46
- USER: string;
47
- GROUP: string;
48
- };
49
- let CALL_STATUS: {
50
- INITIATED: string;
51
- ONGOING: string;
52
- UNANSWERED: string;
53
- REJECTED: string;
54
- BUSY: string;
55
- CANCELLED: string;
56
- ENDED: string;
57
- };
58
- let SORT_BY: {
59
- NAME: string;
60
- STATUS: string;
61
- }
62
- let SORT_ORDER: {
63
- ASCENDING: string;
64
- DESCENDING: string;
65
- }
66
-
67
- let appSettings: AppSettings;
68
-
69
- /**
70
- * Getter for appId.
71
- * @internal
72
- * @returns
73
- * @memberof CometChat
74
- */
75
- export function getAppId(): string;
76
-
77
- /**
78
- * Getter for apiKey.
79
- * @internal
80
- * @returns
81
- * @memberof CometChat
82
- */
83
- export function getApiKey(): string;
84
-
85
- /**------------------------------------*
86
- * Core apis *
87
- *-------------------------------------**/
88
-
89
- /**
90
- * Initialize the CometChat app with appId & Object of AppSettings Class.
91
- * @param {string} appId
92
- * @param {AppSettings} appSettings
93
- * @returns {CometChat}
94
- * @memberof CometChat
95
- */
96
- export function init(appId: any, appSettings: AppSettings): Promise<boolean>;
97
-
98
- /**
99
- * Function to check whether CometChat class initialized before.
100
- * @returns {boolean}
101
- * @memberof CometChat
102
- */
103
- export function isInitialized(): boolean;
104
-
105
- /**
106
- * Function to register the FCM token for Push Notification.
107
- * @param {string} token
108
- * @param {JSON Object} Settings
109
- * @returns {Promise<string>}
110
- * @memberof CometChat
111
- */
112
- export function registerTokenForPushNotification(token: string, settings?: {}): Promise<string>;
113
-
114
- /**
115
- * Login funtion will authenticate user provided as an argument. There are two ways to login:
116
- * 1. using UID and authKey (unsecure way)
117
- * 2. using authToken (secure way)
118
- * @param {...string[]} args
119
- * @returns {User | CometChatException}
120
- * @memberof CometChat
121
- */
122
- export function login(...args: any): Promise<User>;
123
-
124
- /**-------------------------------------------------------------------*
125
- * Message related functions provided by CometChat class *
126
- *--------------------------------------------------------------------**/
127
- /**
128
- * Function to send message.
129
- * @param {TextMessage | MediaMessage | CustomMessage | any} message
130
- * @returns {Message | any}
131
- * @memberof CometChat
132
- */
133
- export function sendMessage(message: TextMessage | MediaMessage | CustomMessage | any): Promise<TextMessage | MediaMessage | CustomMessage | BaseMessage>;
134
-
135
- /**
136
- * Function to send a message to user.
137
- * @internal
138
- * @param {*} message Object
139
- * @returns
140
- * @memberof CometChat
141
- */
142
- export function sendDirectMessage(message: Object): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
143
-
144
- /**
145
- * Function to send a message to group.
146
- * @internal
147
- * @param {*} message
148
- * @returns
149
- * @memberof CometChat
150
- */
151
- export function sendGroupMessage(message: any): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
152
-
153
- /**
154
- * Function to send a media message.
155
- * @param {MediaMessage} message
156
- * @returns {Message | any}
157
- * @memberof CometChat
158
- */
159
- export function sendMediaMessage(message: Object): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
160
-
161
- /**
162
- * Function to send a custom message.
163
- * @param {CustomMessage} message
164
- * @returns {Message | any}
165
- * @memberof CometChat
166
- */
167
- export function sendCustomMessage(message: CustomMessage): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
168
-
169
- /**
170
- * Function to get the last delivered message id from local storage.
171
- * @returns {any}
172
- * @memberof CometChat
173
- */
174
- export function getLastDeliveredMessageId(): Promise<any>;
175
-
176
- /**
177
- * Function to send start typing notification to the provided uid/ guid.
178
- * @param {TypingIndicator | any} typingNotification
179
- * @memberof CometChat
180
- */
181
- export function startTyping(typingNotification: TypingIndicator | any): void;
182
-
183
- /**
184
- * Function to send stop typing notification to the provided uid/ guid.
185
- * @param {TypingIndicator | any} typingNotification
186
- * @memberof CometChat
187
- */
188
- export function endTyping(typingNotification: TypingIndicator | any): void;
189
-
190
- /**
191
- * Mark all messages upto a specified message id as read. There are two ways markAsRead works:
192
- * 1. message
193
- * 2. messageID, receiverID, receiverType, senderID
194
- * @param {...string[]} args
195
- * @memberof CometChat
196
- */
197
- export function markAsRead(...args: any): any;
198
-
199
- /**
200
- * Mark all messages upto a specified message id as delivered. There are two ways markAsDelivered works:
201
- * 1. message
202
- * 2. messageID, receiverID, receiverType, senderID
203
- * @param {...string[]} args
204
- * @memberof CometChat
205
- */
206
- export function markAsDelivered(...args: any): any;
207
-
208
- /**
209
- * Send a transient message.
210
- * @param {string} uid
211
- * @param {string} receiverType
212
- * @memberof CometChat
213
- */
214
- export function sendTransientMessage(transientMessage: TransientMessage): void;
215
-
216
- /**
217
- * Triggers the onTextMessageReceived event.
218
- * @internal
219
- * @param {any} message
220
- * @memberof CometChat
221
- */
222
- export function sendTestMessage(message: any): Promise<void>;
223
-
224
- /**
225
- * Function to fetch message details for the provided messageID.
226
- * @param {string | any} messageId
227
- * @returns {Message | any}
228
- * @memberof CometChat
229
- */
230
- export function getMessageDetails(messageId: string | any): Promise<TextMessage | MediaMessage | CustomMessage | BaseMessage>;
231
-
232
- /**
233
- * Function to fetch message receipt details for the provided messageID.
234
- * @param {string | any} messageId
235
- * @returns {MessageReceipt[]}
236
- * @memberof CometChat
237
- */
238
- export function getMessageReceipts(messageId: string | any): Promise<Object>;
239
-
240
- /**
241
- * Function to fetch unread message count.
242
- * @param {boolean} doHideMessages
243
- * @returns {Object}
244
- * @memberof CometChat
245
- */
246
- export function getUnreadMessageCount(doHideMessages?: boolean): Promise<Object>;
247
-
248
- /**
249
- * Function to fetch unread message count for all users.
250
- * @param {boolean} doHideMessages
251
- * @returns {Object}
252
- * @memberof CometChat
253
- */
254
- export function getUnreadMessageCountForAllUsers(doHideMessages?: boolean): Promise<Object>;
255
-
256
- /**
257
- * Function to fetch unread message count for all groups.
258
- * @param {boolean} doHideMessages
259
- * @returns {Object}
260
- * @memberof CometChat
261
- */
262
- export function getUnreadMessageCountForAllGroups(doHideMessages?: boolean): Promise<Object>;
263
-
264
- /**
265
- * Function to fetch unread message count for a particular UID.
266
- * @param {string} UID
267
- * @param {boolean} doHideMessages
268
- * @returns {Object}
269
- * @memberof CometChat
270
- */
271
- export function getUnreadMessageCountForUser(UID: string, doHideMessages?: boolean): Promise<Object>;
272
-
273
- /**
274
- * Function to fetch unread message count for a particular GUID.
275
- * @param {string} GUID
276
- * @param {boolean} doHideMessages
277
- * @returns {Object}
278
- * @memberof CometChat
279
- */
280
- export function getUnreadMessageCountForGroup(GUID: string, doHideMessages?: boolean): Promise<Object>;
281
-
282
- /**
283
- * Funtion to edit a message.
284
- * @param {BaseMessage} message
285
- * @returns {Promise<BaseMessage>}
286
- * @memberof CometChat
287
- */
288
- export function editMessage(message: BaseMessage): Promise<BaseMessage>;
289
-
290
- /**
291
- * Funtion to delete a message.
292
- * @param {string} messageId
293
- * @returns {Promise<BaseMessage>}
294
- * @memberof CometChat
295
- */
296
- export function deleteMessage(messageId: string): Promise<BaseMessage>;
297
-
298
- /**---------------------------------------------------------------------------------------*
299
- * Online User/Group Member count related functions provided by CometChat class *
300
- *----------------------------------------------------------------------------------------**/
301
-
302
- /**
303
- * This function will return online user count.
304
- * @returns {Promise<number>}
305
- * @memberof CometChat
306
- */
307
- export function getOnlineUserCount(): Promise<number>;
308
-
309
- /**
310
- * This function will return online group members count for given GUIDs.
311
- * @param {String[]} groups
312
- * @returns {Promise<number>}
313
- * @memberof CometChat
314
- */
315
- export function getOnlineGroupMemberCount(groups: String[]): Promise<Object>;
316
-
317
- /**-------------------------------------------------------------------*
318
- * User related functions provided by CometChat class *
319
- *--------------------------------------------------------------------**/
320
-
321
- /**
322
- * Function to create a user.
323
- * @param {User | any} user
324
- * @param {string} apiKey
325
- * @returns {Promise<User>}
326
- * @memberof CometChat
327
- */
328
- export function createUser(user: User | any, apiKey: string): Promise<User>;
329
-
330
- /**
331
- *
332
- * Function to update the already existing user and returns the result with updated user.
333
- * @param {User | any} user
334
- * @param {string} apiKey
335
- * @returns {Promise<User>}
336
- * @memberof CometChat
337
- */
338
- export function updateUser(user: User | any, apiKey: string): Promise<User>;
339
-
340
- /**
341
- *
342
- * Function to update the logged-in user and returns the result with updated user
343
- * @param {User} user
344
- * @returns Promise<User>
345
- * @memberof CometChat
346
- */
347
- export function updateCurrentUserDetails(user: User | any): Promise<User>;
348
-
349
- /**
350
- * Function to get the information for the uid provided as an argument
351
- * @param {string} uid
352
- * @returns {Promise<User>}
353
- * @memberof CometChat
354
- */
355
- export function getUser(uid: any): Promise<User>;
356
-
357
- /**
358
- *
359
- * This function will return logged in user from local storage.
360
- * @returns {Promise<User | null>}
361
- * @memberof CometChat
362
- */
363
- export function getLoggedinUser(): Promise<User | null>;
364
-
365
- /**
366
- * Function to block users.
367
- * @param {String[]} blockedUids
368
- * @returns
369
- * @memberof CometChat
370
- */
371
- export function blockUsers(blockedUids: String[]): Promise<Object>;
372
-
373
- /**
374
- * Function to unblock users.
375
- * @param {String[]} blockedUids
376
- * @returns
377
- * @memberof CometChat
378
- */
379
- export function unblockUsers(blockedUids: String[]): Promise<Object>;
380
-
381
- /**-------------------------------------------------------------------*
382
- * Conversation related functions provided by CometChat class *
383
- *--------------------------------------------------------------------**/
384
-
385
- /**
386
- * Function to fetch conversation for a specific user/group.
387
- * @param {string} conversationWith
388
- * @param {string} conversationType
389
- * @returns {Promise<Conversation>}
390
- * @memberof CometChat
391
- */
392
- export function getConversation(conversationWith: string, conversationType: string): Promise<Conversation>;
393
-
394
- /**
395
- * Function to tag a conversation for a specific user/group.
396
- * @param {string} conversationWith
397
- * @param {string} conversationType
398
- * @param {Array<String>} tags
399
- * @returns {Promise<Conversation>}
400
- * @memberof CometChat
401
- */
402
- export function tagConversation(conversationWith: string, conversationType: string, tags: Array<String>): Promise<Conversation>;
403
-
404
- /**
405
- * function to delete conversation for a specific user/group.
406
- * @param {string} conversationWith
407
- * @param {string} conversationType
408
- * @returns Promise<string>
409
- * @memberof CometChat
410
- */
411
- export function deleteConversation(conversationWith: string, conversationType: string): Promise<string>;
412
-
413
- /**-------------------------------------------------------------------*
414
- * Group related functions provided by CometChat class *
415
- *--------------------------------------------------------------------**/
416
-
417
- /**
418
- * Function to create a group.
419
- * @param {Group} group
420
- * @returns {Promise<Group>}
421
- * @memberof CometChat
422
- */
423
- export function createGroup(group: Group | any): Promise<Group>;
424
-
425
- /**
426
- * Function to fetch details of a group.
427
- * @param {string | Object} guid
428
- * @returns {Promise<Group>}
429
- * @memberof CometChat
430
- */
431
- export function getGroup(guid: string | Object): Promise<Group>;
432
-
433
- /**
434
- * Function to join a public group.
435
- * @param {guid} guid
436
- * @param {GroupType} type
437
- * @param {string} password
438
- * @returns {Promise<Group>}
439
- * @memberof CometChat
440
- */
441
- export function joinGroup(grp: any, type?: GroupType, password?: string): Promise<Group>;
442
-
443
- /**
444
- * Function to update a group.
445
- * @param {Group} group
446
- * @returns {Promise<Group>}
447
- * @memberof CometChat
448
- */
449
- export function updateGroup(group: any): Promise<Group>;
450
-
451
- /**
452
- * Function to delete a group.
453
- * @param {string} guid
454
- * @returns {Promise<boolean>}
455
- * @memberof CometChat
456
- */
457
- export function deleteGroup(guid: string): Promise<boolean>;
458
-
459
- /**
460
- * Function to leave a group.
461
- * @param {string} guid
462
- * @returns {Promise}
463
- * @memberof CometChat
464
- */
465
- export function leaveGroup(guid: string): Promise<boolean>;
466
-
467
- /**
468
- * Function to kick a member from a group.
469
- * @param {string} guid
470
- * @param {string} uid
471
- * @returns {Promise<boolean>}
472
- * @memberof CometChat
473
- */
474
- export function kickGroupMember(guid: string, uid: string): Promise<boolean>;
475
-
476
- /**
477
- * Function to change the scope of a member in a group.
478
- * @param {string} guid
479
- * @param {string} uid
480
- * @param {GroupMemberScope} scope
481
- * @returns {Promise<boolean>}
482
- * @memberof CometChat
483
- */
484
- export function updateGroupMemberScope(guid: string, uid: string, scope: GroupMemberScope): Promise<boolean>;
485
-
486
- /**
487
- * Function to ban a group member from a group.
488
- * @param {string} guid
489
- * @param {string} uid
490
- * @returns {Promise<boolean>}
491
- * @memberof CometChat
492
- */
493
- export function banGroupMember(guid: string, uid: string): Promise<boolean>;
494
- /**
495
- * Function to unban a group member from a group.
496
- * @param {string} guid
497
- * @param {string} uid
498
- * @returns {Promise<boolean>}
499
- * @memberof CometChat
500
- */
501
- export function unbanGroupMember(guid: string, uid: string): Promise<boolean>;
502
-
503
- /**
504
- * Function to add members in a group. This function can also be used to ban a group member from a group.
505
- * @param {string} guid
506
- * @param {Array<GroupMember>} groupMembers
507
- * @param {Array<String>} bannedMembersList
508
- * @returns {Promise<Object>}
509
- * @memberof CometChat
510
- */
511
- export function addMembersToGroup(guid: string, groupMembers: Array<GroupMember>, bannedMembersList: Array<string>): Promise<Object>;
512
-
513
- /**
514
- *
515
- * Function to transfer ownership of a group.
516
- * @param {string} guid
517
- * @param {string} uid
518
- * @returns {Promise<string>}
519
- * @memberof CometChat
520
- */
521
- export function transferGroupOwnership(guid: string, uid: string): Promise<string>;
522
-
523
- /**
524
- * Function to create a group and add/ban members in/from that group.
525
- * @param {Group} group
526
- * @param {Array<GroupMember>} members
527
- * @param {Array<String>} banMembers
528
- * @returns {Promise<Object>}
529
- * @memberof CometChat
530
- */
531
- export function createGroupWithMembers(group: Group, members: Array<GroupMember>, banMembers: Array<string>): Promise<Object>;
532
-
533
- /**-------------------------------------------------------------------*
534
- * Call related functions provided by CometChat class *
535
- *--------------------------------------------------------------------**/
536
-
537
- /**
538
- * Function to initiate a user/group call.
539
- * @param {Call} call
540
- * @returns {Promise<Call>}
541
- * @memberof CometChat
542
- */
543
- export function initiateCall(call: Call | any): Promise<Call>;
544
-
545
- /**
546
- * Function to accept an incoming user/group call.
547
- * @param {string} sessionid
548
- * @returns {Promise<Call>}
549
- * @memberof CometChat
550
- */
551
- export function acceptCall(sessionid: string): Promise<Call>;
552
-
553
- /**
554
- * Function to reject an incoming call or cancel an outgoing call.
555
- * @param {string} sessionId
556
- * @param {string} status
557
- * @returns {Promise<Call>}
558
- * @memberof CometChat
559
- */
560
- export function rejectCall(sessionId: string, status: any): Promise<Call>;
561
-
562
- /**
563
- * Function to end an ongoing call.
564
- * @param {string} sessionid
565
- * @param {boolean} isInternal - Optional
566
- * @returns {Promise<Call>}
567
- * @memberof CometChat
568
- */
569
- export function endCall(sessionid: string, isInternal?: boolean): Promise<Call>;
570
-
571
- /**
572
- * Function to get the active call.
573
- * @returns {Call}
574
- * @memberof CometChat
575
- */
576
- export function getActiveCall(): Call;
577
-
578
- /**
579
- * Function to start a call.
580
- * @param {CallSettings | string} callSettings
581
- * @param {HTMLElement} view
582
- * @param {UserCallEventListener} callEventHandler
583
- * @memberof CometChat
584
- */
585
- export function startCall(callSettings: CallSettings | string, view: HTMLElement, ongoingCallListener?: OngoingCallListener): void;
586
-
587
- /**
588
- * Function to fetch participant count of an ongoing call.
589
- * @param {string} sessionId
590
- * @param {string} type
591
- * @returns {Promise<number>}
592
- * @memberof CometChat
593
- */
594
- export function getCallParticipantCount(sessionId: string, type: string): Promise<number>;
595
-
596
- /**-------------------------------------------------------------------------------------------------------*
597
- * Events listeners setting and removing . *
598
- *--------------------------------------------------------------------------------------------------------**/
599
-
600
- /**
601
- * Function to add a Connection Listner.
602
- * @param {string} name
603
- * @param {ConnectionListener} connectionListener
604
- * @memberof CometChat
605
- */
606
- export function addConnectionListener(name: string, connectionListener: ConnectionListener): void;
607
-
608
- /**
609
- * Function to remove a Connection Listner.
610
- * @param {string} name
611
- * @memberof CometChat
612
- */
613
- export function removeConnectionListener(name: string): void;
614
-
615
- /**
616
- * Function to add a Message Listner.
617
- * @param {string} name
618
- * @param {MessageListener} messageListener
619
- * @memberof CometChat
620
- */
621
- export function addMessageListener(name: string, messageListener: MessageListener): void;
622
-
623
- /**
624
- * Function to remove a Message Listner.
625
- * @param {string} name
626
- * @memberof CometChat
627
- */
628
- export function removeMessageListener(name: string): void;
629
-
630
- /**
631
- *
632
- * Function to add a Call Listener.
633
- * @param {string} name
634
- * @param {CallListener} callListener
635
- * @memberof CometChat
636
- */
637
- export function addCallListener(name: string, callListener: CallListener): void;
638
-
639
- /**
640
- * Function to remove a Call Listener.
641
- * @param {string} name
642
- * @memberof CometChat
643
- */
644
- export function removeCallListener(name: string): void;
645
-
646
- /**
647
- * Function to add a User Listener.
648
- * @param {string} name
649
- * @param {UserListener} userListener
650
- * @memberof CometChat
651
- */
652
- export function addUserListener(name: string, userListener: UserListener): void;
653
-
654
- /**
655
- * Function to remove a User Listener.
656
- * @param {string} name
657
- * @memberof CometChat
658
- */
659
- export function removeUserListener(name: string): void;
660
-
661
- /**
662
- * Function to add a Group Listener.
663
- * @param {string} name
664
- * @param {GroupListener} groupListener
665
- * @memberof CometChat
666
- */
667
- export function addGroupListener(name: string, groupListener: GroupListener): void;
668
-
669
- /**
670
- *
671
- * Function to remove a Group Listener.
672
- * @param {string} name
673
- * @memberof CometChat
674
- */
675
- export function removeGroupListener(name: string): void;
676
-
677
- /**
678
- * Function to add a Login Listener.
679
- *
680
- * @param {string} name
681
- * @param {LoginListener} loginListener
682
- * @memberof CometChat
683
- */
684
- export function addLoginListener(name: string, loginListener: LoginListener): void;
685
-
686
- /**
687
- * Function to remove a Login Listener.
688
- *
689
- * @param {string} name
690
- * @memberof CometChat
691
- */
692
- export function removeLoginListener(name: string): void;
693
-
694
- /**
695
- * Get the current connection status
696
- * @returns {string}
697
- * @memberof CometChat
698
- */
699
- export function getConnectionStatus(): string;
700
-
701
- /**
702
- * Returns a boolean value which indicates if the extension is enabled or not.
703
- * @param {string} extensionId
704
- * @returns {Promise<boolean>}
705
- * @memberof CometChat
706
- */
707
- export function isExtensionEnabled(extensionId: string): Promise<boolean>;
708
-
709
- /**
710
- * Returns an object of CCExtension Class which has the details of the extension.
711
- *
712
- * @param {string} extensionId
713
- * @returns {Promise<CCExtension>}
714
- * @memberof CometChat
715
- */
716
- export function getExtensionDetails(extensionId: string): Promise<CCExtension>;
717
-
718
- /**
719
- * Get the XMPP/ WEBRTC details from the servers
720
- * @internal
721
- * @returns {Promise<Object>}
722
- * @memberof CometChat
723
- */
724
- export function getAppSettings(): Promise<Object>;
725
-
726
- /**
727
- * Returns a boolean value which indicates if a feature is enabled or not for the current plan.
728
- * @param {string} feature
729
- * @returns {Promise<boolean>}
730
- * @memberof CometChat
731
- */
732
- export function isFeatureEnabled(feature: string): Promise<boolean>;
733
-
734
- /**
735
- * Clears the authtoken from server and clears the local cache.
736
- * @returns {Promise<Object>}
737
- * @memberof CometChat
738
- */
739
- export function logout(): Promise<Object>;
740
-
741
- /**
742
- * Function to call extension API.
743
- * @param {string} slug
744
- * @param {string} method
745
- * @param {string} endpoint
746
- * @param {Object} data
747
- * @returns {Promise<Object>}
748
- * @memberof CometChat
749
- */
750
- export function callExtension(slug: string, method: string, endpoint: string, data?: Object): Promise<Object>;
751
-
752
- /**
753
- * Function to set resource, platform and language variable.
754
- * @param {string} resource
755
- * @param {string} platform
756
- * @param {string} language
757
- * @memberof CometChat
758
- */
759
- export function setSource(resource: string, platform: string, language: string): void;
760
-
761
- /**
762
- *
763
- * Method to connect to WebSocket server.
764
- *
765
- * @static
766
- * @returns void
767
- * @memberof CometChat
768
- */
769
- export function connect(): void;
770
-
771
- /**
772
- *
773
- * Method to disconnect from WebSocket server.
774
- *
775
- * @static
776
- * @returns void
777
- * @memberof CometChat
778
- */
779
- export function disconnect(): void;
780
-
781
-
782
- /**
783
- *
784
- * @module CometChatException
785
- * @implements {ErrorModel}
786
- */
787
- export class CometChatException implements ErrorModel {
788
- code?: string | number;
789
- name?: string;
790
- message?: string;
791
- details?: string;
792
- constructor(errorModel: ErrorModel);
793
- }
794
-
795
- /** @private */
796
- export interface UserObj {
797
- uid: string;
798
- name: string;
799
- authToken: string;
800
- avatar: string;
801
- lastActiveAt: number;
802
- link: string;
803
- metadata: string;
804
- role: string;
805
- status: string;
806
- statusMessage: string;
807
- tags: Array<string>;
808
- deactivatedAt: number;
809
- }
810
- /**
811
- * Implementation of UserObject
812
- */
813
- export class User {
814
- /**
815
- * Method to get UID of the user.
816
- * @returns {string}
817
- */
818
- getUid(): string;
819
- /**
820
- * Method to set UID of the user.
821
- * @param {string} uid
822
- */
823
- setUid(uid: string): void;
824
- /**
825
- * Method to get name of the user.
826
- * @returns {string}
827
- */
828
- getName(): string;
829
- /**
830
- * Method to set name of the user.
831
- * @param {string} name
832
- */
833
- setName(name: string): void;
834
- /**
835
- * Method to get authToken of the user.
836
- * @returns {string}
837
- */
838
- getAuthToken(): string;
839
- /**
840
- * Method to set authToken of the user.
841
- * @param {string} authToken
842
- */
843
- setAuthToken(authToken: string): void;
844
- /**
845
- * Method to get avatar of the user.
846
- * @returns {string}
847
- */
848
- getAvatar(): string;
849
- /**
850
- * Method to set avatar of the user.
851
- * @param {string} avatar
852
- */
853
- setAvatar(avatar: string): void;
854
- /**
855
- * Method to get last active at timestamp of the user.
856
- * @returns {number}
857
- */
858
- getLastActiveAt(): number;
859
- /**
860
- * Method to set last active at timestamp of the user.
861
- * @param {number} lastActiveAt
862
- */
863
- setLastActiveAt(lastActiveAt: number): void;
864
- /**
865
- * Method to get link of the user.
866
- * @returns {string}
867
- */
868
- getLink(): string;
869
- /**
870
- * Method to set link of the user.
871
- * @param {string} link
872
- */
873
- setLink(link: string): string;
874
- /**
875
- * Method to get metadata of the user.
876
- * @returns {string}
877
- */
878
- getMetadata(): string;
879
- /**
880
- * Method to set metadata of the user.
881
- * @param {string} metadata
882
- */
883
- setMetadata(metadata: string): void;
884
- /**
885
- * Method to get role of the user.
886
- * @returns {string}
887
- */
888
- getRole(): string;
889
- /**
890
- * Method to set role of the user.
891
- * @param {string} role
892
- */
893
- setRole(role: string): void;
894
- /**
895
- * Method to get status of the user.
896
- * @returns {string}
897
- */
898
- getStatus(): string;
899
- /**
900
- * Method to set status of the user.
901
- * @param {string} status
902
- */
903
- setStatus(status: string): void;
904
- /**
905
- * Method to get status message of the user.
906
- * @returns {string}
907
- */
908
- getStatusMessage(): string;
909
- /**
910
- * Method to set status message of the user.
911
- * @param {string} statusMessage
912
- */
913
- setStatusMessage(statusMessage: string): void;
914
- setBlockedByMe(blockedByMe: boolean): void;
915
- /**
916
- * Method to know if the logged-in user has blocked the other user.
917
- * @returns {boolean}
918
- */
919
- getBlockedByMe(): boolean;
920
- setHasBlockedMe(hasBlockedMe: boolean): void;
921
- /**
922
- * Method to know if the logged-in user has been blocked by the other user.
923
- * @returns {boolean}
924
- */
925
- getHasBlockedMe(): boolean;
926
- /**
927
- * Method to set tags of the user.
928
- * @param {string[]} tags
929
- */
930
- setTags(tags: Array<string>): void;
931
- /**
932
- * Method to get tags of the user.
933
- * @returns {string[]}
934
- */
935
- getTags(): Array<string>;
936
- /**
937
- * Method to set deactivatedAt timestamp of a user.
938
- * @param {number} deactivatedAt
939
- */
940
- setDeactivatedAt(deactivatedAt: number): void;
941
- /**
942
- * Method to get deactivatedAt timestamp of a user.
943
- * @returns {number}
944
- */
945
- getDeactivatedAt(): number;
946
- constructor(...userObj: any[]);
947
- }
948
-
949
- /**
950
- *
951
- * @module MediaMessage
952
- */
953
- export class MediaMessage extends BaseMessage implements Message {
954
- /** @private */ static readonly TYPE: {
955
- TEXT: string;
956
- MEDIA: string;
957
- IMAGE: string;
958
- VIDEO: string;
959
- AUDIO: string;
960
- FILE: string;
961
- CUSTOM: string;
962
- };
963
- /** @private */ static readonly RECEIVER_TYPE: {
964
- USER: string;
965
- GROUP: string;
966
- };
967
- /** @private */ static readonly CATEGORY: {
968
- MESSAGE: string;
969
- ACTION: string;
970
- CALL: string;
971
- CUSTOM: string;
972
- };
973
- private url;
974
- private file;
975
- private files;
976
- private _metaData;
977
- protected data?: any;
978
- private attachment;
979
- private caption;
980
- private tags?: Array<String>;
981
- constructor(receiverId: string, file: object | string | Array<object> | any, type: string, receiverType: string);
982
- /**
983
- * Method to set caption for the media message.
984
- * @param {string} text
985
- */
986
- setCaption(text: string): void;
987
- /**
988
- * Method to get caption of the media message.
989
- * @returns {string}
990
- */
991
- getCaption(): string;
992
- /**
993
- * Method to get sender of the message.
994
- * @returns {User}
995
- */
996
- getSender(): User;
997
- /**
998
- * Method to get receiver of the message.
999
- * @returns {User | Group}
1000
- */
1001
- getReceiver(): User | Group;
1002
- /**
1003
- * Method to get metadata of the message.
1004
- * @returns {Object}
1005
- */
1006
- getMetadata(): Object;
1007
- /**
1008
- * Method to set metadata of the message.
1009
- * @param {Object} metadata
1010
- */
1011
- setMetadata(metadata: Object): void;
1012
- /**
1013
- * Method to get data of the message.
1014
- * @returns {Object}
1015
- */
1016
- getData(): Object;
1017
- /**
1018
- * Method to set data of the message.
1019
- * @param {Object} value
1020
- */
1021
- setData(value: Object): void;
1022
- /**
1023
- * Method to get attachment of media message.
1024
- * @returns {Attachment}
1025
- */
1026
- getAttachment(): Attachment;
1027
- /**
1028
- * Method to set attachment of media message.
1029
- * @param {Attachment} attachment
1030
- */
1031
- setAttachment(attachment: Attachment): void;
1032
- /**
1033
- * Method to get all the attachments of media message.
1034
- * @returns {Array<Attachment>}
1035
- */
1036
- getAttachments(): Array<Attachment>;
1037
- /**
1038
- * Method to set multiple attachments of media message.
1039
- * @param {Array<Attachment>} attachments
1040
- */
1041
- setAttachments(attachments: Array<Attachment>): void;
1042
- /**
1043
- * Method to get URL of the media file.
1044
- * @returns {string}
1045
- */
1046
- getURL(): string;
1047
- /**
1048
- * Get the tags of the message.
1049
- * @returns {Array<String>}
1050
- */
1051
- getTags(): Array<String>;
1052
- /**
1053
- * @param {Array<String>} tags
1054
- * Set the tags for the message.
1055
- */
1056
- setTags(tags: Array<String>): void;
1057
- }
1058
-
1059
- /**
1060
- *
1061
- * @module BaseMessage
1062
- */
1063
- export interface Message {
1064
- }
1065
- /**
1066
- *Basic Message Object
1067
- *
1068
- * @export
1069
- * @class BaseMessage
1070
- */
1071
- export class BaseMessage implements Message {
1072
- protected id?: number;
1073
- protected conversationId?: string;
1074
- protected parentMessageId?: number;
1075
- protected muid?: string;
1076
- protected sender?: User;
1077
- protected receiverId?: string;
1078
- protected receiver?: User | Group;
1079
- protected type?: string;
1080
- protected category?: MessageCategory;
1081
- protected receiverType?: string;
1082
- protected sentAt?: number;
1083
- protected deliveredAt?: number;
1084
- protected readAt?: number;
1085
- protected deliveredToMeAt?: number;
1086
- protected readByMeAt?: number;
1087
- protected metadata: Object;
1088
- protected status?: string;
1089
- protected receipts?: any[];
1090
- protected readReceipts?: MessageReceipt[];
1091
- protected deliveryReceipts?: MessageReceipt[];
1092
- protected editedAt: number;
1093
- protected editedBy: string;
1094
- protected deletedAt: number;
1095
- protected deletedBy: string;
1096
- protected replyCount: number;
1097
- protected rawMessage: Object;
1098
- constructor(receiverId: string, messageType: string, receiverType: string, category: MessageCategory);
1099
- /**
1100
- * Get ID of the message
1101
- * @returns {number}
1102
- */
1103
- getId(): number;
1104
- /**
1105
- * @param {number} value
1106
- * Set ID of the message
1107
- */
1108
- setId(value: number): void;
1109
- /**
1110
- * Get conversation ID of the message.
1111
- * @returns {string}
1112
- */
1113
- getConversationId(): string;
1114
- /**
1115
- * @param {string} value
1116
- * Set conversation ID of the message.
1117
- */
1118
- setConversationId(value: string): void;
1119
- /**
1120
- * Get parent message ID of the message.
1121
- * @returns {number}
1122
- */
1123
- getParentMessageId(): number;
1124
- /**
1125
- * @param {number} value
1126
- * Set parent message ID of the message.
1127
- */
1128
- setParentMessageId(value: number): void;
1129
- /**
1130
- * Get MUID of the message.
1131
- * @returns {string}
1132
- */
1133
- getMuid(): string;
1134
- /**
1135
- * @param {string} value
1136
- * Sets the MUID of the message.
1137
- */
1138
- setMuid(value: string): void;
1139
- /**
1140
- * Get sender of the message.
1141
- * @returns {User}
1142
- */
1143
- getSender(): User;
1144
- /**
1145
- * @param {User} value
1146
- * Set sender of the message.
1147
- */
1148
- setSender(value: User): void;
1149
- /**
1150
- * Get receiver of the message.
1151
- * @returns {User | Group}
1152
- */
1153
- getReceiver(): User | Group;
1154
- /**
1155
- * @param {User | Group} value
1156
- * Set receiver of the message.
1157
- */
1158
- setReceiver(value: User | Group): void;
1159
- /**
1160
- * Get receiverID of the message.
1161
- * @returns {string}
1162
- */
1163
- getReceiverId(): string;
1164
- /**
1165
- * @param {string} value
1166
- * Set receiverId of the message.
1167
- */
1168
- setReceiverId(value: string): void;
1169
- /**
1170
- * Get type of the message.
1171
- * @returns {string}
1172
- */
1173
- getType(): string;
1174
- /**
1175
- * @param {string} value
1176
- * Set type of the message.
1177
- */
1178
- setType(value: string): void;
1179
- /**
1180
- * Get receiver type of the message.
1181
- * @returns {string}
1182
- */
1183
- getReceiverType(): string;
1184
- /**
1185
- * @param {string} value
1186
- * Set the receiver type of the message.
1187
- */
1188
- setReceiverType(value: string): void;
1189
- /**
1190
- * Get message's sentAt timestamp.
1191
- * @returns {number}
1192
- */
1193
- getSentAt(): number;
1194
- /**
1195
- * @param {number} value
1196
- * Set message's sentAt timestamp.
1197
- */
1198
- setSentAt(value: number): void;
1199
- /** @private */
1200
- getStatus(): string;
1201
- /** @private */
1202
- setStatus(value: string): void;
1203
- /**
1204
- * Get delivery timestamp of the message.
1205
- * @returns {number}
1206
- */
1207
- getDeliveredAt(): number;
1208
- /**
1209
- * @param {number} deliveredAt
1210
- * Set delivery timestamp of the message.
1211
- */
1212
- setDeliveredAt(deliveredAt: number): void;
1213
- /**
1214
- * Get timestamp of the message at which it was delivered to logged in user.
1215
- * @returns {number}
1216
- */
1217
- getDeliveredToMeAt(): number;
1218
- /**
1219
- * @param {number} deliveredToMeAt
1220
- * Set timestamp of the message at which it was delivered to logged in user.
1221
- */
1222
- setDeliveredToMeAt(deliveredToMeAt: number): void;
1223
- /**
1224
- * Get read timestamp of the message.
1225
- * @returns {number}
1226
- */
1227
- getReadAt(): number;
1228
- /**
1229
- * @param {number} readAt
1230
- * Set read timestamp of the message.
1231
- */
1232
- setReadAt(readAt: number): void;
1233
- /**
1234
- * Get timestamp of the message at which it was read by the logged in user.
1235
- * @returns {number}
1236
- */
1237
- getReadByMeAt(): number;
1238
- /**
1239
- * @param {number} readByMeAt
1240
- * Set timestamp of the message at which it was read by the logged in user.
1241
- */
1242
- setReadByMeAt(readByMeAt: number): void;
1243
- /**
1244
- * Get category of the message.
1245
- * @returns {string}
1246
- */
1247
- getCategory(): MessageCategory;
1248
- /**
1249
- * @param {string} category
1250
- * Set category of the message.
1251
- */
1252
- setCategory(category: MessageCategory): void;
1253
- /**
1254
- * Get timestamp of the message when it was updated/edited.
1255
- * @returns {number}
1256
- */
1257
- getEditedAt(): number;
1258
- /**
1259
- * @param {number} editedAt
1260
- * Set timestamp of the message when it was updated/edited.
1261
- */
1262
- setEditedAt(editedAt: number): void;
1263
- /**
1264
- * Get UID of the user who edited/updated the message.
1265
- * @returns {string}
1266
- */
1267
- getEditedBy(): string;
1268
- /**
1269
- * @param {string} editedBy
1270
- * Set UID of the user who edited/updated the message.
1271
- */
1272
- setEditedBy(editedBy: string): void;
1273
- /**
1274
- * Get timestamp of the message when it was deleted.
1275
- * @returns {number}
1276
- */
1277
- getDeletedAt(): number;
1278
- /**
1279
- * @param {number} deletedAt
1280
- * Set timestamp of the message when it was deleted.
1281
- */
1282
- setDeletedAt(deletedAt: number): void;
1283
- /**
1284
- * Get UID of the user who deleted the message.
1285
- * @returns {number}
1286
- */
1287
- getDeletedBy(): string;
1288
- /**
1289
- * @param {string} deletedBy
1290
- * Set UID of the user who deleted the message.
1291
- */
1292
- setDeletedBy(deletedBy: string): void;
1293
- /**
1294
- * Get the number of replies of the message.
1295
- * @returns {number}
1296
- */
1297
- getReplyCount(): number;
1298
- /**
1299
- * @param {number} value
1300
- * Set the number of replies of the message.
1301
- */
1302
- setReplyCount(value: number): void;
1303
- /**
1304
- * Get the raw JSON of the message.
1305
- * @returns
1306
- */
1307
- getRawMessage(): Object;
1308
- /**
1309
- * @param {Object} rawMessage
1310
- * Set the raw JSON of the message.
1311
- */
1312
- setRawMessage(rawMessage: Object): void;
1313
- }
1314
-
1315
- /**
1316
- *
1317
- * @module TextMessage
1318
- */
1319
- export class TextMessage extends BaseMessage implements Message {
1320
- /** @private */ static readonly TYPE: string;
1321
- /** @private */ static readonly RECEIVER_TYPE: {
1322
- USER: string;
1323
- GROUP: string;
1324
- };
1325
- /** @private */ static readonly CATEGORY: string;
1326
- private text?;
1327
- private data?;
1328
- private processedText?;
1329
- private tags?;
1330
- /**
1331
- *Creates an instance of TextMessage.
1332
- * @param {string} receiverUid
1333
- * @param {string} text
1334
- * @param {string} senderUid
1335
- * @param {string} receiverType
1336
- * @memberof TextMessage
1337
- */
1338
- constructor(receiverId: string, text: string, receiverType: string);
1339
- /**
1340
- * Method to get sender of the message.
1341
- * @returns {User}
1342
- */
1343
- getSender(): User;
1344
- /**
1345
- * Method to get receiver of the message.
1346
- * @returns {User | Group}
1347
- */
1348
- getReceiver(): User | Group;
1349
- /**
1350
- * Method to get metadata of the message.
1351
- * @returns {Object}
1352
- */
1353
- getMetadata(): Object;
1354
- /**
1355
- * Method to set metadata of the message.
1356
- * @param {Object} value
1357
- */
1358
- setMetadata(value: Object): void;
1359
- /**
1360
- * Method to get data of the message.
1361
- * @returns {Object}
1362
- */
1363
- getData(): any;
1364
- /**
1365
- * Method to set data of the message.
1366
- * @param {Object} value
1367
- */
1368
- setData(value: string): void;
1369
- /**
1370
- * Method to get text of the message.
1371
- * @returns {string}
1372
- */
1373
- getText(): string;
1374
- /**
1375
- * Method to set text of the message.
1376
- * @param {string} text
1377
- */
1378
- setText(text: string): void;
1379
- /** @internal */
1380
- setProcessedText(text: string): void;
1381
- /** @internal */
1382
- getProcessedText(): string;
1383
- /**
1384
- * Get the tags of the message.
1385
- * @returns {Array<String>}
1386
- */
1387
- getTags(): Array<String>;
1388
- /**
1389
- * @param {Array<String>} tags
1390
- * Set the tags for the message.
1391
- */
1392
- setTags(tags: Array<String>): void;
1393
- }
1394
-
1395
- export const constants: {
1396
- DEFAULT_STORE: string;
1397
- MSG_VER_PRE: string;
1398
- MSG_VER_POST: string;
1399
- };
1400
- export const DEFAULT_VALUES: {
1401
- ZERO: number;
1402
- MSGS_LIMIT: number;
1403
- MSGS_MAX_LIMIT: number;
1404
- USERS_LIMIT: number;
1405
- USERS_MAX_LIMIT: number;
1406
- GROUPS_LIMIT: number;
1407
- GROUPS_MAX_LIMIT: number;
1408
- CONVERSATION_MAX_LIMIT: number;
1409
- CALL_TIMEOUT: number;
1410
- DEFAULT_MSG_ID: number;
1411
- DEFAULT_MAX_TYPING_INDICATOR_LIMIT: number;
1412
- REGION_DEFAULT: string;
1413
- REGION_DEFAULT_EU: string;
1414
- REGION_DEFAULT_US: string;
1415
- REGION_DEFAULT_IN: string;
1416
- REGION_DEFAULT_PRIVATE: string;
1417
- };
1418
- export const CALLING_COMPONENT_VERSION = 5;
1419
- export enum GroupType {
1420
- Public = "public",
1421
- Private = "private",
1422
- Protected = "protected",
1423
- Password = "password"
1424
- }
1425
- export const GROUP_TYPE: {
1426
- PUBLIC: string;
1427
- PRIVATE: string;
1428
- PROTECTED: string;
1429
- PASSWORD: string;
1430
- };
1431
- export enum GroupMemberScope {
1432
- Admin = "admin",
1433
- Moderator = "moderator",
1434
- Member = "member"
1435
- }
1436
- export const GROUP_MEMBER_SCOPE: {
1437
- ADMIN: string;
1438
- MODERATOR: string;
1439
- PARTICIPANT: string;
1440
- };
1441
- export const APPINFO: {
1442
- platform: string;
1443
- sdkVersion: string;
1444
- apiVersion: string;
1445
- sdkVersionWithUnderScore: string;
1446
- };
1447
- export const SDKHeader: {
1448
- platform: string;
1449
- sdkVersion: string;
1450
- sdk: string;
1451
- };
1452
- export const WS: {
1453
- CONVERSATION: {
1454
- TYPE: {
1455
- CHAT: string;
1456
- GROUP_CHAT: string;
1457
- };
1458
- };
1459
- };
1460
- export const ANALYTICS: {
1461
- analyticsHost: string;
1462
- analyticsVersion: string;
1463
- };
1464
- export const LOCAL_STORE: {
1465
- COMMON_STORE: string;
1466
- MESSAGE_LISTENERS_LIST: string;
1467
- USERS_STORE: string;
1468
- MESSAGES_STORE: string;
1469
- KEYS_STORE: string;
1470
- STORE_STRING: string;
1471
- KEY_STRING: string;
1472
- KEY_USER: string;
1473
- KEY_APP_SETTINGS: string;
1474
- KEY_APP_ID: string;
1475
- KEY_DEVICE_ID: string;
1476
- KEY_MESSAGE_LISTENER_LIST: string;
1477
- };
1478
- export const ResponseConstants: {
1479
- RESPONSE_KEYS: {
1480
- KEY_DATA: string;
1481
- KEY_META: string;
1482
- KEY_CURSOR: string;
1483
- KEY_ACTION: string;
1484
- KEY_MESSAGE: string;
1485
- KEY_ERROR: string;
1486
- KEY_ERROR_DETAILS: string;
1487
- KEY_ERROR_CODE: string;
1488
- KEY_ERROR_MESSAGE: string;
1489
- KEY_AUTH_TOKEN: string;
1490
- KEY_WS_CHANNEL: string;
1491
- KEY_IDENTITY: string;
1492
- KEY_SERVICE: string;
1493
- KEY_ENTITIES: string;
1494
- KEY_ENTITITY: string;
1495
- KEY_ENTITYTYPE: string;
1496
- KEY_ATTACHMENTS: string;
1497
- CODE_REQUEST_OK: number;
1498
- CODE_BAD_REQUEST: number;
1499
- UNREAD_UNDELIVERED_KEYS: {
1500
- ENTITY: string;
1501
- ENTITY_TYPE: string;
1502
- ENTITY_Id: string;
1503
- COUNT: string;
1504
- };
1505
- GROUP_MEMBERS_RESPONSE: {
1506
- SUCCESS: string;
1507
- ERROR: string;
1508
- MESSAGE: string;
1509
- };
1510
- KEY_ENTITY_TYPE: {
1511
- USER: string;
1512
- GROUP: string;
1513
- };
1514
- };
1515
- };
1516
- export const DELIVERY_RECEIPTS: {
1517
- RECEIVER_ID: string;
1518
- RECEIVER_TYPE: string;
1519
- RECIPIENT: string;
1520
- MESSAGE_ID: string;
1521
- RECEIVED: string;
1522
- DELIVERED_AT: string;
1523
- ID: string;
1524
- TIME: string;
1525
- DELIVERED_TO_ME_AT: string;
1526
- };
1527
- export const READ_RECEIPTS: {
1528
- RECEIVER_ID: string;
1529
- RECEIVER_TYPE: string;
1530
- RECIPIENT: string;
1531
- MESSAGE_ID: string;
1532
- READ: string;
1533
- READ_AT: string;
1534
- ID: string;
1535
- TIME: string;
1536
- READ_BY_ME_AT: string;
1537
- };
1538
- export const MessageConstatnts: {
1539
- TYPE: {
1540
- TEXT: string;
1541
- MEDIA: string;
1542
- IMAGE: string;
1543
- VIDEO: string;
1544
- AUDIO: string;
1545
- FILE: string;
1546
- CUSTOM: string;
1547
- };
1548
- CATEGORY: {
1549
- MESSAGE: string;
1550
- ACTION: string;
1551
- CALL: string;
1552
- CUSTOM: string;
1553
- };
1554
- RECEIVER_TYPE: {
1555
- USER: string;
1556
- GROUP: string;
1557
- };
1558
- KEYS: {
1559
- ATTATCHMENT: string;
1560
- ATTATCHMENTS: string;
1561
- ACTION: string;
1562
- TYPE: string;
1563
- DATA: string;
1564
- ID: string;
1565
- MUID: string;
1566
- SENDER: string;
1567
- RECEIVER: string;
1568
- RECEIVER_ID: string;
1569
- CATEGORY: string;
1570
- RECEIVER_TYPE: string;
1571
- SENT_AT: string;
1572
- STATUS: string;
1573
- TEXT: string;
1574
- URL: string;
1575
- METADATA: string;
1576
- RECEIPTS: string;
1577
- MY_RECEIPTS: string;
1578
- CUSTOM_DATA: string;
1579
- CUSTOM_SUB_TYPE: string;
1580
- RESOURCE: string;
1581
- };
1582
- KNOWN_MEDIA_TYPE: {
1583
- IMAGE: any[];
1584
- VIDEO: any[];
1585
- AUDIO: any[];
1586
- FILE: any[];
1587
- };
1588
- PAGINATION: {
1589
- AFFIX: {
1590
- APPEND: string;
1591
- PREPEND: string;
1592
- };
1593
- CURSOR_FILEDS: {
1594
- ID: string;
1595
- SENT_AT: string;
1596
- };
1597
- CURSOR_AFFIX_DEFAULT: string;
1598
- CURSOR_FIELD_DEFAULT: string;
1599
- KEYS: {
1600
- PER_PAGE: string;
1601
- CURSOR_AFFIX: string;
1602
- AFFIX: string;
1603
- CURSOR_FIELD: string;
1604
- CURSOR_VALUE: string;
1605
- UID: string;
1606
- SENT_AT: string;
1607
- ID: string;
1608
- CURRENT_PAGE: string;
1609
- UNREAD: string;
1610
- HIDE_MESSAGES_FROM_BLOCKED_USER: string;
1611
- SEARCH_KEY: string;
1612
- ONLY_UPDATES: string;
1613
- UPDATED_AT: string;
1614
- CATEGORY: string;
1615
- CATEGORIES: string;
1616
- TYPE: string;
1617
- TYPES: string;
1618
- HIDE_REPLIES: string;
1619
- HIDE_DELETED_MESSAGES: string;
1620
- };
1621
- };
1622
- };
1623
- export const ATTACHMENTS_CONSTANTS: {
1624
- KEYS: {
1625
- EXTENSION: string;
1626
- MIME_TYPE: string;
1627
- NAME: string;
1628
- SIZE: string;
1629
- URL: string;
1630
- };
1631
- };
1632
- export enum MessageCategory {
1633
- ACTION = "action",
1634
- MESSAGE = "message",
1635
- CALL = "call",
1636
- CUSTOM = "custom"
1637
- }
1638
- export const TYPING_NOTIFICATION: {
1639
- RECEIVER_ID: string;
1640
- RECEIVER_TYPE: string;
1641
- META: string;
1642
- KEYS: {
1643
- TYPING_NOTIFICATION: string;
1644
- TIMESTAMP: string;
1645
- };
1646
- ACTIONS: {
1647
- STARTED: string;
1648
- ENDED: string;
1649
- };
1650
- };
1651
- export const ActionConstatnts: {
1652
- ACTION_SUBJECTS: {
1653
- ACTION_ON: string;
1654
- ACTION_BY: string;
1655
- ACTION_FOR: string;
1656
- };
1657
- ACTION_ENTITY_TYPE: {
1658
- GROUP_USER: string;
1659
- USER: string;
1660
- GROUP: string;
1661
- MESSAGE: string;
1662
- };
1663
- ACTION_KEYS: {
1664
- ACTION_CREATED: string;
1665
- ACTION_UPDATED: string;
1666
- ACTION_DELETED: string;
1667
- ENTITIES: string;
1668
- ENTITY: string;
1669
- ENTITY_TYPE: string;
1670
- TYPE_MEMBER_JOINED: string;
1671
- TYPE_MEMBER_LEFT: string;
1672
- TYPE_MEMBER_KICKED: string;
1673
- TYPE_MEMBER_BANNED: string;
1674
- TYPE_MEMBER_UNBANNED: string;
1675
- TYPE_MEMBER_INVITED: string;
1676
- TYPE_MEMBER_ADDED: string;
1677
- ACTION_SCOPE_CHANGED: string;
1678
- ACTION_TYPE_USER: string;
1679
- ACTION_TYPE_GROUP: string;
1680
- ACTION_TYPE_GROUP_MEMBER: string;
1681
- TYPE_MESSAGE_EDITED: string;
1682
- TYPE_MESSAGE_DELETED: string;
1683
- ACTION_TYPE_CALL: string;
1684
- EXTRAS: string;
1685
- SCOPE: string;
1686
- NEW: string;
1687
- OLD: string;
1688
- };
1689
- ActionMessages: {
1690
- ACTION_GROUP_JOINED_MESSAGE: string;
1691
- ACTION_GROUP_LEFT_MESSAGE: string;
1692
- ACTION_MEMBER_KICKED_MESSAGE: string;
1693
- ACTION_MEMBER_BANNED_MESSAGE: string;
1694
- ACTION_MEMBER_UNBANNED_MESSAGE: string;
1695
- ACTION_MEMBER_INVITED_MESSAGE: string;
1696
- ACTION_MESSAGE_EDITED_MESSAGE: string;
1697
- ACTION_MESSAGE_DELETED_MESSAGE: string;
1698
- ACTION_MEMBER_SCOPE_CHANGED: string;
1699
- ACTION_MEMBER_ADDED_TO_GROUP: string;
1700
- };
1701
- ACTION_TYPE: {
1702
- TYPE_MEMBER_JOINED: string;
1703
- TYPE_MEMBER_LEFT: string;
1704
- TYPE_MEMBER_KICKED: string;
1705
- TYPE_MEMBER_BANNED: string;
1706
- TYPE_MEMBER_UNBANNED: string;
1707
- TYPE_MEMBER_INVITED: string;
1708
- TYPE_MEMBER_SCOPE_CHANGED: string;
1709
- TYPE_MESSAGE: string;
1710
- TYPE_MESSAGE_EDITED: string;
1711
- TYPE_MESSAGE_DELETED: string;
1712
- TYPE_MEMBER_ADDED: string;
1713
- };
1714
- ACTIONS: {
1715
- MEMBER_ADDED: string;
1716
- MEMBER_JOINED: string;
1717
- MEMBER_LEFT: string;
1718
- MEMBER_KICKED: string;
1719
- MEMBER_BANNED: string;
1720
- MEMBER_UNBANNED: string;
1721
- MEMBER_INVITED: string;
1722
- MEMBER_SCOPE_CHANGED: string;
1723
- MESSAGE_EDITED: string;
1724
- MESSSAGE_DELETED: string;
1725
- TYPE_USER: string;
1726
- TYPE_GROUP: string;
1727
- TYPE_GROUP_MEMBER: string;
1728
- };
1729
- };
1730
- export const BlockedUsersConstants: {
1731
- REQUEST_KEYS: {
1732
- DIRECTIONS: {
1733
- BOTH: string;
1734
- HAS_BLOCKED_ME: string;
1735
- BLOCKED_BY_ME: string;
1736
- };
1737
- };
1738
- };
1739
- export const CallConstants: {
1740
- CALL_MODE: {
1741
- DEFAULT: string;
1742
- SPOTLIGHT: string;
1743
- SINGLE: string;
1744
- TILE: string;
1745
- GRID: string;
1746
- };
1747
- CALL_TYPE: {
1748
- AUDIO: string;
1749
- VIDEO: string;
1750
- };
1751
- RECEIVER_TYPE_GROUP: string;
1752
- RECEIVER_TYPE_USER: string;
1753
- CALL_KEYS: {
1754
- CALL_DATA: string;
1755
- CALL_ID: string;
1756
- CALL_SESSION_ID: string;
1757
- CALL_RECEIVER: string;
1758
- CALL_SENDER: string;
1759
- CALL_RECEIVER_TYPE: string;
1760
- CALL_STATUS: string;
1761
- CALL_TYPE: string;
1762
- CALL_INITIATED_AT: string;
1763
- CALL_JOINED_AT: string;
1764
- CALL_LEFT_AT: string;
1765
- CALL_METADATA: string;
1766
- CALL_ENTITIES: string;
1767
- CALL_ENTITY_TYPE: string;
1768
- CALL_ENTITY: string;
1769
- CALL_ENTITY_USER: string;
1770
- CALL_ENTITY_GROUP: string;
1771
- };
1772
- CALL_STATUS: {
1773
- INITIATED: string;
1774
- ONGOING: string;
1775
- UNANSWERED: string;
1776
- REJECTED: string;
1777
- BUSY: string;
1778
- CANCELLED: string;
1779
- ENDED: string;
1780
- };
1781
- AUDIO_INPUT_DEVICES: string;
1782
- AUDIO_OUTPUT_DEVICES: string;
1783
- VIDEO_INPUT_DEVICES: string;
1784
- POST_MESSAGES: {
1785
- TYPES: {
1786
- ACTION_MESSAGE: string;
1787
- HANGUP: string;
1788
- COMETCHAT_RTC_SETTINGS: string;
1789
- };
1790
- ACTIONS: {
1791
- USER_JOINED: string;
1792
- USER_LEFT: string;
1793
- USER_LIST_CHANGED: string;
1794
- INITIAL_DEVICE_LIST: string;
1795
- DEVICE_CHANGE: string;
1796
- LOAD: string;
1797
- CHANGE_AUDIO_INPUT: string;
1798
- CHANGE_AUDIO_OUTPUT: string;
1799
- CHANGE_VIDEO_INPUT: string;
1800
- MUTE_AUDIO: string;
1801
- UNMUTE_AUDIO: string;
1802
- PAUSE_VIDEO: string;
1803
- UNPAUSE_VIDEO: string;
1804
- SWITCH_MODE: string;
1805
- START_SCREENSHARE: string;
1806
- STOP_SCREENSHARE: string;
1807
- END_CALL: string;
1808
- START_RECORDING: string;
1809
- STOP_RECORDING: string;
1810
- RECORDING_TOGGLED: string;
1811
- USER_MUTED: string;
1812
- SCREEN_SHARE_STARTED: string;
1813
- SCREEN_SHARE_STOPPED: string;
1814
- };
1815
- };
1816
- MEDIA_DEVICE: {
1817
- ID: string;
1818
- NAME: string;
1819
- ACTIVE: string;
1820
- };
1821
- };
1822
- export const GroupConstants: {
1823
- KEYS: {
1824
- NAME: string;
1825
- GUID: string;
1826
- TYPE: string;
1827
- PASSWORD: string;
1828
- ICON: string;
1829
- DESCRIPTION: string;
1830
- OWNER: string;
1831
- METADATA: string;
1832
- CREATED_AT: string;
1833
- UPDATED_AT: string;
1834
- HAS_JOINED: string;
1835
- WS_CHANNEL: string;
1836
- TAGS: string;
1837
- };
1838
- };
1839
- export const GroupMemersConstans: {
1840
- KEYS: {
1841
- SCOPE: string;
1842
- UID: string;
1843
- GUID: string;
1844
- USER: string;
1845
- NAME: string;
1846
- };
1847
- };
1848
- export const UserConstants: {
1849
- UID: string;
1850
- NAME: string;
1851
- AUTH_TOKEN: string;
1852
- AVATAR: string;
1853
- LAST_ACTIVE_AT: string;
1854
- LINK: string;
1855
- META_DATA: string;
1856
- ROLE: string;
1857
- STATUS: string;
1858
- STATUS_MESSAGE: string;
1859
- USER_NAME: string;
1860
- TAGS: string;
1861
- };
1862
- export const Errors: {
1863
- ERROR_IO_EXCEPTION: string;
1864
- ERROR_JSON_EXCEPTION: string;
1865
- ERROR_PASSWORD_MISSING: string;
1866
- ERROR_LIMIT_EXCEEDED: string;
1867
- ERROR_USER_NOT_LOGGED_IN: string;
1868
- ERROR_INVALID_GUID: string;
1869
- ERROR_PASSWORD_MISSING_MESSAGE: string;
1870
- ERROR_LIMIT_EXCEEDED_MESSAGE: string;
1871
- ERROR_USER_NOT_LOGGED_IN_MESSAGE: string;
1872
- ERROR_INVALID_GUID_MESSAGE: string;
1873
- ERROR_DEFAULT_MESSAGE: string;
1874
- ERR_SETTINGS_HASH_OUTDATED: string;
1875
- ERR_NO_AUTH: string;
1876
- };
1877
- export const CALL_ERROR: {
1878
- CALL_ALREADY_INITIATED: {
1879
- code: string;
1880
- name: string;
1881
- message: string;
1882
- details: {};
1883
- };
1884
- ERROR_IN_CALLING: {
1885
- code: string;
1886
- name: string;
1887
- message: string;
1888
- details: {};
1889
- };
1890
- CANNOT_ACCEPT_CALL: {
1891
- code: string;
1892
- name: string;
1893
- message: string;
1894
- details: {};
1895
- };
1896
- NOT_INITIALIZED: {
1897
- code: string;
1898
- name: string;
1899
- message: string;
1900
- details: {};
1901
- };
1902
- NOT_LOGGED_IN: {
1903
- code: string;
1904
- name: string;
1905
- message: string;
1906
- details: {};
1907
- };
1908
- SESSION_ID_REQUIRED: {
1909
- code: string;
1910
- name: string;
1911
- message: string;
1912
- details: {};
1913
- };
1914
- CALL_SETTINGS_REQUIRED: {
1915
- code: string;
1916
- name: string;
1917
- message: string;
1918
- details: {};
1919
- };
1920
- JWT_NOT_FOUND: {
1921
- code: string;
1922
- name: string;
1923
- message: string;
1924
- details: {};
1925
- };
1926
- };
1927
- export const PARAMETER_ERROR: {
1928
- PARAMETER_REQUIRED: {
1929
- code: string;
1930
- name: string;
1931
- message: string;
1932
- details: {};
1933
- };
1934
- };
1935
- export const GENERAL_ERROR: {
1936
- MUST_BE_A_STRING: {
1937
- code: string;
1938
- name: string;
1939
- message: string;
1940
- details: {};
1941
- };
1942
- MUST_BE_A_NUMBER: {
1943
- code: string;
1944
- name: string;
1945
- message: string;
1946
- details: {};
1947
- };
1948
- MUST_BE_A_OBJECT: {
1949
- code: string;
1950
- name: string;
1951
- message: string;
1952
- details: {};
1953
- };
1954
- MUST_BE_AN_ARRAY: {
1955
- code: string;
1956
- name: string;
1957
- message: string;
1958
- details: {};
1959
- };
1960
- MUST_BE_A_BOOLEAN: {
1961
- code: string;
1962
- name: string;
1963
- message: string;
1964
- details: {};
1965
- };
1966
- MUST_BE_A_BLOB: {
1967
- code: string;
1968
- name: string;
1969
- message: string;
1970
- details: {};
1971
- };
1972
- INVALID: {
1973
- code: string;
1974
- name: string;
1975
- message: string;
1976
- details: {};
1977
- };
1978
- METHOD_COMPULSORY: {
1979
- code: string;
1980
- name: string;
1981
- message: string;
1982
- details: {};
1983
- };
1984
- LIMIT_EXCEEDED: {
1985
- code: string;
1986
- name: string;
1987
- message: string;
1988
- details: {};
1989
- };
1990
- MUST_BE_A_POSITIVE_NUMBER: {
1991
- code: string;
1992
- name: string;
1993
- message: string;
1994
- details: {};
1995
- };
1996
- INVALID_MEDIA_FILE: {
1997
- code: string;
1998
- name: string;
1999
- message: string;
2000
- details: {};
2001
- };
2002
- EMPTY_STRING: {
2003
- code: string;
2004
- name: string;
2005
- message: string;
2006
- details: {};
2007
- };
2008
- MISSING_KEY: {
2009
- code: string;
2010
- name: string;
2011
- message: string;
2012
- details: {};
2013
- };
2014
- EMPTY_ARRAY: {
2015
- code: string;
2016
- name: string;
2017
- message: string;
2018
- details: {};
2019
- };
2020
- INVALID_SEARCH_KEYWORD: {
2021
- code: string;
2022
- name: string;
2023
- message: string;
2024
- details: {};
2025
- };
2026
- INVALID_GROUP_PROPERTY: {
2027
- code: string;
2028
- name: string;
2029
- message: string;
2030
- details: {};
2031
- };
2032
- INVALID_USER_PROPERTY: {
2033
- code: string;
2034
- name: string;
2035
- message: string;
2036
- details: {};
2037
- };
2038
- PARAMETER_MUST_BE_A_NUMBER: {
2039
- code: string;
2040
- name: string;
2041
- message: string;
2042
- details: {};
2043
- };
2044
- PARAMETER_MUST_BE_AN_ARRAY: {
2045
- code: string;
2046
- name: string;
2047
- message: string;
2048
- details: {};
2049
- };
2050
- PARAMETER_MUST_BE_A_BOOLEAN: {
2051
- code: string;
2052
- name: string;
2053
- message: string;
2054
- details: {};
2055
- };
2056
- PARAMETER_MUST_BE_A_POSITIVE_NUMBER: {
2057
- code: string;
2058
- name: string;
2059
- message: string;
2060
- details: {};
2061
- };
2062
- PARAMETER_MUST_BE_A_STRING: {
2063
- code: string;
2064
- name: string;
2065
- message: string;
2066
- details: {};
2067
- };
2068
- PARAMETER_COMPULSORY: {
2069
- code: string;
2070
- name: string;
2071
- message: string;
2072
- details: {};
2073
- };
2074
- PASSWORD_COMPULSORY: {
2075
- code: string;
2076
- name: string;
2077
- message: string;
2078
- details: {};
2079
- };
2080
- INVALID_ARRAY: {
2081
- code: string;
2082
- name: string;
2083
- message: string;
2084
- details: {};
2085
- };
2086
- };
2087
- export const ReceiptErrors: {
2088
- MISSING_PARAMETERS: {
2089
- code: string;
2090
- name: string;
2091
- message: string;
2092
- details: {};
2093
- };
2094
- INVALID_PARAMETER: {
2095
- code: string;
2096
- name: string;
2097
- message: string;
2098
- details: {};
2099
- };
2100
- NO_WEBSOCKET_CONNECTION: {
2101
- code: string;
2102
- name: string;
2103
- message: string;
2104
- details: {};
2105
- };
2106
- RECEIPTS_TEMPORARILY_BLOCKED: {
2107
- code: string;
2108
- name: string;
2109
- message: string;
2110
- details: {};
2111
- };
2112
- UNKNOWN_ERROR_OCCURRED: {
2113
- code: string;
2114
- name: string;
2115
- message: string;
2116
- details: {};
2117
- };
2118
- };
2119
- export const UserErrors: {
2120
- INVALID_STATUS: CometChatException;
2121
- INVALID_DIRECTION: CometChatException;
2122
- USER_NOT_LOGGED_IN: CometChatException;
2123
- };
2124
- export const GroupErrors: {
2125
- NOT_A_GROUP: CometChatException;
2126
- INVALID_SCOPE: CometChatException;
2127
- INVALID_GROUP_TYPE: CometChatException;
2128
- };
2129
- export const ConversationErrors: {
2130
- INVALID_CONVERSATION_TYPE: {
2131
- code: string;
2132
- name: string;
2133
- message: string;
2134
- details: string;
2135
- };
2136
- CONVERSATION_NOT_FOUND: {
2137
- code: string;
2138
- name: string;
2139
- message: string;
2140
- details: string;
2141
- };
2142
- };
2143
- export const ExtensionErrors: {
2144
- INVALID_EXTENSION: {
2145
- code: string;
2146
- name: string;
2147
- message: string;
2148
- details: {};
2149
- };
2150
- EXTENSION_NOT_FOUND: {
2151
- code: string;
2152
- name: string;
2153
- message: string;
2154
- details: {};
2155
- };
2156
- };
2157
- export const MessageErrors: {
2158
- INVALID_RECEIVER_TYPE: {
2159
- code: string;
2160
- name: string;
2161
- message: string;
2162
- details: string;
2163
- };
2164
- };
2165
- export const FeatureRestrictionErrors: {
2166
- INVALID_FEATURE: {
2167
- code: string;
2168
- name: string;
2169
- message: string;
2170
- details: {};
2171
- };
2172
- FEATURE_NOT_FOUND: {
2173
- code: string;
2174
- name: string;
2175
- message: string;
2176
- details: {};
2177
- };
2178
- };
2179
- export const PresenceConstatnts: {
2180
- STATUS: {
2181
- ONLINE: string;
2182
- AVAILABLE: string;
2183
- OFFLINE: string;
2184
- JOINED: string;
2185
- LEFT: string;
2186
- };
2187
- };
2188
- export const APP_SETTINGS: {
2189
- APP_SETTINGS: string;
2190
- KEYS: {
2191
- CHAT_HOST: string;
2192
- CHAT_USE_SSL: string;
2193
- GROUP_SERVICE: string;
2194
- CALL_SERVICE: string;
2195
- CHAT_WS_PORT: string;
2196
- CHAT_WSS_PORT: string;
2197
- CHAT_HTTP_BIND_PORT: string;
2198
- CHAT_HTTPS_BIND_PORT: string;
2199
- ADMIN_API_HOST: string;
2200
- CLIENT_API_HOST: string;
2201
- WEBRTC_HOST: string;
2202
- WEBRTC_USE_SSL: string;
2203
- WEBRTC_WS_PORT: string;
2204
- WEBRTC_WSS_PORT: string;
2205
- WEBRTC_HTTP_BIND_PORT: string;
2206
- WEBRTC_HTTPS_BIND_PORT: string;
2207
- EXTENSION_LIST: string;
2208
- EXTENSION_KEYS: {
2209
- ID: string;
2210
- NAME: string;
2211
- };
2212
- JID_HOST_OVERRIDE: string;
2213
- CHAT_HOST_OVERRIDE: string;
2214
- CHAT_HOST_APP_SPECIFIC: string;
2215
- MODE: string;
2216
- CONNECTION_TYPE: string;
2217
- DEFAULT_MODE: string;
2218
- LIMITED_TRANSIENT: string;
2219
- NO_TRANSIENT: string;
2220
- ANALYTICS_PING_DISABLED: string;
2221
- ANALYTICS_HOST: string;
2222
- ANALYTICS_VERSION: string;
2223
- ANALYTICS_USE_SSL: string;
2224
- SETTINGS_HASH: string;
2225
- SETTINGS_HASH_RECEIVED_AT: string;
2226
- APP_VERSION: string;
2227
- };
2228
- };
2229
- export const COMMON_UTILITY_CONSTANTS: {
2230
- TYPE_CONSTANTS: {
2231
- BOOLEAN: string;
2232
- STRING: string;
2233
- OBJECT: string;
2234
- NUMBER: string;
2235
- };
2236
- };
2237
- export const CONNECTION_STATUS: {
2238
- CONNECTED: string;
2239
- CONNECTING: string;
2240
- DISCONNECTED: string;
2241
- FEATURE_THROTTLED: string;
2242
- };
2243
- export const SESSION_STORE: {
2244
- SESSION_ID: string;
2245
- };
2246
- export const API_ERROR_CODES: {
2247
- AUTH_ERR_AUTH_TOKEN_NOT_FOUND: string;
2248
- };
2249
- export const PROSODY_API: {
2250
- DOMAIN_PREFIX: string;
2251
- PATH: {
2252
- ROOM: string;
2253
- ROOM_SIZE: string;
2254
- SESSIONS: string;
2255
- };
2256
- RESPONSE: {
2257
- PARTICIPANTS: string;
2258
- };
2259
- QUERY_PARAMETERS: {
2260
- DOMAIN: string;
2261
- ROOM: string;
2262
- };
2263
- };
2264
- export const ProsodyApiErrors: {
2265
- INVALID_SESSIONID: {
2266
- code: string;
2267
- name: string;
2268
- message: string;
2269
- details: string;
2270
- };
2271
- INVALID_TYPE: {
2272
- code: string;
2273
- name: string;
2274
- message: string;
2275
- details: string;
2276
- };
2277
- };
2278
- export const JWT_API: {
2279
- KEYS: {
2280
- PASSTHROUGH: string;
2281
- EXPAND: string;
2282
- };
2283
- };
2284
- export const ONLINE_MEMBER_COUNT_API: {
2285
- ENDPOINTS: {
2286
- GET_ONLINE_MEMBER_COUNT: string;
2287
- };
2288
- RESPONSE: {
2289
- ONLINE_USERS_COUNT: string;
2290
- GROUPS: string;
2291
- };
2292
- ERRORS: {
2293
- INVALID_GROUPLIST: {
2294
- code: string;
2295
- name: string;
2296
- message: string;
2297
- details: string;
2298
- };
2299
- };
2300
- };
2301
-
2302
- /**
2303
- *
2304
- * @module Group
2305
- */
2306
- export class Group {
2307
- /** @private */ static readonly TYPE: typeof GroupType;
2308
- /** @private */ static readonly Type: typeof GroupType;
2309
- private guid;
2310
- private name;
2311
- private type;
2312
- private password;
2313
- private icon;
2314
- private description;
2315
- private owner;
2316
- private metadata;
2317
- private createdAt;
2318
- private updatedAt;
2319
- private hasJoined;
2320
- private wsChannel;
2321
- private scope;
2322
- private joinedAt;
2323
- private membersCount;
2324
- private tags;
2325
- /**
2326
- * Creates an instance of Group.
2327
- * @param {string} guid
2328
- * @param {string} name
2329
- * @param {GroupType} type
2330
- * @param {string} [passsword]
2331
- * @param {string} [icon]
2332
- * @param {string} [description]
2333
- * @memberof Group
2334
- */
2335
- constructor(guid: string, name?: string, type?: GroupType | string, passsword?: string, icon?: string, description?: string, hasJoined?: boolean);
2336
- /**
2337
- * Method to get GUID of the group.
2338
- * @returns {string}
2339
- */
2340
- getGuid(): string;
2341
- /**
2342
- * Method to set GUID of the group.
2343
- * @param {string} guid
2344
- */
2345
- setGuid(guid: string): void;
2346
- /**
2347
- * Method to get name of the group.
2348
- * @returns {string}
2349
- */
2350
- getName(): string;
2351
- /**
2352
- * Method to set name of the group.
2353
- * @param {string} name
2354
- */
2355
- setName(name: string): void;
2356
- /**
2357
- * Method to get the type of the group.
2358
- * @returns {GroupType | string}
2359
- */
2360
- getType(): GroupType | string;
2361
- /**
2362
- * Method to set the type of the group.
2363
- * @param {GroupType | string} type
2364
- */
2365
- setType(type: GroupType | string): void;
2366
- /**
2367
- * Method to get password of the group.
2368
- * @returns {string}
2369
- */
2370
- getPassword(): string;
2371
- /**
2372
- * Method to set password of the group.
2373
- * @param {string} password
2374
- */
2375
- setPassword(password: string): void;
2376
- /**
2377
- * Method to get icon of the group.
2378
- * @returns {string}
2379
- */
2380
- getIcon(): string;
2381
- /**
2382
- * Method to set icon of the group.
2383
- * @param {string} icon
2384
- */
2385
- setIcon(icon: string): void;
2386
- /**
2387
- * Method to get description of the group.
2388
- * @returns {string}
2389
- */
2390
- getDescription(): string;
2391
- /**
2392
- * Method to set description of the group.
2393
- * @param {string} description
2394
- */
2395
- setDescription(description: string): void;
2396
- /**
2397
- * Method to get owner of the group.
2398
- * @returns {string}
2399
- */
2400
- getOwner(): string;
2401
- /**
2402
- * Method to set owner of the group.
2403
- * @param {string} owner
2404
- */
2405
- setOwner(owner: string): void;
2406
- /**
2407
- * Method to get metadata of the group.
2408
- * @returns {string}
2409
- */
2410
- getMetadata(): string;
2411
- /**
2412
- * Method to set metadata of the group.
2413
- * @param {string} metadata
2414
- */
2415
- setMetadata(metadata: string): void;
2416
- /**
2417
- * Method to get the created at timestamp of the group.
2418
- * @returns {number}
2419
- */
2420
- getCreatedAt(): number;
2421
- /**
2422
- * Method to set the created at timestamp of the group.
2423
- * @param {number} createdAt
2424
- */
2425
- setCreatedAt(createdAt: number): void;
2426
- /**
2427
- * Method to get the updated at timestamp of the group.
2428
- * @returns {number}
2429
- */
2430
- getUpdatedAt(): number;
2431
- /**
2432
- * Method to set updated at timestamp of the group.
2433
- * @param {number} updatedAt
2434
- */
2435
- setUpdatedAt(updatedAt: number): void;
2436
- /**
2437
- * Method to get the joinedAt of the group.
2438
- * @returns {boolean}
2439
- */
2440
- getHasJoined(): boolean;
2441
- /**
2442
- * Method to set the joinedAt of the group.
2443
- * @param {boolean} hasJoined
2444
- */
2445
- setHasJoined(hasJoined: boolean): void;
2446
- /** @private */
2447
- getWsChannel(): any;
2448
- /** @private */
2449
- setWsChannel(wsChannel: any): void;
2450
- /**
2451
- * Method to set scope of the logged-in user in the group.
2452
- * @param {string} scope
2453
- */
2454
- setScope(scope: string): void;
2455
- /**
2456
- * Method to get scope of the logged-in user.
2457
- * @returns {string}
2458
- */
2459
- getScope(): string;
2460
- /**
2461
- * Method to get joinedAt timestamp of the logged-in user.
2462
- * @returns {string}
2463
- */
2464
- getJoinedAt(): string;
2465
- /**
2466
- * Method to set joinedAt timestamp of the logged-in user in the group.
2467
- * @param {string} joinedAt
2468
- */
2469
- setJoinedAt(joinedAt: string): void;
2470
- /**
2471
- * Method to get members count of the group.
2472
- * @returns {number}
2473
- */
2474
- getMembersCount(): number;
2475
- /**
2476
- * Method to set members count of the group.
2477
- * @param {number} membersCount
2478
- */
2479
- setMembersCount(membersCount: number): void;
2480
- /**
2481
- * Method to set tags of the group.
2482
- * @param {string[]} tags
2483
- */
2484
- setTags(tags: Array<String>): void;
2485
- /**
2486
- * Method to get tags of the group.
2487
- * @returns {string[]}
2488
- */
2489
- getTags(): Array<String>;
2490
- }
2491
-
2492
- export class MessageListener {
2493
- /**
2494
- * This event is triggered when a text message is received.
2495
- */
2496
- onTextMessageReceived?: Function;
2497
- /**
2498
- * This event is triggered when a media message is received.
2499
- */
2500
- onMediaMessageReceived?: Function;
2501
- /**
2502
- * This event is triggered when a custom message is received.
2503
- */
2504
- onCustomMessageReceived?: Function;
2505
- /**
2506
- * This event is triggered when someone start typing.
2507
- */
2508
- onTypingStarted?: Function;
2509
- /**
2510
- * This event is triggered when someone stops typing.
2511
- */
2512
- onTypingEnded?: Function;
2513
- /**
2514
- * This event is triggered when a message is delivered.
2515
- */
2516
- onMessagesDelivered?: Function;
2517
- /**
2518
- * This event is triggered when a message is read.
2519
- */
2520
- onMessagesRead?: Function;
2521
- /**
2522
- * This event is triggered when a message is edited.
2523
- */
2524
- onMessageEdited?: Function;
2525
- /**
2526
- * This event is triggered when a message is deleted.
2527
- */
2528
- onMessageDeleted?: Function;
2529
- /**
2530
- * This event is triggered when a transient message is received.
2531
- */
2532
- onTransientMessageReceived?: Function;
2533
- constructor(...args: any[]);
2534
- }
2535
- export class CallListener {
2536
- /**
2537
- * This event is triggered when an incoming call is received.
2538
- */
2539
- onIncomingCallReceived?: Function;
2540
- /**
2541
- * This event is triggered when an outgoing call is accepted.
2542
- */
2543
- onOutgoingCallAccepted?: Function;
2544
- /**
2545
- * This event is triggered when an outgoing call is rejected.
2546
- */
2547
- onOutgoingCallRejected?: Function;
2548
- /**
2549
- * This event is triggered when an incoming call is cancelled.
2550
- */
2551
- onIncomingCallCancelled?: Function;
2552
- /**
2553
- * This event is triggered when call is ended.
2554
- */
2555
- onCallEndedMessageReceived?: Function;
2556
- constructor(...args: any[]);
2557
- }
2558
- export class UserListener {
2559
- /**
2560
- * This event is triggered when a user comes online.
2561
- */
2562
- onUserOnline?: Function;
2563
- /**
2564
- * This event is triggered when a user goes offline.
2565
- */
2566
- onUserOffline?: Function;
2567
- constructor(...args: any[]);
2568
- }
2569
- export class GroupListener {
2570
- /**
2571
- * This event is triggered when a user joins a group.
2572
- */
2573
- onGroupMemberJoined?: Function;
2574
- /**
2575
- * This event is triggered when a group member leaves the group.
2576
- */
2577
- onGroupMemberLeft?: Function;
2578
- /**
2579
- * This event is triggered when a group member is kicked from the group.
2580
- */
2581
- onGroupMemberKicked?: Function;
2582
- /**
2583
- * This event is triggered when a group member is banned from the group.
2584
- */
2585
- onGroupMemberBanned?: Function;
2586
- /**
2587
- * This event is triggered when a group member is unbanned from the group.
2588
- */
2589
- onGroupMemberUnbanned?: Function;
2590
- /**
2591
- * This event is triggered when scope of a group member is changed.
2592
- */
2593
- onGroupMemberScopeChanged?: Function;
2594
- /**
2595
- * This event is triggered when a user is added in the group.
2596
- */
2597
- onGroupMemberAddedToGroup: Function;
2598
- constructor(...args: any[]);
2599
- }
2600
- export class OngoingCallListener {
2601
- /**
2602
- * @internal
2603
- */
2604
- onYouLeft?: Function;
2605
- /**
2606
- * @internal
2607
- */
2608
- onYouJoined?: Function;
2609
- /**
2610
- * This event is triggered when a user joins the call.
2611
- */
2612
- onUserJoined?: Function;
2613
- /**
2614
- * This event is triggered when a user leaves the call.
2615
- */
2616
- onUserLeft?: Function;
2617
- /**
2618
- * This event is triggered when the participant list of the call changes.
2619
- */
2620
- onUserListUpdated?: Function;
2621
- /**
2622
- * This event is triggered when the media device list changes.
2623
- */
2624
- onMediaDeviceListUpdated?: Function;
2625
- /**
2626
- * This event is triggered when someone starts recording the call.
2627
- */
2628
- onRecordingStarted?: Function;
2629
- /**
2630
- * This event is triggered when someone stops recording the call.
2631
- */
2632
- onRecordingStopped?: Function;
2633
- /**
2634
- * This event is triggered when someone starts sharing their screen in the call.
2635
- */
2636
- onScreenShareStarted?: Function;
2637
- /**
2638
- * This event is triggered when someone stops sharing their screen in the call.
2639
- */
2640
- onScreenShareStopped?: Function;
2641
- /**
2642
- * This event is triggered when a user is muted.
2643
- */
2644
- onUserMuted?: Function;
2645
- /**
2646
- * This event is triggered when the call is ended.
2647
- */
2648
- onCallEnded?: Function;
2649
- /**
2650
- * This event is triggered when an error occurs.
2651
- */
2652
- onError?: Function;
2653
- /**
2654
- * This event is triggered when an audio call is switched to a video call.
2655
- */
2656
- onCallSwitchedToVideo?: Function;
2657
- constructor(...args: any[]);
2658
- }
2659
- export class LoginListener {
2660
- /**
2661
- * This event is triggered when the user login is successful.
2662
- */
2663
- loginSuccess?: Function;
2664
- /**
2665
- * This event is triggered when the user login fails.
2666
- */
2667
- loginFailure?: Function;
2668
- /**
2669
- * This event is triggered when the user logout is successful.
2670
- */
2671
- logoutSuccess?: Function;
2672
- /**
2673
- * This event is triggered when the user logout fails.
2674
- */
2675
- logoutFailure?: Function;
2676
- constructor(...args: any[]);
2677
- }
2678
- export class ConnectionListener {
2679
- /**
2680
- * This event is triggered when the WebSocket connection is in connected state.
2681
- */
2682
- onConnected?: Function;
2683
- /**
2684
- * This event is triggered when the WebSocket connection is in connecting state.
2685
- */
2686
- inConnecting?: Function;
2687
- /**
2688
- * This event is triggered when the WebSocket connection is in disconnected state.
2689
- */
2690
- onDisconnected?: Function;
2691
- /**
2692
- * This event is triggered when the WebSocket connection is in feature throttled state.
2693
- */
2694
- onFeatureThrottled?: Function;
2695
- constructor(...args: any[]);
2696
- }
2697
- /** @internal */
2698
- export interface EventListener {
2699
- _name: string;
2700
- _eventListener?: MessageListener | UserListener | OngoingCallListener | CallListener | GroupListener | LoginListener | ConnectionListener;
2701
- }
2702
- /** @internal */
2703
- export class Listener implements EventListener {
2704
- _name: string;
2705
- _callback: Function;
2706
- constructor(name: string, callback: Function);
2707
- }
2708
-
2709
- /** @internal */
2710
- export class UserCallListener extends Listener implements EventListener {
2711
- _cursor?: number;
2712
- _eventListener: OngoingCallListener;
2713
- constructor(callEventHandler?: OngoingCallListener, cursor?: number, callback?: Function);
2714
- }
2715
-
2716
- /**
2717
- *
2718
- * @module Call
2719
- */
2720
- export class Call extends BaseMessage implements Message {
2721
- static readonly TYPE: {
2722
- TEXT: string;
2723
- MEDIA: string;
2724
- IMAGE: string;
2725
- VIDEO: string;
2726
- AUDIO: string;
2727
- FILE: string;
2728
- CUSTOM: string;
2729
- };
2730
- static readonly RECEIVER_TYPE: {
2731
- USER: string;
2732
- GROUP: string;
2733
- };
2734
- static readonly CATEGORY: {
2735
- MESSAGE: string;
2736
- ACTION: string;
2737
- CALL: string;
2738
- CUSTOM: string;
2739
- };
2740
- static readonly ACTION_TYPE: {
2741
- TYPE_MEMBER_JOINED: string;
2742
- TYPE_MEMBER_LEFT: string;
2743
- TYPE_MEMBER_KICKED: string;
2744
- TYPE_MEMBER_BANNED: string;
2745
- TYPE_MEMBER_UNBANNED: string;
2746
- TYPE_MEMBER_INVITED: string;
2747
- TYPE_MEMBER_SCOPE_CHANGED: string;
2748
- TYPE_MESSAGE: string;
2749
- TYPE_MESSAGE_EDITED: string;
2750
- TYPE_MESSAGE_DELETED: string;
2751
- TYPE_MEMBER_ADDED: string;
2752
- };
2753
- protected metadata: any;
2754
- protected action: string;
2755
- protected rawData: string;
2756
- protected initiatedAt: number;
2757
- protected joinedAt: number;
2758
- protected data: any;
2759
- protected callInitiator: object;
2760
- protected callReceiver: object;
2761
- /**
2762
- * @memberof {@link CometChat | CometChat }
2763
- * @param receiverId
2764
- * @param type
2765
- * @param receiverType
2766
- * @param category
2767
- */
2768
- constructor(receiverId: any, type: any, receiverType: any, category?: any);
2769
- /**
2770
- * Get call initiator entity(User)
2771
- * @returns {User}
2772
- */
2773
- getCallInitiator(): User;
2774
- /**
2775
- * @param {User} user
2776
- * Set details of the call initiator.
2777
- */
2778
- setCallInitiator(user: User): void;
2779
- /**
2780
- * Get call receiver entity(User/Group)
2781
- * @returns {User | Group}
2782
- */
2783
- getCallReceiver(): Group | User;
2784
- /**
2785
- * @param {User | Group} receiver
2786
- * Set details of the call receiver.
2787
- */
2788
- setCallReceiver(receiver: User | Group): void;
2789
- /** @internal */
2790
- getData(): object;
2791
- /** @internal */
2792
- setData(data: object): void;
2793
- /**
2794
- * Get unique session id of the call message.
2795
- * @returns {string}
2796
- */
2797
- getSessionId(): string;
2798
- /**
2799
- * @param {string} sessionId
2800
- * Set unique session id of the call message.
2801
- */
2802
- setSessionId(sessionId: string): void;
2803
- /**
2804
- * Get JSONObject of data set by developer.
2805
- * @returns
2806
- */
2807
- getMetadata(): any;
2808
- /**
2809
- * @param {any} metadata
2810
- * Set metadata of the call message.
2811
- */
2812
- setMetadata(metadata: any): void;
2813
- /**
2814
- * Get sender of the message.
2815
- * @returns {User}
2816
- */
2817
- getSender(): User;
2818
- /**
2819
- * Get action of call.
2820
- * @returns {string}
2821
- */
2822
- getAction(): string;
2823
- /**
2824
- * @param {string} action
2825
- * Set action of call.
2826
- */
2827
- setAction(action: string): void;
2828
- /**
2829
- * Get call initiated timestamp.
2830
- * @returns {number}
2831
- */
2832
- getInitiatedAt(): number;
2833
- /**
2834
- * @param {number} initiatedAt
2835
- * Set call initiated timestamp.
2836
- */
2837
- setInitiatedAt(initiatedAt: number): void;
2838
- /**
2839
- * Get call join timestamp.
2840
- * @returns {number}
2841
- */
2842
- getJoinedAt(): number;
2843
- /**
2844
- * @param {number} joinedAt
2845
- * Set call join timestamp.
2846
- */
2847
- setJoinedAt(joinedAt: number): void;
2848
- /**
2849
- * Get raw JSON data of the call message.
2850
- * @returns {any}
2851
- */
2852
- getRawData(): any;
2853
- /**
2854
- * @param {any} rawData
2855
- * Set raw JSON data of the call message.
2856
- */
2857
- setRawData(rawData: any): void;
2858
- /**
2859
- * @internal
2860
- * @param {string} receiverUid
2861
- * @param {string} text
2862
- * @param {string} senderUid
2863
- * @param {string} receiverType
2864
- * @memberof Actions
2865
- */
2866
- static callFromJSON(rawMessage: any): Call | Message;
2867
- }
2868
-
2869
- export class CallController {
2870
- static getInstance(): CallController;
2871
-
2872
- /**
2873
- * Method to get all the available audio input devices.
2874
- * @returns {MediaDevice[]}
2875
- */
2876
- getAudioInputDevices(): MediaDevice[];
2877
-
2878
- /**
2879
- * Method to get all the available audio output devices.
2880
- * @returns {MediaDevice[]}
2881
- */
2882
- getAudioOutputDevices(): MediaDevice[];
2883
-
2884
- /**
2885
- * Method to get all the available video input devices.
2886
- * @returns {MediaDevice[]}
2887
- */
2888
- getVideoInputDevices(): MediaDevice[];
2889
-
2890
- /**
2891
- * Method to change the audio input devices.
2892
- * @param {string} deviceId
2893
- * @returns {MediaDevice[]}
2894
- */
2895
- setAudioInputDevice(deviceId: string): void;
2896
-
2897
- /**
2898
- * Method to change the audio output devices.
2899
- * @param {string} deviceId
2900
- * @returns {MediaDevice[]}
2901
- */
2902
- setAudioOutputDevice(deviceId: string): void;
2903
-
2904
- /**
2905
- * Method to change the video input devices.
2906
- * @param {string} deviceId
2907
- * @returns {MediaDevice[]}
2908
- */
2909
- setVideoInputDevice(deviceId: string): void;
2910
-
2911
- /**
2912
- * Method to mute/unmute audio stream.
2913
- * @param {boolean} muteAudio
2914
- */
2915
- muteAudio(muteAudio: boolean): void;
2916
-
2917
- /**
2918
- * Method to pause/unpause video stream.
2919
- * @param {boolean} pauseVideo
2920
- */
2921
- pauseVideo(pauseVideo: boolean): void;
2922
-
2923
- /**
2924
- * Method to set mode.
2925
- * @param mode
2926
- */
2927
- setMode(mode: any): void;
2928
-
2929
- /**
2930
- * Method to start screen share.
2931
- */
2932
- startScreenShare(): void;
2933
-
2934
- /**
2935
- * Method to stop screen share.
2936
- */
2937
- stopScreenShare(): void;
2938
-
2939
- /**
2940
- * Method to start call recording.
2941
- */
2942
- startRecording(): void;
2943
-
2944
- /**
2945
- * Method to stop call recording.
2946
- */
2947
- stopRecording(): void;
2948
-
2949
- /**
2950
- * Method to switch an audio call to video call.
2951
- */
2952
- switchToVideoCall(): void;
2953
-
2954
- /**
2955
- * Method to open the virtual background settings.
2956
- */
2957
- openVirtualBackground(): void;
2958
-
2959
- /**
2960
- * Method to set the background blur. This method takes number as input which decides the blur level of the background.
2961
- */
2962
- setBackgroundBlur(blurLevel: number): void;
2963
-
2964
- /**
2965
- * Method to set the background image. This method takes either a URL or file Object & sets that image as the background.
2966
- */
2967
- setBackgroundImage(image: string | Object): void;
2968
- }
2969
-
2970
- /**
2971
- *
2972
- * @module Action
2973
- */
2974
- export class Action extends BaseMessage implements Message {
2975
- static readonly TYPE: {
2976
- TEXT: string;
2977
- MEDIA: string;
2978
- IMAGE: string;
2979
- VIDEO: string;
2980
- AUDIO: string;
2981
- FILE: string;
2982
- CUSTOM: string;
2983
- };
2984
- static readonly RECEIVER_TYPE: {
2985
- USER: string;
2986
- GROUP: string;
2987
- };
2988
- static readonly CATEGORY: {
2989
- MESSAGE: string;
2990
- ACTION: string;
2991
- CALL: string;
2992
- CUSTOM: string;
2993
- };
2994
- static readonly ACTION_TYPE: {
2995
- TYPE_MEMBER_JOINED: string;
2996
- TYPE_MEMBER_LEFT: string;
2997
- TYPE_MEMBER_KICKED: string;
2998
- TYPE_MEMBER_BANNED: string;
2999
- TYPE_MEMBER_UNBANNED: string;
3000
- TYPE_MEMBER_INVITED: string;
3001
- TYPE_MEMBER_SCOPE_CHANGED: string;
3002
- TYPE_MESSAGE: string;
3003
- TYPE_MESSAGE_EDITED: string;
3004
- TYPE_MESSAGE_DELETED: string;
3005
- TYPE_MEMBER_ADDED: string;
3006
- };
3007
- protected actionBy: User | Group | BaseMessage;
3008
- protected actionFor: User | Group | BaseMessage;
3009
- protected actionOn: User | Group | BaseMessage;
3010
- protected message: string;
3011
- protected rawData: any;
3012
- protected action: string;
3013
- protected oldScope: string;
3014
- protected newScope: string;
3015
- /**
3016
- * @internal
3017
- */
3018
- static actionFromJSON(rawMessage: any): Action | Message;
3019
- /**
3020
- * Method to get old scope of a member.
3021
- * @returns {string}
3022
- */
3023
- getOldScope(): string;
3024
- /**
3025
- * @param {string} oldScope
3026
- * Method to set old scope of a member.
3027
- */
3028
- setOldScope(oldScope: string): void;
3029
- /**
3030
- * Method to get new scope of a member.
3031
- * @returns {string}
3032
- */
3033
- getNewScope(): string;
3034
- /**
3035
- * @param {string} newScope
3036
- * Method to set new scope of a member.
3037
- */
3038
- setNewScope(newScope: string): void;
3039
- /**
3040
- * Method to get raw JSON data in string.
3041
- * @returns {string}
3042
- */
3043
- getRawData(): any;
3044
- /**
3045
- * @param {any} rawData
3046
- * Method to set raw JSON data.
3047
- */
3048
- setRawData(rawData: any): void;
3049
- /**
3050
- * Method to get the default action message.
3051
- * @returns {string}
3052
- */
3053
- getMessage(): string;
3054
- /**
3055
- * @param {string} message
3056
- * Method to set the default action message.
3057
- */
3058
- setMessage(message: string): void;
3059
- /**
3060
- * Method to get the action which is being performed.
3061
- * @returns {string}
3062
- */
3063
- getAction(): string;
3064
- /**
3065
- * @param {string} action
3066
- * Method to set the default action message.
3067
- */
3068
- setAction(action: string): void;
3069
- /**
3070
- * Method to get the sender of the action message.
3071
- * @returns {string}
3072
- */
3073
- getSender(): User;
3074
- /**
3075
- * Method to get the entity which performed the action.
3076
- * @returns {User | Group | BaseMessage}
3077
- */
3078
- getActionBy(): User | Group | BaseMessage;
3079
- /**
3080
- * @param {User | Group | BaseMessage} by
3081
- * Method to set the entity which performed the action.
3082
- */
3083
- setActionBy(by: User | Group | BaseMessage): void;
3084
- /**
3085
- * Method to get the entity on which the action was performed.
3086
- * @returns {User | Group | BaseMessage}
3087
- */
3088
- getActionOn(): User | Group | BaseMessage;
3089
- /**
3090
- * @param {User | Group | BaseMessage} on
3091
- * Method to set the entity on which the action was performed.
3092
- */
3093
- setActionOn(on: User | Group | BaseMessage): void;
3094
- /**
3095
- * Method to get the entity for whom the action was performed.
3096
- * @returns {User | Group | BaseMessage | any}
3097
- */
3098
- getActionFor(): User | Group | BaseMessage | any;
3099
- /**
3100
- * @param {User | Group | BaseMessage} for
3101
- * Method to set the entity for whom the action was performed.
3102
- */
3103
- setActionFor(actionFor: User | Group | BaseMessage): void;
3104
- /**
3105
- * Method to get the metadata of the action message.
3106
- * @returns {any}
3107
- */
3108
- getMetadata(): any;
3109
- /**
3110
- * @param {any} metadata
3111
- * Method to get the metadata of the action message.
3112
- */
3113
- setMetadata(metadata: any): void;
3114
- }
3115
-
3116
- export class GroupsRequest {
3117
- constructor(builder?: GroupsRequestBuilder);
3118
- /**
3119
- * Get list of next set of groups based on the parameters specified in GroupsRequestBuilder class The Developer need to call this method repeatedly using the same object of GroupsRequest class to get paginated list of groups.
3120
- * @returns {Promise<Group[] | []>}
3121
- */
3122
- fetchNext(): Promise<Group[] | []>;
3123
- }
3124
- export class GroupsRequestBuilder {
3125
- /** @private */ limit: number;
3126
- /** @private */ searchKeyword: string;
3127
- /** @private */ hasJoined: boolean;
3128
- /** @private */ tags: Array<String>;
3129
- /** @private */ showTags: boolean;
3130
- /**
3131
- *
3132
- * @param {number} limit
3133
- * A method to set limit for the number of Groups returned in a single iteration. A maximum of 100 groups can fetched in a single iteration.
3134
- * @returns
3135
- */
3136
- setLimit(limit: number): this;
3137
- /**
3138
- *
3139
- * @param {string} searchKeyword
3140
- * A method to set the search string based on which the groups are to be fetched.
3141
- * @returns
3142
- */
3143
- setSearchKeyword(searchKeyword: string): this;
3144
- /**
3145
- * A method to fetch only joined groups.
3146
- * @param {boolean} hasJoined
3147
- * @returns
3148
- */
3149
- joinedOnly(hasJoined: boolean): this;
3150
- /**
3151
- *
3152
- * @param {string[]} tags
3153
- * A method to set the tags based on which the groups are to be fetched.
3154
- * @returns
3155
- */
3156
- setTags(tags: Array<String>): this;
3157
- /**
3158
- *
3159
- * @param {boolean} withTags
3160
- * A method to get the tags along with the other details of the groups.
3161
- * @returns
3162
- */
3163
- withTags(withTags: boolean): this;
3164
- /**
3165
- * This method will return an object of the GroupsRequest class.
3166
- * @returns {GroupsRequest}
3167
- */
3168
- build(): GroupsRequest;
3169
- }
3170
-
3171
- export class GroupMembersRequest {
3172
- constructor(builder: GroupMembersRequestBuilder);
3173
- /**
3174
- * Get list of next set of group members based on the parameters specified in GroupMembersRequestBuilder class. The Developer need to call this method repeatedly using the same object of GroupMembersRequest class to get paginated list of group members.
3175
- * @returns {Promise<GroupMember[] | []>}
3176
- */
3177
- fetchNext(): Promise<GroupMember[] | []>;
3178
- }
3179
- export class GroupMembersRequestBuilder {
3180
- /** @private */ limit: number;
3181
- /** @private */ searchKeyword: string;
3182
- /** @private */ guid: string;
3183
- /** @private */ scopes?: Array<String>;
3184
- constructor(guid: string);
3185
- /**
3186
- *
3187
- * @param {number} limit
3188
- * A method to set limit for the number of group members returned in a single iteration. A maximum of 100 group members can fetched in a single iteration.
3189
- * @returns
3190
- */
3191
- setLimit(limit: number): this;
3192
- /**
3193
- *
3194
- * @param {string} searchKeyword
3195
- * A method to set the search string based on which the group members are to be fetched.
3196
- * @returns
3197
- */
3198
- setSearchKeyword(searchKeyword: string): this;
3199
- /**
3200
- *
3201
- * @param {string[]} scopes
3202
- * A method to set the search group members based on their scope.
3203
- * @returns
3204
- */
3205
- setScopes(scopes: Array<String>): this;
3206
- /**
3207
- * This method will return an object of the GroupMembersRequest class.
3208
- * @returns {GroupMembersRequest}
3209
- */
3210
- build(): GroupMembersRequest;
3211
- }
3212
-
3213
- export class BannedMembersRequest {
3214
- constructor(builder: BannedMembersRequestBuilder);
3215
- /**
3216
- * Get list of next set of banned members based on the parameters specified in BannedMembersRequestBuilder class. The Developer need to call this method repeatedly using the same object of BannedMembersRequest class to get paginated list of banned members.
3217
- * @returns {Promise<GroupMember[] | []>}
3218
- */
3219
- fetchNext(): Promise<GroupMember[] | []>;
3220
- }
3221
- export class BannedMembersRequestBuilder {
3222
- /** @private */ limit: number;
3223
- /** @private */ searchKeyword: string;
3224
- /** @private */ guid: string;
3225
- /** @private */ scopes?: Array<String>;
3226
- constructor(guid: string);
3227
- /**
3228
- *
3229
- * @param {number} limit
3230
- * A method to set limit for the number of banned members returned in a single iteration. A maximum of 100 banned members can fetched in a single iteration.
3231
- * @returns
3232
- */
3233
- setLimit(limit: number): this;
3234
- /**
3235
- *
3236
- * @param {string} searchKeyword
3237
- * A method to set the search string based on which the banned members are to be fetched.
3238
- * @returns
3239
- */
3240
- setSearchKeyword(searchKeyword: string): this;
3241
- /**
3242
- *
3243
- * @param {string[]} scopes
3244
- * A method to set the search banned members based on their scope.
3245
- * @returns
3246
- */
3247
- setScopes(scopes: Array<String>): this;
3248
- /**
3249
- * This method will return an object of the BannedMembersRequest class.
3250
- * @returns {BannedMembersRequest}
3251
- */
3252
- build(): BannedMembersRequest;
3253
- }
3254
-
3255
- export class UsersRequest {
3256
- static USER_STATUS: {
3257
- ONLINE: string;
3258
- OFFLINE: string;
3259
- };
3260
- constructor(builder?: UsersRequestBuilder);
3261
- /**
3262
- * Get list of next set of users based on the parameters specified in UsersRequestBuilder class The Developer need to call this method repeatedly using the same object of UsersRequestBuilder class to get paginated list of users.
3263
- * @returns {Promise<User[] | []>}
3264
- */
3265
- fetchNext(): Promise<User[] | []>;
3266
- }
3267
- export class UsersRequestBuilder {
3268
- /** @private */ limit: number;
3269
- /** @private */ status: string;
3270
- /** @private */ searchKeyword: string;
3271
- /** @private */ shouldHideBlockedUsers: boolean;
3272
- /** @private */ role: string;
3273
- /** @private */ roles: Array<String>;
3274
- /** @private */ tags: Array<String>;
3275
- /** @private */ showFriendsOnly: boolean;
3276
- /** @private */ showTags: boolean;
3277
- /** @private */ UIDs: Array<String>;
3278
- /** @private */ SortBy: string;
3279
- /** @private */ SortOrder: string;
3280
- /** @private */ SearchIn: Array<String>;
3281
-
3282
- /**
3283
- * A method to set limit for the number of Users returned in a single iteration. A maximum of 100 users can fetched in a single iteration.
3284
- * @param {number} limit
3285
- * @returns
3286
- */
3287
- setLimit(limit: number): this;
3288
- /**
3289
- * A method to get the users belonging to a specific status.
3290
- * @param {string} status
3291
- * @returns
3292
- */
3293
- setStatus(status: string): this;
3294
- /**
3295
- * A method to set the search string based on which the users are to be fetched.
3296
- * @param {string} searchKeyword
3297
- * @returns
3298
- */
3299
- setSearchKeyword(searchKeyword: string): this;
3300
- /**
3301
- * Method to hide blocked users.
3302
- * @param {boolean} hideBlockedUsers
3303
- * @returns
3304
- */
3305
- hideBlockedUsers(hideBlockedUsers: boolean): this;
3306
- /**
3307
- * A method to get the users with the specified role.
3308
- * @param {string} role
3309
- * @returns
3310
- */
3311
- setRole(role: string): this;
3312
- /**
3313
- * A method to get the users with the specified roles.
3314
- * @param {string[]} role
3315
- * @returns
3316
- */
3317
- setRoles(roles: Array<String>): this;
3318
- /**
3319
- * A method to fetch only friends.
3320
- * @param {boolean} friendsOnly
3321
- * @returns
3322
- */
3323
- friendsOnly(friendsOnly: boolean): this;
3324
- /**
3325
- * A method to get the users with the specified tags.
3326
- * @param {string[]} tags
3327
- * @returns
3328
- */
3329
- setTags(tags: Array<String>): this;
3330
- /**
3331
- * A method to get the tags along with the other details of the users.
3332
- * @param {boolean} withTags
3333
- * @returns
3334
- */
3335
- withTags(withTags: boolean): this;
3336
- /**
3337
- * A method to get the users with the specified UIDs.
3338
- * @param {string[]} uids
3339
- * @returns
3340
- */
3341
- setUIDs(uids: Array<String>): this;
3342
- /**
3343
- * A method to get the users sorted by either `name` or `status`.
3344
- * It accepts a string as input.
3345
- * By default the SDK fetches users sorted by `status`.
3346
- * @param {string} sortBy
3347
- * @returns
3348
- */
3349
- public sortBy(sortBy: string): this;
3350
- /**
3351
- * A method to get the users sorted either in `asc` or `desc` order.
3352
- * It accepts a string as input.
3353
- * By default the SDK fetches users sorted in `asc` order.
3354
- * @param {string} sortOrder
3355
- * @returns
3356
- */
3357
- public sortByOrder(sortOrder: string): this;
3358
- /**
3359
- * A method to set which field the search string should be searched.
3360
- * It accepts an array of string as input.
3361
- * It can be `["name"]`, `["uid"]` or `["name", "uid"]`.
3362
- * By default the SDK searches the search string in `["name", "uid"]`.
3363
- * @param {string[]} searchIn
3364
- * @returns
3365
- */
3366
- public searchIn(searchIn: Array<String>): this;
3367
- /**
3368
- * This method will return an object of the UsersRequest class.
3369
- * @returns {UsersRequest}
3370
- */
3371
- build(): UsersRequest;
3372
- }
3373
-
3374
- export class ConversationsRequest {
3375
- /**
3376
- * @private
3377
- * @param {ConversationsRequestBuilder} builder
3378
- */
3379
- constructor(builder?: ConversationsRequestBuilder);
3380
- /**
3381
- * Get list of next set of conversations based on the parameters specified in ConversationsRequestBuilder class. The Developer need to call this method repeatedly using the same object of ConversationsRequest class to get paginated list of conversations.
3382
- * @returns {Promise<Conversation[] | []>}
3383
- */
3384
- fetchNext(): Promise<Conversation[] | []>;
3385
- }
3386
- export class ConversationsRequestBuilder {
3387
- /** @private */ conversationType: string;
3388
- /** @private */ limit: number;
3389
- /** @private */ getUserAndGroupTags: boolean;
3390
- /** @private */ tags: Array<String>;
3391
- /** @private */ WithTags: boolean;
3392
- /** @private */ groupTags: Array<String>;
3393
- /** @private */ userTags: Array<String>;
3394
- /**
3395
- *
3396
- * @param {number} limit
3397
- * A method to set limit for the number of Conversations returned in a single iteration. A maximum of 50 conversations can fetched in a single iteration.
3398
- * @returns
3399
- */
3400
- setLimit(limit: number): this;
3401
- /**
3402
- *
3403
- * @param {string} conversationType
3404
- * A method to set the conversation type. It can take once of the two values: 1. 'user' - to fetch only the user conversations. 2. 'group' - to fetch only the group conversations.
3405
- * @returns
3406
- */
3407
- setConversationType(conversationType: string): this;
3408
- /**
3409
- *
3410
- * @param {boolean} getUserAndGroupTags
3411
- * A method to fetch the user/group tags in the ConversationWith Object. The default value is false.
3412
- * @returns
3413
- */
3414
- withUserAndGroupTags(getUserAndGroupTags: boolean): this;
3415
- /**
3416
- * A method to get the tags along with conversations.
3417
- * @param {boolean} withTags
3418
- * @returns
3419
- */
3420
- withTags(withTags: boolean): this;
3421
- /**
3422
- * A method to get conversations with the specified tags.
3423
- * @param {Array<String>} tags
3424
- * @returns
3425
- */
3426
- setTags(tags: Array<String>): this;
3427
- /**
3428
- * A method to filter conversation list by group tags.
3429
- * @param {Array<String>} groupTags
3430
- * @returns
3431
- */
3432
- public setGroupTags(groupTags: Array<String>): this;
3433
- /**
3434
- * A method to filter conversation list by user tags.
3435
- * @param {Array<String>} userTags
3436
- * @returns
3437
- */
3438
- public setUserTags(userTags: Array<String>): this;
3439
- /**
3440
- * This method will return an object of the ConversationsRequest class.
3441
- * @returns {ConversationsRequest}
3442
- */
3443
- build(): ConversationsRequest;
3444
- }
3445
-
3446
- export class MessagesRequest {
3447
- constructor(builder?: MessagesRequestBuilder);
3448
- /**
3449
- * Get list of next messages based on the parameters specified in MessagesRequestBuilder class. The Developer need to call this method repeatedly using the same object of MessagesRequest class to get paginated list of message.
3450
- * @returns {Promise<BaseMessage[] | []>}
3451
- */
3452
- fetchNext(): Promise<BaseMessage[] | []>;
3453
- /**
3454
- * Get list of previous messages based on the parameters specified in MessagesRequestBuilder class. The Developer need to call this method repeatedly using the same object of MessagesRequest class to get paginated list of message.
3455
- * @returns {Promise<BaseMessage[] | []>}
3456
- */
3457
- fetchPrevious(): Promise<BaseMessage[] | []>;
3458
- }
3459
- export class MessagesRequestBuilder {
3460
- /** @private */ limit?: number;
3461
- /** @private */ maxLimit: number;
3462
- /** @private */ uid?: string;
3463
- /** @private */ guid?: string;
3464
- /** @private */ parentMessageId?: number;
3465
- /** @private */ timestamp?: number;
3466
- /** @private */ id?: number;
3467
- /** @private */ unread?: boolean;
3468
- /** @private */ HideMessagesFromBlockedUsers?: boolean;
3469
- /** @private */ searchKey?: string;
3470
- /** @private */ updatedAt?: string;
3471
- /** @private */ onlyUpdate?: number;
3472
- /** @private */ category?: string;
3473
- /** @private */ categories?: Array<String>;
3474
- /** @private */ type?: string;
3475
- /** @private */ types?: Array<String>;
3476
- /** @private */ HideReplies?: boolean;
3477
- /** @private */ HideDeletedMessages?: boolean;
3478
- /** @private */ tags?: Array<String>;
3479
- /** @private */ WithTags?: boolean;
3480
- /**
3481
- * A method to set limit for the number of messages returned in a single iteration. A maximum of 100 messages can fetched in a single iteration.
3482
- * @param {number} limit
3483
- * @returns
3484
- */
3485
- setLimit(limit: number): this;
3486
- /**
3487
- * A method to set GUID of a Group to get messages of that particular group conversation.
3488
- * @param {string} guid
3489
- * @returns
3490
- */
3491
- setGUID(guid: string): this;
3492
- /**
3493
- * A method to set UID of a User to get messages of that particular user conversation.
3494
- * @param {string} uid
3495
- * @returns
3496
- */
3497
- setUID(uid: string): this;
3498
- /**
3499
- * A method to set parent message id to get messages of that particular thread.
3500
- * @param {number} parentMessageId
3501
- * @returns
3502
- */
3503
- setParentMessageId(parentMessageId: number): this;
3504
- /**
3505
- * A method to set timestamp to get messages before/after the specified timestamp.
3506
- * @param {number} timestamp
3507
- * @returns
3508
- */
3509
- setTimestamp(timestamp?: number): this;
3510
- /**
3511
- * A method to set message ID of a particular message to get messages before/after the specified message.
3512
- * @param {number} id
3513
- * @returns
3514
- */
3515
- setMessageId(id?: number): this;
3516
- /**
3517
- * A method to get only unread messages.
3518
- * @param {boolean} unread
3519
- * @returns
3520
- */
3521
- setUnread(unread?: boolean): this;
3522
- /**
3523
- * Method to set parameters to hide or show message from blocked users.
3524
- * @param {boolean} hideMessagesFromBlockedUsers
3525
- * @returns
3526
- */
3527
- hideMessagesFromBlockedUsers(hideMessagesFromBlockedUsers?: boolean): this;
3528
- /**
3529
- * A method to set the search string based on which the messages are to be fetched.
3530
- * @param {string} searchKey
3531
- * @returns
3532
- */
3533
- setSearchKeyword(searchKey: string): this;
3534
- /**
3535
- * A method set timestamp to get fetch messages updated/edited after that timestamp.
3536
- * @param {string} updatedAt
3537
- * @returns
3538
- */
3539
- setUpdatedAfter(updatedAt: string): this;
3540
- /**
3541
- * A method to get only edited/updated messages.
3542
- * @param {boolean} onlyUpdate
3543
- * @returns
3544
- */
3545
- updatesOnly(onlyUpdate: boolean): this;
3546
- /**
3547
- * A method to set parameter to get the messages belonging to a specific category.
3548
- * @param {string} category
3549
- * @returns
3550
- */
3551
- setCategory(category: string): this;
3552
- /**
3553
- * A method to set parameter to get the messages belonging to specific categories.
3554
- * @param {string[]} categories
3555
- * @returns
3556
- */
3557
- setCategories(categories: Array<String>): this;
3558
- /**
3559
- * A method to set parameter to get the messages belonging to a specific type.
3560
- * @param {string} type
3561
- * @returns
3562
- */
3563
- setType(type: string): this;
3564
- /**
3565
- * A method to set parameter to get the messages belonging to specific types.
3566
- * @param {string[]} types
3567
- * @returns
3568
- */
3569
- setTypes(types: Array<String>): this;
3570
- /**
3571
- * A method to hide message replies.
3572
- * @param {boolean} hideReplies
3573
- * @returns
3574
- */
3575
- hideReplies(hideReplies: boolean): this;
3576
- /**
3577
- * A method to hide deleted messages.
3578
- * @param {boolean} hideDeletedMessages
3579
- * @returns
3580
- */
3581
- hideDeletedMessages(hideDeletedMessages: boolean): this;
3582
- /**
3583
- * A method to set parameter to get the messages belonging to specific tags.
3584
- * @param {Array<String>} tags
3585
- * @returns
3586
- */
3587
- setTags(tags: Array<String>): this;
3588
- /**
3589
- * A method to get messages with tags.
3590
- * @param {boolean} withTags
3591
- * @returns
3592
- */
3593
- withTags(withTags: boolean): this;
3594
- /**
3595
- * This method will return an object of the MessagesRequest class.
3596
- * @returns {MessagesRequest}
3597
- */
3598
- build(): MessagesRequest;
3599
- }
3600
-
3601
- /**
3602
- *
3603
- * @module TypingIndicator
3604
- */
3605
- export class TypingIndicator {
3606
- constructor(receiverId?: string, receiverType?: string, meta?: any);
3607
- /**
3608
- * Method to get receiver type of the transient message.
3609
- * @returns {string}
3610
- */
3611
- getReceiverType(): string;
3612
- /**
3613
- * Method to set receiver type of the transient message.
3614
- * @param {string} receiverType
3615
- */
3616
- setReceiverType(receiverType: string): void;
3617
- /**
3618
- * Method to get receiverID of typing indicator.
3619
- * @returns {string}
3620
- */
3621
- getReceiverId(): string;
3622
- /**
3623
- * Method to set receiverID of typing indicator.
3624
- * @param {string} receiverId
3625
- */
3626
- setReceiverId(receiverId: string): void;
3627
- /**
3628
- * Method to get metadata of the transient message.
3629
- * @returns {string}
3630
- */
3631
- getMetadata(): string;
3632
- /**
3633
- * Method to set metadata of the transient message.
3634
- * @param {string} meta
3635
- */
3636
- setMetadata(meta: string): void;
3637
- /**
3638
- * Method to get sender of the transient message.
3639
- * @returns {User}
3640
- */
3641
- getSender(): User;
3642
- /**
3643
- * Method to set sender of the transient message.
3644
- * @param {User} sender
3645
- */
3646
- setSender(sender: User): void;
3647
- }
3648
-
3649
- /**
3650
- *
3651
- * @module CustomMessage
3652
- */
3653
- export class CustomMessage extends BaseMessage implements Message {
3654
- private customData;
3655
- private subType;
3656
- private data?;
3657
- private tags?;
3658
- constructor(...args: any[]);
3659
- /**
3660
- * Method to get custom data of the message.
3661
- * @returns {Object}
3662
- */
3663
- getCustomData(): Object;
3664
- /**
3665
- * Method to set custom data of the message.
3666
- * @param {Object} customData
3667
- */
3668
- setCustomData(customData: Object): void;
3669
- /**
3670
- * Method to get sender of the message.
3671
- * @returns {User}
3672
- */
3673
- getSender(): User;
3674
- /**
3675
- * Method to get receiver of the message.
3676
- * @returns {User | Group}
3677
- */
3678
- getReceiver(): User | Group;
3679
- /**
3680
- * Methhod to get sub type of the message.
3681
- * @returns {string}
3682
- */
3683
- getSubType(): string;
3684
- /**
3685
- * Method to set sub type of the message.
3686
- * @param {string} subType
3687
- */
3688
- setSubType(subType: string): void;
3689
- /**
3690
- * Method to get metadata of the message.
3691
- * @returns {Object}
3692
- */
3693
- getMetadata(): Object;
3694
- /**
3695
- * Method to set metadata of the message.
3696
- * @param {Object} metadata
3697
- */
3698
- setMetadata(metadata: Object): void;
3699
- /**
3700
- * Method to get data of the message.
3701
- * @returns
3702
- */
3703
- getData(): any;
3704
- /**
3705
- * Get the tags of the message.
3706
- * @returns {Array<String>}
3707
- */
3708
- getTags(): Array<String>;
3709
- /**
3710
- * @param {Array<String>} tags
3711
- * Set the tags for the message.
3712
- */
3713
- setTags(tags: Array<String>): void;
3714
- }
3715
-
3716
- /**
3717
- *
3718
- * @module GroupMember
3719
- */
3720
- export class GroupMember extends User {
3721
- constructor(uid: string, scope?: string);
3722
- /**
3723
- * Method to set scope of the group member.
3724
- * @param {GroupMemberScope} scope
3725
- */
3726
- setScope(scope: GroupMemberScope): void;
3727
- /**
3728
- * Method to set joinedAt of the group member.
3729
- * @param {number} joinedAt
3730
- */
3731
- setJoinedAt(joinedAt: number): void;
3732
- /**
3733
- * Method to set guid of the group member.
3734
- * @param {string} guid
3735
- */
3736
- setGuid(guid: string): void;
3737
- /**
3738
- * Method to get scope of the group member.
3739
- * @returns {string}
3740
- */
3741
- getScope(): string;
3742
- /**
3743
- * Method to get joinedAt of the group member.
3744
- * @returns {number}
3745
- */
3746
- getJoinedAt(): number;
3747
- /**
3748
- * Method to get guid of the group member.
3749
- * @returns {string}
3750
- */
3751
- getGuid(): string;
3752
- }
3753
-
3754
- export class BlockedUsersRequest {
3755
- static directions: {
3756
- BOTH: string;
3757
- HAS_BLOCKED_ME: string;
3758
- BLOCKED_BY_ME: string;
3759
- };
3760
- /**
3761
- * @private
3762
- * @param {BlockedUsersRequestBuilder} builder
3763
- */
3764
- constructor(builder?: BlockedUsersRequestBuilder);
3765
- /**
3766
- *
3767
- * Get list of next set of blocked users based on the parameters specified in BlockedUsersRequestBuilder class. The Developer need to call this method repeatedly using the same object of BlockedUsersRequest class to get paginated list of blocked users.
3768
- * @returns {Promise<User[] | []>}
3769
- */
3770
- fetchNext(): Promise<User[] | []>;
3771
- }
3772
- export class BlockedUsersRequestBuilder {
3773
- /** @private */ limit: number;
3774
- /** @private */ searchKeyword: string;
3775
- /** @private */ direction: string;
3776
- /**
3777
- *
3778
- * @param {number} limit
3779
- * A method to set limit for the number of blocked users returned in a single iteration. A maximum of 100 blocked users can fetched in a single iteration.
3780
- * @returns
3781
- */
3782
- setLimit(limit: number): this;
3783
- /**
3784
- *
3785
- * @param {string} searchKeyword
3786
- * A method to set the search string based on which the blocked users are to be fetched.
3787
- * @returns
3788
- */
3789
- setSearchKeyword(searchKeyword: string): this;
3790
- /**
3791
- *
3792
- * @param direction
3793
- * A method to either fetch only users the logged-in user has blocked or the users who have blocked the logged-in user or both.
3794
- * @returns
3795
- */
3796
- setDirection(direction: string): this;
3797
- /** @internal */
3798
- blockedByMe(): this;
3799
- /** @internal */
3800
- hasBlockedMe(): this;
3801
- /**
3802
- * This method will return an object of the BlockedUsersRequest class.
3803
- * @returns {BlockedUsersRequest}
3804
- */
3805
- build(): BlockedUsersRequest;
3806
- }
3807
-
3808
- export class AppSettings {
3809
- static SUBSCRIPTION_TYPE_NONE: string;
3810
- static SUBSCRIPTION_TYPE_ALL_USERS: string;
3811
- static SUBSCRIPTION_TYPE_ROLES: string;
3812
- static SUBSCRIPTION_TYPE_FRIENDS: string;
3813
- /** @private */
3814
- static REGION_EU: string;
3815
- /** @private */
3816
- static REGION_US: string;
3817
- /** @private */
3818
- static REGION_IN: string;
3819
- /** @private */
3820
- static REGION_PRIVATE: string;
3821
- /** @private */
3822
- subscriptionType: string;
3823
- /** @private */
3824
- roles: string[];
3825
- /** @private */
3826
- region: string;
3827
- /** @private */
3828
- autoJoinGroup: boolean;
3829
- /** @private */
3830
- establishSocketConnection: boolean;
3831
- /** @private */
3832
- adminHost: string;
3833
- /** @private */
3834
- clientHost: string;
3835
- /**
3836
- * @private
3837
- * @param {AppSettingsBuilder}
3838
- */
3839
- constructor(builder: AppSettingsBuilder);
3840
- /**
3841
- * This method returns the subscription type set using one of the following methods of the AppSettingsBuilder `subscribePresenceForAllUsers()`, `subscribePresenceForRoles()` or `subscribePresenceForFriends()`.
3842
- * @returns {string}
3843
- */
3844
- getSubscriptionType(): string;
3845
- /**
3846
- * This method returns the roles set using the `setRoles()` of the AppSettingsBuilder.
3847
- * @returns {string[]}
3848
- */
3849
- getRoles(): string[];
3850
- /**
3851
- * This method returns the region set using the `setRegion()` of the AppSettingsBuilder.
3852
- * @returns {string}
3853
- */
3854
- getRegion(): string;
3855
- /**
3856
- * This method returns whether auto joining of group was enabled or not using the `enableAutoJoinForGroups()` of the AppSettingsBuilder.
3857
- * @returns {boolean}
3858
- */
3859
- getIsAutoJoinEnabled(): boolean;
3860
- /**
3861
- * This method returns whether the SDK should connect to WebSocket server when a user logs-in or not.
3862
- * @returns {boolean}
3863
- */
3864
- shouldAutoEstablishSocketConnection(): boolean;
3865
-
3866
- /**
3867
- * This method returns the admin host to which the SDK should connect.
3868
- * @returns {boolean}
3869
- */
3870
- getAdminHost(): string;
3871
-
3872
- /**
3873
- * This method returns the client host to which the SDK should connect.
3874
- * @returns {boolean}
3875
- */
3876
- getClientHost(): string;
3877
- }
3878
- export class AppSettingsBuilder {
3879
- /** @private */
3880
- subscriptionType: string;
3881
- /** @private */
3882
- roles: string[];
3883
- /** @private */
3884
- region: string;
3885
- /** @private */
3886
- autoJoinGroup: boolean;
3887
- /** @private */
3888
- establishSocketConnection: boolean;
3889
- /** @private */
3890
- adminHost: string;
3891
- /** @private */
3892
- clientHost: string;
3893
- /**
3894
- * A method to subscribe presence for all users.
3895
- * @returns
3896
- */
3897
- subscribePresenceForAllUsers(): this;
3898
- /**
3899
- * @param {string[]} roles
3900
- * A method to subscribe presence for all roles.
3901
- * @returns
3902
- */
3903
- subscribePresenceForRoles(roles: string[]): this;
3904
- /**
3905
- * A method to subscribe presence for friends.
3906
- * @returns
3907
- */
3908
- subscribePresenceForFriends(): this;
3909
- /**
3910
- * @param {string} region
3911
- * A method to set region of the app.
3912
- * @returns
3913
- */
3914
- setRegion(region?: string): this;
3915
- /**
3916
- * @param {boolean} isAutoJoinEnabled
3917
- * A method to enable/disable auto joining group. The default value is true.
3918
- * @returns
3919
- */
3920
- enableAutoJoinForGroups(isAutoJoinEnabled?: boolean): this;
3921
- /**
3922
- * @param {boolean} establishSocketConnection
3923
- * A method to auto connect to WebSocket server when a user logs-in. The default value is true.
3924
- * @returns
3925
- */
3926
- autoEstablishSocketConnection(establishSocketConnection?: boolean): this;
3927
- /**
3928
- * @param {string} adminHost
3929
- * This method is used to override the admin host which the SDK uses to make an API call.
3930
- * @returns
3931
- */
3932
- overrideAdminHost(adminHost: string): this;
3933
- /**
3934
- * @param {string} clientHost
3935
- * This method is used to override the client host which the SDK uses to make an API call.
3936
- * @returns
3937
- */
3938
- overrideClientHost(clientHost: string): this
3939
- /**
3940
- * This method will return an object of the AppSettings class.
3941
- * @returns {AppSettings}
3942
- */
3943
- build(): AppSettings;
3944
- }
3945
-
3946
- export class CometChatHelper {
3947
- /** @private */
3948
- constructor();
3949
- /**
3950
- * Takes JSONMessage as an input and will return an Object of BaseMessage Class.
3951
- * @param {Object} message
3952
- * @returns {TextMessage | MediaMessage | CustomMessage | BaseMessage}
3953
- * @memberof CometChatHelper
3954
- */
3955
- static processMessage(message: Object): Promise<TextMessage | MediaMessage | CustomMessage | BaseMessage>;
3956
- /**-------------------------------------------------------------------*
3957
- * Message related functions provided by CometChat class *
3958
- *--------------------------------------------------------------------**/
3959
- /**
3960
- * Takes a Message Object and converts it into Conversation Object.
3961
- * @param {TextMessage | MediaMessage | CustomMessage} message
3962
- * @returns {Conversation} conversation
3963
- * @memberof CometChat
3964
- */
3965
- static getConversationFromMessage(message: TextMessage | MediaMessage | CustomMessage | any): Promise<Conversation>;
3966
- }
3967
-
3968
- /**
3969
- *
3970
- * @module Conversation
3971
- */
3972
- export class Conversation {
3973
- protected conversationId: string;
3974
- protected conversationType: string;
3975
- protected lastMessage: TextMessage | MediaMessage | CustomMessage | any;
3976
- protected conversationWith: User | Group;
3977
- protected unreadMessageCount: number;
3978
- protected tags: Array<String>;
3979
- constructor(conversationId: string, conversationType: string, lastMessage: TextMessage | MediaMessage | CustomMessage | any, conversationWith: User | Group, unreadMessageCount: number, tags: Array<String>);
3980
- /**
3981
- * Method to set conversation ID of the conversation.
3982
- * @param {string} conversationId
3983
- */
3984
- setConversationId(conversationId: string): void;
3985
- /**
3986
- * Method to set conversation type of the conversation.
3987
- * @param {string} conversationId
3988
- */
3989
- setConversationType(conversationType: string): void;
3990
- /**
3991
- * Method to set last message of the conversation.
3992
- * @param {TextMessage | MediaMessage | CustomMessage | any} conversationId
3993
- */
3994
- setLastMessage(lastMessage: TextMessage | MediaMessage | CustomMessage | any): void;
3995
- /**
3996
- * Method to set conversationWith of the conversation.
3997
- * @param {User | Group} conversationId
3998
- */
3999
- setConversationWith(conversationWith: User | Group): void;
4000
- /**
4001
- * Method to set unread message count of the conversation.
4002
- * @param {number} conversationId
4003
- */
4004
- setUnreadMessageCount(unreadMessageCount: number): void;
4005
- /**
4006
- * Method to get conversation ID of the conversation.
4007
- * @returns {string}
4008
- */
4009
- getConversationId(): string;
4010
- /**
4011
- * Method to get conversation type of the conversation.
4012
- * @returns {string}
4013
- */
4014
- getConversationType(): string;
4015
- /**
4016
- * Method to get last message of the conversation.
4017
- * @returns {TextMessage | MediaMessage | CustomMessage | any}
4018
- */
4019
- getLastMessage(): TextMessage | MediaMessage | CustomMessage | any;
4020
- /**
4021
- * Method to get conversationWith of the conversation.
4022
- * @returns {User | Group}
4023
- */
4024
- getConversationWith(): User | Group;
4025
- /**
4026
- * Method to get unread message count of the conversation.
4027
- * @returns {number}
4028
- */
4029
- getUnreadMessageCount(): number;
4030
- /**
4031
- * Method to get tags of a conversation.
4032
- * @returns {Array<String>}
4033
- */
4034
- getTags(): Array<String>;
4035
- }
4036
-
4037
- export class Attachment {
4038
- constructor(file: Object);
4039
- /**
4040
- * Create the file object from the provided JSON Object.
4041
- * @private
4042
- * @param {Object} file
4043
- * @returns {FileObject}
4044
- * @memberof FileObject
4045
- */
4046
- createFileFromJSON(file: Object): Attachment;
4047
- /**
4048
- * Converts the FileObject to JSON Object.
4049
- * @private
4050
- * @param {FileObject} fileObject
4051
- * @returns {Object}
4052
- * @memberof FileObject
4053
- */
4054
- toJSON(attachment: Attachment): Object;
4055
- /**
4056
- * Get extension of the file.
4057
- * @returns {string}
4058
- */
4059
- getExtension(): string;
4060
- /**
4061
- * Method to set extension of the file.
4062
- * @param {string} extension
4063
- */
4064
- setExtension(extension: string): void;
4065
- /**
4066
- * Get mime type of the file.
4067
- * @returns {string}
4068
- */
4069
- getMimeType(): string;
4070
- /**
4071
- * Method to set mimeType of the file.
4072
- * @param {string} mimeType
4073
- */
4074
- setMimeType(mimeType: string): void;
4075
- /**
4076
- * Get name of the file.
4077
- * @returns {string}
4078
- */
4079
- getName(): string;
4080
- /**
4081
- * Method to set name of the file.
4082
- * @param {string} name
4083
- */
4084
- setName(name: string): void;
4085
- /**
4086
- * Get size of the file.
4087
- * @returns {string}
4088
- */
4089
- getSize(): number;
4090
- /**
4091
- * Method to set size of the file.
4092
- * @param {string} name
4093
- */
4094
- setSize(size: number): void;
4095
- /**
4096
- * Get URL of the file.
4097
- * @returns {string}
4098
- */
4099
- getUrl(): string;
4100
- /**
4101
- * Method to set URL of the file.
4102
- * @param {string} name
4103
- */
4104
- setUrl(url: string): void;
4105
- }
4106
-
4107
- export class CallSettings {
4108
- static POSITION_TOP_LEFT: string;
4109
- static POSITION_TOP_RIGHT: string;
4110
- static POSITION_BOTTOM_LEFT: string;
4111
- static POSITION_BOTTOM_RIGHT: string;
4112
- static ASPECT_RATIO_DEFAULT: string;
4113
- static ASPECT_RATIO_CONTAIN: string;
4114
- static ASPECT_RATIO_COVER: string;
4115
- constructor(builder?: CallSettingsBuilder);
4116
- shouldUseLegacyUI(): boolean;
4117
- isRecordingButtonEnabled(): boolean;
4118
- shouldStartRecordingOnCallStart(): boolean;
4119
- getCustomCSS(): string;
4120
- getSessionId(): string;
4121
- isAudioOnlyCall(): boolean;
4122
- getUser(): RTCUser;
4123
- getRegion(): string;
4124
- getAppId(): string;
4125
- getDomain(): string;
4126
- isDefaultLayoutEnabled(): boolean;
4127
- getMode(): string;
4128
- getStartWithAudioMuted(): boolean;
4129
- getStartWithVideoMuted(): boolean;
4130
- isEndCallButtonEnabled(): boolean;
4131
- isMuteAudioButtonEnabled(): boolean;
4132
- isPauseVideoButtonEnabled(): boolean;
4133
- isScreenShareButtonEnabled(): boolean;
4134
- isModeButtonEnabled(): boolean;
4135
- getLocalizedStringObject(): Object;
4136
- getAnalyticsSettings(): Object;
4137
- isAudioToVideoButtonEnabled(): boolean;
4138
- getVirtualBackground(): VirtualBackground;
4139
- isVirtualBackgroundSettingEnabled(): boolean;
4140
- getMainVideoContainerSetting(): MainVideoContainerSetting;
4141
- }
4142
- export class CallSettingsBuilder {
4143
- /** @private */ sessionID: string;
4144
- /** @private */ defaultLayout: boolean;
4145
- /** @private */ isAudioOnly: boolean;
4146
- /** @private */ region: string;
4147
- /** @private */ domain: string;
4148
- /** @private */ user: RTCUser;
4149
- /** @private */ mode: string;
4150
- /** @private */ ShowEndCallButton: boolean;
4151
- /** @private */ ShowMuteAudioButton: boolean;
4152
- /** @private */ ShowPauseVideoButton: boolean;
4153
- /** @private */ ShowScreenShareButton: boolean;
4154
- /** @private */ ShowSwitchModeButton: boolean;
4155
- /** @private */ StartAudioMuted: boolean;
4156
- /** @private */ StartVideoMuted: boolean;
4157
- /** @private */ localizedObject: Object;
4158
- /** @private */ analyticsSettings: Object;
4159
- /** @private */ appId: string;
4160
- /** @private */ customCSS: string;
4161
- /** @private */ ShowRecordingButton: boolean;
4162
- /** @private */ StartRecordingOnCallStart: boolean;
4163
- /** @private */ useLegacyUI: boolean;
4164
- /** @private */ShowSwitchToVideoCallButton: boolean;
4165
- /** @private */virtualBackground: VirtualBackground;
4166
- /** @private */ShowVirtualBackgroundSetting: boolean;
4167
- /** @private */ MainVideoContainerSetting: MainVideoContainerSetting;
4168
- /**
4169
- *
4170
- * @param {string} sessionID
4171
- * This methods sets the session ID of the call.
4172
- * @returns
4173
- */
4174
- setSessionID(sessionID: string): this;
4175
- /**
4176
- *
4177
- * @param {boolean} defaultLayout
4178
- * This methods shows/hides the default button layout.
4179
- * If set to true the default button layout will be shown.
4180
- * If set to false the default button layout will be hidden.
4181
- * Default value is true
4182
- * @returns
4183
- */
4184
- enableDefaultLayout(defaultLayout: boolean): this;
4185
- /**
4186
- *
4187
- * @param {boolean} isAudioOnly
4188
- * This methods sets the type(audio/video) of the call.
4189
- * If set to true, the call will be strictly an audio call.
4190
- * If set to false, the call will be an audio-video call.
4191
- * Default value is false
4192
- * @returns
4193
- */
4194
- setIsAudioOnlyCall(isAudioOnly: boolean): this;
4195
- /**
4196
- * @private
4197
- * @param {string} region
4198
- * This method sets the region of the app.
4199
- * @returns
4200
- */
4201
- setRegion(region: string): this;
4202
- /**
4203
- * @private
4204
- * @param {string} domain
4205
- * This method sets the domain of the app.
4206
- * @returns
4207
- */
4208
- setDomain(domain: string): this;
4209
- /**
4210
- * @private
4211
- * @param {RTCUser} user
4212
- * This method sets the user.
4213
- * @returns
4214
- */
4215
- setUser(user: RTCUser): this;
4216
- /**
4217
- *
4218
- * @param {string} mode
4219
- * This method sets the mode of the call.
4220
- * @returns
4221
- */
4222
- setMode(mode: string): this;
4223
- /**
4224
- *
4225
- * @param {boolean} showEndCallButton
4226
- * This method shows/hides the end call button.
4227
- * If set to true it will display the end call button.
4228
- * If set to false it will hide the end call button.
4229
- * Default value is true.
4230
- * @returns
4231
- */
4232
- showEndCallButton(showEndCallButton: boolean): this;
4233
- /**
4234
- *
4235
- * @param {boolean} showMuteAudioButton
4236
- * This method shows/hides the mute audio button.
4237
- * If set to true it will display the mute audio button.
4238
- * If set to false it will hide the mute audio button.
4239
- * Default value is true.
4240
- * @returns
4241
- */
4242
- showMuteAudioButton(showMuteAudioButton: boolean): this;
4243
- /**
4244
- *
4245
- * @param {boolean} showPauseVideoButton
4246
- * This method shows/hides the pause video button.
4247
- * If set to true it will display the pause video button.
4248
- * If set to false it will hide the pause video button.
4249
- * Default value is true.
4250
- * @returns
4251
- */
4252
- showPauseVideoButton(showPauseVideoButton: boolean): this;
4253
- /**
4254
- *
4255
- * @param {boolean} showScreenShareButton
4256
- * This method shows/hides the screen share button.
4257
- * If set to true it will display the screen share button.
4258
- * If set to false it will hide the screen share button.
4259
- * Default value is true.
4260
- * @returns
4261
- */
4262
- showScreenShareButton(showScreenShareButton: boolean): this;
4263
- /**
4264
- *
4265
- * @param {boolean} showModeButton
4266
- * This method shows/hides the switch mode button.
4267
- * If set to true it will display the switch mode button.
4268
- * If set to false it will hide the switch mode button.
4269
- * Default value is true.
4270
- * @returns
4271
- */
4272
- showModeButton(showModeButton: boolean): this;
4273
- /**
4274
- *
4275
- * @param {Object} localizedStringObject
4276
- * This method will set the localized text in the call screen.
4277
- * @returns
4278
- */
4279
- setLocalizedStringObject(localizedStringObject: Object): this;
4280
- /**
4281
- * @private
4282
- * @param {Object} analyticsSettings
4283
- * This method will set the settings required for analytics.
4284
- * @returns
4285
- */
4286
- setAnalyticsSettings(analyticsSettings: Object): this;
4287
- /**
4288
- *
4289
- * @param {string} appId
4290
- * This method will set the appID.
4291
- * @returns
4292
- */
4293
- setAppId(appId: string): this;
4294
- /**
4295
- *
4296
- * @param {boolean} audioMuted
4297
- * This method allows the call to be started with audio muted.
4298
- * If set to true, the call will start with audio muted.
4299
- * Default value is false.
4300
- * @returns
4301
- */
4302
- startWithAudioMuted(audioMuted: boolean): this;
4303
- /**
4304
- *
4305
- * @param {boolean} videoMuted
4306
- * This method allows the call to be started with video muted.
4307
- * If set to true, the call will start with video muted.
4308
- * Default value is false.
4309
- * @returns
4310
- */
4311
- startWithVideoMuted(videoMuted: boolean): this;
4312
- /**
4313
- *
4314
- * @param {boolean} customCSS
4315
- * This method will set the custom CSS of the call screen.
4316
- * @returns
4317
- */
4318
- setCustomCSS(customCSS: string): this;
4319
- /**
4320
- *
4321
- * @param {boolean} showRecordingButton
4322
- * This method shows/hides the recording button.
4323
- * If set to true it will display the recording button.
4324
- * If set to false it will hide the recording button.
4325
- * Default value is false.
4326
- * @returns
4327
- */
4328
- showRecordingButton(showRecordingButton: boolean): this;
4329
- /**
4330
- *
4331
- * @param {boolean} startRecordingOnCallStart
4332
- * This method starts the recording as soon as the call start.
4333
- * If set to true it will start the recording as soon as the call start.
4334
- * Default value is false.
4335
- * @returns
4336
- */
4337
- startRecordingOnCallStart(startRecordingOnCallStart: boolean): this;
4338
- /**
4339
- *
4340
- * @param {boolean} legacyUI
4341
- * This method will render the legacy call UI.
4342
- * If set to true it will render the legacy call UI.
4343
- * Default value is false.
4344
- * @returns
4345
- */
4346
- forceLegacyUI(legacyUI: boolean): this;
4347
- /**
4348
- *
4349
- * @param {boolean} showAudioToVideoSwitchButton
4350
- * This method shows/hides the switch to video call button.
4351
- * If set to true it will display the switch to video call button.
4352
- * If set to false it will hide the switch to video call button.
4353
- * Default value is true.
4354
- * @returns
4355
- */
4356
- showSwitchToVideoCallButton(showAudioToVideoSwitchButton: boolean): this;
4357
-
4358
- /**
4359
- *
4360
- * @param {VirtualBackground} virtualBackground
4361
- * This method will set the virtual background setting.
4362
- * This methods takes an Object of VirtualBackground Class.
4363
- * @returns
4364
- */
4365
- setVirtualBackground(virtualBackground: VirtualBackground): this;
4366
-
4367
- /**
4368
- *
4369
- * @param {boolean} showVirtualBackgroundSetting
4370
- * This method shows/hides the virtual background setting button.
4371
- * If set to true it will display the virtual background setting button.
4372
- * If set to false it will hide the virtual background setting button.
4373
- * Default value is true.
4374
- * @returns
4375
- */
4376
- showVirtualBackgroundSetting(showVirtualBackgroundSetting: boolean): this;
4377
- /**
4378
- *
4379
- * @param {MainVideoContainerSetting} mainVideoContainerSetting
4380
- * This method can be used to customize the main video container.
4381
- * @returns
4382
- */
4383
- setMainVideoContainerSetting(mainVideoContainerSetting: MainVideoContainerSetting): this;
4384
- /**
4385
- * This method will return an object of the CallSettings class.
4386
- * @returns {CallSettings}
4387
- */
4388
- build(): CallSettings;
4389
- }
4390
-
4391
- export class MainVideoContainerSetting{
4392
- /** @private */ videoFit: string;
4393
- /** @private */ zoomButton: Object;
4394
- /** @private */ nameLabel: Object;
4395
- /** @private */ network: Object;
4396
-
4397
- /**
4398
- *
4399
- * @param {string} mainVideoAspectRatio
4400
- * This method is used to set the aspect ratio of main video.
4401
- * The default value is `contain`.
4402
- * @returns
4403
- */
4404
- setMainVideoAspectRatio(mainVideoAspectRatio: string): void;
4405
-
4406
- /**
4407
- *
4408
- * @param {string} position
4409
- * @param {boolean} visibility
4410
- * This method is used to set the position & visibility parameter of the full screen button.
4411
- * By default the full screen button is visible in the `bottom-right` position.
4412
- * @returns
4413
- */
4414
- setFullScreenButtonParams(position: string, visibility: boolean): void;
4415
-
4416
- /**
4417
- *
4418
- * @param {string} position
4419
- * @param {boolean} visibility
4420
- * @param {string} backgroundColor
4421
- * This method is used to set the position, visibility & background color of the name label.
4422
- * By default the name label is visible in the `bottom-right` position with a background-color `rgba(27, 27, 27, 0.4)`.
4423
- * @returns
4424
- */
4425
- setNameLabelParams(position: string, visibility: boolean, backgroundColor: string): void;
4426
-
4427
- /**
4428
- *
4429
- * @param {string} position
4430
- * @param {boolean} visibility
4431
- * This method is used to set the position, visibility of the network label.
4432
- * By default the network label is visible in the `bottom-right` position.
4433
- * @returns
4434
- */
4435
- setNetworkLabelParams(position: string, visibility: boolean): void;
4436
- }
4437
-
4438
- export class VirtualBackground {
4439
- public constructor(builder?: VirtualBackgroundBuilder);
4440
- shouldAllowBackgroundBlur(): boolean;
4441
- shouldAllowUserImages(): boolean;
4442
- shouldShowDefaultImages(): boolean;
4443
- getImages(): Array<String>;
4444
- isBackgroundBlurEnforced(): number;
4445
- getEnforcedBackgroundImage(): string;
4446
- }
4447
-
4448
- export class VirtualBackgroundBuilder{
4449
- /** @private */ AllowBackgroundBlur: boolean;
4450
- /** @private */ AllowUserImages: boolean;
4451
- /** @private */ ShowDefaultImages: boolean;
4452
- /** @private */ SetImages: Array<String>;
4453
- /** @private */ EnforceBackgroundBlur: number;
4454
- /** @private */ EnforceBackgroundImage: string;
4455
-
4456
- /**
4457
- *
4458
- * @param {boolean} AllowBackgroundBlur
4459
- * This method will show the background blur option in Virtual Background.
4460
- * If set to true it will show the background blur option.
4461
- * Default value is true.
4462
- * @returns
4463
- */
4464
- allowBackgroundBlur(AllowBackgroundBlur: boolean): this;
4465
-
4466
- /**
4467
- *
4468
- * @param {boolean} AllowUserImage
4469
- * This method will allow the user to add custom images as background.
4470
- * If set to true it will allow the user to add custom images as background.
4471
- * Default value is true.
4472
- * @returns
4473
- */
4474
- allowUserImages(AllowUserImages: boolean): this;
4475
-
4476
- /**
4477
- *
4478
- * @param {boolean} ShowDefaultImages
4479
- * This method will show the default images to be used as background.
4480
- * If set to true it will show the default images to be used as background.
4481
- * Default value is true.
4482
- * @returns
4483
- */
4484
- showDefaultImages(ShowDefaultImages: boolean): this;
4485
-
4486
- /**
4487
- *
4488
- * @param {boolean} SetImages
4489
- * This method will allow user to add custom Images to be used as background. It takes in an array of URLs.
4490
- * @returns
4491
- */
4492
-
4493
- setImages(SetImages: Array<String>):
4494
- this;
4495
-
4496
- /**
4497
- *
4498
- * @param {number} EnforceBackgroundBlur
4499
- * This method will enforce background blur.
4500
- * This method takes number as input which decides the blur level of the background.
4501
- * Default value is 0.
4502
- * @returns
4503
- */
4504
- enforceBackgroundBlur(EnforceBackgroundBlur: number): this;
4505
-
4506
- /**
4507
- *
4508
- * @param {string} EnforceBackgroundImage
4509
- * This method will enforce background image.
4510
- * If an URL of the image is sent then that image will be set as background.
4511
- * By default no image is set.
4512
- * @returns
4513
- */
4514
- enforceBackgroundImage(EnforceBackgroundImage: string): this;
4515
-
4516
- /**
4517
- * This method will return an object of the VirtualBackground class.
4518
- * @returns {VirtualBackground}
4519
- */
4520
- build(): VirtualBackground;
4521
- }
4522
-
4523
- export class CCExtension {
4524
- constructor(extension: any);
4525
- /**
4526
- * This method returns the id of the extension.
4527
- * @returns {string}
4528
- */
4529
- getId(): string;
4530
- /**
4531
- * This method returns the name of the extension.
4532
- * @returns {string}
4533
- */
4534
- getName(): string;
4535
- }
4536
-
4537
- export class MediaDevice {
4538
- constructor(id: string, name: string, active: boolean);
4539
- /**
4540
- * Method to get ID of the media device.
4541
- * @returns {string}
4542
- */
4543
- getId(): string;
4544
- /**
4545
- * Method to set ID of the media device.
4546
- * @param {string} id
4547
- */
4548
- setId(id: string): void;
4549
- /**
4550
- * Method to get name of the media device.
4551
- * @returns {string}
4552
- */
4553
- getName(): string;
4554
- /**
4555
- * Method to set name of the media device.
4556
- * @param {string} name
4557
- */
4558
- setName(name: string): void;
4559
- /**
4560
- * Method to check if the media device is active or not.
4561
- * @returns {boolean}
4562
- */
4563
- getIsActive(): boolean;
4564
- /**
4565
- * Method to set the media device as active.
4566
- * @param {boolean} active
4567
- */
4568
- setIsActive(active: boolean): void;
4569
- }
4570
-
4571
- export class TransientMessage {
4572
- constructor(receiverId: string, receiverType: string, data: any);
4573
- /**
4574
- * Method to get receiverID of the transient message.
4575
- * @returns {string}
4576
- */
4577
- getReceiverId(): string;
4578
- /**
4579
- * Method to set receiverID of the transient message.
4580
- * @param {string} receiverId
4581
- */
4582
- setReceiverId(receiverId: string): void;
4583
- /**
4584
- * Method to get receiver type of the transient message.
4585
- * @returns {string}
4586
- */
4587
- getReceiverType(): string;
4588
- /**
4589
- * Method to set receiver type of the transient message.
4590
- * @param {string} receiverType
4591
- */
4592
- setReceiverType(receiverType: string): void;
4593
- /**
4594
- * Method to get data of the transient message.
4595
- * @returns {any}
4596
- */
4597
- getData(): any;
4598
- /**
4599
- * Method to set data of the transient message.
4600
- * @param {any} data
4601
- */
4602
- setData(data: any): void;
4603
- /**
4604
- * Method to get sender of the transient message.
4605
- * @returns {User}
4606
- */
4607
- getSender(): User;
4608
- /**
4609
- * Method to set sender of the transient message.
4610
- * @param {User} sender
4611
- */
4612
- setSender(sender: User): void;
4613
- }
4614
-
4615
- /**
4616
- *
4617
- *
4618
- * @export
4619
- * @interface ErrorModel
4620
- */
4621
- export interface ErrorModel {
4622
- code?: string | number;
4623
- name?: string;
4624
- message?: string;
4625
- details?: string;
4626
- }
4627
-
4628
- /**
4629
- *
4630
- * @module MessageReceipt
4631
- */
4632
- export class MessageReceipt {
4633
- RECEIPT_TYPE: {
4634
- READ_RECEIPT: string;
4635
- DELIVERY_RECEIPT: string;
4636
- };
4637
- /**
4638
- * Method to get receiver type of the message receipt.
4639
- * @returns {string}
4640
- */
4641
- getReceiverType(): string;
4642
- /**
4643
- * Method to set receiver type of the message receipt.
4644
- * @param {string} receiverType
4645
- */
4646
- setReceiverType(receiverType: string): void;
4647
- /**
4648
- * Method to get sender of the message receipt.
4649
- * @returns {User}
4650
- */
4651
- getSender(): User;
4652
- /**
4653
- * Method to set sender of the message receipt.
4654
- * @param {User} sender
4655
- */
4656
- setSender(sender: User): void;
4657
- /**
4658
- * Method to get receiver of the message receipt.
4659
- * @returns {string}
4660
- */
4661
- getReceiver(): string;
4662
- /**
4663
- * Method to set receiver of the message receipt.
4664
- * @param {string} receiver
4665
- */
4666
- setReceiver(receiver: string): void;
4667
- /**
4668
- * Method to get timestamp of the message receipt.
4669
- * @returns {string}
4670
- */
4671
- getTimestamp(): string;
4672
- /**
4673
- * Method to set timestamp of the message receipt.
4674
- * @param {string} timestamp
4675
- */
4676
- setTimestamp(timestamp: string): void;
4677
- /**
4678
- * Method to set readAt timestamp of the message receipt.
4679
- * @param {number} readAt
4680
- */
4681
- setReadAt(readAt: number): void;
4682
- /**
4683
- * Method to get readAt timestamp of the message receipt.
4684
- * @returns {number}
4685
- */
4686
- getReadAt(): number;
4687
- /**
4688
- * Method to set deliveredAt timestamp of the message receipt.
4689
- * @param {number} deliveredAt
4690
- */
4691
- setDeliveredAt(deliveredAt: number): void;
4692
- /**
4693
- * Method to get deliveredAt timestamp of the message receipt.
4694
- * @returns {number}
4695
- */
4696
- getDeliveredAt(): number;
4697
- /**
4698
- * Method to get the message ID.
4699
- * @returns {string}
4700
- */
4701
- getMessageId(): string;
4702
- /**
4703
- * Method to set the message ID.
4704
- * @param {string} messageId
4705
- */
4706
- setMessageId(messageId: string): void;
4707
- /**
4708
- * Method to get the receipt type of message receipt.
4709
- * @returns {string}
4710
- */
4711
- getReceiptType(): string;
4712
- /**
4713
- * Method to set the receipt type of message receipt.
4714
- * @param {string} receiptType
4715
- */
4716
- setReceiptType(receiptType?: string): void;
4717
- }
4718
-
4719
- export class RTCUser {
4720
- constructor(uid: string);
4721
- setUID(uid: string): void;
4722
- getUID(): string;
4723
- setName(name: string): void;
4724
- getName(): string;
4725
- setAvatar(avatar: string): void;
4726
- getAvatar(): string;
4727
- setJWT(jwt: string): void;
4728
- getJWT(): string;
4729
- setResource(resource: string): void;
4730
- getResource(): string;
4731
- }
4732
- }