rooks
Version:
Collection of awesome react hooks
17 lines (16 loc) • 472 B
TypeScript
type CountdownOptions = {
interval?: number;
onDown?: (restTime: number, newTime: Date) => void;
onEnd?: (newTime: Date) => void;
};
/**
*
* useCountdown
* Easy way to countdown until a given endtime in intervals
*
* @param endTime Time to countdown
* @param options Countdown options
* @see https://rooks.vercel.app/docs/hooks/useCountdown
*/
declare function useCountdown(endTime: Date, options?: CountdownOptions): number;
export { useCountdown };