Skip to content

Commit 378f568

Browse files
committed
Add TypeScript declaration file
1 parent fb7c5b7 commit 378f568

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

index.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function on<K extends keyof GlobalEventHandlersEventMap>(name: K, selector: string, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: EventListenerOptions): void;
2+
export function on(name: string, selector: string, listener: EventListener, options?: EventListenerOptions): void;
3+
export function off(name: string, selector: string, listener: EventListener, options?: EventListenerOptions): void;
4+
export function fire(target: EventTarget, name: string, detail?: any): boolean;

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"repository": "dgraham/delegated-events",
77
"main": "dist/index.umd.js",
88
"module": "dist/index.esm.js",
9+
"types": "index.d.ts",
910
"scripts": {
1011
"clean": "rm -rf build dist",
1112
"flow": "flow check",
@@ -44,6 +45,7 @@
4445
"rollup-plugin-node-resolve": "^5.1.0"
4546
},
4647
"files": [
47-
"dist"
48+
"dist",
49+
"index.d.ts"
4850
]
4951
}

0 commit comments

Comments
 (0)