@rongcloud/engine 4.4.8-enterprise.2 → 4.4.8-enterprise.4

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,7 +1,7 @@
1
1
  /*
2
- * RCEngine - v4.4.8-enterprise.2
3
- * CommitId - bbd1ce6836028953773821c2b3b9ab8199bc732f
4
- * Thu Dec 30 2021 17:52:45 GMT+0800 (China Standard Time)
2
+ * RCEngine - v4.4.8-enterprise.4
3
+ * CommitId - f7183402bade5fc3cb01a275efb9d2dda56faa71
4
+ * Wed Sep 28 2022 09:39:45 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -1534,7 +1534,11 @@ declare enum ConnectionStatus {
1534
1534
  /**
1535
1535
  * 请求导航超时
1536
1536
  */
1537
- RESPONSE_NAVI_TIMEOUT = 204
1537
+ RESPONSE_NAVI_TIMEOUT = 204,
1538
+ /**
1539
+ * Token 错误。
1540
+ */
1541
+ RC_CONN_USER_OR_PASSWD_ERROR = 31004
1538
1542
  }
1539
1543
 
1540
1544
  interface IAsyncRes<T = any> {
@@ -3252,14 +3256,22 @@ declare class APIContext {
3252
3256
  * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
3253
3257
  * @param token
3254
3258
  * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
3259
+ * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 Electron 环境有效)
3260
+ * 同一个账号在一台新设备上登录的时候,会把这个账号在之前登录的设备上踢出。
3261
+ 由于 SDK 有断线重连功能,存在下面情况。
3262
+ 用户在 A 设备登录,A 设备网络不稳定,没有连接成功,SDK 启动重连机制。
3263
+ 用户此时又在 B 设备登录,B 设备连接成功。
3264
+ A 设备网络稳定之后,用户在 A 设备连接成功,B 设备被踢出。
3265
+ 这个字段就是为这种情况加的。
3266
+ 设置 reconnectKickEnable 为 true 时,SDK 重连的时候发现此时已有别的设备连接成功,不再强行踢出已有设备,而是踢出重连设备。
3255
3267
  */
3256
- connect(token: string, refreshNavi?: boolean): Promise<IConnectResult>;
3268
+ connect(token: string, refreshNavi?: boolean, reconnectKickEnable?: boolean): Promise<IConnectResult>;
3257
3269
  /**
3258
3270
  * 拉取实时配置 web 端需更新 voipCall 字段
3259
3271
  */
3260
3272
  private _pullUserSettings;
3261
3273
  disconnect(): Promise<void>;
3262
- reconnect(): Promise<IConnectResult>;
3274
+ reconnect(reconnectKickEnable?: boolean): Promise<IConnectResult>;
3263
3275
  private _getTokenWithoutNavi;
3264
3276
  /**
3265
3277
  * 获取当前缓存的导航数据
@@ -3838,8 +3850,9 @@ interface IEngine {
3838
3850
  * 建立连接
3839
3851
  * @param token
3840
3852
  * @param naviInfo
3853
+ * @param reconnectKickEnable
3841
3854
  */
3842
- connect(token: string, naviInfo: INaviInfo, versionInfo: string): Promise<ErrorCode>;
3855
+ connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
3843
3856
  /**
3844
3857
  * 上报版本信息
3845
3858
  * @param version
@@ -4374,8 +4387,9 @@ declare abstract class AEngine implements IEngine {
4374
4387
  * 建立连接
4375
4388
  * @param token
4376
4389
  * @param naviInfo
4390
+ * @param reconnectKickEnable
4377
4391
  */
4378
- abstract connect(token: string, naviInfo: INaviInfo): Promise<ErrorCode>;
4392
+ abstract connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
4379
4393
  /**
4380
4394
  * 发送SDK版本
4381
4395
  * @param versionInfo