diff --git a/package.json b/package.json index 0d3c327..6d29caa 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,12 @@ "version": "1.1.0", "description": "Provide performant way to subscribe to browser UI Events.", "main": "lib/index.js", + "types": "lib/index.d.ts", "scripts": { "test:sauce": "zuul -- test/*-test.js", "test:local": "zuul --local 8080 --ui mocha-bdd -- test/*-test.js", "test": "mocha test/", - "build": "NODE_ENV=production babel src --out-dir lib --source-maps", + "build": "NODE_ENV=production babel src --out-dir lib --source-maps --copy-files", "watch": "babel src --out-dir lib --watch --source-maps", "docs": "documentation build --access public --theme ./node_modules/documentation-markdown-api-theme/lib/index -f html -o out.md src/UIEventObserver.js && cat out.md | add-text-to-markdown README.md --section \"Usage\" --write; rm out.md", "prepublish": "npm run --if-present build" diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..6d38bc9 --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,16 @@ +/** Declaration file generated by dts-gen */ +export class UIEventObserver { + constructor(); + + hasSubscriber(target: any, domEventName: string): boolean; + + subscribe(target: any, eventName: string, handler: Function): Function; + + subscribeOnce(target: any, eventName: string, handler: Function): Function; + + unsubscribe(target: any, eventName: string, handler: Function): void; + + unsubscribeAll(): void; +} +export default new UIEventObserver(); +