1- import React from "react" ;
1+ import * as React from "react" ;
22
33export type BatteryManager = {
44 supported : boolean ;
@@ -7,7 +7,7 @@ export type BatteryManager = {
77 charging : boolean | null ;
88 chargingTime : number | null ;
99 dischargingTime : number | null ;
10- }
10+ } ;
1111
1212export type GeolocationState = {
1313 loading : boolean ;
@@ -20,7 +20,7 @@ export type GeolocationState = {
2020 speed : number | null ;
2121 timestamp : number | null ;
2222 error : GeolocationPositionError | null ;
23- }
23+ } ;
2424
2525export type HistoryState < T > = {
2626 state : T ;
@@ -30,22 +30,22 @@ export type HistoryState<T> = {
3030 clear : ( ) => void ;
3131 canUndo : boolean ;
3232 canRedo : boolean ;
33- }
33+ } ;
3434
3535export type LongPressOptions = {
3636 threshold ?: number ;
3737 onStart ?: ( e : Event ) => void ;
3838 onFinish ?: ( e : Event ) => void ;
3939 onCancel ?: ( e : Event ) => void ;
40- }
40+ } ;
4141
4242export type LongPressFns = {
4343 onMouseDown : ( e : React . MouseEvent ) => void ;
4444 onMouseUp : ( e : React . MouseEvent ) => void ;
4545 onMouseLeave : ( e : React . MouseEvent ) => void ;
4646 onTouchStart : ( e : React . TouchEvent ) => void ;
4747 onTouchEnd : ( e : React . TouchEvent ) => void ;
48- }
48+ } ;
4949
5050export type MousePosition = {
5151 x : number ;
@@ -54,7 +54,7 @@ export type MousePosition = {
5454 elementY : number ;
5555 elementPositionX : number ;
5656 elementPositionY : number ;
57- }
57+ } ;
5858
5959export type NetworkState = {
6060 online : boolean ;
@@ -64,7 +64,7 @@ export type NetworkState = {
6464 rtt : number | null ;
6565 saveData : boolean | null ;
6666 type : string | null ;
67- }
67+ } ;
6868
6969export type CustomList < T > = {
7070 set : ( l : T [ ] ) => void ;
@@ -73,7 +73,7 @@ export type CustomList<T> = {
7373 insertAt : ( index : number , element : T ) => void ;
7474 updateAt : ( index : number , element : T ) => void ;
7575 clear : ( ) => void ;
76- }
76+ } ;
7777
7878export type CustomQueue < T > = {
7979 add : ( element : T ) => void ;
@@ -82,14 +82,14 @@ export type CustomQueue<T> = {
8282 first : T | undefined ;
8383 last : T | undefined ;
8484 size : number ;
85- }
85+ } ;
8686
8787export type RenderInfo = {
8888 name : string ;
8989 renders : number ;
9090 sinceLastRender : number ;
9191 timestamp : number ;
92- }
92+ } ;
9393
9494export type SpeechOptions = {
9595 lang ?: string ;
@@ -100,7 +100,7 @@ export type SpeechOptions = {
100100 rate ?: number ;
101101 pitch ?: number ;
102102 volume ?: number ;
103- }
103+ } ;
104104
105105export type SpeechState = {
106106 isPlaying : boolean ;
@@ -113,13 +113,14 @@ export type SpeechState = {
113113 rate : number ;
114114 pitch : number ;
115115 volume : number ;
116- }
117-
118- declare module '@uidotdev/usehooks' {
116+ } ;
119117
118+ declare module "@uidotdev/usehooks" {
120119 export function useBattery ( ) : BatteryManager ;
121120
122- export function useClickAway < T extends Element > ( cb : ( e : Event ) => void ) : React . MutableRefObject < T > ;
121+ export function useClickAway < T extends Element > (
122+ cb : ( e : Event ) => void
123+ ) : React . MutableRefObject < T > ;
123124
124125 export function useCopyToClipboard ( ) : [
125126 {
@@ -147,7 +148,10 @@ declare module '@uidotdev/usehooks' {
147148
148149 export function useDebounce < T > ( value : T , delay : number ) : T ;
149150
150- export function useDefault < T > ( initialValue : T , defaultValue : T ) : [ T , React . Dispatch < React . SetStateAction < T > > ] ;
151+ export function useDefault < T > (
152+ initialValue : T ,
153+ defaultValue : T
154+ ) : [ T , React . Dispatch < React . SetStateAction < T > > ] ;
151155
152156 export function useDocumentTitle ( title : string ) : void ;
153157
@@ -157,14 +161,16 @@ declare module '@uidotdev/usehooks' {
157161
158162 export function useHistoryState < T > ( initialPresent ?: T ) : HistoryState < T > ;
159163
160- export function useHover < T extends Element > ( ) : [ React . MutableRefObject < T > , boolean ] ;
164+ export function useHover < T extends Element > ( ) : [
165+ React . MutableRefObject < T > ,
166+ boolean
167+ ] ;
161168
162169 export function useIdle ( ms ?: number ) : boolean ;
163170
164- export function useIntersectionObserver ( options ?: IntersectionObserverInit ) : [
165- React . MutableRefObject < Element > ,
166- IntersectionObserverEntry | null
167- ] ;
171+ export function useIntersectionObserver (
172+ options ?: IntersectionObserverInit
173+ ) : [ React . MutableRefObject < Element > , IntersectionObserverEntry | null ] ;
168174
169175 export function useIsClient ( ) : boolean ;
170176
@@ -174,9 +180,12 @@ declare module '@uidotdev/usehooks' {
174180
175181 export function useLockBodyScroll ( ) : void ;
176182
177- export function useLongPress ( callback : ( e : Event ) => void , options ?: LongPressOptions ) : LongPressFns ;
183+ export function useLongPress (
184+ callback : ( e : Event ) => void ,
185+ options ?: LongPressOptions
186+ ) : LongPressFns ;
178187
179- export function useMap < T > ( initialState ?: T ) : Map < T > ;
188+ export function useMap < T > ( initialState ?: T ) : Map < T , any > ;
180189
181190 export function useMeasure < T extends Element > ( ) : [
182191 React . MutableRefObject < T > ,
@@ -188,7 +197,10 @@ declare module '@uidotdev/usehooks' {
188197
189198 export function useMediaQuery ( query : string ) : boolean ;
190199
191- export function useMouse < T extends Element > ( ) : [ MousePosition , React . MutableRefObject < T > ] ;
200+ export function useMouse < T extends Element > ( ) : [
201+ MousePosition ,
202+ React . MutableRefObject < T >
203+ ] ;
192204
193205 export function useNetworkState ( ) : NetworkState ;
194206
@@ -209,17 +221,22 @@ declare module '@uidotdev/usehooks' {
209221
210222 export function useRenderInfo ( name ?: string ) : RenderInfo | undefined ;
211223
212- export function useScript ( src : string , options ?: {
213- removeOnUnmount ?: boolean ;
214- } ) : "idle" | "loading" | "ready" | "error" ;
224+ export function useScript (
225+ src : string ,
226+ options ?: {
227+ removeOnUnmount ?: boolean ;
228+ }
229+ ) : "idle" | "loading" | "ready" | "error" ;
215230
216231 export function useSet < T > ( values ?: T [ ] ) : Set < T > ;
217232
218233 export function useSpeech ( text : string , options ?: SpeechOptions ) : SpeechState ;
219234
220235 export function useThrottle < T > ( value : T , delay : number ) : T ;
221236
222- export function useToggle ( initialValue ?: boolean ) : [ boolean , ( newValue ?: boolean ) => void ] ;
237+ export function useToggle (
238+ initialValue ?: boolean
239+ ) : [ boolean , ( newValue ?: boolean ) => void ] ;
223240
224241 export function useVisibilityChange ( ) : boolean ;
225242
0 commit comments