@cometchat/calls-sdk-javascript 5.0.0-beta.1 → 5.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.
package/dist/index.d.ts CHANGED
@@ -1,13 +1,17 @@
1
- import { AudioInputDevice } from '../../../calls-sdk-core';
2
- import { AudioOutputDevice } from '../../../calls-sdk-core';
3
1
  import * as v from 'valibot';
4
- import { VideoInputDevice } from '../../../calls-sdk-core';
5
2
 
6
3
  declare interface AnyProperties {
7
4
  [prop: string]: any;
8
5
  }
9
6
 
10
- declare type AudioInputDevice_2 = MediaDeviceInfo & {
7
+ export declare type APIErrorResponse = {
8
+ message: string;
9
+ devMessage: string;
10
+ source: string;
11
+ code: string;
12
+ };
13
+
14
+ export declare type AudioInputDevice = MediaDeviceInfo & {
11
15
  kind: Extract<MediaDeviceKind, 'audioinput'>;
12
16
  };
13
17
 
@@ -19,7 +23,7 @@ declare type AudioMode = {
19
23
 
20
24
  declare type AudioModeType = 'BLUETOOTH' | 'EARPIECE' | 'HEADPHONES' | 'SPEAKER';
21
25
 
22
- declare type AudioOutputDevice_2 = MediaDeviceInfo & {
26
+ export declare type AudioOutputDevice = MediaDeviceInfo & {
23
27
  kind: Extract<MediaDeviceKind, 'audiooutput'>;
24
28
  };
25
29
 
@@ -877,6 +881,14 @@ declare class CallSettingsBuilder {
877
881
  * @returns
878
882
  */
879
883
  setVirtualBackground(virtualBackground: VirtualBackground): this;
884
+ /**
885
+ *
886
+ * @param {MainVideoContainerSetting} mainVideoContainerSetting
887
+ * This method can be used to customize the main video container.
888
+ * @deprecated This method is deprecated and not supported.
889
+ * @returns
890
+ */
891
+ setMainVideoContainerSetting(_mainVideoContainerSetting: MainVideoContainerSetting): this;
880
892
  /**
881
893
  *
882
894
  * @param {boolean} showVirtualBackgroundSetting
@@ -952,6 +964,10 @@ export declare class CometChatCalls extends SessionMethods {
952
964
  };
953
965
  static CallLogRequestBuilder: typeof CallLogRequestBuilder;
954
966
  static CallLog: typeof CallLog;
967
+ /** @deprecated */
968
+ static MainVideoContainerSetting: typeof MainVideoContainerSetting;
969
+ /** @deprecated */
970
+ static CallSettings: typeof CallSettings;
955
971
  /**
956
972
  * @deprecated Use CometChatCalls.init passing object directly.
957
973
  */
@@ -1010,13 +1026,13 @@ export declare class CometChatCalls extends SessionMethods {
1010
1026
  static startSession(callToken: string, callSettings: CallSettings, container: HTMLElement): Promise<Result<void, VerifyTokenException>>;
1011
1027
  private static _connectToRoom;
1012
1028
  private static connectToRoom;
1013
- static joinSession(callToken: string, callSettings: SessionSettings, container: HTMLElement): Promise<Result<void, VerifyTokenException>>;
1014
- static getAudioInputDevices(): AudioInputDevice_2[];
1015
- static getVideoInputDevices(): VideoInputDevice_2[];
1016
- static getAudioOutputDevices(): AudioOutputDevice_2[];
1017
- static getCurrentAudioInputDevice(): AudioInputDevice_2 | undefined;
1018
- static getCurrentVideoInputDevice(): VideoInputDevice_2 | undefined;
1019
- static getCurrentAudioOutputDevice(): AudioOutputDevice_2 | undefined;
1029
+ static joinSession(callToken: string, sessionSettings: SessionSettings, container: HTMLElement): Promise<Result<void, VerifyTokenException>>;
1030
+ static getAudioInputDevices(): AudioInputDevice[];
1031
+ static getVideoInputDevices(): VideoInputDevice[];
1032
+ static getAudioOutputDevices(): AudioOutputDevice[];
1033
+ static getCurrentAudioInputDevice(): AudioInputDevice | undefined;
1034
+ static getCurrentVideoInputDevice(): VideoInputDevice | undefined;
1035
+ static getCurrentAudioOutputDevice(): AudioOutputDevice | undefined;
1020
1036
  }
1021
1037
 
1022
1038
  declare namespace CometChatCallsDefault {
@@ -1057,7 +1073,6 @@ declare type ConfigStateBoth = {
1057
1073
  hideToggleVideoButton: boolean;
1058
1074
  hideParticipantListButton: boolean;
1059
1075
  hideChatButton: boolean;
1060
- hideScreenSharingButton: boolean;
1061
1076
  hideSessionTimer: boolean;
1062
1077
  hideNetworkIndicator: boolean;
1063
1078
  hideRecordingStatusIndicator: boolean;
@@ -1072,6 +1087,7 @@ declare type ConfigStateBoth = {
1072
1087
  enableSpotlightDrag: boolean;
1073
1088
  enableSpotlightSwap: boolean;
1074
1089
  isPeerCall: boolean;
1090
+ enableNotifications: boolean;
1075
1091
  };
1076
1092
 
1077
1093
  declare type ConfigStateWeb = {
@@ -1079,7 +1095,16 @@ declare type ConfigStateWeb = {
1079
1095
  audioInputDeviceId?: string;
1080
1096
  audioOutputDeviceId?: string;
1081
1097
  videoInputDeviceId?: string;
1098
+ hideScreenSharingButton: boolean;
1082
1099
  hideVirtualBackgroundButton: boolean;
1100
+ /**
1101
+ * @unstable This API may change or be removed in a future release.
1102
+ * When enabled, the SDK renders only remote audio elements without any
1103
+ * visual UI (no video tiles, controls, or overlays). This allows the
1104
+ * host app to provide its own custom UI while the SDK handles the
1105
+ * underlying call connection and audio playback.
1106
+ */
1107
+ unstable_renderAudioOnly: boolean;
1083
1108
  };
1084
1109
 
1085
1110
  /**
@@ -1338,6 +1363,45 @@ declare interface LoginListener {
1338
1363
  onLogoutFailure?: (error: CometChatException) => void;
1339
1364
  }
1340
1365
 
1366
+ declare class MainVideoContainerSetting {
1367
+ /**
1368
+ *
1369
+ * @param {string} mainVideoAspectRatio
1370
+ * This method is used to set the aspect ratio of main video.
1371
+ * The default value is `contain`
1372
+ * @returns
1373
+ */
1374
+ setMainVideoAspectRatio(_mainVideoAspectRatio: (typeof CallSettings.ASPECT_RATIO)[keyof typeof CallSettings.ASPECT_RATIO]): void;
1375
+ /**
1376
+ *
1377
+ * @param {string} position
1378
+ * @param {boolean} visibility
1379
+ * This method is used to set the position & visibility parameter of the full screen button.
1380
+ * By default the full screen button is visible in the `bottom-right` position.
1381
+ * @returns
1382
+ */
1383
+ setFullScreenButtonParams(_position: (typeof CallSettings.POSITION)[keyof typeof CallSettings.POSITION], _visibility: boolean): void;
1384
+ /**
1385
+ *
1386
+ * @param {string} position
1387
+ * @param {boolean} visibility
1388
+ * @param {string} backgroundColor
1389
+ * This method is used to set the position, visibility & background color of the name label.
1390
+ * By default the name label is visible in the `bottom-left` position with a background-color `rgba(27, 27, 27, 0.4)`
1391
+ * @returns
1392
+ */
1393
+ setNameLabelParams(_position: (typeof CallSettings.POSITION)[keyof typeof CallSettings.POSITION], _visibility: boolean, _backgroundColor: string): void;
1394
+ /**
1395
+ *
1396
+ * @param {string} position
1397
+ * @param {boolean} visibility
1398
+ * This method is used to set the position, visibility of the network label.
1399
+ * By default the network label is visible in the `bottom-right` position.
1400
+ * @returns
1401
+ */
1402
+ setNetworkLabelParams(_position: (typeof CallSettings.POSITION)[keyof typeof CallSettings.POSITION], _visibility: boolean): void;
1403
+ }
1404
+
1341
1405
  declare type MobileSDKEvents = SDKEvents & {
1342
1406
  onAudioModeChanged: (payload: AudioMode['type']) => void;
1343
1407
  onCameraFacingChanged: (payload: CameraFacing) => void;
@@ -1697,7 +1761,7 @@ declare class Recording {
1697
1761
 
1698
1762
  declare type Region = _TRegion | Omit<string, _TRegion>;
1699
1763
 
1700
- declare type Result<T, E = Error> = {
1764
+ export declare type Result<T, E = Error> = {
1701
1765
  data: T;
1702
1766
  error: null;
1703
1767
  } | {
@@ -1734,8 +1798,6 @@ declare class SessionMethods extends SessionMethodsCore {
1734
1798
  static hideSettingsDialog(): void;
1735
1799
  static showVirtualBackgroundDialog(): void;
1736
1800
  static hideVirtualBackgroundDialog(): void;
1737
- static enablePictureInPictureLayout(): void;
1738
- static disablePictureInPictureLayout(): void;
1739
1801
  static getAudioInputDevices(): AudioInputDevice[];
1740
1802
  static getAudioOutputDevices(): AudioOutputDevice[];
1741
1803
  static getVideoInputDevices(): VideoInputDevice[];
@@ -1784,6 +1846,11 @@ declare class SessionMethodsCore {
1784
1846
  * Unmutes the local user's audio during the call.
1785
1847
  */
1786
1848
  static unmuteAudio(): void;
1849
+ /**
1850
+ * Toggles the local user's audio mute state.
1851
+ * If audio is muted, it will be unmuted, and vice versa.
1852
+ */
1853
+ static toggleAudio(): void;
1787
1854
  /**
1788
1855
  * Pauses the local user's video stream.
1789
1856
  */
@@ -1792,10 +1859,20 @@ declare class SessionMethodsCore {
1792
1859
  * Resumes the local user's video stream.
1793
1860
  */
1794
1861
  static resumeVideo(): void;
1862
+ /**
1863
+ * Toggles the local user's video stream.
1864
+ * If video is paused, it will be resumed, and vice versa.
1865
+ */
1866
+ static toggleVideo(): void;
1795
1867
  /**
1796
1868
  * Local user leaves the current session.
1797
1869
  */
1798
1870
  static leaveSession(): void;
1871
+ /**
1872
+ * Ends the current session for all participants.
1873
+ * This will terminate the conference and disconnect everyone.
1874
+ */
1875
+ static endSessionForAll(): void;
1799
1876
  /**
1800
1877
  * Raises the user's virtual hand in the call.
1801
1878
  */
@@ -1804,6 +1881,11 @@ declare class SessionMethodsCore {
1804
1881
  * Lowers the user's virtual hand in the call.
1805
1882
  */
1806
1883
  static lowerHand(): void;
1884
+ /**
1885
+ * Toggles the user's virtual hand state.
1886
+ * If the hand is raised, it will be lowered, and vice versa.
1887
+ */
1888
+ static toggleHand(): void;
1807
1889
  /**
1808
1890
  * Switches between the front and rear camera.
1809
1891
  */
@@ -1821,6 +1903,11 @@ declare class SessionMethodsCore {
1821
1903
  * Stops the ongoing call recording.
1822
1904
  */
1823
1905
  static stopRecording(): void;
1906
+ /**
1907
+ * Toggles the call recording state.
1908
+ * If recording is active, it will be stopped, and vice versa.
1909
+ */
1910
+ static toggleRecording(): void;
1824
1911
  /**
1825
1912
  * Pins a participant's video to focus on them.
1826
1913
  * @param participantId - The ID of the participant to pin.
@@ -1846,6 +1933,18 @@ declare class SessionMethodsCore {
1846
1933
  * @param count - The number of unread messages.
1847
1934
  */
1848
1935
  static setChatButtonUnreadCount(count: number): void;
1936
+ /**
1937
+ * Toggles the visibility of the participant list panel.
1938
+ */
1939
+ static toggleParticipantList(): void;
1940
+ /**
1941
+ * Shows the participant list panel.
1942
+ */
1943
+ static showParticipantList(): void;
1944
+ /**
1945
+ * Hides the participant list panel.
1946
+ */
1947
+ static hideParticipantList(): void;
1849
1948
  /**
1850
1949
  * @deprecated switchToVideoCall is deprecated and not supported.
1851
1950
  */
@@ -1915,7 +2014,7 @@ declare interface VerifyTokenException extends Error {
1915
2014
  details?: unknown;
1916
2015
  }
1917
2016
 
1918
- declare type VideoInputDevice_2 = MediaDeviceInfo & {
2017
+ export declare type VideoInputDevice = MediaDeviceInfo & {
1919
2018
  kind: Extract<MediaDeviceKind, 'videoinput'>;
1920
2019
  };
1921
2020