@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.
- package/dist/live/controller.d.ts +1 -1
- package/dist/live/createLive.d.ts +1 -1
- package/dist/live/createLiveReact.d.ts +4 -4
- package/dist/live/live.d.ts +2 -2
- package/dist/realsee-live.cjs.development.js +155 -150
- package/dist/realsee-live.cjs.development.js.map +1 -1
- package/dist/realsee-live.cjs.production.js +1 -1
- package/dist/realsee-live.cjs.production.js.map +1 -1
- package/dist/realsee-live.esm.js +156 -151
- package/dist/realsee-live.esm.js.map +1 -1
- package/dist/realsee-live.umd.development.js +2342 -2228
- package/dist/realsee-live.umd.development.js.map +1 -1
- package/dist/realsee-live.umd.production.js +1 -1
- package/dist/realsee-live.umd.production.js.map +1 -1
- package/dist/rtc/BrowserRTC.d.ts +1 -0
- package/dist/typings/live/EventType.d.ts +3 -3
- package/dist/typings/live/GetVoiceSign.d.ts +1 -1
- package/dist/typings/live/LiveConnectOptions.d.ts +1 -1
- package/dist/typings/live/LiveMsg.d.ts +3 -3
- package/dist/typings/live/RoomInfo.d.ts +1 -1
- package/dist/typings/live/UserInfo.d.ts +20 -3
- package/dist/typings/live/UserVolume.d.ts +1 -1
- package/dist/typings/live/WebSocket.d.ts +1 -1
- package/dist/typings/react/RTCActionReactCallback.d.ts +1 -1
- package/dist/typings/rtc/eventType.d.ts +1 -1
- package/dist/typings/rtc/protocol.d.ts +5 -0
- package/dist/utils/RobustWebSocket.d.ts +5 -5
- package/dist/utils/subscribe.d.ts +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/BrowserRTC.html +10 -10
- package/docs/interfaces/RTCProtocol.html +12 -10
- package/docs/modules.html +12 -6
- package/package.json +17 -15
package/dist/rtc/BrowserRTC.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { UserInfo } from './UserInfo';
|
|
|
4
4
|
/**
|
|
5
5
|
* 带看事件列表
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
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
|
|
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
|
|
74
|
+
export type EventType<KeyframesSnapshot> = LiveEventType<KeyframesSnapshot>;
|
|
@@ -10,7 +10,7 @@ export interface GetVoiceSignReturnType {
|
|
|
10
10
|
/**
|
|
11
11
|
* 获取用户语音签名
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type GetVoiceSign = ({ voiceId, userId, roomId, }: {
|
|
14
14
|
voiceId: string;
|
|
15
15
|
userId: string;
|
|
16
16
|
roomId: string | number;
|
|
@@ -16,7 +16,7 @@ export declare enum Command {
|
|
|
16
16
|
/**
|
|
17
17
|
* 向服务端请求数据时的数据格式。
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
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
|
|
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
|
|
103
|
+
export type LiveMsg = {
|
|
104
104
|
code: string;
|
|
105
105
|
message: string;
|
|
106
106
|
command: Command;
|
|
@@ -26,7 +26,7 @@ export declare enum MemUserStatus {
|
|
|
26
26
|
/**
|
|
27
27
|
* 用户信息扩展字段:比如提供用户画像相关的数据。
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
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
|
|
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?:
|
|
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,2 +1,2 @@
|
|
|
1
1
|
import { RTCProtocol } from '../rtc/protocol';
|
|
2
|
-
export
|
|
2
|
+
export type RTCActionReactCallback = Pick<RTCProtocol, 'join' | 'quit' | 'shock' | 'toggleMicro' | 'detectMicro'>;
|
|
@@ -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
|
|
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
|
|
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
|
|
20
|
+
export type RobustWebSocketEventDetail = {
|
|
21
21
|
reconnects: number;
|
|
22
22
|
attempts: number;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type RobustWebSocketEvent<T> = Event & {
|
|
25
25
|
detail: T;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
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;
|