Skip to content

Commit

Permalink
Merge pull request #8 from rob2d/typescript-defs-and-webpack-5
Browse files Browse the repository at this point in the history
Typescript support and Webpack 5 Builds
  • Loading branch information
rob2d authored Feb 24, 2021
2 parents 06ba02b + afd98b2 commit 8a8c840
Show file tree
Hide file tree
Showing 6 changed files with 939 additions and 1,611 deletions.
19 changes: 19 additions & 0 deletions build/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
declare module 'use-viewport-sizes' {
/**
* Hook which observes viewport dimensions. Returns [width, height] of
* current visible viewport of app.
*
* If no input specified, returns the [width, height] when the window changes.
*
* If input is specified as a number, it interprets this as the number of
* miliseconds to debounce before updates.
*
* If the input is specified as a function, it accepts a callback
* with the viewport width and height passed in the first arg as
* { vpW, vpH }, and will only return a new value and update when
* the hash-value returned changes.
*/
export default function(
input:number | (({ vpW: number, vpH: number }) => String)
):[vpW: number, vpH: number];
}
2 changes: 1 addition & 1 deletion build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8a8c840

Please sign in to comment.