floating-live 0.15.0 → 0.15.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.
package/dist/live.js CHANGED
@@ -25,7 +25,9 @@ class FloatingLive extends events_1.EventEmitter {
25
25
  return super.on(eventName, listener);
26
26
  }
27
27
  emit(eventName, ...args) {
28
- return super.emit(eventName, ...args);
28
+ const emit = super.emit(eventName, ...args);
29
+ super.emit("event", eventName, ...args);
30
+ return emit;
29
31
  }
30
32
  throw(err) {
31
33
  this.emit("error", err);
@@ -1,6 +1,6 @@
1
1
  import { FloatingLive } from "../live";
2
2
  import { FloatingHookMap } from "../types/hook";
3
- export declare type HookFunction<T> = (ctx: T) => boolean | void | Promise<boolean | void>;
3
+ export type HookFunction<T> = (ctx: T) => boolean | void | Promise<boolean | void>;
4
4
  export declare class ModHook {
5
5
  private list;
6
6
  protected readonly main: FloatingLive;
@@ -33,5 +33,6 @@ export interface FloatingEventMap {
33
33
  "value:remove": (name: string) => void;
34
34
  "value:change": (name: string, value: any) => void;
35
35
  [name: `change:${string}`]: (value: any) => void;
36
+ event: (eventName: string, ...args: any[]) => void;
36
37
  error: (err: Error) => void;
37
38
  }
@@ -1,6 +1,6 @@
1
1
  import { FloatingLive } from "../live";
2
2
  /** 插件模块, 加载时调用 */
3
- export declare type FloatingLivePlugin<C extends object = object> = () => {
3
+ export type FloatingLivePlugin<C extends object = object> = () => {
4
4
  /** 插件名称 */
5
5
  name: string;
6
6
  register: (ctx: FloatingLive, options?: C) => void;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "floating-live",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "type": "commonjs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "author": "Minteea",
8
- "license": "GPLv3",
8
+ "license": "MIT",
9
9
  "exports": {
10
10
  ".": {
11
11
  "types": "./dist/index.d.ts",