import type { UseCounterReturnsAction } from "../use-counter/index.js"; import type { UseIntervalFnInterval } from "../use-interval-fn/index.js"; import type { Pausable } from "../use-pausable/index.js"; export interface UseIntervalOptions { /** * Expose more controls * * @defaultValue false */ controls?: Controls; /** * Execute the update immediately on calling * * @defaultValue true */ immediate?: boolean; /** * Callback on every interval * * @param count - The current count */ callback?: (count: number) => void; } export interface UseIntervalAction extends UseCounterReturnsAction, Pausable { /** * Reset the count, optionally set a new count */ reset: (count?: number) => void; } export type UseIntervalWithControlsReturns = [ /** * Current count */ count: number, /** * Counter Actions */ UseIntervalAction ]; export type UseIntervalReturns = Controls extends true ? UseIntervalWithControlsReturns : number; /** * A React Hook that create a interval counter. */ export declare function useInterval(interval?: UseIntervalFnInterval, options?: UseIntervalOptions): UseIntervalReturns; export declare function useInterval(interval: UseIntervalFnInterval, options: UseIntervalOptions): UseIntervalReturns;