@cometchat/calls-sdk-javascript 5.0.1 → 5.0.2
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 +259 -8
- package/dist/index.es.js +9311 -9215
- package/dist/index.umd.js +90 -90
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1057,54 +1057,296 @@ declare interface CometChatException {
|
|
|
1057
1057
|
message?: string;
|
|
1058
1058
|
}
|
|
1059
1059
|
|
|
1060
|
+
/**
|
|
1061
|
+
* Configuration that applies on both web and mobile platforms.
|
|
1062
|
+
*/
|
|
1060
1063
|
declare type ConfigStateBoth = {
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether the call starts as an audio-only (`'VOICE'`) call or a video
|
|
1066
|
+
* (`'VIDEO'`) call. In a voice call no camera is acquired and no video
|
|
1067
|
+
* tiles are shown.
|
|
1068
|
+
*
|
|
1069
|
+
* @default 'VIDEO'
|
|
1070
|
+
*/
|
|
1061
1071
|
sessionType: SessionType;
|
|
1072
|
+
/**
|
|
1073
|
+
* The arrangement used to display participant video tiles:
|
|
1074
|
+
* - `'TILE'` — an equal grid of all participants.
|
|
1075
|
+
* - `'SIDEBAR'` — one main participant with the rest in a side strip.
|
|
1076
|
+
* - `'SPOTLIGHT'` — a single full-screen participant with the local user
|
|
1077
|
+
* shown in a small picture-in-picture tile.
|
|
1078
|
+
*
|
|
1079
|
+
* @default 'TILE'
|
|
1080
|
+
*/
|
|
1062
1081
|
layout: Layout;
|
|
1082
|
+
/**
|
|
1083
|
+
* Which camera to use when the call starts: `'FRONT'` (selfie) or `'REAR'`
|
|
1084
|
+
* (back). Primarily relevant on mobile devices with multiple cameras; the
|
|
1085
|
+
* user can still switch afterwards.
|
|
1086
|
+
*
|
|
1087
|
+
* @default undefined — uses the SDK's current camera (front by default)
|
|
1088
|
+
*/
|
|
1063
1089
|
initialCameraFacing?: CameraFacing;
|
|
1090
|
+
/**
|
|
1091
|
+
* Automatically starts recording the session as soon as the call begins,
|
|
1092
|
+
* without the user pressing the record button. Recording must be enabled
|
|
1093
|
+
* for your app for this to take effect.
|
|
1094
|
+
*
|
|
1095
|
+
* @default false
|
|
1096
|
+
*/
|
|
1064
1097
|
autoStartRecording: boolean;
|
|
1098
|
+
/**
|
|
1099
|
+
* Hides the recording button from the call controls, preventing the user
|
|
1100
|
+
* from manually starting or stopping recording from within the SDK UI.
|
|
1101
|
+
*
|
|
1102
|
+
* @default true
|
|
1103
|
+
*/
|
|
1065
1104
|
hideRecordingButton: boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* Hides the entire bottom control bar (mic, camera, leave, and every other
|
|
1107
|
+
* call control). Useful when the host app provides its own controls.
|
|
1108
|
+
*
|
|
1109
|
+
* @default false
|
|
1110
|
+
*/
|
|
1066
1111
|
hideControlPanel: boolean;
|
|
1112
|
+
/**
|
|
1113
|
+
* Hides the "leave call" button from the call controls. The host app is
|
|
1114
|
+
* then responsible for providing its own way to leave the session.
|
|
1115
|
+
*
|
|
1116
|
+
* @default false
|
|
1117
|
+
*/
|
|
1067
1118
|
hideLeaveSessionButton: boolean;
|
|
1119
|
+
/**
|
|
1120
|
+
* Hides the top header bar of the call UI (which shows the call title,
|
|
1121
|
+
* session timer, and similar information).
|
|
1122
|
+
*
|
|
1123
|
+
* @default false
|
|
1124
|
+
*/
|
|
1068
1125
|
hideHeaderPanel: boolean;
|
|
1126
|
+
/**
|
|
1127
|
+
* Hides the "raise hand" button from the call controls.
|
|
1128
|
+
*
|
|
1129
|
+
* @default false
|
|
1130
|
+
*/
|
|
1069
1131
|
hideRaiseHandButton: boolean;
|
|
1132
|
+
/**
|
|
1133
|
+
* Hides the "share / invite" button that lets the user invite others to
|
|
1134
|
+
* join the call.
|
|
1135
|
+
*
|
|
1136
|
+
* @default true
|
|
1137
|
+
*/
|
|
1070
1138
|
hideShareInviteButton: boolean;
|
|
1139
|
+
/**
|
|
1140
|
+
* Hides the layout-switcher button, preventing the user from changing
|
|
1141
|
+
* between the tile, sidebar, and spotlight layouts at runtime.
|
|
1142
|
+
*
|
|
1143
|
+
* @default false
|
|
1144
|
+
*/
|
|
1071
1145
|
hideChangeLayoutButton: boolean;
|
|
1146
|
+
/**
|
|
1147
|
+
* Hides the microphone mute/unmute button from the call controls.
|
|
1148
|
+
*
|
|
1149
|
+
* @default false
|
|
1150
|
+
*/
|
|
1072
1151
|
hideToggleAudioButton: boolean;
|
|
1152
|
+
/**
|
|
1153
|
+
* Hides the camera on/off button from the call controls.
|
|
1154
|
+
*
|
|
1155
|
+
* @default false
|
|
1156
|
+
*/
|
|
1073
1157
|
hideToggleVideoButton: boolean;
|
|
1158
|
+
/**
|
|
1159
|
+
* Hides the button that opens the participant list panel.
|
|
1160
|
+
*
|
|
1161
|
+
* @default false
|
|
1162
|
+
*/
|
|
1074
1163
|
hideParticipantListButton: boolean;
|
|
1164
|
+
/**
|
|
1165
|
+
* Hides the in-call chat button.
|
|
1166
|
+
*
|
|
1167
|
+
* @default true
|
|
1168
|
+
*/
|
|
1075
1169
|
hideChatButton: boolean;
|
|
1170
|
+
/**
|
|
1171
|
+
* Hides the elapsed-time timer that shows how long the call has been
|
|
1172
|
+
* running.
|
|
1173
|
+
*
|
|
1174
|
+
* @default false
|
|
1175
|
+
*/
|
|
1076
1176
|
hideSessionTimer: boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* Hides the network-quality indicator that reflects each participant's
|
|
1179
|
+
* connection strength.
|
|
1180
|
+
*
|
|
1181
|
+
* @default true
|
|
1182
|
+
*/
|
|
1077
1183
|
hideNetworkIndicator: boolean;
|
|
1184
|
+
/**
|
|
1185
|
+
* Hides the "recording in progress" badge shown while the session is being
|
|
1186
|
+
* recorded. The recording itself is unaffected.
|
|
1187
|
+
*
|
|
1188
|
+
* @default false
|
|
1189
|
+
*/
|
|
1078
1190
|
hideRecordingStatusIndicator: boolean;
|
|
1191
|
+
/**
|
|
1192
|
+
* Hides the button that switches between the front and rear cameras.
|
|
1193
|
+
* Mainly relevant on mobile devices with more than one camera.
|
|
1194
|
+
*
|
|
1195
|
+
* @default false
|
|
1196
|
+
*/
|
|
1079
1197
|
hideSwitchCameraButton: boolean;
|
|
1198
|
+
/**
|
|
1199
|
+
* Enables the per-participant context menu — opened by right-clicking (web)
|
|
1200
|
+
* or long-pressing (mobile) a participant's tile — that exposes actions such
|
|
1201
|
+
* as pinning a participant.
|
|
1202
|
+
*
|
|
1203
|
+
* Note: this menu is automatically unavailable in the `'SPOTLIGHT'` and
|
|
1204
|
+
* picture-in-picture layouts regardless of this setting.
|
|
1205
|
+
*
|
|
1206
|
+
* @default true
|
|
1207
|
+
*/
|
|
1080
1208
|
enableParticipantContextMenu: boolean;
|
|
1209
|
+
/**
|
|
1210
|
+
* The display name to show for the local user in the call (participant
|
|
1211
|
+
* tiles, participant list, etc.). When left empty, the name associated with
|
|
1212
|
+
* the logged-in user is used.
|
|
1213
|
+
*
|
|
1214
|
+
* @default '' — falls back to the logged-in user's name
|
|
1215
|
+
*/
|
|
1081
1216
|
displayName: string;
|
|
1217
|
+
/**
|
|
1218
|
+
* Joins the call with the microphone muted. The user can unmute manually
|
|
1219
|
+
* afterwards (unless the toggle-audio button is hidden).
|
|
1220
|
+
*
|
|
1221
|
+
* @default false
|
|
1222
|
+
*/
|
|
1082
1223
|
startAudioMuted: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
* Joins the call with the camera off. The user can turn the camera on
|
|
1226
|
+
* manually afterwards (unless the toggle-video button is hidden).
|
|
1227
|
+
*
|
|
1228
|
+
* @default false
|
|
1229
|
+
*/
|
|
1083
1230
|
startVideoPaused: boolean;
|
|
1231
|
+
/**
|
|
1232
|
+
* Title text shown in the call's header panel (for example, the meeting or
|
|
1233
|
+
* room name).
|
|
1234
|
+
*
|
|
1235
|
+
* @default '' — no title shown
|
|
1236
|
+
*/
|
|
1084
1237
|
title: string;
|
|
1238
|
+
/**
|
|
1239
|
+
* How long, in milliseconds, the local user may remain alone in the call
|
|
1240
|
+
* (no other participants) before an "are you still there?" idle prompt is
|
|
1241
|
+
* shown. The countdown only runs while you are the only participant.
|
|
1242
|
+
*
|
|
1243
|
+
* @default 60000 — 60 seconds
|
|
1244
|
+
*/
|
|
1085
1245
|
idleTimeoutPeriodBeforePrompt: number;
|
|
1246
|
+
/**
|
|
1247
|
+
* How long, in milliseconds, the idle prompt stays on screen waiting for a
|
|
1248
|
+
* response before the SDK automatically leaves the call on the user's behalf.
|
|
1249
|
+
*
|
|
1250
|
+
* @default 180000 — 3 minutes
|
|
1251
|
+
*/
|
|
1086
1252
|
idleTimeoutPeriodAfterPrompt: number;
|
|
1253
|
+
/**
|
|
1254
|
+
* Allows the user to drag the local picture-in-picture tile to reposition
|
|
1255
|
+
* it. Only applies when `layout` is `'SPOTLIGHT'`.
|
|
1256
|
+
*
|
|
1257
|
+
* @default true
|
|
1258
|
+
*/
|
|
1087
1259
|
enableSpotlightDrag: boolean;
|
|
1088
|
-
|
|
1260
|
+
/**
|
|
1261
|
+
* Marks this as a one-to-one (peer) call. In a peer call, when one
|
|
1262
|
+
* participant leaves the session ends for everyone rather than continuing
|
|
1263
|
+
* without them (unless `forceLeave` is passed when leaving). The remote
|
|
1264
|
+
* peer's connectivity is also watched: if no remote stats arrive for 10
|
|
1265
|
+
* seconds onRemoteConnectionLost is published, and
|
|
1266
|
+
* onRemoteConnectionRestored once they resume.
|
|
1267
|
+
*
|
|
1268
|
+
* @default false
|
|
1269
|
+
*/
|
|
1089
1270
|
isPeerCall: boolean;
|
|
1271
|
+
/**
|
|
1272
|
+
* Enables the in-call toast notifications surfaced by the SDK (for example
|
|
1273
|
+
* "X joined the call" or error messages). Set to `false` to suppress all
|
|
1274
|
+
* SDK toasts.
|
|
1275
|
+
*
|
|
1276
|
+
* @default true
|
|
1277
|
+
*/
|
|
1090
1278
|
enableNotifications: boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* @unstable This API may change or be removed in a future release.
|
|
1281
|
+
* When enabled in a voice call (`sessionType: 'VOICE'`), the SDK renders
|
|
1282
|
+
* no visible UI at all — no controls, header, modals, or toast
|
|
1283
|
+
* notifications — while the call connection, media, and events continue
|
|
1284
|
+
* to work normally. Remote participants' audio keeps playing. The host
|
|
1285
|
+
* app is responsible for providing its own UI, including reacting to
|
|
1286
|
+
* session end (the SDK's "session has ended" view and the idle-timeout
|
|
1287
|
+
* prompt/auto-leave are not shown in this mode).
|
|
1288
|
+
*
|
|
1289
|
+
* Only supported in voice calls: for video calls (`sessionType:
|
|
1290
|
+
* 'VIDEO'`) the flag is ignored with a console warning and the default
|
|
1291
|
+
* UI is rendered.
|
|
1292
|
+
*
|
|
1293
|
+
* @default false
|
|
1294
|
+
*/
|
|
1295
|
+
unstable_headlessMode: boolean;
|
|
1091
1296
|
};
|
|
1092
1297
|
|
|
1298
|
+
/**
|
|
1299
|
+
* Configuration that only applies on the web platform.
|
|
1300
|
+
* These options are ignored on mobile.
|
|
1301
|
+
*/
|
|
1093
1302
|
declare type ConfigStateWeb = {
|
|
1303
|
+
/**
|
|
1304
|
+
* Applies background-noise suppression to the local microphone so that
|
|
1305
|
+
* keyboard clicks, fans, and other ambient sounds are filtered out before
|
|
1306
|
+
* your audio is sent to other participants.
|
|
1307
|
+
*
|
|
1308
|
+
* @default false
|
|
1309
|
+
*/
|
|
1094
1310
|
enableNoiseReduction: boolean;
|
|
1311
|
+
/**
|
|
1312
|
+
* The `deviceId` of the microphone to capture audio from when the call
|
|
1313
|
+
* starts. Use this to pre-select a specific input device instead of the
|
|
1314
|
+
* system default. Device IDs come from the browser's
|
|
1315
|
+
* `navigator.mediaDevices.enumerateDevices()`.
|
|
1316
|
+
*
|
|
1317
|
+
* @default undefined — uses the system default microphone
|
|
1318
|
+
*/
|
|
1095
1319
|
audioInputDeviceId?: string;
|
|
1320
|
+
/**
|
|
1321
|
+
* The `deviceId` of the speaker / output device used to play remote
|
|
1322
|
+
* participants' audio. Use this to pre-select a specific output device
|
|
1323
|
+
* instead of the system default.
|
|
1324
|
+
*
|
|
1325
|
+
* @default undefined — uses the system default speaker
|
|
1326
|
+
*/
|
|
1096
1327
|
audioOutputDeviceId?: string;
|
|
1328
|
+
/**
|
|
1329
|
+
* The `deviceId` of the camera to capture video from when the call starts.
|
|
1330
|
+
* Use this to pre-select a specific camera instead of the system default.
|
|
1331
|
+
*
|
|
1332
|
+
* @default undefined — uses the system default camera
|
|
1333
|
+
*/
|
|
1097
1334
|
videoInputDeviceId?: string;
|
|
1335
|
+
/**
|
|
1336
|
+
* Hides the screen-sharing button from the call controls, preventing the
|
|
1337
|
+
* user from starting a screen share from within the SDK UI.
|
|
1338
|
+
*
|
|
1339
|
+
* @default false
|
|
1340
|
+
*/
|
|
1098
1341
|
hideScreenSharingButton: boolean;
|
|
1099
|
-
hideVirtualBackgroundButton: boolean;
|
|
1100
1342
|
/**
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1104
|
-
*
|
|
1105
|
-
*
|
|
1343
|
+
* Hides the virtual-background button from the call controls, preventing the
|
|
1344
|
+
* user from blurring or replacing their camera background from within the
|
|
1345
|
+
* SDK UI.
|
|
1346
|
+
*
|
|
1347
|
+
* @default false
|
|
1106
1348
|
*/
|
|
1107
|
-
|
|
1349
|
+
hideVirtualBackgroundButton: boolean;
|
|
1108
1350
|
};
|
|
1109
1351
|
|
|
1110
1352
|
declare type ConnectionError = {
|
|
@@ -1133,6 +1375,8 @@ declare const EVENT_LISTENER_METHODS: {
|
|
|
1133
1375
|
readonly onSessionLeft: "onSessionLeft";
|
|
1134
1376
|
readonly onConnectionLost: "onConnectionLost";
|
|
1135
1377
|
readonly onConnectionRestored: "onConnectionRestored";
|
|
1378
|
+
readonly onRemoteConnectionLost: "onRemoteConnectionLost";
|
|
1379
|
+
readonly onRemoteConnectionRestored: "onRemoteConnectionRestored";
|
|
1136
1380
|
readonly onConnectionClosed: "onConnectionClosed";
|
|
1137
1381
|
readonly onConnectionFailed: "onConnectionFailed";
|
|
1138
1382
|
readonly onSessionTimedOut: "onSessionTimedOut";
|
|
@@ -1412,6 +1656,13 @@ declare class MainVideoContainerSetting {
|
|
|
1412
1656
|
|
|
1413
1657
|
declare type MobileSDKEvents = SDKEvents & {
|
|
1414
1658
|
onAudioModeChanged: (payload: AudioMode['type']) => void;
|
|
1659
|
+
/**
|
|
1660
|
+
* Fired when the list of available audio modes changes,
|
|
1661
|
+
* e.g. a Bluetooth device or headphones are connected/disconnected.
|
|
1662
|
+
*
|
|
1663
|
+
* @param payload - The updated list of available audio modes.
|
|
1664
|
+
*/
|
|
1665
|
+
onAudioModesChanged: (payload: AudioMode[]) => void;
|
|
1415
1666
|
onCameraFacingChanged: (payload: CameraFacing) => void;
|
|
1416
1667
|
onSwitchCameraButtonClicked: () => void;
|
|
1417
1668
|
onPictureInPictureLayoutEnabled: () => void;
|