@hydroperx/event
Advanced tools
| export type TypedEventTarget<EventMap extends object> = { | ||
| new (): IntermediateEventTarget<EventMap>; | ||
| }; | ||
| interface IntermediateEventTarget<EventMap> extends EventTarget { | ||
| addEventListener<K extends keyof EventMap>(type: K, callback: (event: EventMap[K] extends Event ? EventMap[K] : never) => EventMap[K] extends Event ? void : never, options?: boolean | AddEventListenerOptions): void; | ||
| addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; | ||
| removeEventListener<K extends keyof EventMap>(type: K, callback: (event: EventMap[K] extends Event ? EventMap[K] : never) => EventMap[K] extends Event ? void : never, options?: boolean | EventListenerOptions): void; | ||
| removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; | ||
| } | ||
| export {}; |
| export {}; |
+12
-4
| { | ||
| "name": "@hydroperx/event", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Provide types of dispatched events in event targets.", | ||
| "main": "src/index.ts", | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "prepublishOnly": "npm run build" | ||
| }, | ||
| "exports": { | ||
| ".": { | ||
| "default": "./dist/index.js", | ||
| "types": "./dist/index.d.ts" | ||
| } | ||
| }, | ||
| "repository": "https://github.com/hydroperx/event", | ||
| "license": "Apache-2.0", | ||
| "author": "Hydroper <HydroperFox@gmail.com>", | ||
| "keywords": ["event"], | ||
| "scripts": {} | ||
| "keywords": ["event"] | ||
| } |
+2
-1
@@ -7,4 +7,5 @@ { | ||
| "strict": true, | ||
| "noEmit": true | ||
| "noEmit": false, | ||
| "declaration": true | ||
| } | ||
| } |
3266
49.89%6
50%48
33.33%