@realsee/live 0.3.0-alpha.4 → 0.4.0-alpha.1

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 (147) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/live/controller.d.ts +43 -0
  3. package/{lib → dist/live}/createLive.d.ts +6 -6
  4. package/dist/live/createLiveReact.d.ts +6 -0
  5. package/dist/realsee-live.cjs.development.js +52517 -0
  6. package/dist/realsee-live.cjs.development.js.map +1 -0
  7. package/dist/realsee-live.cjs.js +7 -0
  8. package/dist/realsee-live.cjs.production.js +2 -0
  9. package/dist/realsee-live.cjs.production.js.map +1 -0
  10. package/dist/realsee-live.esm.js +52506 -0
  11. package/dist/realsee-live.esm.js.map +1 -0
  12. package/dist/realsee-live.umd.development.js +52454 -0
  13. package/dist/realsee-live.umd.development.js.map +1 -0
  14. package/dist/realsee-live.umd.production.js +2 -0
  15. package/dist/realsee-live.umd.production.js.map +1 -0
  16. package/{lib/RTC → dist/rtc}/BrowserRTC.d.ts +29 -30
  17. package/{lib/RTC → dist/rtc}/BrowserRTC4Chime.d.ts +55 -53
  18. package/dist/rtc/CoreRTC.d.ts +23 -0
  19. package/{lib/RTC → dist/rtc}/VRWebViewRTC.d.ts +22 -23
  20. package/dist/rtc/index.d.ts +5 -0
  21. package/{lib/typings/Chime → dist/typings/chime}/AttendeeResponse.d.ts +5 -5
  22. package/{lib/typings/Chime → dist/typings/chime}/MeetingResponse.d.ts +12 -12
  23. package/{lib/typings/Chime → dist/typings/chime}/MeetingSessionConfigurationOptions.d.ts +16 -16
  24. package/dist/typings/chime/index.d.ts +3 -0
  25. package/dist/typings/index.d.ts +4 -0
  26. package/{lib/typings → dist/typings/live}/EventType.d.ts +90 -89
  27. package/{lib/typings → dist/typings/live}/GetVoiceSign.d.ts +17 -11
  28. package/{lib/typings → dist/typings/live}/Live.d.ts +123 -122
  29. package/{lib/typings → dist/typings/live}/LiveMsg.d.ts +119 -119
  30. package/{lib/typings → dist/typings/live}/LiveOptions.d.ts +65 -46
  31. package/{lib/typings → dist/typings/live}/RoomInfo.d.ts +13 -13
  32. package/{lib/typings → dist/typings/live}/UserInfo.d.ts +87 -87
  33. package/dist/typings/live/UserVolume.d.ts +7 -0
  34. package/{lib/typings → dist/typings/live}/WebSocket.d.ts +78 -78
  35. package/dist/typings/live/index.d.ts +9 -0
  36. package/{lib/createLiveReact.d.ts → dist/typings/react/LiveReact.d.ts} +162 -160
  37. package/dist/typings/react/RTCActionReactCallback.d.ts +2 -0
  38. package/dist/typings/react/index.d.ts +2 -0
  39. package/dist/typings/rtc/VRWebViewRTCOptions.d.ts +6 -0
  40. package/{lib/typings/RTCEventType.d.ts → dist/typings/rtc/eventType.d.ts} +29 -35
  41. package/dist/typings/rtc/index.d.ts +5 -0
  42. package/{lib/typings/RTCJoinedInfo.d.ts → dist/typings/rtc/joinedInfo.d.ts} +34 -28
  43. package/{lib/typings/RTCProtocol.d.ts → dist/typings/rtc/protocol.d.ts} +53 -42
  44. package/dist/typings/rtc/type.d.ts +8 -0
  45. package/{lib/shared-utils → dist/utils}/appendUri.d.ts +1 -1
  46. package/dist/utils/clientDetector.d.ts +4 -0
  47. package/{lib/shared-utils → dist/utils}/equal.d.ts +10 -11
  48. package/{lib/shared-utils/Subscribe.d.ts → dist/utils/subscribe.d.ts} +75 -76
  49. package/{lib/shared-utils → dist/utils}/uuid.d.ts +4 -4
  50. package/package.json +20 -34
  51. package/docs/.nojekyll +0 -1
  52. package/docs/assets/custom.css +0 -43
  53. package/docs/assets/highlight.css +0 -127
  54. package/docs/assets/icons.css +0 -1043
  55. package/docs/assets/icons.png +0 -0
  56. package/docs/assets/icons@2x.png +0 -0
  57. package/docs/assets/main.js +0 -52
  58. package/docs/assets/search.js +0 -1
  59. package/docs/assets/style.css +0 -1413
  60. package/docs/assets/widgets.png +0 -0
  61. package/docs/assets/widgets@2x.png +0 -0
  62. package/docs/classes/RTCProtocol.BrowserRTC.html +0 -60
  63. package/docs/classes/RTCProtocol.BrowserRTC4Chime.html +0 -66
  64. package/docs/classes/RTCProtocol.RTCExample.html +0 -62
  65. package/docs/classes/RTCProtocol.VRWebViewRTC.html +0 -60
  66. package/docs/classes/shared_utils.Subscribe.html +0 -56
  67. package/docs/enums/RTCProtocol.RTCJoinedInfoCodeEnum.html +0 -9
  68. package/docs/enums/RTCProtocol.RTCType.html +0 -1
  69. package/docs/enums/live.BuiltinActionType.html +0 -15
  70. package/docs/enums/live.BuiltinEventType.html +0 -7
  71. package/docs/enums/live.Command.html +0 -7
  72. package/docs/enums/live.MemUserStatus.html +0 -1
  73. package/docs/enums/live.MicroStatus.html +0 -3
  74. package/docs/enums/live.UserStatus.html +0 -9
  75. package/docs/enums/live.WebSocketCloseError.html +0 -19
  76. package/docs/enums/live.WebSocketErrorType.html +0 -1
  77. package/docs/enums/live.WebSocketState.html +0 -13
  78. package/docs/index.html +0 -382
  79. package/docs/interfaces/RTCProtocol.GetVoiceSignReturnType.html +0 -1
  80. package/docs/interfaces/RTCProtocol.RTCJoinedInfo.html +0 -1
  81. package/docs/interfaces/RTCProtocol.RTCProtocol-1.html +0 -60
  82. package/docs/interfaces/RTCProtocol.VRWebViewRTCOptions.html +0 -1
  83. package/docs/interfaces/live.Live.html +0 -119
  84. package/docs/interfaces/live.LiveOptions.html +0 -22
  85. package/docs/interfaces/live.LiveReact.html +0 -52
  86. package/docs/modules/RTCProtocol.html +0 -17
  87. package/docs/modules/live.html +0 -103
  88. package/docs/modules/shared_utils.html +0 -10
  89. package/docs/modules.html +0 -1
  90. package/lib/RTC/BrowserRTC.js +0 -169
  91. package/lib/RTC/BrowserRTC.js.map +0 -1
  92. package/lib/RTC/BrowserRTC4Chime.js +0 -299
  93. package/lib/RTC/BrowserRTC4Chime.js.map +0 -1
  94. package/lib/RTC/VRWebViewRTC.js +0 -125
  95. package/lib/RTC/VRWebViewRTC.js.map +0 -1
  96. package/lib/RTC/index.d.ts +0 -22
  97. package/lib/RTC/index.js +0 -50
  98. package/lib/RTC/index.js.map +0 -1
  99. package/lib/createLive.js +0 -590
  100. package/lib/createLive.js.map +0 -1
  101. package/lib/createLiveReact.js +0 -212
  102. package/lib/createLiveReact.js.map +0 -1
  103. package/lib/index.d.ts +0 -2
  104. package/lib/index.js +0 -8
  105. package/lib/index.js.map +0 -1
  106. package/lib/shared-utils/Subscribe.js +0 -134
  107. package/lib/shared-utils/Subscribe.js.map +0 -1
  108. package/lib/shared-utils/appendUri.js +0 -13
  109. package/lib/shared-utils/appendUri.js.map +0 -1
  110. package/lib/shared-utils/equal.js +0 -92
  111. package/lib/shared-utils/equal.js.map +0 -1
  112. package/lib/shared-utils/uuid.js +0 -17
  113. package/lib/shared-utils/uuid.js.map +0 -1
  114. package/lib/typings/Chime/AttendeeResponse.js +0 -3
  115. package/lib/typings/Chime/AttendeeResponse.js.map +0 -1
  116. package/lib/typings/Chime/MeetingResponse.js +0 -3
  117. package/lib/typings/Chime/MeetingResponse.js.map +0 -1
  118. package/lib/typings/Chime/MeetingSessionConfigurationOptions.js +0 -3
  119. package/lib/typings/Chime/MeetingSessionConfigurationOptions.js.map +0 -1
  120. package/lib/typings/EventType.js +0 -3
  121. package/lib/typings/EventType.js.map +0 -1
  122. package/lib/typings/GetVoiceSign.js +0 -3
  123. package/lib/typings/GetVoiceSign.js.map +0 -1
  124. package/lib/typings/Live.js +0 -3
  125. package/lib/typings/Live.js.map +0 -1
  126. package/lib/typings/LiveMsg.js +0 -111
  127. package/lib/typings/LiveMsg.js.map +0 -1
  128. package/lib/typings/LiveOptions.js +0 -3
  129. package/lib/typings/LiveOptions.js.map +0 -1
  130. package/lib/typings/RTCEventType.js +0 -3
  131. package/lib/typings/RTCEventType.js.map +0 -1
  132. package/lib/typings/RTCJoinedInfo.js +0 -23
  133. package/lib/typings/RTCJoinedInfo.js.map +0 -1
  134. package/lib/typings/RTCProtocol.js +0 -9
  135. package/lib/typings/RTCProtocol.js.map +0 -1
  136. package/lib/typings/RoomInfo.js +0 -3
  137. package/lib/typings/RoomInfo.js.map +0 -1
  138. package/lib/typings/UserInfo.js +0 -31
  139. package/lib/typings/UserInfo.js.map +0 -1
  140. package/lib/typings/VRWebViewRTCOptions.d.ts +0 -6
  141. package/lib/typings/VRWebViewRTCOptions.js +0 -3
  142. package/lib/typings/VRWebViewRTCOptions.js.map +0 -1
  143. package/lib/typings/WebSocket.js +0 -107
  144. package/lib/typings/WebSocket.js.map +0 -1
  145. package/umd/RTCProtocol.543610f0.js +0 -1
  146. package/umd/createLive.1ecf7dd4.js +0 -1
  147. package/umd/createLiveReact.9075a8fd.js +0 -1
@@ -1,30 +1,29 @@
1
- import { Subscribe } from '../shared-utils/Subscribe';
2
- import { RTCEventType } from '../typings/RTCEventType';
3
- import { RTCProtocol, RTCType } from '../typings/RTCProtocol';
4
- import { GetVoiceSign } from '../typings/GetVoiceSign';
5
- export declare class BrowserRTC extends Subscribe<RTCEventType> implements RTCProtocol {
6
- type: RTCType;
7
- joined: boolean;
8
- micro: boolean;
9
- voiceId: string;
10
- private _getVoiceSign;
11
- private $dom;
12
- private _trtc;
13
- constructor(options: {
14
- getVoiceSign: GetVoiceSign;
15
- });
16
- private _initParentDom;
17
- join: (options: {
18
- voiceId: string;
19
- userId: string;
20
- roomId: string;
21
- type: RTCType;
22
- }) => Promise<boolean>;
23
- quit(): Promise<boolean>;
24
- detectMicro(): Promise<boolean>;
25
- toggleMicro(flag?: boolean): Promise<boolean>;
26
- shock(): void;
27
- private _registerRtcEvent;
28
- private _handleStreamAdded;
29
- private _handleStreamSubscribed;
30
- }
1
+ import { GetVoiceSign } from '../typings/live/GetVoiceSign';
2
+ import { RTCType } from '../typings/rtc/type';
3
+ import { CoreRTC } from './CoreRTC';
4
+ export declare class BrowserRTC extends CoreRTC {
5
+ type: RTCType;
6
+ joined: boolean;
7
+ micro: boolean;
8
+ voiceId: string;
9
+ private _getVoiceSign;
10
+ private $dom;
11
+ private _trtc;
12
+ constructor(options: {
13
+ getVoiceSign: GetVoiceSign;
14
+ });
15
+ private _initParentDom;
16
+ join: (options: {
17
+ voiceId: string;
18
+ userId: string;
19
+ roomId: string;
20
+ type: RTCType;
21
+ }) => Promise<boolean>;
22
+ quit(): Promise<boolean>;
23
+ detectMicro(): Promise<boolean>;
24
+ toggleMicro(flag?: boolean): Promise<boolean>;
25
+ shock(): void;
26
+ private _registerRtcEvent;
27
+ private _handleStreamAdded;
28
+ private _handleStreamSubscribed;
29
+ }
@@ -1,53 +1,55 @@
1
- import { Subscribe } from "../shared-utils/Subscribe";
2
- import { RTCEventType } from "../typings/RTCEventType";
3
- import { RTCProtocol, RTCType } from "../typings/RTCProtocol";
4
- import { GetVoiceSign } from "../typings/GetVoiceSign";
5
- import { AudioVideoObserver, ConsoleLogger, DefaultDeviceController, DefaultMeetingSession, DeviceChangeObserver, LogLevel } from "amazon-chime-sdk-js";
6
- export declare class BrowserRTC4Chime extends Subscribe<RTCEventType> implements RTCProtocol {
7
- type: RTCType;
8
- joined: boolean;
9
- micro: boolean;
10
- voiceId: string;
11
- userId: string;
12
- logger: ConsoleLogger;
13
- deviceController: DefaultDeviceController;
14
- meetingSession: DefaultMeetingSession | undefined;
15
- audioInput: MediaDeviceInfo | undefined;
16
- audioOutput: MediaDeviceInfo | undefined;
17
- deviceChangeObserver: DeviceChangeObserver;
18
- audioVideoObserver: AudioVideoObserver;
19
- private _getVoiceSign;
20
- private $dom;
21
- private $audio;
22
- constructor(options: {
23
- getVoiceSign: GetVoiceSign;
24
- logLevel?: LogLevel;
25
- });
26
- /**
27
- * 对audio标签初始化
28
- */
29
- _initDom: () => void;
30
- /**
31
- * 初始化事件监听器
32
- */
33
- initObservers: () => void;
34
- /**
35
- * 加入语音会议
36
- * @param options
37
- * @returns
38
- */
39
- join(options: {
40
- voiceId: string;
41
- userId: string;
42
- roomId: string | number | undefined;
43
- type: RTCType;
44
- }): Promise<boolean>;
45
- /**
46
- * 注册rtc事件
47
- */
48
- _registerRtcEvent: () => void;
49
- quit(): Promise<boolean>;
50
- detectMicro(): Promise<boolean>;
51
- toggleMicro(flag?: boolean): Promise<boolean>;
52
- shock(): void;
53
- }
1
+ import { AudioVideoObserver, ConsoleLogger, DefaultDeviceController, DefaultMeetingSession, DeviceChangeObserver, LogLevel } from 'amazon-chime-sdk-js';
2
+ import { GetVoiceSign } from '../typings/live/GetVoiceSign';
3
+ import { RTCType } from '../typings/rtc/type';
4
+ import { CoreRTC } from './CoreRTC';
5
+ /**
6
+ * amazon-chime-sdk-js 适配的rtc实现
7
+ */
8
+ export declare class BrowserRTC4Chime extends CoreRTC {
9
+ type: RTCType;
10
+ joined: boolean;
11
+ micro: boolean;
12
+ voiceId: string;
13
+ userId: string;
14
+ logger: ConsoleLogger;
15
+ deviceController: DefaultDeviceController;
16
+ meetingSession: DefaultMeetingSession | undefined;
17
+ audioInput: MediaDeviceInfo | undefined;
18
+ audioOutput: MediaDeviceInfo | undefined;
19
+ deviceChangeObserver: DeviceChangeObserver;
20
+ audioVideoObserver: AudioVideoObserver;
21
+ private _getVoiceSign;
22
+ private $dom;
23
+ private $audio;
24
+ constructor(options: {
25
+ getVoiceSign: GetVoiceSign;
26
+ logLevel?: LogLevel;
27
+ });
28
+ /**
29
+ * 对audio标签初始化
30
+ */
31
+ _initDom: () => void;
32
+ /**
33
+ * 初始化事件监听器
34
+ */
35
+ initObservers: () => void;
36
+ /**
37
+ * 加入语音会议
38
+ * @param options
39
+ * @returns
40
+ */
41
+ join(options: {
42
+ voiceId: string;
43
+ userId: string;
44
+ roomId: string | number | undefined;
45
+ type: RTCType;
46
+ }): Promise<boolean>;
47
+ /**
48
+ * 注册rtc事件
49
+ */
50
+ _registerRtcEvent: () => void;
51
+ quit(): Promise<boolean>;
52
+ detectMicro(): Promise<boolean>;
53
+ toggleMicro(flag?: boolean): Promise<boolean>;
54
+ shock(): void;
55
+ }
@@ -0,0 +1,23 @@
1
+ import { RTCEventType } from '../typings/rtc/eventType';
2
+ import { RTCProtocol } from '../typings/rtc/protocol';
3
+ import { RTCType } from '../typings/rtc/type';
4
+ import { Subscribe } from '../utils/subscribe';
5
+ /**
6
+ * rtc 基础抽象类
7
+ */
8
+ export declare abstract class CoreRTC extends Subscribe<RTCEventType> implements RTCProtocol {
9
+ abstract joined: boolean;
10
+ abstract micro: boolean;
11
+ abstract voiceId: string;
12
+ abstract type: RTCType;
13
+ abstract join(options: {
14
+ voiceId: string;
15
+ userId: string;
16
+ roomId: string | number | undefined;
17
+ type: RTCType;
18
+ }): Promise<boolean>;
19
+ abstract quit(): Promise<boolean>;
20
+ abstract detectMicro(): Promise<boolean>;
21
+ abstract toggleMicro(flag?: boolean): Promise<boolean>;
22
+ abstract shock(): void;
23
+ }
@@ -1,23 +1,22 @@
1
- import { Subscribe } from '../shared-utils/Subscribe';
2
- import { RTCEventType } from '../typings/RTCEventType';
3
- import { RTCProtocol, RTCType } from '../typings/RTCProtocol';
4
- import { VRWebViewRTCOptions } from '../typings/VRWebViewRTCOptions';
5
- export declare class VRWebViewRTC extends Subscribe<RTCEventType> implements RTCProtocol {
6
- type: RTCType;
7
- joined: boolean;
8
- micro: boolean;
9
- voiceId: string;
10
- private options;
11
- get jsBridge(): import("@realsee/jsbridge-x/lib/typings/JSBridgeProtocol").JSBridgeProtocol;
12
- constructor({ jsBridge, getVoiceSign }: VRWebViewRTCOptions);
13
- join(options: {
14
- voiceId: string;
15
- userId: string;
16
- roomId: string;
17
- type: RTCType;
18
- }): Promise<boolean>;
19
- quit(): Promise<boolean>;
20
- detectMicro(): Promise<boolean>;
21
- toggleMicro(flag?: boolean): Promise<boolean>;
22
- shock(): void;
23
- }
1
+ import { RTCType } from '../typings/rtc/type';
2
+ import { VRWebViewRTCOptions } from '../typings/rtc/VRWebViewRTCOptions';
3
+ import { CoreRTC } from './CoreRTC';
4
+ export declare class VRWebViewRTC extends CoreRTC {
5
+ type: RTCType;
6
+ joined: boolean;
7
+ micro: boolean;
8
+ voiceId: string;
9
+ private options;
10
+ get jsBridge(): import("@realsee/jsbridge-x").JSBridgeProtocol;
11
+ constructor({ jsBridge, getVoiceSign }: VRWebViewRTCOptions);
12
+ join(options: {
13
+ voiceId: string;
14
+ userId: string;
15
+ roomId: string;
16
+ type: RTCType;
17
+ }): Promise<boolean>;
18
+ quit(): Promise<boolean>;
19
+ detectMicro(): Promise<boolean>;
20
+ toggleMicro(flag?: boolean): Promise<boolean>;
21
+ shock(): void;
22
+ }
@@ -0,0 +1,5 @@
1
+ export { CoreRTC } from './CoreRTC';
2
+ export { BrowserRTC } from './BrowserRTC';
3
+ export { BrowserRTC4Chime } from './BrowserRTC4Chime';
4
+ export { VRWebViewRTC } from './VRWebViewRTC';
5
+ export type { RTCProtocol } from '../typings/rtc/protocol';
@@ -1,5 +1,5 @@
1
- export interface AttendeeResponse {
2
- attendee_id: string;
3
- external_user_id: string;
4
- join_token: string;
5
- }
1
+ export interface AttendeeResponse {
2
+ attendee_id: string;
3
+ external_user_id: string;
4
+ join_token: string;
5
+ }
@@ -1,12 +1,12 @@
1
- export interface MeetingResponse {
2
- MediaPlacement: {
3
- AudioFallbackUrl: string;
4
- AudioHostUrl: string;
5
- ScreenDataUrl: string;
6
- ScreenSharingUrl: string;
7
- ScreenViewingUrl: string;
8
- SignalingUrl: string;
9
- TurnControlUrl: string;
10
- };
11
- MeetingId: string;
12
- }
1
+ export interface MeetingResponse {
2
+ MediaPlacement: {
3
+ AudioFallbackUrl: string;
4
+ AudioHostUrl: string;
5
+ ScreenDataUrl: string;
6
+ ScreenSharingUrl: string;
7
+ ScreenViewingUrl: string;
8
+ SignalingUrl: string;
9
+ TurnControlUrl: string;
10
+ };
11
+ MeetingId: string;
12
+ }
@@ -1,16 +1,16 @@
1
- import { AttendeeResponse } from "./AttendeeResponse";
2
- import { MeetingResponse } from "./MeetingResponse";
3
- export interface MeetingSessionConfigurationOptions {
4
- attendence: AttendeeResponse;
5
- config: {
6
- passport: string;
7
- vendor: string;
8
- app_id: string;
9
- bypass: any;
10
- };
11
- expire_time: number;
12
- identifier: string;
13
- user_id: string;
14
- user_sig: string;
15
- vendor_wrapper: MeetingResponse;
16
- }
1
+ import { AttendeeResponse } from "./AttendeeResponse";
2
+ import { MeetingResponse } from "./MeetingResponse";
3
+ export interface MeetingSessionConfigurationOptions {
4
+ attendence: AttendeeResponse;
5
+ config: {
6
+ passport: string;
7
+ vendor: string;
8
+ app_id: string;
9
+ bypass: any;
10
+ };
11
+ expire_time: number;
12
+ identifier: string;
13
+ user_id: string;
14
+ user_sig: string;
15
+ vendor_wrapper: MeetingResponse;
16
+ }
@@ -0,0 +1,3 @@
1
+ export * from './AttendeeResponse';
2
+ export * from './MeetingResponse';
3
+ export * from './MeetingSessionConfigurationOptions';
@@ -0,0 +1,4 @@
1
+ export * from './chime';
2
+ export * from './live';
3
+ export * from './react';
4
+ export * from './rtc';
@@ -1,89 +1,90 @@
1
- import { BuiltinMsg, LiveMsg } from './LiveMsg';
2
- import { UserInfo } from './UserInfo';
3
- import { WebSocketError, WebSocketState } from './WebSocket';
4
- /**
5
- * WebSocket 相关异步事件
6
- * @description 可以
7
- */
8
- declare type WebSocketEventType = {
9
- /**
10
- * WebSocket 状态发生更新
11
- * @param readyState - 当前状态枚举值。
12
- */
13
- 'ws.readyStateUpdate'(readyState: WebSocketState): void;
14
- /**
15
- * WebSocket 连接前
16
- */
17
- 'ws.beforeConnect'(reConnect?: number): void;
18
- /**
19
- * WebSocket 连接后
20
- */
21
- 'ws.afterConnect'(reConnect?: number): void;
22
- /**
23
- * WebSocket 连接过程中遭遇的异常情况信息。
24
- * @param error - 错误信息。
25
- */
26
- 'ws.error'(error: WebSocketError): void;
27
- /**
28
- * WebSocket 收到的消息
29
- * @param liveMsg - 透传 WebSocket 消息
30
- */
31
- 'ws.message'(liveMsg: LiveMsg): void;
32
- };
33
- declare type LiveEventType<Snapshot> = {
34
- /**
35
- * 内置消息事件
36
- * @param builtinMsg
37
- */
38
- 'builtinEvent'(builtinMsg: BuiltinMsg): void;
39
- /**
40
- * 内置消息事件: 用户信息改变
41
- * @param builtinMsg
42
- */
43
- 'userChange'(builtinMsg: BuiltinMsg): void;
44
- /**
45
- * 内置消息事件:房间信息改变
46
- * @param builtinMsg
47
- */
48
- 'roomChange'(builtinMsg: BuiltinMsg): void;
49
- /**
50
- * 收到其他用户的广播消息。
51
- * @param evtMsg
52
- */
53
- 'broadcast'(evtMsg: Record<string, any>, frontRequestId: string): void;
54
- /**
55
- * 带看已经就绪,可以发送帧数据。
56
- * @param lastKeyframe 带看最后一帧数据(链接切换、断网等重连恢复上次会话帧状态),你可以通过此数据拉齐当前UI状态。
57
- */
58
- 'readyKeyframeSync'(lastKeyframe: Partial<Snapshot>): void;
59
- /**
60
- * 获取其他用户输送的帧数据:根据此帧数据更新UI状态。
61
- * @param keyframes
62
- */
63
- 'keyframes'(keyframes: Partial<Snapshot>, frontRequestId: string): void;
64
- /**
65
- * 个人信息发生更新。
66
- * @param userInfo
67
- */
68
- 'selfInfoUpdate'(userInfo: UserInfo, frontRequestId: string): void;
69
- /**
70
- * 用户列表更新。
71
- * @param userList
72
- */
73
- 'userListUpdate'(userList: UserInfo[], frontRequestId: string): void;
74
- /**
75
- * 被踢出房间
76
- * @param
77
- * */
78
- 'kickOut'(): void;
79
- /**
80
- * 异常消息:不符合规范。
81
- * @param liveMsg
82
- */
83
- 'error'(liveMsg: LiveMsg): void;
84
- };
85
- declare type KeyframeTypes<Type> = {
86
- [Property in keyof Type as Property]: (nextKeyframes: Type[Property], prevKeyframes: Type[Property], frontRequestId: string) => void;
87
- };
88
- declare type EventType<Snapshot> = LiveEventType<Snapshot> & WebSocketEventType;
89
- export { LiveEventType, WebSocketEventType, KeyframeTypes, EventType };
1
+ import { BuiltinMsg, LiveMsg } from './LiveMsg';
2
+ import { UserInfo } from './UserInfo';
3
+ import { WebSocketError, WebSocketState } from './WebSocket';
4
+ /**
5
+ * WebSocket 相关异步事件
6
+ * @description
7
+ * @deprecated 这些事件不应暴露给应用层
8
+ */
9
+ declare type WebSocketEventType = {
10
+ /**
11
+ * WebSocket 状态发生更新
12
+ * @param readyState - 当前状态枚举值。
13
+ */
14
+ 'ws.readyStateUpdate'(readyState: WebSocketState): void;
15
+ /**
16
+ * WebSocket 连接前
17
+ */
18
+ 'ws.beforeConnect'(reConnect?: number): void;
19
+ /**
20
+ * WebSocket 连接后
21
+ */
22
+ 'ws.afterConnect'(reConnect?: number): void;
23
+ /**
24
+ * WebSocket 连接过程中遭遇的异常情况信息。
25
+ * @param error - 错误信息。
26
+ */
27
+ 'ws.error'(error: WebSocketError): void;
28
+ /**
29
+ * WebSocket 收到的消息
30
+ * @param liveMsg - 透传 WebSocket 消息
31
+ */
32
+ 'ws.message'(liveMsg: LiveMsg): void;
33
+ };
34
+ declare type LiveEventType<Snapshot> = {
35
+ /**
36
+ * 内置消息事件
37
+ * @param builtinMsg
38
+ */
39
+ 'builtinEvent'(builtinMsg: BuiltinMsg): void;
40
+ /**
41
+ * 内置消息事件: 用户信息改变
42
+ * @param builtinMsg
43
+ */
44
+ 'userChange'(builtinMsg: BuiltinMsg): void;
45
+ /**
46
+ * 内置消息事件:房间信息改变
47
+ * @param builtinMsg
48
+ */
49
+ 'roomChange'(builtinMsg: BuiltinMsg): void;
50
+ /**
51
+ * 收到其他用户的广播消息。
52
+ * @param evtMsg
53
+ */
54
+ 'broadcast'(evtMsg: Record<string, any>, frontRequestId: string): void;
55
+ /**
56
+ * 带看已经就绪,可以发送帧数据。
57
+ * @param lastKeyframe 带看最后一帧数据(链接切换、断网等重连恢复上次会话帧状态),你可以通过此数据拉齐当前UI状态。
58
+ */
59
+ 'readyKeyframeSync'(lastKeyframe: Partial<Snapshot>): void;
60
+ /**
61
+ * 获取其他用户输送的帧数据:根据此帧数据更新UI状态。
62
+ * @param keyframes
63
+ */
64
+ 'keyframes'(keyframes: Partial<Snapshot>, frontRequestId: string): void;
65
+ /**
66
+ * 个人信息发生更新。
67
+ * @param userInfo
68
+ */
69
+ 'selfInfoUpdate'(userInfo: UserInfo, frontRequestId: string): void;
70
+ /**
71
+ * 用户列表更新。
72
+ * @param userList
73
+ */
74
+ 'userListUpdate'(userList: UserInfo[], frontRequestId: string): void;
75
+ /**
76
+ * 被踢出房间
77
+ * @param
78
+ * */
79
+ 'kickOut'(): void;
80
+ /**
81
+ * 异常消息:不符合规范。
82
+ * @param liveMsg
83
+ */
84
+ 'error'(liveMsg: LiveMsg): void;
85
+ };
86
+ declare type KeyframeTypes<Type> = {
87
+ [Property in keyof Type as Property]: (nextKeyframes: Type[Property], prevKeyframes: Type[Property], frontRequestId: string) => void;
88
+ };
89
+ declare type EventType<Snapshot> = LiveEventType<Snapshot> & WebSocketEventType;
90
+ export { LiveEventType, WebSocketEventType, KeyframeTypes, EventType };
@@ -1,11 +1,17 @@
1
- export interface GetVoiceSignReturnType {
2
- sdkAppId: number;
3
- userId: string;
4
- roomId: string | number;
5
- userSig: string;
6
- }
7
- export declare type GetVoiceSign = ({ voiceId, userId, roomId }: {
8
- voiceId: string;
9
- userId: string;
10
- roomId: string | number;
11
- }) => Promise<GetVoiceSignReturnType>;
1
+ /**
2
+ * 语音签名的返回值
3
+ */
4
+ export interface GetVoiceSignReturnType {
5
+ sdkAppId: number;
6
+ userId: string;
7
+ roomId: string | number;
8
+ userSig: string;
9
+ }
10
+ /**
11
+ * 获取用户语音签名
12
+ */
13
+ export declare type GetVoiceSign = ({ voiceId, userId, roomId, }: {
14
+ voiceId: string;
15
+ userId: string;
16
+ roomId: string | number;
17
+ }) => Promise<GetVoiceSignReturnType>;