floating-live 0.15.0-beta.9 → 0.15.0
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/README.md +2 -2
- package/dist/module/command.d.ts +2 -0
- package/dist/module/command.js +4 -0
- package/dist/module/hook.js +1 -1
- package/dist/module/plugin.d.ts +4 -0
- package/dist/module/plugin.js +5 -1
- package/dist/types/message.d.ts +1 -1
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/room.d.ts +10 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,10 +17,10 @@ GUI版本:[Minteea/floating-live-gui](https://github.com/Minteea/floating-live
|
|
|
17
17
|
npm install floating-live
|
|
18
18
|
```
|
|
19
19
|
``` javascript
|
|
20
|
-
// 导入FloatingLive
|
|
20
|
+
// 导入FloatingLive本体
|
|
21
21
|
const { FloatingLive } = require("floating-live")
|
|
22
22
|
// 导入bilibili房间生成插件
|
|
23
|
-
const bilibili = require("@floating-live/bilibili
|
|
23
|
+
const bilibili = require("@floating-live/bilibili")
|
|
24
24
|
|
|
25
25
|
// 创建一个FloatingLive实例
|
|
26
26
|
const live = new FloatingLive()
|
package/dist/module/command.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare class ModCommand {
|
|
|
11
11
|
unregister(name: string): void;
|
|
12
12
|
/** 调用命令 */
|
|
13
13
|
call<T extends keyof FloatingCommandMap>(name: T, ...args: Parameters<FloatingCommandMap[T]>): any;
|
|
14
|
+
/** 检测命令是否存在 */
|
|
15
|
+
has<T extends keyof FloatingCommandMap>(name: T): boolean;
|
|
14
16
|
/** 获取快照 */
|
|
15
17
|
getSnapshot(): string[];
|
|
16
18
|
}
|
package/dist/module/command.js
CHANGED
package/dist/module/hook.js
CHANGED
package/dist/module/plugin.d.ts
CHANGED
package/dist/module/plugin.js
CHANGED
|
@@ -14,7 +14,7 @@ class ModPlugin {
|
|
|
14
14
|
}
|
|
15
15
|
/** 注册插件 */
|
|
16
16
|
register(pluginFunc, options) {
|
|
17
|
-
const name = pluginFunc.
|
|
17
|
+
const name = pluginFunc.pluginName;
|
|
18
18
|
if (!name) {
|
|
19
19
|
this.main.throw(Object.assign(new TypeError("缺少插件id"), {
|
|
20
20
|
from: "plugin",
|
|
@@ -53,5 +53,9 @@ class ModPlugin {
|
|
|
53
53
|
// 移除插件注册
|
|
54
54
|
this.main.emit("plugin:remove", name);
|
|
55
55
|
}
|
|
56
|
+
/** 获取插件实例 */
|
|
57
|
+
get(name) {
|
|
58
|
+
return this.list.get(name);
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
exports.ModPlugin = ModPlugin;
|
package/dist/types/message.d.ts
CHANGED
package/dist/types/plugin.d.ts
CHANGED
package/dist/types/room.d.ts
CHANGED
|
@@ -85,12 +85,14 @@ export interface PlatformInfo {
|
|
|
85
85
|
/** 统计信息 */
|
|
86
86
|
stats?: Record<string, string>;
|
|
87
87
|
/** 货币信息 */
|
|
88
|
-
currency?:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
currency?: {
|
|
89
|
+
[key: string | number]: {
|
|
90
|
+
/** 货币名称 */
|
|
91
|
+
name: string;
|
|
92
|
+
/** 1货币面值等值value (1面值/1数值) */
|
|
93
|
+
ratio: number;
|
|
94
|
+
/** 1单位消费金额等值value (1.00CNY/1数值) (若为0则为免费货币) */
|
|
95
|
+
money?: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
96
98
|
}
|