Skip to content

Commit

Permalink
chore: add TS typings (#46)
Browse files Browse the repository at this point in the history
* chore: add TS typings

* chore: add customReporter to TS typings
  • Loading branch information
aigoncharov authored Nov 13, 2020
1 parent 7f0ac96 commit 740026d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"source": "src/index.js",
"scripts": {
"start": "microbundle watch",
"prepare": "microbundle --name useResizeAware --globals react=React --jsx React.createElement && cp -f dist/index.umd.js docs/react-resize-aware.js && flow-copy-source src dist"
"prepare": "microbundle --name useResizeAware --globals react=React --jsx React.createElement && cp -f dist/index.umd.js docs/react-resize-aware.js && flow-copy-source src dist && cp src/index.d.ts dist/index.d.ts"
},
"files": [
"dist/*",
Expand Down
6 changes: 6 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="react" />

declare module 'react-resize-aware' {
const useResizeAware: <T extends object = { width: number | null; height: number | null }>(customReporter?: (target: HTMLIFrameElement | null) => T) => [JSX.Element, T]
export default useResizeAware
}

0 comments on commit 740026d

Please sign in to comment.