import { Dayjs } from 'dayjs'; /** * useCurrentTime Hook 配置项 */ export interface UseCurrentTimeOptions { /** * 刷新间隔(毫秒) * @default 60000 */ refreshInterval?: number; /** * 是否禁用自动刷新 * @default false */ disabled?: boolean; /** * dayjs locale * @default 优先使用全局配置,其次使用 i18n 当前语言(getCurrentLocale) * @example 'zh-CN' | 'zh-HK' | 'en' | 'en-US' | 'ja' */ locale?: string; /** * 时间更新回调 */ onUpdate?: (time: Dayjs) => void; } /** * 管理当前时间状态的自定义 Hook * * @description * - 自动创建定时器刷新时间 * - 支持自定义刷新间隔 * - 支持国际化(locale):优先级为 用户指定 > 全局配置 > i18n 当前语言 * - 组件卸载时自动清除定时器 * * @example * const currentTime = useCurrentTime({ * refreshInterval: 1000, * locale: 'zh-CN', * onUpdate: (time) => console.log(time.format()) * }); * * @param options 配置项 * @returns 当前时间(Dayjs 对象) */ export declare function useCurrentTime(options?: UseCurrentTimeOptions): Dayjs;