Skip to content

Commit 9ed894a

Browse files
committed
fix issues with typescript module def
1 parent bb70f4a commit 9ed894a

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

build/index.d.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
/**
2-
* Hook which observes viewport dimensions.
3-
*
4-
* If input not specified, returns the [width, height] when the window changes.
5-
* If input is specified as a number, it returns the [width, height].
6-
*
7-
* If the input is specified as a function, it accepts a callback
8-
* with the viewport width and height passed in the first arg as
9-
* { vpW, vpH }, and will only return a new value and update when
10-
* the hash-value returned changes.
11-
*/
12-
export declare function useViewportSizes(
13-
input:number | (({ vpW: number, vpH: number }) => String)
14-
):[vpW: number, vpH: number];
1+
declare module 'use-viewport-sizes' {
2+
/**
3+
* Hook which observes viewport dimensions.
4+
*
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].
7+
*
8+
* If the input is specified as a function, it accepts a callback
9+
* with the viewport width and height passed in the first arg as
10+
* { vpW, vpH }, and will only return a new value and update when
11+
* the hash-value returned changes.
12+
*/
13+
export default function(
14+
input:number | (({ vpW: number, vpH: number }) => String)
15+
):[vpW: number, vpH: number];
16+
}

src/index.d.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
/**
2-
* Hook which observes viewport dimensions.
3-
*
4-
* If input not specified, returns the [width, height] when the window changes.
5-
* If input is specified as a number, it returns the [width, height].
6-
*
7-
* If the input is specified as a function, it accepts a callback
8-
* with the viewport width and height passed in the first arg as
9-
* { vpW, vpH }, and will only return a new value and update when
10-
* the hash-value returned changes.
11-
*/
12-
export declare function useViewportSizes(
13-
input:number | (({ vpW: number, vpH: number }) => String)
14-
):[vpW: number, vpH: number];
1+
declare module 'use-viewport-sizes' {
2+
/**
3+
* Hook which observes viewport dimensions.
4+
*
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].
7+
*
8+
* If the input is specified as a function, it accepts a callback
9+
* with the viewport width and height passed in the first arg as
10+
* { vpW, vpH }, and will only return a new value and update when
11+
* the hash-value returned changes.
12+
*/
13+
export default function(
14+
input:number | (({ vpW: number, vpH: number }) => String)
15+
):[vpW: number, vpH: number];
16+
}

0 commit comments

Comments
 (0)