Skip to content

Commit

Permalink
Add TypeScript declaration file
Browse files Browse the repository at this point in the history
  • Loading branch information
dgraham committed Jun 25, 2019
1 parent fb7c5b7 commit 378f568
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions index.d.ts
@@ -0,0 +1,4 @@
export function on<K extends keyof GlobalEventHandlersEventMap>(name: K, selector: string, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: EventListenerOptions): void;
export function on(name: string, selector: string, listener: EventListener, options?: EventListenerOptions): void;
export function off(name: string, selector: string, listener: EventListener, options?: EventListenerOptions): void;
export function fire(target: EventTarget, name: string, detail?: any): boolean;
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -6,6 +6,7 @@
"repository": "dgraham/delegated-events",
"main": "dist/index.umd.js",
"module": "dist/index.esm.js",
"types": "index.d.ts",
"scripts": {
"clean": "rm -rf build dist",
"flow": "flow check",
Expand Down Expand Up @@ -44,6 +45,7 @@
"rollup-plugin-node-resolve": "^5.1.0"
},
"files": [
"dist"
"dist",
"index.d.ts"
]
}

0 comments on commit 378f568

Please sign in to comment.