Skip to content

Commit

Permalink
feat(typescript): add d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Apr 12, 2017
1 parent 635c95a commit 7126b5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 16 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 7126b5d

Please sign in to comment.