@cometchat/calls-sdk-javascript 5.0.1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.d.ts +304 -8
- package/dist/index.es.js +9994 -9588
- package/dist/index.umd.js +100 -100
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -991,6 +991,29 @@ export declare class CometChatCalls extends SessionMethods {
|
|
|
991
991
|
readonly success: true;
|
|
992
992
|
readonly error: null;
|
|
993
993
|
}>;
|
|
994
|
+
/**
|
|
995
|
+
* Shared tail of {@link init} / {@link initFromSettings}. Both entry points validate
|
|
996
|
+
*/
|
|
997
|
+
private static finalizeInit;
|
|
998
|
+
/**
|
|
999
|
+
* Initializes the CometChat Calls SDK from a `cometchat-settings.json` object.
|
|
1000
|
+
* Parallels the Chat SDK's `initFromSettings` (file-based init for skills-driven
|
|
1001
|
+
* integrations): it maps the shared settings shape onto the Calls SDK's own
|
|
1002
|
+
* `CallAppSettings` and then performs exactly the same work as {@link init}.
|
|
1003
|
+
* @param settings - Parsed `cometchat-settings.json` object.
|
|
1004
|
+
* @returns An object indicating success or failure with error details.
|
|
1005
|
+
*/
|
|
1006
|
+
static initFromSettings(settings: CometChatSettings): Promise<{
|
|
1007
|
+
readonly success: false;
|
|
1008
|
+
readonly error: {
|
|
1009
|
+
readonly name: "VALIDATION_ERROR";
|
|
1010
|
+
readonly message: `Invalid app settings: ${string}`;
|
|
1011
|
+
readonly timestamp: number;
|
|
1012
|
+
};
|
|
1013
|
+
} | {
|
|
1014
|
+
readonly success: true;
|
|
1015
|
+
readonly error: null;
|
|
1016
|
+
}>;
|
|
994
1017
|
static login(uid: string, authKey?: string): Promise<User_2>;
|
|
995
1018
|
static loginWithAuthToken(authToken: string): Promise<User_2>;
|
|
996
1019
|
static logout(): Promise<string>;
|
|
@@ -1003,6 +1026,13 @@ export declare class CometChatCalls extends SessionMethods {
|
|
|
1003
1026
|
token: string;
|
|
1004
1027
|
}>;
|
|
1005
1028
|
private static getBaseURL;
|
|
1029
|
+
/**
|
|
1030
|
+
* SDK-identification telemetry chokepoint. Fire-and-forget, deduped, non-fatal.
|
|
1031
|
+
* Called from login success AND init()-session-restore. Sends `/user_sessions`
|
|
1032
|
+
* ONLY when the Chat SDK is absent (it otherwise handles this telemetry itself).
|
|
1033
|
+
* Never awaited on the happy path; never throws.
|
|
1034
|
+
*/
|
|
1035
|
+
private static reportSdkIdentification;
|
|
1006
1036
|
private static loginWithUID;
|
|
1007
1037
|
private static authenticateWithToken;
|
|
1008
1038
|
private static logoutInternal;
|
|
@@ -1057,54 +1087,311 @@ declare interface CometChatException {
|
|
|
1057
1087
|
message?: string;
|
|
1058
1088
|
}
|
|
1059
1089
|
|
|
1090
|
+
declare interface CometChatSettings {
|
|
1091
|
+
appId: string;
|
|
1092
|
+
region: string;
|
|
1093
|
+
credentials?: {
|
|
1094
|
+
authKey?: string;
|
|
1095
|
+
};
|
|
1096
|
+
callsSDK?: {
|
|
1097
|
+
adminHost?: string | null;
|
|
1098
|
+
clientHost?: string | null;
|
|
1099
|
+
host?: string | null;
|
|
1100
|
+
};
|
|
1101
|
+
chatSDK?: Record<string, unknown>;
|
|
1102
|
+
uiKit?: Record<string, unknown>;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Configuration that applies on both web and mobile platforms.
|
|
1107
|
+
*/
|
|
1060
1108
|
declare type ConfigStateBoth = {
|
|
1109
|
+
/**
|
|
1110
|
+
* Whether the call starts as an audio-only (`'VOICE'`) call or a video
|
|
1111
|
+
* (`'VIDEO'`) call. In a voice call no camera is acquired and no video
|
|
1112
|
+
* tiles are shown.
|
|
1113
|
+
*
|
|
1114
|
+
* @default 'VIDEO'
|
|
1115
|
+
*/
|
|
1061
1116
|
sessionType: SessionType;
|
|
1117
|
+
/**
|
|
1118
|
+
* The arrangement used to display participant video tiles:
|
|
1119
|
+
* - `'TILE'` — an equal grid of all participants.
|
|
1120
|
+
* - `'SIDEBAR'` — one main participant with the rest in a side strip.
|
|
1121
|
+
* - `'SPOTLIGHT'` — a single full-screen participant with the local user
|
|
1122
|
+
* shown in a small picture-in-picture tile.
|
|
1123
|
+
*
|
|
1124
|
+
* @default 'TILE'
|
|
1125
|
+
*/
|
|
1062
1126
|
layout: Layout;
|
|
1127
|
+
/**
|
|
1128
|
+
* Which camera to use when the call starts: `'FRONT'` (selfie) or `'REAR'`
|
|
1129
|
+
* (back). Primarily relevant on mobile devices with multiple cameras; the
|
|
1130
|
+
* user can still switch afterwards.
|
|
1131
|
+
*
|
|
1132
|
+
* @default undefined — uses the SDK's current camera (front by default)
|
|
1133
|
+
*/
|
|
1063
1134
|
initialCameraFacing?: CameraFacing;
|
|
1135
|
+
/**
|
|
1136
|
+
* Automatically starts recording the session as soon as the call begins,
|
|
1137
|
+
* without the user pressing the record button. Recording must be enabled
|
|
1138
|
+
* for your app for this to take effect.
|
|
1139
|
+
*
|
|
1140
|
+
* @default false
|
|
1141
|
+
*/
|
|
1064
1142
|
autoStartRecording: boolean;
|
|
1143
|
+
/**
|
|
1144
|
+
* Hides the recording button from the call controls, preventing the user
|
|
1145
|
+
* from manually starting or stopping recording from within the SDK UI.
|
|
1146
|
+
*
|
|
1147
|
+
* @default true
|
|
1148
|
+
*/
|
|
1065
1149
|
hideRecordingButton: boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* Hides the entire bottom control bar (mic, camera, leave, and every other
|
|
1152
|
+
* call control). Useful when the host app provides its own controls.
|
|
1153
|
+
*
|
|
1154
|
+
* @default false
|
|
1155
|
+
*/
|
|
1066
1156
|
hideControlPanel: boolean;
|
|
1157
|
+
/**
|
|
1158
|
+
* Hides the "leave call" button from the call controls. The host app is
|
|
1159
|
+
* then responsible for providing its own way to leave the session.
|
|
1160
|
+
*
|
|
1161
|
+
* @default false
|
|
1162
|
+
*/
|
|
1067
1163
|
hideLeaveSessionButton: boolean;
|
|
1164
|
+
/**
|
|
1165
|
+
* Hides the top header bar of the call UI (which shows the call title,
|
|
1166
|
+
* session timer, and similar information).
|
|
1167
|
+
*
|
|
1168
|
+
* @default false
|
|
1169
|
+
*/
|
|
1068
1170
|
hideHeaderPanel: boolean;
|
|
1171
|
+
/**
|
|
1172
|
+
* Hides the "raise hand" button from the call controls.
|
|
1173
|
+
*
|
|
1174
|
+
* @default false
|
|
1175
|
+
*/
|
|
1069
1176
|
hideRaiseHandButton: boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* Hides the "share / invite" button that lets the user invite others to
|
|
1179
|
+
* join the call.
|
|
1180
|
+
*
|
|
1181
|
+
* @default true
|
|
1182
|
+
*/
|
|
1070
1183
|
hideShareInviteButton: boolean;
|
|
1184
|
+
/**
|
|
1185
|
+
* Hides the layout-switcher button, preventing the user from changing
|
|
1186
|
+
* between the tile, sidebar, and spotlight layouts at runtime.
|
|
1187
|
+
*
|
|
1188
|
+
* @default false
|
|
1189
|
+
*/
|
|
1071
1190
|
hideChangeLayoutButton: boolean;
|
|
1191
|
+
/**
|
|
1192
|
+
* Hides the microphone mute/unmute button from the call controls.
|
|
1193
|
+
*
|
|
1194
|
+
* @default false
|
|
1195
|
+
*/
|
|
1072
1196
|
hideToggleAudioButton: boolean;
|
|
1197
|
+
/**
|
|
1198
|
+
* Hides the camera on/off button from the call controls.
|
|
1199
|
+
*
|
|
1200
|
+
* @default false
|
|
1201
|
+
*/
|
|
1073
1202
|
hideToggleVideoButton: boolean;
|
|
1203
|
+
/**
|
|
1204
|
+
* Hides the button that opens the participant list panel.
|
|
1205
|
+
*
|
|
1206
|
+
* @default false
|
|
1207
|
+
*/
|
|
1074
1208
|
hideParticipantListButton: boolean;
|
|
1209
|
+
/**
|
|
1210
|
+
* Hides the in-call chat button.
|
|
1211
|
+
*
|
|
1212
|
+
* @default true
|
|
1213
|
+
*/
|
|
1075
1214
|
hideChatButton: boolean;
|
|
1215
|
+
/**
|
|
1216
|
+
* Hides the elapsed-time timer that shows how long the call has been
|
|
1217
|
+
* running.
|
|
1218
|
+
*
|
|
1219
|
+
* @default false
|
|
1220
|
+
*/
|
|
1076
1221
|
hideSessionTimer: boolean;
|
|
1222
|
+
/**
|
|
1223
|
+
* Hides the network-quality indicator that reflects each participant's
|
|
1224
|
+
* connection strength.
|
|
1225
|
+
*
|
|
1226
|
+
* @default true
|
|
1227
|
+
*/
|
|
1077
1228
|
hideNetworkIndicator: boolean;
|
|
1229
|
+
/**
|
|
1230
|
+
* Hides the "recording in progress" badge shown while the session is being
|
|
1231
|
+
* recorded. The recording itself is unaffected.
|
|
1232
|
+
*
|
|
1233
|
+
* @default false
|
|
1234
|
+
*/
|
|
1078
1235
|
hideRecordingStatusIndicator: boolean;
|
|
1236
|
+
/**
|
|
1237
|
+
* Hides the button that switches between the front and rear cameras.
|
|
1238
|
+
* Mainly relevant on mobile devices with more than one camera.
|
|
1239
|
+
*
|
|
1240
|
+
* @default false
|
|
1241
|
+
*/
|
|
1079
1242
|
hideSwitchCameraButton: boolean;
|
|
1243
|
+
/**
|
|
1244
|
+
* Enables the per-participant context menu — opened by right-clicking (web)
|
|
1245
|
+
* or long-pressing (mobile) a participant's tile — that exposes actions such
|
|
1246
|
+
* as pinning a participant.
|
|
1247
|
+
*
|
|
1248
|
+
* Note: this menu is automatically unavailable in the `'SPOTLIGHT'` and
|
|
1249
|
+
* picture-in-picture layouts regardless of this setting.
|
|
1250
|
+
*
|
|
1251
|
+
* @default true
|
|
1252
|
+
*/
|
|
1080
1253
|
enableParticipantContextMenu: boolean;
|
|
1254
|
+
/**
|
|
1255
|
+
* The display name to show for the local user in the call (participant
|
|
1256
|
+
* tiles, participant list, etc.). When left empty, the name associated with
|
|
1257
|
+
* the logged-in user is used.
|
|
1258
|
+
*
|
|
1259
|
+
* @default '' — falls back to the logged-in user's name
|
|
1260
|
+
*/
|
|
1081
1261
|
displayName: string;
|
|
1262
|
+
/**
|
|
1263
|
+
* Joins the call with the microphone muted. The user can unmute manually
|
|
1264
|
+
* afterwards (unless the toggle-audio button is hidden).
|
|
1265
|
+
*
|
|
1266
|
+
* @default false
|
|
1267
|
+
*/
|
|
1082
1268
|
startAudioMuted: boolean;
|
|
1269
|
+
/**
|
|
1270
|
+
* Joins the call with the camera off. The user can turn the camera on
|
|
1271
|
+
* manually afterwards (unless the toggle-video button is hidden).
|
|
1272
|
+
*
|
|
1273
|
+
* @default false
|
|
1274
|
+
*/
|
|
1083
1275
|
startVideoPaused: boolean;
|
|
1276
|
+
/**
|
|
1277
|
+
* Title text shown in the call's header panel (for example, the meeting or
|
|
1278
|
+
* room name).
|
|
1279
|
+
*
|
|
1280
|
+
* @default '' — no title shown
|
|
1281
|
+
*/
|
|
1084
1282
|
title: string;
|
|
1283
|
+
/**
|
|
1284
|
+
* How long, in milliseconds, the local user may remain alone in the call
|
|
1285
|
+
* (no other participants) before an "are you still there?" idle prompt is
|
|
1286
|
+
* shown. The countdown only runs while you are the only participant.
|
|
1287
|
+
*
|
|
1288
|
+
* @default 60000 — 60 seconds
|
|
1289
|
+
*/
|
|
1085
1290
|
idleTimeoutPeriodBeforePrompt: number;
|
|
1291
|
+
/**
|
|
1292
|
+
* How long, in milliseconds, the idle prompt stays on screen waiting for a
|
|
1293
|
+
* response before the SDK automatically leaves the call on the user's behalf.
|
|
1294
|
+
*
|
|
1295
|
+
* @default 180000 — 3 minutes
|
|
1296
|
+
*/
|
|
1086
1297
|
idleTimeoutPeriodAfterPrompt: number;
|
|
1298
|
+
/**
|
|
1299
|
+
* Allows the user to drag the local picture-in-picture tile to reposition
|
|
1300
|
+
* it. Only applies when `layout` is `'SPOTLIGHT'`.
|
|
1301
|
+
*
|
|
1302
|
+
* @default true
|
|
1303
|
+
*/
|
|
1087
1304
|
enableSpotlightDrag: boolean;
|
|
1088
|
-
|
|
1305
|
+
/**
|
|
1306
|
+
* Marks this as a one-to-one (peer) call. In a peer call, when one
|
|
1307
|
+
* participant leaves the session ends for everyone rather than continuing
|
|
1308
|
+
* without them (unless `forceLeave` is passed when leaving). The remote
|
|
1309
|
+
* peer's connectivity is also watched: if no remote stats arrive for 10
|
|
1310
|
+
* seconds onRemoteConnectionLost is published, and
|
|
1311
|
+
* onRemoteConnectionRestored once they resume.
|
|
1312
|
+
*
|
|
1313
|
+
* @default false
|
|
1314
|
+
*/
|
|
1089
1315
|
isPeerCall: boolean;
|
|
1316
|
+
/**
|
|
1317
|
+
* Enables the in-call toast notifications surfaced by the SDK (for example
|
|
1318
|
+
* "X joined the call" or error messages). Set to `false` to suppress all
|
|
1319
|
+
* SDK toasts.
|
|
1320
|
+
*
|
|
1321
|
+
* @default true
|
|
1322
|
+
*/
|
|
1090
1323
|
enableNotifications: boolean;
|
|
1324
|
+
/**
|
|
1325
|
+
* @unstable This API may change or be removed in a future release.
|
|
1326
|
+
* When enabled in a voice call (`sessionType: 'VOICE'`), the SDK renders
|
|
1327
|
+
* no visible UI at all — no controls, header, modals, or toast
|
|
1328
|
+
* notifications — while the call connection, media, and events continue
|
|
1329
|
+
* to work normally. Remote participants' audio keeps playing. The host
|
|
1330
|
+
* app is responsible for providing its own UI, including reacting to
|
|
1331
|
+
* session end (the SDK's "session has ended" view and the idle-timeout
|
|
1332
|
+
* prompt/auto-leave are not shown in this mode).
|
|
1333
|
+
*
|
|
1334
|
+
* Only supported in voice calls: for video calls (`sessionType:
|
|
1335
|
+
* 'VIDEO'`) the flag is ignored with a console warning and the default
|
|
1336
|
+
* UI is rendered.
|
|
1337
|
+
*
|
|
1338
|
+
* @default false
|
|
1339
|
+
*/
|
|
1340
|
+
unstable_headlessMode: boolean;
|
|
1091
1341
|
};
|
|
1092
1342
|
|
|
1343
|
+
/**
|
|
1344
|
+
* Configuration that only applies on the web platform.
|
|
1345
|
+
* These options are ignored on mobile.
|
|
1346
|
+
*/
|
|
1093
1347
|
declare type ConfigStateWeb = {
|
|
1348
|
+
/**
|
|
1349
|
+
* Applies background-noise suppression to the local microphone so that
|
|
1350
|
+
* keyboard clicks, fans, and other ambient sounds are filtered out before
|
|
1351
|
+
* your audio is sent to other participants.
|
|
1352
|
+
*
|
|
1353
|
+
* @default false
|
|
1354
|
+
*/
|
|
1094
1355
|
enableNoiseReduction: boolean;
|
|
1356
|
+
/**
|
|
1357
|
+
* The `deviceId` of the microphone to capture audio from when the call
|
|
1358
|
+
* starts. Use this to pre-select a specific input device instead of the
|
|
1359
|
+
* system default. Device IDs come from the browser's
|
|
1360
|
+
* `navigator.mediaDevices.enumerateDevices()`.
|
|
1361
|
+
*
|
|
1362
|
+
* @default undefined — uses the system default microphone
|
|
1363
|
+
*/
|
|
1095
1364
|
audioInputDeviceId?: string;
|
|
1365
|
+
/**
|
|
1366
|
+
* The `deviceId` of the speaker / output device used to play remote
|
|
1367
|
+
* participants' audio. Use this to pre-select a specific output device
|
|
1368
|
+
* instead of the system default.
|
|
1369
|
+
*
|
|
1370
|
+
* @default undefined — uses the system default speaker
|
|
1371
|
+
*/
|
|
1096
1372
|
audioOutputDeviceId?: string;
|
|
1373
|
+
/**
|
|
1374
|
+
* The `deviceId` of the camera to capture video from when the call starts.
|
|
1375
|
+
* Use this to pre-select a specific camera instead of the system default.
|
|
1376
|
+
*
|
|
1377
|
+
* @default undefined — uses the system default camera
|
|
1378
|
+
*/
|
|
1097
1379
|
videoInputDeviceId?: string;
|
|
1380
|
+
/**
|
|
1381
|
+
* Hides the screen-sharing button from the call controls, preventing the
|
|
1382
|
+
* user from starting a screen share from within the SDK UI.
|
|
1383
|
+
*
|
|
1384
|
+
* @default false
|
|
1385
|
+
*/
|
|
1098
1386
|
hideScreenSharingButton: boolean;
|
|
1099
|
-
hideVirtualBackgroundButton: boolean;
|
|
1100
1387
|
/**
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1104
|
-
*
|
|
1105
|
-
*
|
|
1388
|
+
* Hides the virtual-background button from the call controls, preventing the
|
|
1389
|
+
* user from blurring or replacing their camera background from within the
|
|
1390
|
+
* SDK UI.
|
|
1391
|
+
*
|
|
1392
|
+
* @default false
|
|
1106
1393
|
*/
|
|
1107
|
-
|
|
1394
|
+
hideVirtualBackgroundButton: boolean;
|
|
1108
1395
|
};
|
|
1109
1396
|
|
|
1110
1397
|
declare type ConnectionError = {
|
|
@@ -1133,6 +1420,8 @@ declare const EVENT_LISTENER_METHODS: {
|
|
|
1133
1420
|
readonly onSessionLeft: "onSessionLeft";
|
|
1134
1421
|
readonly onConnectionLost: "onConnectionLost";
|
|
1135
1422
|
readonly onConnectionRestored: "onConnectionRestored";
|
|
1423
|
+
readonly onRemoteConnectionLost: "onRemoteConnectionLost";
|
|
1424
|
+
readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
|
|
1136
1425
|
readonly onConnectionClosed: "onConnectionClosed";
|
|
1137
1426
|
readonly onConnectionFailed: "onConnectionFailed";
|
|
1138
1427
|
readonly onSessionTimedOut: "onSessionTimedOut";
|
|
@@ -1412,6 +1701,13 @@ declare class MainVideoContainerSetting {
|
|
|
1412
1701
|
|
|
1413
1702
|
declare type MobileSDKEvents = SDKEvents & {
|
|
1414
1703
|
onAudioModeChanged: (payload: AudioMode['type']) => void;
|
|
1704
|
+
/**
|
|
1705
|
+
* Fired when the list of available audio modes changes,
|
|
1706
|
+
* e.g. a Bluetooth device or headphones are connected/disconnected.
|
|
1707
|
+
*
|
|
1708
|
+
* @param payload - The updated list of available audio modes.
|
|
1709
|
+
*/
|
|
1710
|
+
onAudioModesChanged: (payload: AudioMode[]) => void;
|
|
1415
1711
|
onCameraFacingChanged: (payload: CameraFacing) => void;
|
|
1416
1712
|
onSwitchCameraButtonClicked: () => void;
|
|
1417
1713
|
onPictureInPictureLayoutEnabled: () => void;
|