floating-live 0.15.0-beta.10 → 0.15.0-beta.11

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.
@@ -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
  }
@@ -21,6 +21,10 @@ class ModCommand {
21
21
  call(name, ...args) {
22
22
  return this.list.get(name)?.(...args);
23
23
  }
24
+ /** 检测命令是否存在 */
25
+ has(name) {
26
+ return this.list.has(name);
27
+ }
24
28
  /** 获取快照 */
25
29
  getSnapshot() {
26
30
  return [...this.list].map(([key]) => key);
@@ -230,7 +230,7 @@ export interface GiftInfo {
230
230
  /** 总价值 */
231
231
  value: number;
232
232
  /** 平台货币 */
233
- currency: string;
233
+ currency?: string | number;
234
234
  /** 礼物连击数 */
235
235
  combo?: string;
236
236
  /** 礼物连击id */
@@ -85,12 +85,14 @@ export interface PlatformInfo {
85
85
  /** 统计信息 */
86
86
  stats?: Record<string, string>;
87
87
  /** 货币信息 */
88
- currency?: Record<string, {
89
- /** 货币名称 */
90
- name: string;
91
- /** 1货币面值等值value (1面值/1数值) */
92
- ratio: number;
93
- /** 1单位消费金额等值value (1.00CNY/1数值) (若为0则为免费货币) */
94
- money?: number;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "floating-live",
3
- "version": "0.15.0-beta.10",
3
+ "version": "0.15.0-beta.11",
4
4
  "type": "commonjs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",