import { Moment } from 'moment'; import { DatePickerOptions } from './constant'; export declare type DisabledDateTimeFnResult = (cur: Moment) => ({ disabledHours: () => number[]; disabledMinutes: () => number[]; disabledSeconds: () => number[]; }); /** * 限制范围类型 */ export declare type LimitRangeType = typeof DatePickerOptions.limitRangeOptions[number]['value']; /** * 节假日类型 */ export declare type HolidaysLimitType = typeof DatePickerOptions.holidaysLimitOptions[number]['value']; export interface IGeneratorParams { /** * 限制类型 */ limitRange: LimitRangeType; /** * 日期模式 */ timeMode: 'time' | 'date'; /** * 开始时间 limitRange => period */ startDate?: string; /** * 截止时间 limitRange => period */ endDate?: string; /** * 指定时间 limitRange => beforeSelect | afterSelect */ selectTime?: string; /** * 可选时间 limitRange => multipleSelect */ validMultiDate?: string[]; /** * 节假日限制 */ holidaysLimit: HolidaysLimitType; } /** * 获取相对日期 * @param dateStr add:[*] subtract:[*] * @param refDate 相对日期 */ export declare const getPeriodDate: (dateStr: string, refDate?: Moment) => Moment; export interface GeneratorDisabledCallbackResultType { /** * 日期禁用校验方法 * @param cur 当前时间 * @param taday * @returns */ disabledDateFn: (cur: Moment, taday?: Moment) => boolean; /** * 时间禁用校验方法 * @param cur 当前时间 * @returns */ disabledDateTimeFn: null | DisabledDateTimeFnResult; /** * 开始时间 */ startDate?: Moment; /** * ]截止时间 */ endDate?: Moment; } /** * 根据传入的规则生成 日期禁用回调函数 * @param params 入参 * @returns */ export declare const generatorDisabledCallback: (params: IGeneratorParams) => GeneratorDisabledCallbackResultType; export interface RuleCallbackProps extends GeneratorDisabledCallbackResultType { /** * 日期格式 */ tiemMode: string; /** * 当前选中值 */ currentValue: string | Moment; /** * 节假日限制 */ holidaysLimit: HolidaysLimitType; /** * 获取提示内容 * @param t * @param params * @returns */ getLocale: (t: string, params?: any) => any; /** * 控件名称 */ name: string; /** * 日期格式化 */ format: string; } export declare const getRuleCallback: (props: RuleCallbackProps) => string;