@sheto/emiter 1.0.0 → 1.0.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/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ type ActionType = (payload?: any) => void;
2
+ interface EmiterType {
3
+ timer: null | number;
4
+ queue: {
5
+ name: string;
6
+ payload: any;
7
+ }[];
8
+ actions: Record<string, ActionType[]>;
9
+ emit: (eventName: string, payload?: any) => void;
10
+ on: (eventName: string, action: ActionType) => void;
11
+ release(eventNames: string[]): void;
12
+ }
13
+ export declare const globalEmiter: EmiterType;
14
+ export default globalEmiter;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const EmiterPlugin = {
1
+ export const globalEmiter = {
2
2
  queue: [],
3
3
  actions: {},
4
4
  timer: null,
@@ -44,4 +44,4 @@ export const EmiterPlugin = {
44
44
  }
45
45
  }
46
46
  };
47
- export default EmiterPlugin;
47
+ export default globalEmiter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheto/emiter",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "没有框架限制的全局事件处理器",
5
5
  "license": "MIT",
6
6
  "author": "sheto",
package/types/index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- type actionType = (payload?: any) => void;
2
- interface EmiterType {
3
- timer: null | number;
4
- queue: {
5
- name: string;
6
- payload: any;
7
- }[];
8
- actions: Record<string, actionType[]>;
9
- emit: (eventName: string, payload?: any) => void;
10
- on: (eventName: string, action: actionType) => void;
11
- release(eventNames: string[]): void;
12
- }
13
- export declare const EmiterPlugin: EmiterType;
14
- export default EmiterPlugin;