UNPKG

440 BTypeScriptView Raw
1import dayjs from 'dayjs';
2export type TDate = dayjs.ConfigType;
3export interface Options {
4 leftTime?: number;
5 targetDate?: TDate;
6 interval?: number;
7 onEnd?: () => void;
8}
9export interface FormattedRes {
10 days: number;
11 hours: number;
12 minutes: number;
13 seconds: number;
14 milliseconds: number;
15}
16declare const useCountdown: (options?: Options) => readonly [number, FormattedRes];
17export default useCountdown;