floating-live 0.17.0-alpha.12 → 0.17.0-alpha.14

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/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Minteea
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Minteea
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
9
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,36 +1,36 @@
1
- # Floating Live
2
-
3
- 一个用于处理和保存直播弹幕的 Web 小工具,开箱即用。
4
-
5
- 本体无弹幕获取功能,需要配合[floating-live-plugins](https://github.com/Minteea/floating-live-plugins)中的插件使用。
6
-
7
- 目前插件库支持 bilibili 和 AcFun 的直播弹幕,不同平台的弹幕会转换为同一种格式便于保存。
8
-
9
- 项目仍在开发中,功能尚未完善,目前除了记录保存直播弹幕外暂时没有别的用处啦,敬请期待。
10
-
11
- 注意:当前项目未进入正式版本阶段,程序结构及导出数据结构可能随时改动,**非常不建议用于正式项目中**。
12
-
13
- GUI 版本:[Minteea/floating-live-gui](https://github.com/Minteea/floating-live-gui)
14
-
15
- ## 使用方法
16
-
17
- ### npm 安装
18
-
19
- ```
20
- npm install floating-live
21
- ```
22
-
23
- ```javascript
24
- // 导入FloatingLive本体
25
- import { FloatingLive } from "floating-live";
26
- // 导入bilibili房间生成插件
27
- import bilibili from "@floating-live/bilibili";
28
-
29
- // 创建一个FloatingLive实例
30
- const live = new FloatingLive();
31
- // 注册插件
32
- live.plugin.register(bilibili);
33
-
34
- // 添加房间并自动打开
35
- live.room.add("bilibili", 6, true);
36
- ```
1
+ # Floating Live
2
+
3
+ 一个用于处理和保存直播弹幕的 Web 小工具,开箱即用。
4
+
5
+ 本体无弹幕获取功能,需要配合[floating-live-plugins](https://github.com/Minteea/floating-live-plugins)中的插件使用。
6
+
7
+ 目前插件库支持 bilibili 和 AcFun 的直播弹幕,不同平台的弹幕会转换为同一种格式便于保存。
8
+
9
+ 项目仍在开发中,功能尚未完善,目前除了记录保存直播弹幕外暂时没有别的用处啦,敬请期待。
10
+
11
+ 注意:当前项目未进入正式版本阶段,程序结构及导出数据结构可能随时改动,**非常不建议用于正式项目中**。
12
+
13
+ GUI 版本:[Minteea/floating-live-gui](https://github.com/Minteea/floating-live-gui)
14
+
15
+ ## 使用方法
16
+
17
+ ### npm 安装
18
+
19
+ ```
20
+ npm install floating-live
21
+ ```
22
+
23
+ ```javascript
24
+ // 导入FloatingLive本体
25
+ import { FloatingLive } from "floating-live";
26
+ // 导入bilibili房间生成插件
27
+ import bilibili from "@floating-live/bilibili";
28
+
29
+ // 创建一个FloatingLive实例
30
+ const live = new FloatingLive();
31
+ // 注册插件
32
+ live.plugin.register(bilibili);
33
+
34
+ // 添加房间并自动打开
35
+ live.room.add("bilibili", 6, true);
36
+ ```
@@ -13,8 +13,6 @@ export declare class FloatingLive extends App {
13
13
  /** 获取房间 */
14
14
  get(key: string): LiveRoom | import("./live/index.js").InvalidLiveRoom | undefined;
15
15
  has(key: string): boolean;
16
- /** 获取房间信息 */
17
- data(key: string): import("./live/index.js").LiveRoomData | undefined;
18
16
  /** 更新房间信息 */
19
17
  update(key: string): void;
20
18
  /** 打开房间连接 */
@@ -24,10 +24,6 @@ export class FloatingLive extends App {
24
24
  has(key) {
25
25
  return this.room.has(key);
26
26
  }
27
- /** 获取房间信息 */
28
- data(key) {
29
- return this.room.data(key);
30
- }
31
27
  /** 更新房间信息 */
32
28
  update(key) {
33
29
  return this.room.update(key);
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CommandOptions, CommandCallOptions, AppCommandMap, CommandFunction } from "./command/index.js";
1
+ import { CommandOptions, CommandCallOptions, AppCommandMap, CommandFunction, AppCommandAliasMap } from "./command/index.js";
2
2
  import { CommandManager } from "./command/manager.js";
3
3
  import { AppEventDetailMap, AppEventEmitOptions, AppEventListener } from "./event/index.js";
4
4
  import { AppHookMap, HookCallOptions, HookContext, HookFunction, HookUseOptions } from "./hook/index.js";
@@ -31,6 +31,7 @@ export declare class App extends CustomEventEmitter implements PluginContext {
31
31
  getPluginExposes(pluginName: string): any;
32
32
  hasPlugin(pluginName: string): boolean;
33
33
  registerCommand<T extends keyof AppCommandMap>(name: T, func: CommandFunction<AppCommandMap[T]>, options?: CommandOptions): void;
34
+ registerCommandAlias<T extends keyof AppCommandAliasMap>(name: T, targetName: AppCommandAliasMap[T], options?: CommandOptions): void;
34
35
  unregisterCommand(name: string): void;
35
36
  hasCommand(name: string): boolean;
36
37
  call<T extends keyof AppCommandMap>(name: T, ...args: Parameters<AppCommandMap[T]>): ReturnType<AppCommandMap[T]>;
package/dist/app.js CHANGED
@@ -16,7 +16,7 @@ export class App extends CustomEventEmitter {
16
16
  this.valueManager = new ValueManager(this);
17
17
  this.pluginManager = new PluginManager(this);
18
18
  // 初始化命令
19
- this.registerCommand("command.snapshot", () => this.commandManager.toSnapshot());
19
+ this.registerCommand("command.getData", () => this.commandManager.getData());
20
20
  this.registerCommand("get", (e, name) => this.getValue(name));
21
21
  this.registerCommand("set", (e, name, value) => this.setValue(name, value));
22
22
  }
@@ -66,6 +66,9 @@ export class App extends CustomEventEmitter {
66
66
  registerCommand(name, func, options) {
67
67
  this.commandManager.register(name, func, options);
68
68
  }
69
+ registerCommandAlias(name, targetName, options) {
70
+ this.commandManager.registerAlias(name, targetName, options);
71
+ }
69
72
  unregisterCommand(name) {
70
73
  this.commandManager.unregister(name);
71
74
  }
@@ -7,16 +7,20 @@ export declare class CommandManager {
7
7
  constructor(app: App);
8
8
  /** 注册命令 */
9
9
  register(name: string, call: CommandFunction<any>, options?: CommandOptions): void;
10
+ /** 注册命令别名 */
11
+ registerAlias(name: string, targetName: string, options?: CommandOptions): void;
10
12
  /** 注销命令 */
11
13
  unregister(name: string): void;
12
14
  /** 调用命令 */
13
15
  call(name: string, ...args: any[]): any;
14
16
  /** 调用命令(可配置) */
15
17
  callWithOptions(name: string, options: CommandCallOptions, ...args: any[]): any;
18
+ /** 从命令别名调用命令 */
19
+ private _callAliasWithOptions;
16
20
  /** 检测命令是否存在 */
17
21
  has(name: string): boolean;
18
22
  /** 获取数据 */
19
- toSnapshot(): {
23
+ getData(): {
20
24
  name: string;
21
25
  pluginName: string | undefined;
22
26
  }[];
@@ -1,4 +1,9 @@
1
1
  import { appError } from "../error/index.js";
2
+ // 错误列表
3
+ // command:notFound 命令不存在
4
+ // command:alreadyExists 命令已存在
5
+ // command:aliasNotFound 命令别名指向的命令不存在
6
+ // command:aliasTargetUncallable 命令别名不可指向其他命令别名
2
7
  export class CommandManager {
3
8
  /** 功能列表 */
4
9
  list = new Map();
@@ -12,6 +17,12 @@ export class CommandManager {
12
17
  this.list.set(name, { call, pluginName });
13
18
  this.app.emit("command:register", { name });
14
19
  }
20
+ /** 注册命令别名 */
21
+ registerAlias(name, targetName, options) {
22
+ const { pluginName } = options || {};
23
+ this.list.set(name, { targetName, pluginName });
24
+ this.app.emit("command:register", { name });
25
+ }
15
26
  /** 注销命令 */
16
27
  unregister(name) {
17
28
  this.list.delete(name);
@@ -25,13 +36,42 @@ export class CommandManager {
25
36
  callWithOptions(name, options, ...args) {
26
37
  const command = this.list.get(name);
27
38
  if (!command) {
28
- throw appError("command:call_unexist", {
29
- message: `命令不存在: ${name}`,
39
+ throw appError("command:notFound", {
40
+ message: `命令不存在[${name}]`,
30
41
  target: `command/${name}`,
42
+ action: "command.call",
43
+ });
44
+ }
45
+ else {
46
+ const { call } = command;
47
+ if (!call) {
48
+ return this._callAliasWithOptions(name, command.targetName, options, ...args);
49
+ }
50
+ else {
51
+ return call({ source: options.source, client: options.client }, ...args);
52
+ }
53
+ }
54
+ }
55
+ /** 从命令别名调用命令 */
56
+ _callAliasWithOptions(name, targetName, options, ...args) {
57
+ const tcommand = this.list.get(targetName);
58
+ if (!tcommand) {
59
+ throw appError("command:aliasNotFound", {
60
+ message: `命令别名[${name}]指向的命令不存在[${targetName}]`,
61
+ target: `command/${name}>${targetName}`,
62
+ action: "command.call",
31
63
  });
32
64
  }
33
65
  else {
34
- return command.call({ source: options.source, client: options.client }, ...args);
66
+ const { call } = tcommand;
67
+ if (!call) {
68
+ throw appError("command:aliasTargetUncallable", {
69
+ message: `命令别名[${name}]不可指向其他命令别名[${targetName}]`,
70
+ target: `command/${name}>${targetName}>${tcommand.targetName}`,
71
+ action: "command.call",
72
+ });
73
+ }
74
+ return call({ source: options.source, client: options.client }, ...args);
35
75
  }
36
76
  }
37
77
  /** 检测命令是否存在 */
@@ -39,7 +79,7 @@ export class CommandManager {
39
79
  return this.list.has(name);
40
80
  }
41
81
  /** 获取数据 */
42
- toSnapshot() {
82
+ getData() {
43
83
  return [...this.list].map(([name, { pluginName }]) => ({
44
84
  name,
45
85
  pluginName,
@@ -19,27 +19,36 @@ export interface CommandItem {
19
19
  call: CommandFunction<any>;
20
20
  pluginName?: string;
21
21
  }
22
+ export interface CommandAliasItem {
23
+ call?: undefined;
24
+ targetName: string;
25
+ pluginName?: string;
26
+ }
27
+ /** 命令函数类型表 */
22
28
  export interface AppCommandMap {
23
29
  get: <T extends keyof AppValueMap>(name: T) => AppValueMap[T];
24
30
  set: <T extends keyof AppValueMap>(name: T, value: AppValueMap[T]) => boolean;
25
- /** 获取注册值快照 */
26
- "value.snapshot": () => {
31
+ /** 获取注册值数据 */
32
+ "value.getData": () => {
27
33
  name: string;
28
34
  value: any;
29
35
  }[];
30
- /** 获取命令快照 */
31
- "command.snapshot": () => {
36
+ /** 获取命令数据 */
37
+ "command.getData": () => {
32
38
  name: string;
33
39
  }[];
34
- /** 获取插件快照 */
35
- "plugin.snapshot": () => {
40
+ /** 获取插件数据 */
41
+ "plugin.getData": () => {
36
42
  pluginName: string;
37
43
  }[];
38
- /** 获取hook快照 */
39
- "hook.snapshot": () => {
44
+ /** 获取hook数据 */
45
+ "hook.getData": () => {
40
46
  name: string;
41
47
  list: {
42
48
  pluginName?: string;
43
49
  }[];
44
50
  }[];
45
51
  }
52
+ /** 命令别名映射 */
53
+ export interface AppCommandAliasMap {
54
+ }
@@ -2,12 +2,14 @@ export * from "./types.js";
2
2
  export interface AppError extends Error {
3
3
  /** 错误发生信息 */
4
4
  cause: {
5
- /** 错误id */
6
- id: string;
5
+ /** 错误代码 */
6
+ code: string;
7
7
  /** 错误目标对象 */
8
8
  target?: string;
9
9
  /** 错误原因 */
10
10
  reason?: string | Error | AppError;
11
+ /** 调用行为 */
12
+ action?: string;
11
13
  };
12
14
  }
13
15
  export interface AppErrorOptions {
@@ -17,8 +19,10 @@ export interface AppErrorOptions {
17
19
  target?: string;
18
20
  /** 错误原因 */
19
21
  reason?: string | Error | AppError;
22
+ /** 调用行为 */
23
+ action?: string;
20
24
  /** 错误构造函数 */
21
25
  errorConstructor?: ErrorConstructor;
22
26
  [key: string]: unknown;
23
27
  }
24
- export declare function appError(id: string, { message, target, reason, errorConstructor }: AppErrorOptions): Error;
28
+ export declare function appError(code: string, { message, target, reason, action, errorConstructor, }: AppErrorOptions): AppError;
@@ -1,10 +1,14 @@
1
1
  export * from "./types.js";
2
- export function appError(id, { message, target, reason, errorConstructor = Error }) {
2
+ export function appError(code, { message, target, reason, action, errorConstructor = Error, }) {
3
3
  return new errorConstructor(message, {
4
4
  cause: {
5
- id,
5
+ code,
6
6
  target,
7
7
  reason,
8
+ action,
8
9
  },
9
10
  });
10
11
  }
12
+ // 错误码分类
13
+ // http:xxx http状态码
14
+ // node:xxx nodejs错误码
@@ -13,7 +13,7 @@ export declare class HookManager {
13
13
  call(name: string, ctx: any): Promise<any>;
14
14
  /** 同步调用钩子函数 */
15
15
  callSync(name: string, ctx: any): any;
16
- toSnapshot(): {
16
+ getData(): {
17
17
  name: string;
18
18
  list: {
19
19
  pluginName?: string;
@@ -1,11 +1,14 @@
1
1
  import { appError } from "../error/index.js";
2
+ // 错误列表
3
+ // hook:functionAlreadyExists 钩子函数已存在
4
+ // hook:functionNotFound 钩子函数不存在
2
5
  export class HookManager {
3
6
  list = new Map();
4
7
  pluginMap = new Map();
5
8
  app;
6
9
  constructor(app) {
7
10
  this.app = app;
8
- app.registerCommand("hook.snapshot", () => this.toSnapshot());
11
+ app.registerCommand("hook.getData", () => this.getData());
9
12
  }
10
13
  /** 挂载钩子函数 */
11
14
  use(name, call, options) {
@@ -16,10 +19,10 @@ export class HookManager {
16
19
  this.list.set(name, hooks);
17
20
  }
18
21
  else if (hooks.includes(call)) {
19
- throw appError("hook:use_duplicate", {
20
- message: `钩子函数挂载失败: ${name}`,
21
- reason: "重复挂载同一函数",
22
+ throw appError("hook:functionAlreadyExists", {
23
+ message: `无法重复挂载同一钩子函数: ${name}`,
22
24
  target: `hook/${name}`,
25
+ action: "hook.use",
23
26
  });
24
27
  }
25
28
  hooks.push({ call, pluginName });
@@ -29,10 +32,10 @@ export class HookManager {
29
32
  let hooks = this.list.get(name);
30
33
  const index = hooks?.findIndex((item) => item.call == call) ?? -1;
31
34
  if (!hooks || index < 0)
32
- throw appError("hook:unuse_unexist", {
33
- message: `钩子函数卸载失败: ${name}`,
34
- reason: "卸载不存在的钩子函数",
35
+ throw appError("hook:functionNotFound", {
36
+ message: `无法卸载不存在的钩子函数: ${name}`,
35
37
  target: `hook/${name}`,
38
+ action: "hook.unuse",
36
39
  });
37
40
  hooks.splice(index, 1);
38
41
  }
@@ -64,7 +67,7 @@ export class HookManager {
64
67
  }
65
68
  return ctx;
66
69
  }
67
- toSnapshot() {
70
+ getData() {
68
71
  return [...this.list].map(([name, fnList]) => ({
69
72
  name,
70
73
  list: fnList.map(({ pluginName }) => ({ pluginName })),
@@ -1,5 +1,7 @@
1
1
  import { DanmakuMode, UserInfo, ImageInfo, GiftInfo, UserType } from "./messageInfo.js";
2
2
  import { LiveRoomStatus, LiveRoomStatsInfo, LiveRoomDetailInfo } from "./room.js";
3
+ export interface LiveMessageExtensions {
4
+ }
3
5
  export declare namespace LiveMessage {
4
6
  interface Base {
5
7
  /** 平台名称 */
@@ -12,10 +14,17 @@ export declare namespace LiveMessage {
12
14
  type: string;
13
15
  /** 时间戳 */
14
16
  timestamp: number;
15
- /** 消息id */
17
+ /** 消息id
18
+ *
19
+ * 须保证不重复性,规范id格式如下:
20
+ *
21
+ * 用户相关消息:platform:roomId-type:userId-uniqueId
22
+ *
23
+ * 房间相关消息:platform:roomId-type-uniqueId
24
+ * */
16
25
  id: string;
17
- /** 其他属性 */
18
- [attr: string]: any;
26
+ /** 拓展属性 */
27
+ extension?: LiveMessageExtensions;
19
28
  }
20
29
  /** 聊天消息 */
21
30
  interface Comment extends Base {
@@ -81,8 +90,8 @@ export declare namespace LiveMessage {
81
90
  interface Superchat extends Base {
82
91
  type: "superchat";
83
92
  info: {
84
- /** 留言id */
85
- id: string | number;
93
+ /** 留言代码,用于撤回消息 */
94
+ token: string | number;
86
95
  /** 用户信息 */
87
96
  user: UserInfo;
88
97
  /** 文本内容 */
@@ -129,6 +138,7 @@ export declare namespace LiveMessage {
129
138
  info: {
130
139
  /** 切断消息 */
131
140
  message: string;
141
+ status: LiveRoomStatus;
132
142
  };
133
143
  }
134
144
  /** 直播数据更新 */
@@ -141,57 +151,5 @@ export declare namespace LiveMessage {
141
151
  type: "live_detail";
142
152
  info: LiveRoomDetailInfo;
143
153
  }
144
- /** 主播抽奖 */
145
- interface Lottery extends Base {
146
- type: "lottery";
147
- info: {
148
- title: string;
149
- role: "user" | "anchor";
150
- user?: UserInfo;
151
- gift?: GiftInfo;
152
- id: string | number;
153
- award?: GiftInfo | GiftInfo[];
154
- value?: number;
155
- valueType?: string | number;
156
- price?: number;
157
- currency?: string;
158
- };
159
- }
160
- /** 主播抽奖结果 */
161
- interface LotteryResult extends Base {
162
- type: "lottery_result";
163
- info: {
164
- title: string;
165
- role: "user" | "anchor";
166
- id: string | number;
167
- result: {
168
- user: UserInfo;
169
- award: GiftInfo | GiftInfo[];
170
- }[];
171
- };
172
- }
173
- /** 发送红包 */
174
- interface Redpacket extends Base {
175
- type: "redpacket";
176
- info: {
177
- id: string | number;
178
- gifts?: GiftInfo[];
179
- value?: number;
180
- currency?: string | number;
181
- };
182
- }
183
- /** 红包抽奖结果 */
184
- interface RedpacketResult extends Base {
185
- type: "redpacket_result";
186
- info: {
187
- id: string | number;
188
- result: {
189
- user: UserInfo;
190
- gift?: GiftInfo;
191
- value?: number;
192
- currency?: string | number;
193
- }[];
194
- };
195
- }
196
- type All = Comment | Gift | Interact | Membership | Superchat | Block | LiveStart | LiveEnd | LiveCut | LiveDetail | LiveStats | Lottery | LotteryResult;
154
+ type All = Comment | Gift | Interact | Membership | Superchat | Block | LiveStart | LiveEnd | LiveCut | LiveDetail | LiveStats;
197
155
  }
@@ -13,8 +13,8 @@ export interface UserInfo {
13
13
  type?: UserType;
14
14
  /** 粉丝vip等级 */
15
15
  membership?: boolean | number;
16
- /** vip等级 */
17
- vip?: boolean | number;
16
+ /** 平台vip等级 */
17
+ premium?: boolean | number;
18
18
  /** 用户等级 */
19
19
  level?: number;
20
20
  }
@@ -50,10 +50,12 @@ export interface GiftInfo {
50
50
  num: number;
51
51
  /** 礼物价值(总价,按平台货币计算) */
52
52
  value?: number;
53
- /** 价值类型 */
54
- valueType?: string | number;
53
+ /** 显示的礼物价值 */
54
+ displayValue?: number;
55
+ /** 平台货币类型 */
56
+ coinType?: string | number;
55
57
  /** 平台货币名称 */
56
- valueName?: string;
58
+ coinName?: string;
57
59
  /** 礼物连击数 */
58
60
  combo?: number;
59
61
  /** 礼物连击id */
@@ -2,7 +2,7 @@ export interface LivePlatformInfo {
2
2
  /** 平台名称 */
3
3
  name: string;
4
4
  /** 平台vip信息 */
5
- vip?: {
5
+ premium?: {
6
6
  /** 平台vip对应id */
7
7
  id: string;
8
8
  /** 平台vip名称 */
@@ -6,11 +6,12 @@ import { UserInfo } from "./messageInfo.js";
6
6
  export declare abstract class LiveRoom extends CustomEventEmitter implements LiveRoomData {
7
7
  constructor();
8
8
  get valid(): true;
9
- get serviceId(): string;
9
+ get pending(): false;
10
+ get service(): string;
10
11
  /** 平台 */
11
12
  abstract readonly platform: string;
12
- /** api服务 */
13
- readonly service: string;
13
+ /** 服务分支 */
14
+ readonly serviceBranch: string;
14
15
  /** 房间id */
15
16
  abstract readonly id: string | number;
16
17
  /** 房间详情 */
@@ -60,11 +61,15 @@ export declare abstract class LiveRoom extends CustomEventEmitter implements Liv
60
61
  /** 无效房间 */
61
62
  export declare class InvalidLiveRoom implements LiveRoomData {
62
63
  get valid(): false;
63
- get serviceId(): string;
64
- constructor(serviceId: string, id: string | number);
64
+ get service(): string;
65
+ constructor(service: string, id: string | number, { pending, error }?: {
66
+ pending?: boolean | undefined;
67
+ error?: null | undefined;
68
+ });
65
69
  readonly platform: string;
66
70
  readonly id: string | number;
67
- readonly service: string;
71
+ readonly serviceBranch: string;
72
+ pending: boolean;
68
73
  detail: LiveRoomDetailInfo;
69
74
  stats?: LiveRoomStatsInfo;
70
75
  anchor: UserInfo;
@@ -73,6 +78,10 @@ export declare class InvalidLiveRoom implements LiveRoomData {
73
78
  connectionStatus: LiveConnectionStatus;
74
79
  openStatus: LiveRoomOpenStatus;
75
80
  liveId?: string;
81
+ error: {
82
+ code: string;
83
+ message: string;
84
+ } | null;
76
85
  get opened(): boolean;
77
86
  available: boolean;
78
87
  /** 生成房间数据 */
@@ -90,14 +99,16 @@ export interface LiveRoom {
90
99
  export interface LiveRoomData {
91
100
  /** 房间有效性 */
92
101
  valid: boolean;
102
+ /** 房间待定状态 */
103
+ pending?: boolean;
93
104
  /** 平台id */
94
105
  platform: string;
95
- /** API服务 */
96
- service: string;
106
+ /** 服务分支 */
107
+ serviceBranch: string;
97
108
  /** 房间id */
98
109
  id: number | string;
99
110
  /** API服务id */
100
- serviceId: string;
111
+ service: string;
101
112
  /** 房间key */
102
113
  key: string;
103
114
  /** 基本信息 */
@@ -120,6 +131,11 @@ export interface LiveRoomData {
120
131
  opened: boolean;
121
132
  /** 房间是否可用 */
122
133
  available: boolean;
134
+ /** 错误信息 */
135
+ error?: {
136
+ code: string;
137
+ message: string;
138
+ } | null;
123
139
  }
124
140
  /** 房间展示信息 */
125
141
  export interface LiveRoomDetailInfo {
@@ -179,6 +195,8 @@ export declare const LiveRoomOpenStatus: {
179
195
  readonly opened: 2;
180
196
  };
181
197
  export type LiveRoomOpenStatus = EnumValue<typeof LiveRoomOpenStatus>;
198
+ export declare const LiveRoomValidStatus: {};
199
+ export type LiveRoomValidStatus = EnumValue<typeof LiveRoomValidStatus>;
182
200
  export interface LiveRoomEventMap {
183
201
  /** */
184
202
  status: {