import { Dayjs, ConfigType } from 'dayjs'; /** * 当前时间,转换为{@link Date}对象 * * @return 当前时间 */ declare const date: () => Date; /** * 获得年的部分 * * @param date 日期 * @return 年的部分 */ declare const year: (date: Date) => number; /** * @return 今年 */ declare const thisYear: () => number; /** * 计算年龄 * @param birthday * @param dateToCompare */ declare const age: (birthday: Dayjs, dateToCompare?: Dayjs) => number; /** * 转换为dayjs工具 * 作用只是帮助项目不用显示安装dayJS * @param value * @param format */ declare const toDayJs: (value: ConfigType, format?: string) => Dayjs; /** * 检查dayJs是否合法,并返回错误占位值 * @param value * @param error */ declare const checkDateValue: (value: ConfigType, error?: string) => ConfigType; /** * 格式化时间字符串 * @param value * @param format * @param error 是否验证时间合法,验证则填写验证失败返回值 */ declare const parseDateString: (value: ConfigType, format: string, error?: any) => any; /** * 格式化时间 * @param value * @param format */ declare const parseDate: (value: ConfigType, format: string) => Date; /** * 是否是闰年 * @param year */ declare const isLeapYear: (year: number) => boolean; /** * 验证是否为生日 * 1900 年起 * 只支持以下几种格式: * - YYYYMMDD * - YYYY-MM-DD * - YYYY/MM/DD * - YYYY.MM.DD * - YYYY年MM月DD日 * 占位符含义详见 [dayjs](https://day.js.org/docs/zh-CN/parse/string-format) * * @param value 值 * @return 是否为生日 */ declare const isBirthday: (value: string) => boolean; export { age, checkDateValue, date, isBirthday, isLeapYear, parseDate, parseDateString, thisYear, toDayJs, year };