import * as React from 'react'; import type { RequiredWith } from "../../../_util/type"; import type { DisabledType } from '../../../config-provider/DisabledContext'; import type { ValidateStatus } from '../../../form/FormItem'; import type { DateValue, DisabledDate, FilledLocale, FormatType, GenerateConfig, InternalMode, Locale, PickerMode } from '../../interface'; import type { InternalRangePickerProps } from '../RangePicker'; import useInvalidate from './useInvalidate'; type UseInvalidate = typeof useInvalidate; type PickedProps = Pick, 'generateConfig' | 'picker' | 'order' | 'components' | 'allowClear' | 'needConfirm' | 'format' | 'inputReadOnly' | 'disabledDate' | 'minDate' | 'maxDate' | 'defaultOpenValue' | 'getPopupContainer' | 'size' | 'status' | 'variant' | 'popupZIndex' | 'disabled'> & { prefixCls?: string; locale?: Locale; multiple?: boolean; showTime?: any; value?: any; defaultValue?: any; pickerValue?: any; defaultPickerValue?: any; removeIcon?: React.ReactNode; }; type ExcludeBooleanType = T extends boolean ? never : T; type GetGeneric = T extends PickedProps ? U : never; type ToArrayType = T extends any[] ? T : DateType[]; export declare function parseDate(value: DateValue | string | number, generateConfig: GenerateConfig, locale: Locale, formatList: string[]): T | null; export declare function fillLocale(locale: Locale, { showHour, showMinute, showSecond, showMillisecond, use12Hours, }: { showHour?: boolean; showMinute?: boolean; showSecond?: boolean; showMillisecond?: boolean; use12Hours?: boolean; }): FilledLocale; /** * Align the outer props with unique typed and fill undefined props. * This is shared with both RangePicker and Picker. This will do: * - Convert `value` & `defaultValue` to array * - handle the legacy props fill like `clearIcon` + `allowClear` = `clearIcon` */ export default function useFilledProps, UpdaterProps extends Record = object>(props: InProps, updater?: (data: { disabled?: [boolean, boolean] | DisabledType; }) => UpdaterProps): [ filledProps: Omit, keyof UpdaterProps | 'showTime' | 'value' | 'defaultValue' | 'status' | 'minDate' | 'maxDate'> & UpdaterProps & { picker: PickerMode; showTime?: ExcludeBooleanType; value?: ToArrayType; defaultValue?: ToArrayType; pickerValue?: ToArrayType; defaultPickerValue?: ToArrayType; disabledDate: DisabledDate; isCompactItem: boolean; compactItemClassnames: string; enableVariantCls: boolean; status: ValidateStatus; minDate?: DateType; maxDate?: DateType; }, internalPicker: InternalMode, complexPicker: boolean, formatList: FormatType[], maskFormat: string | undefined, isInvalidateDate: ReturnType> ]; export {};