@realsee/live 0.5.0-alpha.9 → 0.5.2-dev.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.
Files changed (33) hide show
  1. package/dist/live/controller.d.ts +1 -1
  2. package/dist/live/createLive.d.ts +1 -1
  3. package/dist/live/createLiveReact.d.ts +4 -4
  4. package/dist/live/live.d.ts +2 -2
  5. package/dist/realsee-live.cjs.development.js +155 -150
  6. package/dist/realsee-live.cjs.development.js.map +1 -1
  7. package/dist/realsee-live.cjs.production.js +1 -1
  8. package/dist/realsee-live.cjs.production.js.map +1 -1
  9. package/dist/realsee-live.esm.js +156 -151
  10. package/dist/realsee-live.esm.js.map +1 -1
  11. package/dist/realsee-live.umd.development.js +2342 -2228
  12. package/dist/realsee-live.umd.development.js.map +1 -1
  13. package/dist/realsee-live.umd.production.js +1 -1
  14. package/dist/realsee-live.umd.production.js.map +1 -1
  15. package/dist/rtc/BrowserRTC.d.ts +1 -0
  16. package/dist/typings/live/EventType.d.ts +3 -3
  17. package/dist/typings/live/GetVoiceSign.d.ts +1 -1
  18. package/dist/typings/live/LiveConnectOptions.d.ts +1 -1
  19. package/dist/typings/live/LiveMsg.d.ts +3 -3
  20. package/dist/typings/live/RoomInfo.d.ts +1 -1
  21. package/dist/typings/live/UserInfo.d.ts +20 -3
  22. package/dist/typings/live/UserVolume.d.ts +1 -1
  23. package/dist/typings/live/WebSocket.d.ts +1 -1
  24. package/dist/typings/react/RTCActionReactCallback.d.ts +1 -1
  25. package/dist/typings/rtc/eventType.d.ts +1 -1
  26. package/dist/typings/rtc/protocol.d.ts +5 -0
  27. package/dist/utils/RobustWebSocket.d.ts +5 -5
  28. package/dist/utils/subscribe.d.ts +1 -1
  29. package/docs/assets/search.js +1 -1
  30. package/docs/classes/BrowserRTC.html +10 -10
  31. package/docs/interfaces/RTCProtocol.html +12 -10
  32. package/docs/modules.html +12 -6
  33. package/package.json +17 -15
@@ -7,6 +7,7 @@ export declare class BrowserRTC extends CoreRTC {
7
7
  micro: boolean;
8
8
  voiceId: string;
9
9
  private _getVoiceSign;
10
+ checkRequirement: () => Promise<import("trtc-js-sdk").CheckResult>;
10
11
  private $dom;
11
12
  private _trtc;
12
13
  constructor(options: {
@@ -4,7 +4,7 @@ import { UserInfo } from './UserInfo';
4
4
  /**
5
5
  * 带看事件列表
6
6
  */
7
- export declare type LiveEventType<KeyframesSnapshot> = {
7
+ export type LiveEventType<KeyframesSnapshot> = {
8
8
  /**
9
9
  * 带看状态变化
10
10
  * @param state
@@ -65,10 +65,10 @@ export declare type LiveEventType<KeyframesSnapshot> = {
65
65
  /**
66
66
  * 帧数据类型
67
67
  */
68
- export declare type KeyframeTypes<Type> = {
68
+ export type KeyframeTypes<Type> = {
69
69
  [Property in keyof Type as Property]: (nextKeyframes: Type[Property], prevKeyframes: Type[Property], frontRequestId: string) => void;
70
70
  };
71
71
  /**
72
72
  * 事件解析
73
73
  */
74
- export declare type EventType<KeyframesSnapshot> = LiveEventType<KeyframesSnapshot>;
74
+ export type EventType<KeyframesSnapshot> = LiveEventType<KeyframesSnapshot>;
@@ -10,7 +10,7 @@ export interface GetVoiceSignReturnType {
10
10
  /**
11
11
  * 获取用户语音签名
12
12
  */
13
- export declare type GetVoiceSign = ({ voiceId, userId, roomId, }: {
13
+ export type GetVoiceSign = ({ voiceId, userId, roomId, }: {
14
14
  voiceId: string;
15
15
  userId: string;
16
16
  roomId: string | number;
@@ -1,5 +1,5 @@
1
1
  import { MicroStatus } from "./LiveMsg";
2
- export declare type LiveConnectOptions = {
2
+ export type LiveConnectOptions = {
3
3
  url?: string;
4
4
  force?: boolean;
5
5
  getTicket?: () => Promise<string>;
@@ -16,7 +16,7 @@ export declare enum Command {
16
16
  /**
17
17
  * 向服务端请求数据时的数据格式。
18
18
  */
19
- export declare type ReqLiveMsg = {
19
+ export type ReqLiveMsg = {
20
20
  /**
21
21
  * 请求指令。
22
22
  */
@@ -81,7 +81,7 @@ export declare enum BuiltinActionType {
81
81
  /**
82
82
  * 内置事件数据结构体。
83
83
  */
84
- export declare type BuiltinMsg = {
84
+ export type BuiltinMsg = {
85
85
  event_type: BuiltinEventType;
86
86
  action: BuiltinActionType;
87
87
  to_user_ids: string[];
@@ -100,7 +100,7 @@ export declare enum MicroStatus {
100
100
  /**
101
101
  * 响应的信息结构体。
102
102
  */
103
- export declare type LiveMsg = {
103
+ export type LiveMsg = {
104
104
  code: string;
105
105
  message: string;
106
106
  command: Command;
@@ -1,4 +1,4 @@
1
- export declare type RoomInfo = {
1
+ export type RoomInfo = {
2
2
  info: {
3
3
  id: string | number;
4
4
  status: string | number;
@@ -26,7 +26,7 @@ export declare enum MemUserStatus {
26
26
  /**
27
27
  * 用户信息扩展字段:比如提供用户画像相关的数据。
28
28
  */
29
- export declare type UserInfoExt = {
29
+ export type UserInfoExt = {
30
30
  /**
31
31
  * 用户昵称。
32
32
  */
@@ -43,7 +43,7 @@ export declare type UserInfoExt = {
43
43
  /**
44
44
  * 带看会话房间用户的信息格式。
45
45
  */
46
- export declare type UserInfo = {
46
+ export type UserInfo = {
47
47
  /**
48
48
  * 用户唯一标识ID。
49
49
  */
@@ -79,9 +79,26 @@ export declare type UserInfo = {
79
79
  /**
80
80
  * 当前用户的权限配置。(UI层面理解)。
81
81
  */
82
- permission?: Record<string, boolean>;
82
+ permission?: Partial<Permission>;
83
83
  /**
84
84
  * 用户信息扩展字段。
85
85
  */
86
86
  extension?: UserInfoExt;
87
87
  };
88
+ interface Permission {
89
+ more_vr_scene: boolean;
90
+ invite_other: boolean;
91
+ control_own_micro: boolean;
92
+ control_other_micro: boolean;
93
+ view_own_micro_status: boolean;
94
+ view_other_micro_status: boolean;
95
+ close_live_room: boolean;
96
+ apply_other_phone: boolean;
97
+ dynamic_enter: boolean;
98
+ sync_frame: boolean;
99
+ transfer_role: boolean;
100
+ change_other_status: boolean;
101
+ control_other_sync: boolean;
102
+ extension: Record<string, boolean>;
103
+ }
104
+ export {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 用户的音量信息。
3
3
  */
4
- export declare type UserVolume = {
4
+ export type UserVolume = {
5
5
  userId: string;
6
6
  audioVolume: number;
7
7
  };
@@ -23,7 +23,7 @@ export declare enum WebSocketState {
23
23
  */
24
24
  CLOSED = 3
25
25
  }
26
- export declare type WebSocketError = {
26
+ export type WebSocketError = {
27
27
  type: WebSocketErrorType;
28
28
  closeError?: WebSocketCloseError;
29
29
  target?: Event | CloseEvent;
@@ -1,2 +1,2 @@
1
1
  import { RTCProtocol } from '../rtc/protocol';
2
- export declare type RTCActionReactCallback = Pick<RTCProtocol, 'join' | 'quit' | 'shock' | 'toggleMicro' | 'detectMicro'>;
2
+ export type RTCActionReactCallback = Pick<RTCProtocol, 'join' | 'quit' | 'shock' | 'toggleMicro' | 'detectMicro'>;
@@ -3,7 +3,7 @@ import { RTCJoinedInfo } from './joinedInfo';
3
3
  /**
4
4
  * RTC 异步事件类型。
5
5
  */
6
- export declare type RTCEventType = {
6
+ export type RTCEventType = {
7
7
  /**
8
8
  * 错误\异常
9
9
  * @param error
@@ -1,3 +1,4 @@
1
+ import { CheckResult } from 'trtc-js-sdk';
1
2
  import { Subscribe } from '../../utils/subscribe';
2
3
  import { RTCEventType } from './eventType';
3
4
  import { RTCType } from './type';
@@ -21,6 +22,10 @@ export interface RTCProtocol extends Subscribe<RTCEventType> {
21
22
  * rtc 实现类型
22
23
  */
23
24
  type: RTCType;
25
+ /**
26
+ * 检查rtc的系统依赖是否满足
27
+ */
28
+ checkRequirement?(): Promise<CheckResult>;
24
29
  /**
25
30
  * 加入房间。
26
31
  * @param voiceId (又称呼`roomId`),当前语音房间Id。
@@ -2,7 +2,7 @@ import { Subscribe } from './subscribe';
2
2
  /**
3
3
  * 鲁棒ws的配置参数
4
4
  */
5
- export declare type RobustWebSocketConstructorOptions = {
5
+ export type RobustWebSocketConstructorOptions = {
6
6
  url: string | ((ws: RobustWebSocket) => string);
7
7
  protocols?: string[];
8
8
  robustOptions?: RobustOptions;
@@ -10,21 +10,21 @@ export declare type RobustWebSocketConstructorOptions = {
10
10
  /**
11
11
  * ws 鲁棒性的配置
12
12
  */
13
- export declare type RobustOptions = {
13
+ export type RobustOptions = {
14
14
  timeout?: number;
15
15
  shouldReconnect?: (event: CloseEvent, ws: RobustWebSocket) => undefined | number;
16
16
  should1000Reconnect?: boolean;
17
17
  ignoreConnectivityEvents?: boolean;
18
18
  automaticOpen?: boolean;
19
19
  };
20
- export declare type RobustWebSocketEventDetail = {
20
+ export type RobustWebSocketEventDetail = {
21
21
  reconnects: number;
22
22
  attempts: number;
23
23
  };
24
- export declare type RobustWebSocketEvent<T> = Event & {
24
+ export type RobustWebSocketEvent<T> = Event & {
25
25
  detail: T;
26
26
  };
27
- export declare type RobustWebSocketEventMap = {
27
+ export type RobustWebSocketEventMap = {
28
28
  connecting: (event: RobustWebSocketEvent<RobustWebSocketEventDetail>) => void;
29
29
  timeout: (event: RobustWebSocketEvent<RobustWebSocketEventDetail>) => void;
30
30
  open: (event: RobustWebSocketEvent<RobustWebSocketEventDetail>) => void;
@@ -1,4 +1,4 @@
1
- export declare type EventMap = {
1
+ export type EventMap = {
2
2
  [name: string]: (...args: any[]) => void | boolean;
3
3
  };
4
4
  /**