-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.5.0-b.1; improve d.ts & bump react peerdep
closes #17
- Loading branch information
Showing
3 changed files
with
33 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
declare module 'use-viewport-sizes' { | ||
export type VPSizesHasher = ({ vpW: number, vpH: number }) => String; | ||
export type VPSizesHasher = ({ vpW, vpH }: { vpW: number, vpH: number}) => String; | ||
export type VPSizesOptions ={ | ||
debounceTimeout?: number, | ||
hasher?: VPSizesHasher, | ||
dimension?: 'w'|'h'|'both' = 'both' | ||
dimension: 'both' | undefined | ||
}; | ||
|
||
export type VPSizeOptions ={ | ||
debounceTimeout?: number, | ||
hasher?: VPSizesHasher, | ||
dimension?: 'w'|'h' | ||
}; | ||
|
||
/** | ||
* Hook which observes viewport dimensions. Returns [width, height] of | ||
* current visible viewport of app, or the specific dimension | ||
*/ | ||
export default function(input:number|VPSizesOptions):([vpW: number, vpH: number, triggerResize: Function]); | ||
|
||
/** | ||
* Hook which observes viewport dimensions. Returns [width, height] of | ||
* current visible viewport of app, or the specific dimension | ||
*/ | ||
export default function(input: VPSizeOptions):([dimension: number, triggerResize:Function]); | ||
|
||
/** | ||
* Hook which observes viewport dimensions. Returns [width, height] of | ||
* current visible viewport of app, or the specific dimension | ||
*/ | ||
export default function(input:VPSizesHasher):([vpW: number, vpH: number, triggerResize: Function]); | ||
|
||
/** | ||
* Hook which observes viewport dimensions. Returns [width, height] of | ||
* current visible viewport of app, or the specific dimension | ||
*/ | ||
export default function( | ||
input:number | VPSizesHasher | VPSizesOptions | ||
):([vpW: number, vpH: number, triggerResize: Function] | | ||
[dimension: number, triggerResize:Function] | ||
); | ||
} | ||
export default function():([vpW: number, vpH: number, triggerResize: Function]); | ||
} |