@mingto/version-polling 1.0.31 → 1.0.32

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.
@@ -1,10 +1,10 @@
1
- interface EventCallback {
1
+ export interface EventCallback {
2
2
  (...args: any[]): any;
3
3
  }
4
- declare class EventBus<E = any> {
5
- private listeners;
4
+ export declare class EventBus<E = any> {
5
+ listeners: Map<E, EventCallback[]>;
6
6
  on(eventName: E, callback: EventCallback): void;
7
7
  emit<T = any>(eventName: E, data?: T): void;
8
+ off(eventName: E, callback?: EventCallback): void;
8
9
  }
9
- declare function createEventBus<E>(): EventBus<E>;
10
- export { createEventBus };
10
+ export declare function createEventBus<E>(): EventBus<E>;
package/package.json CHANGED
@@ -1,29 +1,28 @@
1
- {
2
- "name": "@mingto/version-polling",
3
- "type": "module",
4
- "version": "1.0.31",
5
- "description": "实时检测是否发布新版本",
6
- "author": "hcc",
7
- "license": "ISC",
8
- "keywords": [
9
- "检测",
10
- "线上环境版本"
11
- ],
12
- "publishConfig": {
13
- "access": "public"
14
- },
15
- "main": "./dist/index.js",
16
- "module": "./dist/index.js",
17
- "types": "./dist/index.d.ts",
18
- "files": [
19
- "dist"
20
- ],
21
- "scripts": {
22
- "build": "vite build"
23
- },
24
- "dependencies": {
25
- "@mingto/tools": "1.0.670",
26
- "@types/semver": "^7.7.0",
27
- "semver": "^7.7.2"
28
- }
1
+ {
2
+ "name": "@mingto/version-polling",
3
+ "type": "module",
4
+ "version": "1.0.32",
5
+ "description": "实时检测是否发布新版本",
6
+ "author": "hcc",
7
+ "license": "ISC",
8
+ "keywords": [
9
+ "检测",
10
+ "线上环境版本"
11
+ ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "main": "./dist/index.js",
16
+ "module": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "build": "vite build"
23
+ },
24
+ "dependencies": {
25
+ "@types/semver": "^7.7.0",
26
+ "semver": "^7.7.2"
27
+ }
29
28
  }