@polyv/utils 2.14.0-beta.4 → 2.14.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/cjs/event.d.ts CHANGED
@@ -64,6 +64,9 @@ export type EventType = number | string | symbol;
64
64
  * 事件参数关系类型
65
65
  */
66
66
  export type EventRelationsType = Record<EventType, unknown>;
67
+ /**
68
+ * 事件回调后的类 response 函数
69
+ */
67
70
  type EventHandlerCb = (res: unknown) => void;
68
71
  /**
69
72
  * 事件回调函数类型
@@ -105,7 +108,7 @@ export declare class EventEmitter<Relations extends EventRelationsType = EventRe
105
108
  * @param event 事件名
106
109
  * @param params 回调参数
107
110
  */
108
- emit<E extends Events>(event: E, params: Relations[E], cb: EventHandlerCb): void;
111
+ emit<E extends Events>(event: E, params: Relations[E], cb?: EventHandlerCb): void;
109
112
  emit<E extends Events>(event: undefined extends Relations[E] ? E : never): void;
110
113
  /**
111
114
  * 销毁实例
package/es/event.d.ts CHANGED
@@ -64,6 +64,9 @@ export type EventType = number | string | symbol;
64
64
  * 事件参数关系类型
65
65
  */
66
66
  export type EventRelationsType = Record<EventType, unknown>;
67
+ /**
68
+ * 事件回调后的类 response 函数
69
+ */
67
70
  type EventHandlerCb = (res: unknown) => void;
68
71
  /**
69
72
  * 事件回调函数类型
@@ -105,7 +108,7 @@ export declare class EventEmitter<Relations extends EventRelationsType = EventRe
105
108
  * @param event 事件名
106
109
  * @param params 回调参数
107
110
  */
108
- emit<E extends Events>(event: E, params: Relations[E], cb: EventHandlerCb): void;
111
+ emit<E extends Events>(event: E, params: Relations[E], cb?: EventHandlerCb): void;
109
112
  emit<E extends Events>(event: undefined extends Relations[E] ? E : never): void;
110
113
  /**
111
114
  * 销毁实例
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polyv/utils",
3
- "version": "2.14.0-beta.4",
3
+ "version": "2.14.0",
4
4
  "description": "Utility functions of Polyv frontend development.",
5
5
  "keywords": [
6
6
  "polyv",