import { DependencyList } from 'react'; type UseIntervalControls = { start: (nextDelay?: number) => void; stop: VoidFunction; restart: (nextDelay?: number) => void; isRunning: boolean; }; /** * Custom hook that manages an interval with automatic cleanup. * Provides a reliable way to handle intervals that are properly cleaned up * on component unmount or when dependencies change. * * @param callback - The function to execute on each interval * @param delay - The delay in milliseconds (null to clear the interval) * @param deps - Optional dependency array. If provided, interval restarts when deps change. * If not provided, callback updates via ref without restarting interval. * * @example * ```tsx * // Runs continuously, callback updates via ref * useInterval(() => { * console.log('This runs every second') * }, 1000) * * // Restarts interval when count changes * useInterval(() => { * console.log('Count:', count) * }, 1000, [count]) * ``` */ export declare const useInterval: (callback: VoidFunction, delay?: number | null, deps?: DependencyList) => UseIntervalControls; export type { UseIntervalControls };