@tencentcloud/tuiroom-engine-electron 1.0.0 → 1.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/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import TIM from "tim-js-sdk";
2
2
  import TRTCCloud, { TRTCDeviceInfo, TRTCScreenCaptureSourceInfo } from 'trtc-electron-sdk';
3
3
  import { TUIRoomInfo, TUIVideoStreamType, TUIVideoProfile, TUIAudioProfile, TUIRole, TUIRoomEvents, TUIRoomType, TUISeatInfo, TUIRequestCallback } from './types';
4
4
  export * from './types';
5
- export { TRTCDeviceType, TRTCDeviceState, TRTCDeviceInfo, TRTCVideoMirrorType, TRTCVideoRotation, TRTCVideoFillMode, TRTCVideoStreamType, TRTCScreenCaptureSourceType, TRTCScreenCaptureSourceInfo, Rect, TRTCVideoEncParam, TRTCVideoResolution, TRTCVideoResolutionMode, TRTCScreenCaptureProperty } from 'trtc-electron-sdk';
5
+ export { TRTCDeviceType, TRTCDeviceState, TRTCDeviceInfo, TRTCVideoMirrorType, TRTCVideoRotation, TRTCVideoFillMode, TRTCVideoStreamType, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureSourceType, Rect, TRTCVideoEncParam, TRTCVideoResolution, TRTCVideoResolutionMode, TRTCScreenCaptureProperty } from 'trtc-electron-sdk';
6
6
  /**
7
7
  * TUIRoomEngine 提供了音视频房间的能力
8
8
  *
@@ -33,7 +33,7 @@ declare class TUIRoomEngine {
33
33
  */
34
34
  private JSCallNativeFunctionPromise;
35
35
  /**
36
- * 初始化 TUIRoomEngine
36
+ * 登录 TUIRoomEngine
37
37
  *
38
38
  * @param {object} options
39
39
  * @param {number} options.sdkAppId sdkAppId <br>
@@ -45,14 +45,14 @@ declare class TUIRoomEngine {
45
45
  * @returns {Promise<void>}
46
46
  *
47
47
  * @example
48
- * // 初始化 TUIRoomEngine
49
- * await TUIRoomEngine.init({
48
+ * // 登录 TUIRoomEngine
49
+ * await TUIRoomEngine.login({
50
50
  * sdkAppId: 0, // 填写您申请的 sdkAppId
51
51
  * userId: '', // 填写您业务对应的 userId
52
52
  * userSig: '', // 填写服务器或本地计算的 userSig
53
53
  * })
54
54
  */
55
- static init(options: {
55
+ static login(options: {
56
56
  sdkAppId: number;
57
57
  userId: string;
58
58
  userSig: string;
@@ -77,6 +77,13 @@ declare class TUIRoomEngine {
77
77
  userName: string;
78
78
  avatarUrl: string;
79
79
  }): Promise<void>;
80
+ /**
81
+ * 登出 TUIRoomEngine, 登出 TUIRoomEngine 时将销毁所有 roomEngine 实例
82
+ *
83
+ * @example
84
+ * await TUIRoomEngine.logout();
85
+ */
86
+ static logout(): Promise<void>;
80
87
  /**
81
88
  * 主持人创建房间,调用 createRoom 的用户为房间的所有者。创建房间时可设置房间 Id, 房间名称,以及房间是否允许加入用户开启音视频,发送消息等功能。
82
89
  *
@@ -285,7 +292,7 @@ declare class TUIRoomEngine {
285
292
  seatIndex: number;
286
293
  timeout: number;
287
294
  requestCallback?: (callbackInfo: TUIRequestCallback) => void;
288
- }): Promise<number>;
295
+ }): Promise<string>;
289
296
  /**
290
297
  * 离开麦位
291
298
  * @returns {Promise<void>}
@@ -346,7 +353,7 @@ declare class TUIRoomEngine {
346
353
  userId: string;
347
354
  timeout: number;
348
355
  requestCallback?: (callbackInfo: TUIRequestCallback) => void;
349
- }): Promise<number>;
356
+ }): Promise<string>;
350
357
  /**
351
358
  * 关闭远端用户摄像头
352
359
  *
@@ -405,7 +412,7 @@ declare class TUIRoomEngine {
405
412
  userId: string;
406
413
  timeout: number;
407
414
  requestCallback?: (callbackInfo: TUIRequestCallback) => void;
408
- }): Promise<number>;
415
+ }): Promise<string>;
409
416
  /**
410
417
  * 关闭远端用户麦克风
411
418
  *
@@ -482,7 +489,7 @@ declare class TUIRoomEngine {
482
489
  userId: string;
483
490
  timeout: number;
484
491
  requestCallback?: (callbackInfo: TUIRequestCallback) => void;
485
- }): Promise<number>;
492
+ }): Promise<string>;
486
493
  /**
487
494
  * 要求其他人下麦
488
495
  * @param {object} options 要求其他人下麦的参数
@@ -504,22 +511,22 @@ declare class TUIRoomEngine {
504
511
  /**
505
512
  * 取消已经发出的请求
506
513
  * @param {object} options 取消已经发出请求的参数
507
- * @param {number} options.requestId 请求 Id
514
+ * @param {string} options.requestId 请求 Id
508
515
  * @returns {Promise<void>}
509
516
  *
510
517
  * @example
511
518
  * const roomEngine = new TUIRoomEngine();
512
519
  * await roomEngine.cancelRequest({
513
- * requestId: 0, // 请使用实际 requestId
520
+ * requestId: '', // 请使用实际 requestId
514
521
  * });
515
522
  */
516
523
  cancelRequest(options: {
517
- requestId: number;
524
+ requestId: string;
518
525
  }): Promise<void>;
519
526
  /**
520
527
  * 回复远端用户的请求
521
528
  * @param {object} options 回复远端用户的请求的参数
522
- * @param {number} options.requestId 请求 Id
529
+ * @param {string} options.requestId 请求 Id
523
530
  * @param {boolean} options.agree 是否同意
524
531
  * @returns {Promise<void>}
525
532
  *
@@ -528,18 +535,18 @@ declare class TUIRoomEngine {
528
535
  *
529
536
  * // 同意远端的请求
530
537
  * await roomEngine.responseRemoteRequest({
531
- * requestId: 0, // 请使用实际 requestId
538
+ * requestId: '', // 请使用实际 requestId
532
539
  * agree: true,
533
540
  * });
534
541
  *
535
542
  * // 拒绝远端的请求
536
543
  * await roomEngine.responseRemoteRequest({
537
- * requestId: 0, // 请使用实际 requestId
544
+ * requestId: '', // 请使用实际 requestId
538
545
  * agree: false,
539
546
  * });
540
547
  */
541
548
  responseRemoteRequest(options: {
542
- requestId: number;
549
+ requestId: string;
543
550
  agree: boolean;
544
551
  }): Promise<any>;
545
552
  /**