@realsee/live 0.7.0 → 0.7.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 (62) hide show
  1. package/dist/index.cjs.js +3 -92
  2. package/dist/index.cjs.js.map +1 -0
  3. package/dist/index.d.ts +5 -1336
  4. package/dist/index.es.js +6165 -0
  5. package/dist/index.es.js.map +1 -0
  6. package/dist/live/controller.d.ts +118 -0
  7. package/dist/live/createLive.d.ts +8 -0
  8. package/dist/live/createLiveReact.d.ts +54 -0
  9. package/dist/live/live.d.ts +200 -0
  10. package/dist/rtc/BrowserRTC.d.ts +39 -0
  11. package/dist/rtc/BrowserRTC4Chime.d.ts +60 -0
  12. package/dist/rtc/CoreRTC.d.ts +23 -0
  13. package/dist/rtc/VRWebViewRTC.d.ts +97 -0
  14. package/dist/rtc/index.d.ts +5 -0
  15. package/dist/typings/chime/AttendeeResponse.d.ts +5 -0
  16. package/dist/typings/chime/MeetingResponse.d.ts +12 -0
  17. package/dist/typings/chime/MeetingSessionConfigurationOptions.d.ts +16 -0
  18. package/dist/typings/chime/index.d.ts +3 -0
  19. package/dist/typings/index.d.ts +4 -0
  20. package/dist/typings/live/EventType.d.ts +74 -0
  21. package/dist/typings/live/GetVoiceSign.d.ts +52 -0
  22. package/dist/typings/live/LiveConnectOptions.d.ts +24 -0
  23. package/dist/typings/live/LiveErrorType.d.ts +9 -0
  24. package/dist/typings/live/LiveMsg.d.ts +133 -0
  25. package/dist/typings/live/LiveOptions.d.ts +79 -0
  26. package/dist/typings/live/LiveState.d.ts +15 -0
  27. package/dist/typings/live/RoomInfo.d.ts +13 -0
  28. package/dist/typings/live/UserInfo.d.ts +103 -0
  29. package/dist/typings/live/UserVolume.d.ts +7 -0
  30. package/dist/typings/live/WebSocket.d.ts +82 -0
  31. package/dist/typings/live/index.d.ts +10 -0
  32. package/dist/typings/react/RTCActionReactCallback.d.ts +2 -0
  33. package/dist/typings/react/index.d.ts +1 -0
  34. package/dist/typings/rtc/VRWebViewRTCOptions.d.ts +6 -0
  35. package/dist/typings/rtc/eventType.d.ts +44 -0
  36. package/dist/typings/rtc/index.d.ts +5 -0
  37. package/dist/typings/rtc/joinedInfo.d.ts +38 -0
  38. package/dist/typings/rtc/protocol.d.ts +77 -0
  39. package/dist/typings/rtc/type.d.ts +12 -0
  40. package/dist/utils/RobustWebSocket.d.ts +160 -0
  41. package/dist/utils/appendUri.d.ts +1 -0
  42. package/dist/utils/clientDetector.d.ts +4 -0
  43. package/dist/utils/equal.d.ts +10 -0
  44. package/dist/utils/isServer.d.ts +5 -0
  45. package/dist/utils/logger.d.ts +19 -0
  46. package/dist/utils/subscribe.d.ts +75 -0
  47. package/dist/utils/uuid.d.ts +4 -0
  48. package/docs/classes/CoreRTC.md +7 -7
  49. package/docs/classes/Live.md +29 -56
  50. package/docs/globals.md +0 -6
  51. package/docs/interfaces/RTCProtocol.md +6 -6
  52. package/package.json +14 -22
  53. package/dist/index.d.cts +0 -1336
  54. package/dist/index.esm.js +0 -30
  55. package/docs/classes/Subscribe.md +0 -211
  56. package/docs/namespaces/SubscribeMixinType/README.md +0 -17
  57. package/docs/namespaces/SubscribeMixinType/interfaces/emit.md +0 -31
  58. package/docs/namespaces/SubscribeMixinType/interfaces/hasListener.md +0 -25
  59. package/docs/namespaces/SubscribeMixinType/interfaces/off.md +0 -31
  60. package/docs/namespaces/SubscribeMixinType/interfaces/on.md +0 -37
  61. package/docs/namespaces/SubscribeMixinType/interfaces/once.md +0 -35
  62. package/docs/type-aliases/EventMap.md +0 -17
package/dist/index.d.ts CHANGED
@@ -1,1336 +1,5 @@
1
- import * as trtc_js_sdk from 'trtc-js-sdk';
2
- import { CheckResult } from 'trtc-js-sdk';
3
- import { ConsoleLogger, DefaultDeviceController, DefaultMeetingSession, DeviceChangeObserver, AudioVideoObserver, AudioMixObserver, LogLevel } from 'amazon-chime-sdk-js';
4
- import * as _realsee_jsbridge_x from '@realsee/jsbridge-x';
5
- import { JSBridgeProtocol } from '@realsee/jsbridge-x';
6
- import * as Y from 'yjs';
7
- import React from 'react';
8
-
9
- /**
10
- * 用户的音量信息。
11
- */
12
- type UserVolume = {
13
- userId: string;
14
- audioVolume: number;
15
- };
16
-
17
- /**
18
- * rtc加入返回值code枚举
19
- */
20
- declare enum RTCJoinedInfoCodeEnum {
21
- /**
22
- * 成功
23
- */
24
- Success = 0,
25
- /**
26
- * 失败
27
- */
28
- Failure = 1,
29
- /**
30
- * 重复加入
31
- */
32
- ReJoin = 2,
33
- /**
34
- * 无麦克风权限
35
- */
36
- NoMicroPermission = 3,
37
- /**
38
- * 未知异常
39
- */
40
- Unknown = 500
41
- }
42
- /**
43
- * 进入rtc房间的回调信息
44
- */
45
- interface RTCJoinedInfo {
46
- code: RTCJoinedInfoCodeEnum;
47
- message: string;
48
- userId?: string;
49
- roomId?: number;
50
- errInfo?: {
51
- errCode: number;
52
- errMsg: string;
53
- };
54
- }
55
-
56
- /**
57
- * RTC 异步事件类型。
58
- */
59
- type RTCEventType = {
60
- /**
61
- * 错误\异常
62
- * @param error
63
- */
64
- "error"(error: Error | RTCJoinedInfo): void;
65
- /**
66
- * 即将加入房间。
67
- */
68
- "joinWillStart"(): void;
69
- /**
70
- * 成功加入语音房间。
71
- */
72
- "joined"(): void;
73
- /**
74
- * 弱网提醒事件。
75
- */
76
- "weakNetwork"(): void;
77
- /**
78
- * 每个用户的音量。
79
- * @param userVolumes
80
- */
81
- "userVolumes"(userVolumes: UserVolume[]): void;
82
- /**
83
- * rtc 成功
84
- * @private 内置事件,行为会随版本变更,请勿通过外部注册监听
85
- */
86
- "inner.rtc.success"(result: RTCJoinedInfo | boolean): void;
87
- /**
88
- * rtc 失败
89
- * @private 内置事件,行为会随版本变更,请勿通过外部注册监听
90
- */
91
- "inner.rtc.fail"(result: RTCJoinedInfo | boolean): void;
92
- /**
93
- * rtc 错误
94
- * @private 内置事件,行为会随版本变更,请勿通过外部注册监听
95
- */
96
- "inner.rtc.error"(error: Error): void;
97
- };
98
-
99
- type EventMap = {
100
- [name: string]: (...args: any[]) => void | boolean;
101
- };
102
- /**
103
- * 监听者模式
104
- * @template T 预设的监听回调类型
105
- * @example
106
- * ```
107
- * new Subscribe<{
108
- * "foo": [arg1: number, arg2: string],
109
- * "bar": [arg: boolean],
110
- * }>()
111
- * ```
112
- */
113
- declare class Subscribe<T extends EventMap> {
114
- /**
115
- * 判断是否注册了事件
116
- * @param name 事件类型
117
- */
118
- hasListener(name: keyof T): boolean;
119
- /**
120
- * 注册事件
121
- * @param name 事件类型
122
- * @param callback 事件回调函数
123
- * @param once 是否只执行一次
124
- * @returns 解除事件
125
- * @template K 预设的监听事件名称
126
- * @template C 回调函数函数上下文
127
- */
128
- on<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>, once?: boolean): () => void;
129
- /**
130
- * 注册事件(是否只执行一次)
131
- * @param name 事件类型
132
- * @param callback 事件回调函数
133
- * @returns 解除事件
134
- * @template K 预设的监听事件名称
135
- * @template C 回调函数函数上下文
136
- */
137
- once<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>): () => void;
138
- /**
139
- * 解除事件
140
- *
141
- * 如果 name 不传的话解除对应所有事件
142
- * 如果 name, callback 不传的话解除所有name的所有事件
143
- * @param name 事件类型
144
- * @param callback 事件回调函数
145
- * @template K 预设的监听事件名称
146
- */
147
- off<K extends keyof T>(name?: K, callback?: (...args: Parameters<T[K]>) => ReturnType<T[K]>): void;
148
- /**
149
- * 触发事件
150
- * @param name 事件类型
151
- * @param data 触发事件的数据
152
- * @returns canceled 是否被触发取消
153
- * @template K 预设的监听事件名称
154
- */
155
- emit<K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
156
- }
157
- declare namespace SubscribeMixinType {
158
- interface hasListener<T extends EventMap> {
159
- (name: keyof T): boolean;
160
- }
161
- interface on<T extends EventMap> {
162
- <K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>, once?: boolean): () => void;
163
- }
164
- interface once<T extends EventMap> {
165
- <K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>): () => void;
166
- }
167
- interface off<T extends EventMap> {
168
- <K extends keyof T>(names?: K | K[], callback?: (...args: any[]) => any): void;
169
- }
170
- interface emit<T extends EventMap> {
171
- <K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
172
- }
173
- }
174
-
175
- /**
176
- * rtc 类型
177
- */
178
- declare enum RTCType {
179
- RealseeBrowserRTC = "RealseeBrowserRTC",
180
- RealseeVRWebViewRTC = "RealseeVRWebViewRTC",
181
- RealseeBrowserChimeRTC = "RealseeBrowserChimeRTC"
182
- }
183
- declare enum BuiltInRTCType {
184
- RealseeXTRTC = "trtc",
185
- RealseeXChimeRTC = "chime"
186
- }
187
-
188
- /**
189
- * rtc 协议接口
190
- * @interface
191
- * @extends Subscribe<RTCEventType>
192
- */
193
- interface RTCProtocol extends Subscribe<RTCEventType> {
194
- /**
195
- * 是否已经加入房间
196
- * @type {boolean}
197
- */
198
- joined: boolean;
199
- /**
200
- * 麦克风状态
201
- * @type {boolean}
202
- */
203
- micro: boolean;
204
- /**
205
- * 语音房间ID
206
- * @type {string}
207
- */
208
- voiceId: string;
209
- /**
210
- * rtc 实现类型
211
- * @type {RTCType}
212
- */
213
- type: RTCType;
214
- /**
215
- * 检查rtc的系统依赖是否满足
216
- * @returns {Promise<CheckResult>} 返回一个Promise,表示检查结果
217
- */
218
- checkRequirement?(): Promise<CheckResult>;
219
- /**
220
- * 加入房间。
221
- * @param {Object} options - 加入房间的选项
222
- * @param {string} options.voiceId - 语音房间ID
223
- * @param {string} options.userId - 用户ID
224
- * @param {string|number|undefined} options.roomId - 房间ID
225
- * @param {RTCType} options.type - RTC类型
226
- * @returns {Promise<boolean>} 返回一个Promise,表示是否成功加入房间
227
- */
228
- join(options: {
229
- voiceId: string;
230
- userId: string;
231
- roomId: string | number | undefined;
232
- type: RTCType;
233
- }): Promise<boolean>;
234
- /**
235
- * 重新加入房间。
236
- * @returns {Promise<boolean>} 返回一个Promise,表示是否成功重新加入房间
237
- */
238
- reJoin?(): Promise<boolean>;
239
- /**
240
- * 离开房间。
241
- * @returns {Promise<boolean>} 返回一个Promise,表示是否成功离开房间
242
- */
243
- quit(): Promise<boolean>;
244
- /**
245
- * 监测麦克风授权。
246
- * @returns {Promise<boolean>} 返回一个Promise,表示麦克风是否被授权
247
- */
248
- detectMicro(): Promise<boolean>;
249
- /**
250
- * 关闭\开启 本地麦克风。
251
- * @param {boolean} [flag] - 是否开启麦克风,默认为切换当前状态
252
- * @returns {Promise<boolean>} 返回一个Promise,表示操作是否成功
253
- */
254
- toggleMicro(flag?: boolean): Promise<boolean>;
255
- /**
256
- * 震动。
257
- * @returns {void}
258
- */
259
- shock?(): void;
260
- }
261
-
262
- /**
263
- * rtc 基础抽象类
264
- */
265
- declare abstract class CoreRTC extends Subscribe<RTCEventType> implements RTCProtocol {
266
- abstract joined: boolean;
267
- abstract micro: boolean;
268
- abstract voiceId: string;
269
- abstract type: RTCType;
270
- abstract join(options: {
271
- voiceId: string;
272
- userId: string;
273
- roomId: string | number | undefined;
274
- type: RTCType;
275
- }): Promise<boolean>;
276
- abstract quit(): Promise<boolean>;
277
- abstract detectMicro(): Promise<boolean>;
278
- abstract toggleMicro(flag?: boolean): Promise<boolean>;
279
- abstract shock(): void;
280
- }
281
-
282
- /**
283
- * 语音签名的返回值
284
- */
285
- type GetVoiceSignReturnType = {
286
- /**
287
- * rtc 的 sdkAppId
288
- */
289
- sdkAppId: number;
290
- /**
291
- * rtc 的 用户 id
292
- */
293
- userId: string;
294
- /**
295
- * rtc 的 语音房间号
296
- */
297
- roomId: string | number;
298
- /**
299
- * rtc 的 用户签名
300
- */
301
- userSig: string;
302
- };
303
- /**
304
- * 获取用户语音签名的参数
305
- */
306
- type GetVoiceSignParams = {
307
- /**
308
- * 语音房间号
309
- */
310
- voiceId: string;
311
- /**
312
- * 用户 id
313
- */
314
- userId: string;
315
- /**
316
- * 房间 id
317
- */
318
- roomId: string | number;
319
- };
320
- /**
321
- * 获取用户语音签名的方法
322
- * @param {GetVoiceSignParams} params - 获取语音签名所需的参数
323
- * @returns {Promise<GetVoiceSignReturnType>} 返回一个Promise,解析为语音签名的相关信息
324
- * @property {number} sdkAppId - RTC的sdkAppId
325
- * @property {string} userId - RTC的用户ID
326
- * @property {string|number} roomId - RTC的语音房间号
327
- * @property {string} userSig - RTC的用户签名
328
- */
329
- declare function GetVoiceSignFn(params: GetVoiceSignParams): Promise<GetVoiceSignReturnType>;
330
- /**
331
- * 获取用户语音签名的方法类型
332
- */
333
- type GetVoiceSign = typeof GetVoiceSignFn;
334
-
335
- declare class BrowserRTC extends CoreRTC {
336
- type: RTCType;
337
- joined: boolean;
338
- micro: boolean;
339
- voiceId: string;
340
- private _getVoiceSign;
341
- private _autoPlayConfirm;
342
- checkRequirement: () => Promise<trtc_js_sdk.CheckResult>;
343
- private $dom;
344
- private _trtc;
345
- constructor(options: {
346
- getVoiceSign: GetVoiceSign;
347
- autoPlayConfirm?: (opts: {
348
- onConfirm: () => void;
349
- }) => void;
350
- });
351
- private _initParentDom;
352
- join: (options: {
353
- voiceId: string;
354
- userId: string;
355
- roomId: string;
356
- type: RTCType;
357
- }) => Promise<boolean>;
358
- quit(): Promise<boolean>;
359
- detectMicro(): Promise<boolean>;
360
- toggleMicro(flag?: boolean): Promise<boolean>;
361
- shock(): void;
362
- private _registerRtcEvent;
363
- private _handleStreamAdded;
364
- private _handleStreamSubscribed;
365
- }
366
-
367
- /**
368
- * amazon-chime-sdk-js 适配的rtc实现
369
- */
370
- declare class BrowserRTC4Chime extends CoreRTC {
371
- type: RTCType;
372
- joined: boolean;
373
- micro: boolean;
374
- voiceId: string;
375
- userId: string;
376
- logger: ConsoleLogger;
377
- deviceController: DefaultDeviceController;
378
- meetingSession: DefaultMeetingSession | undefined;
379
- audioInput: MediaDeviceInfo | undefined;
380
- audioOutput: MediaDeviceInfo | undefined;
381
- deviceChangeObserver: DeviceChangeObserver;
382
- audioVideoObserver: AudioVideoObserver;
383
- audioMixObserver?: AudioMixObserver;
384
- private _getVoiceSign;
385
- private _autoPlayConfirm;
386
- private $dom;
387
- private $audio;
388
- constructor(options: {
389
- getVoiceSign: GetVoiceSign;
390
- autoPlayConfirm?: (opts: {
391
- onConfirm: () => void;
392
- }) => void;
393
- logLevel?: LogLevel;
394
- });
395
- /**
396
- * 对audio标签初始化
397
- */
398
- _initDom: () => void;
399
- /**
400
- * 初始化事件监听器
401
- */
402
- initObservers: () => void;
403
- /**
404
- * 加入语音会议
405
- * @param options
406
- * @returns
407
- */
408
- join(options: {
409
- voiceId: string;
410
- userId: string;
411
- roomId: string | number | undefined;
412
- type: RTCType;
413
- }): Promise<boolean>;
414
- /**
415
- * 注册rtc事件
416
- */
417
- _registerRtcEvent: () => void;
418
- quit(): Promise<boolean>;
419
- detectMicro(): Promise<boolean>;
420
- toggleMicro(flag?: boolean): Promise<boolean>;
421
- shock(): void;
422
- }
423
-
424
- interface VRWebViewRTCOptions {
425
- jsBridge: JSBridgeProtocol;
426
- getVoiceSign: GetVoiceSign;
427
- }
428
-
429
- declare class VRWebViewRTC extends CoreRTC {
430
- type: RTCType;
431
- joined: boolean;
432
- micro: boolean;
433
- voiceId: string;
434
- /**
435
- * 保留加入房间参数,用于重连
436
- */
437
- private _joinOptions;
438
- private options;
439
- get jsBridge(): _realsee_jsbridge_x.JSBridgeProtocol;
440
- constructor({ jsBridge, getVoiceSign }: VRWebViewRTCOptions);
441
- /**
442
- * 处理用户音量
443
- * @param userVolumes
444
- */
445
- private handleUserVolumes;
446
- /**
447
- * 处理弱网络情况
448
- * @param weakNetwork
449
- */
450
- private handleWeakNetwork;
451
- /**
452
- * 加入语音房间
453
- * @param options
454
- * @returns
455
- */
456
- join: (options: {
457
- voiceId: string;
458
- userId: string;
459
- roomId: string;
460
- type: RTCType;
461
- }) => Promise<boolean>;
462
- /**
463
- * 重连
464
- * @returns
465
- */
466
- reJoin: () => Promise<boolean>;
467
- /**
468
- * 获取 rtc 签名
469
- * @param params
470
- * @returns
471
- */
472
- private getVoiceSignOrEmitError;
473
- /**
474
- * 处理小程序的加入房间
475
- * @param options
476
- * @returns
477
- */
478
- private handleWxMiniProgramWebViewJoin;
479
- /**
480
- * 处理App WebView的加入房间
481
- * @param options
482
- * @returns
483
- */
484
- private handleAppWebViewJoin;
485
- /**
486
- * 加入语音房间,给小程序使用
487
- * @param param0
488
- * @returns
489
- */
490
- private joinRoomOrEmitError;
491
- /**
492
- * 处理加入语音房间结果
493
- * @param res
494
- * @returns
495
- */
496
- private handleJoinResult;
497
- /**
498
- * 将错误信息发送出去,并将 joined 置为 false
499
- * @param message
500
- */
501
- private emitErrorAndSetJoinedFalse;
502
- /**
503
- * 退出房间
504
- * @returns
505
- */
506
- quit: () => Promise<boolean>;
507
- /**
508
- * 监测麦克风权限
509
- * @returns
510
- */
511
- detectMicro: () => Promise<boolean>;
512
- /**
513
- * 修改麦克风状态
514
- * @param flag
515
- * @returns
516
- */
517
- toggleMicro: (flag?: boolean) => Promise<boolean>;
518
- /**
519
- * 震动
520
- */
521
- shock: () => void;
522
- }
523
-
524
- interface AttendeeResponse {
525
- attendee_id: string;
526
- external_user_id: string;
527
- join_token: string;
528
- }
529
-
530
- interface MeetingResponse {
531
- MediaPlacement: {
532
- AudioFallbackUrl: string;
533
- AudioHostUrl: string;
534
- ScreenDataUrl: string;
535
- ScreenSharingUrl: string;
536
- ScreenViewingUrl: string;
537
- SignalingUrl: string;
538
- TurnControlUrl: string;
539
- };
540
- MeetingId: string;
541
- }
542
-
543
- interface MeetingSessionConfigurationOptions {
544
- attendence: AttendeeResponse;
545
- config: {
546
- passport: string;
547
- vendor: string;
548
- app_id: string;
549
- bypass: any;
550
- };
551
- expire_time: number;
552
- identifier: string;
553
- user_id: string;
554
- user_sig: string;
555
- vendor_wrapper: MeetingResponse;
556
- }
557
-
558
- /**
559
- * WebSocket 通信指令
560
- * - 下行:服务端推送数据
561
- * - 上行:客户端上报数据
562
- */
563
- declare enum Command {
564
- /** 当前用户信息:下行 */
565
- SelfUserInfo = "SELF_USER_INFO",
566
- /** 房间信息:下行 */
567
- RoomInfo = "ROOM_INFO",
568
- /** RTC信息:下行 */
569
- RTCInfo = "RTC_INFO",
570
- /** 用户列表:下行 */
571
- UserList = "USER_LIST",
572
- /** 内置消息:下行、上行 */
573
- BuiltinMsg = "BUILTIN_MSG",
574
- /** 自定义广播事件消息:下行、上行 */
575
- CustomEvent = "CUSTOM_EVENT",
576
- /** 帧数据同步:下行、上行 */
577
- KeyframeSync = "KEYFRAME_SYNC",
578
- /** 被踢出房间:下行 */
579
- UserKickOut = "USER_KICK_OUT"
580
- }
581
- /**
582
- * 向服务端请求数据时的数据格式。
583
- */
584
- type ReqLiveMsg = {
585
- /**
586
- * 请求指令。
587
- */
588
- command: Command;
589
- /**
590
- * 前端请求时生成的uuid()。
591
- */
592
- front_request_id: string | number;
593
- /**
594
- * 数据内容
595
- */
596
- data: {
597
- /**
598
- * 如果此数据仅发送给某些用户,请提供这些用户的ucid。
599
- */
600
- to_user_ids?: string[];
601
- [key: string]: any;
602
- };
603
- };
604
- /**
605
- * 内置事件类型。
606
- */
607
- declare enum BuiltinEventType {
608
- /**
609
- * 变更用户状态。
610
- */
611
- UserChange = "user_change",
612
- /**
613
- * 变更房间状态。
614
- */
615
- RoomChange = "room_change"
616
- }
617
- /**
618
- * 内置事件行为类型。
619
- */
620
- declare enum BuiltinActionType {
621
- /**
622
- * 修改麦克风状态。
623
- */
624
- UserMicroStatus = "change_micro_status",
625
- /**
626
- * 同步当前用户状态:客户端麦克风状态已经修改成功,通知服务端
627
- */
628
- UserMicroStatusSync = "sync_micro_status",
629
- /**
630
- * 调整某些用户的权限。
631
- */
632
- UserPermission = "change_permission",
633
- /**
634
- * 用户状态发生改变。
635
- */
636
- UserStatus = "change_status",
637
- /**
638
- * 更新用户信息。
639
- */
640
- UserInfo = "change_info",
641
- /**
642
- * 关闭房间。
643
- */
644
- RoomClose = "close"
645
- }
646
- /**
647
- * 内置事件数据结构体。
648
- */
649
- type BuiltinMsg = {
650
- event_type: BuiltinEventType;
651
- action: BuiltinActionType;
652
- to_user_ids: string[];
653
- data: {
654
- extension?: Record<string, any>;
655
- [key: string]: any;
656
- };
657
- };
658
- /**
659
- * 麦克风状态。
660
- */
661
- declare enum MicroStatus {
662
- /**
663
- * 打开
664
- */
665
- OPEN = "OPEN",
666
- /**
667
- * 关闭
668
- */
669
- CLOSE = "CLOSE"
670
- }
671
- /**
672
- * 响应的信息结构体。
673
- */
674
- type LiveMsg = {
675
- code: string;
676
- message: string;
677
- command: Command;
678
- roomCode: string;
679
- appId: string;
680
- requestId: string;
681
- frontRequestId: string;
682
- triggerUserId: string;
683
- data: Record<string, any> | Record<string, any>[];
684
- };
685
- /**
686
- * 解析下后端数据格式。
687
- * @param jsonTxt - JSON序列化后的文本。
688
- * @returns false 标识解析失败;解析成功返回 {@link LiveMsg} 实例。
689
- */
690
- declare function parseLiveMsg(jsonTxt: string): LiveMsg | boolean;
691
-
692
- declare enum LiveState {
693
- NOTINITIALIZED = -1,
694
- /**
695
- * 正在链接中
696
- */
697
- CONNECTING = 0,
698
- /**
699
- * 已经链接并且可以通讯
700
- */
701
- OPEN = 1,
702
- /**
703
- * 连接已关闭或者链接失败
704
- */
705
- CLOSED = 3
706
- }
707
-
708
- /**
709
- * 用户当前状态枚举。
710
- */
711
- declare enum UserStatus {
712
- /**
713
- * 正常
714
- */
715
- Normal = 0,
716
- /**
717
- * 被移除
718
- */
719
- Removed = 1,
720
- /**
721
- * 被替换
722
- */
723
- Replaced = 2
724
- }
725
- declare enum MemUserStatus {
726
- WAIT_ENTER = "WAIT_ENTER",
727
- ONLINE = "ONLINE",
728
- LEAVE = "LEAVE",
729
- KICK_OUT = "KICK_OUT",
730
- BE_REPLACE = "BE_REPLACE",
731
- EXCEPTION = "EXCEPTION"
732
- }
733
- /**
734
- * 用户信息扩展字段:比如提供用户画像相关的数据。
735
- */
736
- type UserInfoExt = {
737
- /**
738
- * 用户昵称。
739
- */
740
- nickname?: string;
741
- /**
742
- * 用户头像。
743
- */
744
- avatar?: string;
745
- /**
746
- * 其他用户相关的字段,比如用户职称、住址、联系方式等信息。
747
- */
748
- [key: string]: any;
749
- };
750
- /**
751
- * 带看会话房间用户的信息格式。
752
- */
753
- type UserInfo = {
754
- /**
755
- * 用户唯一标识ID。
756
- */
757
- id: string;
758
- /**
759
- * 用户当前的状态。
760
- */
761
- status?: UserStatus;
762
- /**
763
- * 内存中的用户状态。
764
- */
765
- mem_user_status?: MemUserStatus;
766
- /**
767
- * 用户当前是否开启麦克风。
768
- */
769
- micro_status: boolean;
770
- /**
771
- * 用户角色定义。(前端不关注此字段)。
772
- */
773
- user_role?: number | string;
774
- /**
775
- * 用户当前是否在线。
776
- */
777
- current_ws_online?: boolean;
778
- /**
779
- * 用户曾经是否在线过,即进入房间后又由于某种原因离开后重新进入。
780
- */
781
- once_ws_online?: boolean;
782
- /**
783
- * RTC 环境是否就绪,即当前语音是否联通。
784
- */
785
- rtc: boolean;
786
- /**
787
- * 当前用户的权限配置。(UI层面理解)。
788
- */
789
- permission?: Partial<Permission>;
790
- /**
791
- * 用户信息扩展字段。
792
- */
793
- extension?: UserInfoExt;
794
- };
795
- interface Permission {
796
- more_vr_scene: boolean;
797
- invite_other: boolean;
798
- control_own_micro: boolean;
799
- control_other_micro: boolean;
800
- view_own_micro_status: boolean;
801
- view_other_micro_status: boolean;
802
- close_live_room: boolean;
803
- apply_other_phone: boolean;
804
- dynamic_enter: boolean;
805
- sync_frame: boolean;
806
- transfer_role: boolean;
807
- change_other_status: boolean;
808
- control_other_sync: boolean;
809
- extension: Record<string, boolean>;
810
- }
811
-
812
- /**
813
- * 带看事件列表
814
- */
815
- type LiveEventType<KeyframesSnapshot> = {
816
- /**
817
- * 带看状态变化
818
- * @param state
819
- * @param prevState
820
- */
821
- 'stateChange'(state: LiveState, prevState?: LiveState): void;
822
- /**
823
- * 内置消息事件
824
- * @param builtinMsg
825
- */
826
- 'builtinEvent'(builtinMsg: BuiltinMsg): void;
827
- /**
828
- * 内置消息事件: 用户信息改变
829
- * @param builtinMsg
830
- */
831
- 'userChange'(builtinMsg: BuiltinMsg): void;
832
- /**
833
- * 内置消息事件:房间信息改变
834
- * @param builtinMsg
835
- */
836
- 'roomChange'(builtinMsg: BuiltinMsg): void;
837
- /**
838
- * 收到其他用户的广播消息。
839
- * @param evtMsg
840
- */
841
- 'broadcast'(evtMsg: Record<string, any>, frontRequestId: string): void;
842
- /**
843
- * 带看已经就绪,可以发送帧数据。
844
- * @param lastKeyframe 带看最后一帧数据(链接切换、断网等重连恢复上次会话帧状态),你可以通过此数据拉齐当前UI状态。
845
- * @deprecated 此事件已废弃,请使用 `keyframes` 事件替代,最后的帧数据会通过 `keyframes` 事件发送,同时 keyframes 对象在 ready 后会自动更新。
846
- */
847
- 'readyKeyframeSync'(lastKeyframe: Partial<KeyframesSnapshot>): void;
848
- /**
849
- * 获取其他用户输送的帧数据:根据此帧数据更新UI状态。
850
- * @param keyframes
851
- */
852
- 'keyframes'(keyframes: Partial<KeyframesSnapshot>, frontRequestId: string): void;
853
- /**
854
- * 个人信息发生更新。
855
- * @param userInfo
856
- */
857
- 'selfInfoUpdate'(userInfo: UserInfo, frontRequestId: string): void;
858
- /**
859
- * 用户列表更新。
860
- * @param userList
861
- */
862
- 'userListUpdate'(userList: UserInfo[], frontRequestId: string): void;
863
- /**
864
- * 被踢出房间
865
- * */
866
- 'kickOut'(): void;
867
- /**
868
- * 异常消息:不符合规范。
869
- * @param liveMsg
870
- */
871
- 'error'(liveMsg: LiveMsg): void;
872
- };
873
- /**
874
- * 帧数据订阅发布的事件描述
875
- */
876
- type KeyframeEventType<KeyframesSnapshot> = {
877
- [key in keyof KeyframesSnapshot]: (nextKeyframes: KeyframesSnapshot[key], prevKeyframes: KeyframesSnapshot[key], frontRequestId: string) => void;
878
- };
879
- /**
880
- * 事件解析
881
- */
882
- type EventType<KeyframesSnapshot> = LiveEventType<KeyframesSnapshot>;
883
-
884
- /**
885
- * 依赖配置。
886
- */
887
- interface LiveOptions {
888
- /**
889
- * 创建`WebSocket`所依赖的URL。
890
- */
891
- url?: string;
892
- /**
893
- * RTC实例。
894
- * 优先使用该实例。
895
- */
896
- rtc?: RTCProtocol;
897
- /**
898
- * RTC类型
899
- * rtc 为空时使用内置的rtc实例类型
900
- */
901
- rtcType?: RTCType;
902
- /**
903
- * 麦克风初始状态
904
- */
905
- initialMicroStatus?: MicroStatus;
906
- /**
907
- * 获取建立 WebSocket 连接的依赖Tick
908
- */
909
- getTicket?: () => Promise<string>;
910
- /**
911
- * jsBridge实例
912
- * 使用内置rtc时提供给rtc实例使用
913
- */
914
- jsBridge?: JSBridgeProtocol;
915
- /**
916
- * 获取语音签名的接口
917
- * 使用内置rtc时提供给rtc实例使用
918
- */
919
- getVoiceSign?: GetVoiceSign;
920
- /**
921
- * 使用webRTC时会有自动播放的安全策略限制,用户有交互
922
- * @param options
923
- * @returns
924
- */
925
- autoPlayConfirm?: (options: {
926
- onConfirm: () => void;
927
- }) => void;
928
- /**
929
- * 使用内置的rtc实例
930
- */
931
- useBuiltInRTC?: boolean;
932
- /**
933
- * 内置的rtc通道类型
934
- * trtc or chime , default trtc
935
- */
936
- builtInRTCType?: BuiltInRTCType;
937
- /**
938
- * 使用内置的jsBridge实例
939
- */
940
- useBuiltInJsBridge?: boolean;
941
- /**
942
- * 能否禁用某个/些用户的麦克风
943
- */
944
- canForbidUserMicro?: (users: string | string[]) => boolean;
945
- /**
946
- * 能否限制某个/些用户的帧数据同步
947
- */
948
- canForbidUserSync?: (users: string | string[]) => boolean;
949
- /**
950
- * 能否强制"踢掉"某个/些用户。
951
- */
952
- canForbidUserKick?: (users: string | string[]) => boolean;
953
- /**
954
- * 是否开启调试模式:此模式下会在终端打印日志方便调试。
955
- */
956
- __debug__?: boolean;
957
- }
958
-
959
- /**
960
- * 带看连接配置项
961
- */
962
- type LiveConnectOptions = {
963
- /**
964
- * 这个是带看房间的 ws 地址
965
- */
966
- url?: string;
967
- /**
968
- * 是否强制加入
969
- * 如果为 true,会强制加入房间,不管之前是否已经加入,会把之前的连接断开
970
- * 如果为 false,会检查是否已经加入房间,如果已经加入,不会再次加入
971
- */
972
- force?: boolean;
973
- /**
974
- * 获取带看房间 ticket 的方法
975
- */
976
- getTicket?: () => Promise<string>;
977
- /**
978
- * 初始的麦克风状态
979
- */
980
- rtcMicStatus?: MicroStatus;
981
- };
982
-
983
- type RoomInfo = {
984
- info: {
985
- id: string | number;
986
- status: string | number;
987
- create_user_id: string;
988
- app_id: string;
989
- extension: Record<string, any>;
990
- create_time: string;
991
- room_code: string;
992
- };
993
- init_timestamp: string;
994
- last_frame: Record<string, any>;
995
- };
996
-
997
- /**
998
- * WebSocket 连接状态枚举
999
- */
1000
- declare enum WebSocketState {
1001
- /**
1002
- * 尚未初始化
1003
- */
1004
- NOTINITIALIZED = -1,
1005
- /**
1006
- * 正在链接中
1007
- */
1008
- CONNECTING = 0,
1009
- /**
1010
- * 已经链接并且可以通讯
1011
- */
1012
- OPEN = 1,
1013
- /**
1014
- * 连接正在关闭
1015
- */
1016
- CLOSING = 2,
1017
- /**
1018
- * 连接已关闭或者没有链接成功
1019
- */
1020
- CLOSED = 3
1021
- }
1022
- type WebSocketError = {
1023
- type: WebSocketErrorType;
1024
- closeError?: WebSocketCloseError;
1025
- target?: Event | CloseEvent;
1026
- error?: any;
1027
- };
1028
- declare enum WebSocketErrorType {
1029
- Error = "Error",
1030
- Close = "Close",
1031
- MicroAuth = "MicroAuth",
1032
- DuplicateConnect = "DuplicateConnect",
1033
- IllegalURL = "IllegalURL",
1034
- Unknown = "Unknown",
1035
- IllegalArgs = "IllegalArgs"
1036
- }
1037
- /**
1038
- * WebSocket 异常关闭枚举:https://developer.mozilla.org/zh-CN/docs/Web/API/CloseEvent。
1039
- */
1040
- declare enum WebSocketCloseError {
1041
- /**
1042
- * 正常关闭; 无论为何目的而创建,该链接都已成功完成任务。
1043
- */
1044
- Err_1000 = "CLOSE_NORMAL",
1045
- /**
1046
- * 终端离开, 可能因为服务端错误, 也可能因为浏览器正从打开连接的页面跳转离开。
1047
- */
1048
- Err_1001 = "CLOSE_GOING_AWAY",
1049
- /**
1050
- * 由于协议错误而中断连接。
1051
- */
1052
- Err_1002 = "CLOSE_PROTOCOL_ERROR",
1053
- /**
1054
- * 由于接收到不允许的数据类型而断开连接 (如仅接收文本数据的终端接收到了二进制数据)。
1055
- */
1056
- Err_1003 = "CLOSE_UNSUPPORTED",
1057
- /**
1058
- * 安全因素或WebSocket连接次数达到上限。
1059
- */
1060
- Err_1006 = "CLOSE_ABNORMAL",
1061
- /**
1062
- * 由于收到了格式不符的数据而断开连接 (如文本消息中包含了非 UTF-8 数据)。
1063
- */
1064
- Err_1007 = "Unsupported Data",
1065
- /**
1066
- * 由于收到不符合约定的数据而断开连接。
1067
- */
1068
- Err_1008 = "Policy Violation",
1069
- /**
1070
- * 由于收到过大的数据帧而断开连接。
1071
- */
1072
- Err_1009 = "CLOSE_TOO_LARGE",
1073
- /**
1074
- * 未知错误。
1075
- */
1076
- Err_unknown = "unknown"
1077
- }
1078
- declare function parseWSClsErr(code: number): WebSocketCloseError;
1079
-
1080
- type RTCActionReactCallback = Pick<RTCProtocol, 'join' | 'quit' | 'shock' | 'toggleMicro' | 'detectMicro'>;
1081
-
1082
- type LiveBuiltInData<KeyframesSnapshot> = {
1083
- selfInfo?: UserInfo;
1084
- userList?: UserInfo[];
1085
- roomInfo?: RoomInfo;
1086
- rtcInfo?: {
1087
- voiceId: string;
1088
- type: RTCType;
1089
- };
1090
- keyframes: Y.Map<KeyframesSnapshot>;
1091
- };
1092
- declare const _clearLiveInstanceIfNeed: () => void;
1093
- declare class Live<KeyframesSnapshot extends Record<string, any>> extends Subscribe<EventType<KeyframesSnapshot>> {
1094
- /**
1095
- * 带看的配置选项
1096
- */
1097
- private _options;
1098
- get options(): LiveOptions;
1099
- /**
1100
- * 带看状态
1101
- */
1102
- get state(): LiveState;
1103
- /**
1104
- * 兼容老逻辑
1105
- * @deprecated 请直接读取 state 属性字段,未来将移除该属性
1106
- */
1107
- get readyState(): LiveState;
1108
- /**
1109
- * 获取当前WebSocket连接的URL。(注意:这个是WebSocket连接的完整连接,附带一些query参数)。
1110
- * @deprecated 带看不需要关注底层ws的相关信息,未来将移除
1111
- */
1112
- get url(): string | undefined;
1113
- /**
1114
- * 获取当前live使用的RTC实例
1115
- */
1116
- get $RTC(): RTCProtocol;
1117
- /**
1118
- * 获取当前live使用的jsBridge实例
1119
- */
1120
- get jsBridge(): JSBridgeProtocol;
1121
- /**
1122
- * 帧数据监听
1123
- */
1124
- keyframes: Subscribe<KeyframeEventType<KeyframesSnapshot>>;
1125
- /**
1126
- * 带看的 yDoc
1127
- */
1128
- private _yDoc;
1129
- /**
1130
- * 内置的一些数据
1131
- */
1132
- private _buildInData;
1133
- constructor(opts: LiveOptions);
1134
- get _buildInKeyframes(): Y.Map<KeyframesSnapshot>;
1135
- /**
1136
- * 当前帧数据快照
1137
- */
1138
- get snapshot(): Partial<KeyframesSnapshot>;
1139
- _initializeKeyframesObservers: () => void;
1140
- _handleKeyframesChange: (event: Y.YMapEvent<KeyframesSnapshot>) => void;
1141
- /**
1142
- * 根据键值取帧数据
1143
- * @param key 帧数据的键值
1144
- * @returns
1145
- */
1146
- getFramesByKey: <Key extends keyof KeyframesSnapshot>(key: Key) => Partial<KeyframesSnapshot>[Key] | undefined;
1147
- /**
1148
- * 发送帧数据(需要能够被序列化)
1149
- * @param key 帧数据键值
1150
- * @param frame 帧数据本体
1151
- * @returns 发送结果,成功返回true,失败返回false或Error
1152
- */
1153
- sendKeyframe: <Key extends keyof KeyframesSnapshot>(key: Key, frame: KeyframesSnapshot[Key]) => boolean | Error;
1154
- /**
1155
- * 当前用户信息
1156
- */
1157
- get selfInfo(): UserInfo | undefined;
1158
- /**
1159
- * 当前用户列表
1160
- */
1161
- get userList(): UserInfo[];
1162
- /**
1163
- * 当前带看房间信息
1164
- */
1165
- get roomInfo(): RoomInfo | undefined;
1166
- /**
1167
- * 带看控制器
1168
- */
1169
- private _controller;
1170
- private _initializeOptions;
1171
- private _initializeJsBridge;
1172
- private _initializeRTC;
1173
- private _createBuiltInRTC;
1174
- private _createVRWebViewRTC;
1175
- private _createBrowserRTC;
1176
- private _createDefaultRTC;
1177
- private _autoConnect;
1178
- private _debugSetup;
1179
- /**
1180
- * 添加带看控制的事件监听
1181
- */
1182
- private _addLiveControllerEventListeners;
1183
- /**
1184
- * 移除带看控制的事件监听
1185
- */
1186
- private _removeLiveControllerEventListeners;
1187
- /**
1188
- * 带看状态变化处理
1189
- * @param state 当前状态
1190
- * @param prevState 之前的状态
1191
- */
1192
- private _handleStateChange;
1193
- /**
1194
- * 消息接收
1195
- * @param liveMsg
1196
- */
1197
- private _handleMessage;
1198
- /**
1199
- * 清理带看缓存的数据
1200
- */
1201
- private _clearLiveData;
1202
- /**
1203
- * 连接带看
1204
- * @param options 连接选项
1205
- * @returns 连接结果,成功返回true,失败返回Error
1206
- */
1207
- connect: (options?: LiveConnectOptions) => Promise<true | Error>;
1208
- /**
1209
- * 退出带看
1210
- * @returns
1211
- */
1212
- _exit: () => Promise<boolean>;
1213
- /**
1214
- * 退出带看
1215
- * @returns
1216
- */
1217
- exit: () => Promise<void>;
1218
- /**
1219
- * 关闭带看房间
1220
- * @returns 关闭结果
1221
- */
1222
- close: () => Promise<void>;
1223
- /**
1224
- * 销毁带看
1225
- * @returns
1226
- */
1227
- dispose: () => Promise<boolean>;
1228
- /**
1229
- * 修改状态
1230
- * @param evtType
1231
- * @param atnType
1232
- * @param status
1233
- * @param toUserIds
1234
- * @returns
1235
- */
1236
- updateStatus(evtType: BuiltinEventType, atnType: BuiltinActionType, status: Record<string, any>, toUserIds?: string | string[]): Promise<boolean>;
1237
- /**
1238
- * 设置自己的用户信息
1239
- * @param userInfo
1240
- * @returns
1241
- */
1242
- setSelfInfo: (userInfo: Partial<UserInfo>) => Promise<boolean>;
1243
- /**
1244
- * 自定义广播
1245
- * @param request 广播请求的数据
1246
- * @param toUserIds
1247
- * @param timeout
1248
- * @returns
1249
- */
1250
- broadcast<Request extends Record<string, any>, Response>(request: Request, toUserIds: string | string[], timeout: number): Promise<Response> | Error | false;
1251
- toggleMicro: (microStatus: boolean) => Promise<boolean>;
1252
- /**
1253
- * 控制别人的麦
1254
- * @param microStatus
1255
- * @param toUserIds
1256
- * @returns
1257
- */
1258
- forbidMicro: (microStatus: MicroStatus, toUserIds: string | string[]) => Promise<boolean>;
1259
- /**
1260
- * 控制别人的同步全量帧数据权限
1261
- * @param sync
1262
- * @param toUserIds
1263
- * @returns
1264
- */
1265
- forbidSync: (sync: boolean, toUserIds: string | string[]) => Promise<boolean>;
1266
- /**
1267
- * 把用户踢出带看
1268
- * @param toUserIds
1269
- * @returns
1270
- */
1271
- kick: (toUserIds: string | string[]) => Promise<boolean>;
1272
- /**
1273
- * 获取当前某个 keyframe 的数据快照
1274
- */
1275
- getSnapshotForKey<Key extends keyof KeyframesSnapshot>(key: Key): any;
1276
- }
1277
-
1278
- /**
1279
- * 创建`Live`实例
1280
- * @param opts
1281
- * @returns
1282
- */
1283
- declare const createLive: <KeyframesSnapshot extends Record<string, any>>(opts: LiveOptions) => Live<KeyframesSnapshot>;
1284
-
1285
- type LiveProviderPropTypes<KeyframesSnapshot extends Record<string, any>> = {
1286
- children?: React.ReactNode;
1287
- live?: Live<KeyframesSnapshot>;
1288
- };
1289
- /**
1290
- * 创建 LiveReact 实例,并提供 `React` 技术栈相关工具链。
1291
- * @param options 带看配置
1292
- * @returns 返回当前的带看上下文实例
1293
- */
1294
- declare function createLiveReact<KeyframesSnapshot extends Record<string, any>>(options: LiveOptions): {
1295
- live: Live<KeyframesSnapshot>;
1296
- jsBridge: _realsee_jsbridge_x.JSBridgeProtocol;
1297
- LiveProvider: (props: LiveProviderPropTypes<KeyframesSnapshot>) => React.FunctionComponentElement<React.ProviderProps<Live<KeyframesSnapshot> | null>>;
1298
- unsafe__useLiveInstance: () => Live<KeyframesSnapshot>;
1299
- unsafe__useRTCInstance: () => RTCProtocol;
1300
- useConnect: () => (options: LiveConnectOptions) => Promise<true | Error>;
1301
- useKeyframe: <K extends keyof KeyframesSnapshot>(key: K) => (KeyframesSnapshot[K] | ((frame: KeyframesSnapshot[K]) => boolean | Error) | undefined)[];
1302
- useKeyframeUpdateCallback: <KeyOfKeyframe extends keyof KeyframeEventType<KeyframesSnapshot>>(key: KeyOfKeyframe, callback: (...args: Parameters<KeyframeEventType<KeyframesSnapshot>[KeyOfKeyframe]>) => ReturnType<KeyframeEventType<KeyframesSnapshot>[KeyOfKeyframe]>, deps?: React.DependencyList) => () => void;
1303
- useLiveAction: () => {
1304
- connect: (options: LiveConnectOptions) => Promise<void>;
1305
- broadcast: (data: Record<string, any>, toUserIds: string | string[], timeout?: number) => Promise<void>;
1306
- exit: () => Promise<void>;
1307
- kick: (toUserIds: string | string[]) => Promise<void>;
1308
- toggleMicro: (microStatus: boolean) => void;
1309
- forbidMicro: (micro: MicroStatus, toUserIds?: string | string[]) => Promise<void>;
1310
- forbidSync: (sync: boolean, toUserIds?: string | string[]) => void;
1311
- sendKeyframe: (key: keyof KeyframesSnapshot, frame: KeyframesSnapshot[keyof KeyframesSnapshot]) => void;
1312
- getFramesByKey: (key: keyof KeyframesSnapshot) => Partial<KeyframesSnapshot>[keyof KeyframesSnapshot] | undefined;
1313
- setSelfInfo: (userInfo: Partial<UserInfo>) => void;
1314
- updateStatus: (evtType: BuiltinEventType, atnType: BuiltinActionType, status: Record<string, any>, toUserIds?: string | string[]) => void;
1315
- };
1316
- useLiveEventCallback: <K extends keyof LiveEventType<KeyframesSnapshot>>(name: K, callback: (...args: Parameters<LiveEventType<KeyframesSnapshot>[K]>) => ReturnType<LiveEventType<KeyframesSnapshot>[K]>, deps?: React.DependencyList) => () => void;
1317
- useLiveState: () => LiveState;
1318
- useRTCAction: () => {
1319
- join: (options: {
1320
- voiceId: string;
1321
- userId: string;
1322
- roomId: string;
1323
- type: RTCType;
1324
- }) => Promise<boolean>;
1325
- quit: () => Promise<boolean>;
1326
- shock: () => void | undefined;
1327
- toggleMicro: (flag?: boolean | undefined) => Promise<boolean>;
1328
- detectMicro: () => Promise<boolean>;
1329
- };
1330
- useRTCEventCallback: <K extends keyof RTCEventType>(name: K, callback: (...args: Parameters<RTCEventType[K]>) => ReturnType<RTCEventType[K]>, deps?: React.DependencyList) => () => void;
1331
- useSelfInfo: () => (Partial<UserInfo> | ((userInfo: Partial<UserInfo>) => Promise<boolean>))[];
1332
- useKeyframesSnapshot: () => Partial<KeyframesSnapshot>;
1333
- useUserList: () => UserInfo[];
1334
- };
1335
-
1336
- export { type AttendeeResponse, BrowserRTC, BrowserRTC4Chime, BuiltInRTCType, BuiltinActionType, BuiltinEventType, type BuiltinMsg, Command, CoreRTC, type EventMap, type EventType, type GetVoiceSign, GetVoiceSignFn, type GetVoiceSignParams, type GetVoiceSignReturnType, type KeyframeEventType, Live, type LiveBuiltInData, type LiveConnectOptions, type LiveEventType, type LiveMsg, type LiveOptions, type LiveProviderPropTypes, LiveState, type MeetingResponse, type MeetingSessionConfigurationOptions, MemUserStatus, MicroStatus, type Permission, type RTCActionReactCallback, type RTCEventType, type RTCJoinedInfo, RTCJoinedInfoCodeEnum, type RTCProtocol, RTCType, type ReqLiveMsg, type RoomInfo, Subscribe, SubscribeMixinType, type UserInfo, type UserInfoExt, UserStatus, type UserVolume, VRWebViewRTC, type VRWebViewRTCOptions, WebSocketCloseError, type WebSocketError, WebSocketErrorType, WebSocketState, _clearLiveInstanceIfNeed, createLive, createLiveReact, parseLiveMsg, parseWSClsErr };
1
+ export * from './rtc';
2
+ export * from './typings';
3
+ export * from './live/createLive';
4
+ export * from './live/createLiveReact';
5
+ export * from './live/live';