UNPKG

react-use-timer-hook

Version:

A React hook for managing countdown or count-up timers with pause, reset, and customizable callbacks.

23 lines 844 B
import type { UseTimerOptions } from './useTimer.types'; /** * React hook for a flexible timer supporting countdown, count-up, pause, and granular time tracking. * @param options UseTimerOptions configuration object * @returns Timer state and control methods */ export declare function useTimer({ time: initialTime, countUp, autoStart, onFinish, onTick, onReset }?: UseTimerOptions): { isRunning: boolean; start: () => void; pause: () => void; reset: () => void; time: number; totalPauseTime: import("./helpers").TimeFromMillisecondsType; pauseTime: import("./helpers").TimeFromMillisecondsType; pauseStart: number | null; totalMilliseconds: number; totalSeconds: number; milliseconds: number; seconds: number; minutes: number; hours: number; }; //# sourceMappingURL=useTimer.d.ts.map