Skip to content

Commit afd98b2

Browse files
committed
improve description in typescript dts, bump to 0.2.10 for npm release
1 parent 9ed894a commit afd98b2

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

build/index.d.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
declare module 'use-viewport-sizes' {
22
/**
3-
* Hook which observes viewport dimensions.
3+
* Hook which observes viewport dimensions. Returns [width, height] of
4+
* current visible viewport of app.
45
*
5-
* If input not specified, returns the [width, height] when the window changes.
6-
* If input is specified as a number, it returns the [width, height].
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.
710
*
811
* If the input is specified as a function, it accepts a callback
912
* with the viewport width and height passed in the first arg as

package-lock.json

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

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "use-viewport-sizes",
3-
"version": "0.2.9-beta.0",
3+
"version": "0.2.10",
44
"description": "a tiny React hook which allows you to track visible window viewport size in your components w/ an optional debounce or custom memo function for updates for optimal rendering.",
5-
"main": "build/index.js",
6-
"typings": "build/index.d.ts",
5+
"main": "./build/index.js",
6+
"types": "./build/index.d.ts",
77
"scripts": {
88
"start": "webpack --watch",
99
"build": "webpack",
@@ -19,18 +19,23 @@
1919
"@babel/preset-react": "^7.0.0",
2020
"babel-loader": "^8.0.5",
2121
"copy-webpack-plugin": "^7.0.0",
22+
"typescript": "^4.2.2",
2223
"webpack": "^5.24.1",
2324
"webpack-cli": "^4.5.0"
2425
},
2526
"keywords": [
2627
"react",
2728
"hooks",
29+
"hook",
30+
"react-hooks",
2831
"window",
2932
"resize",
3033
"viewport",
3134
"viewport-sizes",
3235
"sizes",
33-
"dimensions"
36+
"dimensions",
37+
"typescript",
38+
"responsive"
3439
],
3540
"author": "Robert Concepcion III",
3641
"repository": "github:rob2d/use-viewport-sizes",

src/index.d.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
declare module 'use-viewport-sizes' {
22
/**
3-
* Hook which observes viewport dimensions.
3+
* Hook which observes viewport dimensions. Returns [width, height] of
4+
* current visible viewport of app.
45
*
5-
* If input not specified, returns the [width, height] when the window changes.
6-
* If input is specified as a number, it returns the [width, height].
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.
710
*
811
* If the input is specified as a function, it accepts a callback
912
* with the viewport width and height passed in the first arg as

0 commit comments

Comments
 (0)