Skip to content

Commit 8a8c840

Browse files
authored
Merge pull request #8 from rob2d/typescript-defs-and-webpack-5
Typescript support and Webpack 5 Builds
2 parents 06ba02b + afd98b2 commit 8a8c840

File tree

6 files changed

+939
-1611
lines changed

6 files changed

+939
-1611
lines changed

build/index.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
declare module 'use-viewport-sizes' {
2+
/**
3+
* Hook which observes viewport dimensions. Returns [width, height] of
4+
* current visible viewport of app.
5+
*
6+
* If no input specified, returns the [width, height] when the window changes.
7+
*
8+
* If input is specified as a number, it interprets this as the number of
9+
* miliseconds to debounce before updates.
10+
*
11+
* If the input is specified as a function, it accepts a callback
12+
* with the viewport width and height passed in the first arg as
13+
* { vpW, vpH }, and will only return a new value and update when
14+
* the hash-value returned changes.
15+
*/
16+
export default function(
17+
input:number | (({ vpW: number, vpH: number }) => String)
18+
):[vpW: number, vpH: number];
19+
}

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)