Comparing version 1.2.0 to 2.0.0
@@ -1,4 +0,22 @@ | ||
import Eventin from './eventin'; | ||
import { Listener } from './constants'; | ||
export { Listener }; | ||
export default Eventin; | ||
type Listener<EventType extends string, EventTypeMapData extends { | ||
[key in EventType]: unknown; | ||
}, E extends EventType> = (data: EventTypeMapData[E]) => void; | ||
declare class Eventin<EventType extends string, EventTypeMapData extends { | ||
[key in EventType]: unknown; | ||
}> { | ||
private eventTypeMapListeners; | ||
constructor(); | ||
emit<E extends EventType>(eventType: E, data: EventTypeMapData[E], { sync, }?: { | ||
sync?: boolean; | ||
}): void; | ||
listen<E extends EventType>(eventType: E, listener: Listener<EventType, EventTypeMapData, E>, { once, }?: { | ||
once?: boolean; | ||
}): () => void; | ||
unlisten<E extends EventType>(eventType: E, listener: Listener<EventType, EventTypeMapData, E>, { once, }?: { | ||
once?: boolean; | ||
}): void; | ||
unlistenAll<E extends EventType>(eventType?: E): void; | ||
} | ||
export { type Listener, Eventin as default }; |
{ | ||
"name": "eventin", | ||
"version": "1.2.0", | ||
"description": "Type-constrainted event emitter.", | ||
"version": "2.0.0", | ||
"description": "Strongly-typed event emitter.", | ||
"keywords": [ | ||
@@ -9,8 +9,6 @@ "EventEmitter", | ||
], | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "tsc --declaration", | ||
"test": "jest", | ||
"prepublish": "npm test && npm run build" | ||
}, | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/index.esm.js", | ||
"types": "dist/index.d.ts", | ||
"homepage": "https://github.com/mebtte/eventin#readme", | ||
"repository": { | ||
@@ -20,23 +18,35 @@ "type": "git", | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/mebtte/eventin/issues" | ||
}, | ||
"homepage": "https://github.com/mebtte/eventin#readme", | ||
"author": { | ||
"name": "mebtte", | ||
"email": "hi@mebtte.com", | ||
"url": "https://mebtte.com" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "rimraf dist && rollup --bundleConfigAsCjs --config rollup.config.js", | ||
"test": "jest", | ||
"prepublish": "npm test && npm run build" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.19.0", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@types/jest": "^29.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.36.2", | ||
"@typescript-eslint/parser": "^5.38.0", | ||
"eslint": "^8.23.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-n": "^15.2.5", | ||
"eslint-plugin-promise": "^6.0.1", | ||
"jest": "^29.0.2", | ||
"@babel/preset-env": "^7.23.3", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@rollup/plugin-typescript": "^11.1.5", | ||
"@types/jest": "^29.5.8", | ||
"@typescript-eslint/eslint-plugin": "^6.11.0", | ||
"eslint": "^8.53.0", | ||
"eslint-config-standard-with-typescript": "^39.1.1", | ||
"eslint-plugin-import": "^2.29.0", | ||
"eslint-plugin-n": "^16.3.1", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"jest": "^29.7.0", | ||
"prettier": "^2.7.1", | ||
"typescript": "^4.8.2" | ||
"rimraf": "^5.0.5", | ||
"rollup": "^4.4.1", | ||
"rollup-plugin-dts": "^6.1.0", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
# eventin [![version](https://img.shields.io/npm/v/eventin)](https://www.npmjs.com/package/eventin) [![license](https://img.shields.io/npm/l/eventin)](https://github.com/mebtte/react-lrc/blob/master/LICENSE) [![](https://img.shields.io/bundlephobia/minzip/eventin)](https://bundlephobia.com/result?p=eventin) | ||
Type-constrainted event emitter. | ||
Strongly-typed event emitter. | ||
@@ -5,0 +5,0 @@ ## Install & Usage |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
13283
0
17
6
213