@@ -128,21 +128,34 @@ declare module "@uidotdev/usehooks" {
128128 ( value : string ) => Promise < void >
129129 ] ;
130130
131+ export function useContinuousRetry (
132+ callback : ( ) => any ,
133+ interval ?: number ,
134+ options ?: {
135+ maxRetries ?: number
136+ } ) : boolean ;
137+
138+ export function useCountdown ( endTime : number , options : {
139+ interval : number ,
140+ onComplete : ( ) => any ,
141+ onTick : ( ) => any
142+ } ) : number ;
143+
131144 export function useCounter (
132145 startingValue ?: number ,
133146 options ?: {
134147 min ?: number ;
135148 max ?: number ;
136149 }
137150 ) : [
138- number ,
139- {
140- increment : ( ) => void ;
141- decrement : ( ) => void ;
142- set : ( nextCount : number ) => void ;
143- reset : ( ) => void ;
144- }
145- ] ;
151+ number ,
152+ {
153+ increment : ( ) => void ;
154+ decrement : ( ) => void ;
155+ set : ( nextCount : number ) => void ;
156+ reset : ( ) => void ;
157+ }
158+ ] ;
146159
147160 export function useDebounce < T > ( value : T , delay : number ) : T ;
148161
@@ -153,8 +166,25 @@ declare module "@uidotdev/usehooks" {
153166
154167 export function useDocumentTitle ( title : string ) : void ;
155168
169+ export function useEventListener (
170+ target : React . MutableRefObject < Element > | Element ,
171+ eventName : string ,
172+ handler : ( Event ) => any ,
173+ options ?: {
174+ capture ?: boolean ,
175+ passive ?: boolean ,
176+ once ?: boolean
177+ } ) : void ;
178+
156179 export function useFavicon ( url : string ) : void ;
157180
181+ export function useFetch (
182+ url : string ,
183+ options ?: { } ) : {
184+ error : Error | undefined ,
185+ data : any | undefined
186+ }
187+
158188 export function useGeolocation ( options ?: PositionOptions ) : GeolocationState ;
159189
160190 export function useHistoryState < T > ( initialPresent ?: T ) : HistoryState < T > ;
@@ -170,10 +200,29 @@ declare module "@uidotdev/usehooks" {
170200 options ?: IntersectionObserverInit
171201 ) : [ React . MutableRefObject < T > , IntersectionObserverEntry | null ] ;
172202
203+ export function useInterval ( cb : ( ) => any , ms : number ) : ( ) => void ;
204+
205+ export function useIntervalWhen (
206+ cb : ( ) => any ,
207+ options : {
208+ ms : number ,
209+ when : boolean ,
210+ startImmediately ?: boolean
211+ } ) : ( ) => void ;
212+
173213 export function useIsClient ( ) : boolean ;
174214
175215 export function useIsFirstRender ( ) : boolean ;
176216
217+ export function useKeyPress (
218+ key : string ,
219+ cb : ( Event ) => any ,
220+ options ?: {
221+ event ?: string ,
222+ target ?: Element | Window ,
223+ eventOptions ?: { }
224+ } ) : void ;
225+
177226 export function useList < T > ( defaultList ?: T [ ] ) : [ T [ ] , CustomList < T > ] ;
178227
179228 export function useLocalStorage < T > (
@@ -183,6 +232,8 @@ declare module "@uidotdev/usehooks" {
183232
184233 export function useLockBodyScroll ( ) : void ;
185234
235+ export function useLogger ( name : string , ...rest : any [ ] ) : void ;
236+
186237 export function useLongPress (
187238 callback : ( e : Event ) => void ,
188239 options ?: LongPressOptions
@@ -214,12 +265,19 @@ declare module "@uidotdev/usehooks" {
214265 type : string ;
215266 } ;
216267
268+ export function usePageLeave ( cb : ( ) => any ) : void ;
269+
217270 export function usePreferredLanguage ( ) : string ;
218271
219272 export function usePrevious < T > ( newValue : T ) : T ;
220273
221274 export function useQueue < T > ( initialValue ?: T [ ] ) : CustomQueue < T > ;
222275
276+ export function useRandomInterval ( cb : ( ) => any , options : {
277+ minDelay : number ,
278+ maxDelay : number
279+ } ) : ( ) => void ;
280+
223281 export function useRenderCount ( ) : number ;
224282
225283 export function useRenderInfo ( name ?: string ) : RenderInfo | undefined ;
@@ -242,6 +300,8 @@ declare module "@uidotdev/usehooks" {
242300
243301 export function useThrottle < T > ( value : T , delay : number ) : T ;
244302
303+ export function useTimeout ( cb : ( ) => any , ms : number ) : ( ) => void ;
304+
245305 export function useToggle (
246306 initialValue ?: boolean
247307 ) : [ boolean , ( newValue ?: boolean ) => void ] ;
0 commit comments