From 9f7092222a7201b7c0014af6d50d8ba51353a343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Thu, 7 Dec 2023 16:57:26 +0800 Subject: [PATCH] chore: more ts --- .../PickerInput/hooks/useRangePickerValue.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/NewPicker/PickerInput/hooks/useRangePickerValue.ts b/src/NewPicker/PickerInput/hooks/useRangePickerValue.ts index 4a36ba9d4..3f5fde27b 100644 --- a/src/NewPicker/PickerInput/hooks/useRangePickerValue.ts +++ b/src/NewPicker/PickerInput/hooks/useRangePickerValue.ts @@ -4,7 +4,7 @@ import * as React from 'react'; import type { GenerateConfig } from '../../../generate'; import { isSame } from '../../../utils/dateUtil'; import type { InternalMode, Locale, PanelMode } from '../../interface'; -import type { RangePickerProps, RangeValueType } from '../RangePicker'; +import type { RangePickerProps } from '../RangePicker'; export function offsetPanelDate( generateConfig: GenerateConfig, @@ -32,7 +32,7 @@ export function offsetPanelDate( } } -const EMPTY_LIST: RangeValueType = []; +const EMPTY_LIST = []; /** Merge the `showTime.defaultValue` into `pickerValue` */ function fillTimePickerValue( @@ -56,22 +56,22 @@ function fillTimePickerValue( return tmpDate; } -export default function useRangePickerValue( +export default function useRangePickerValue( generateConfig: GenerateConfig, locale: Locale, - calendarValue: RangeValueType, + calendarValue: ValueType, open: boolean, activeIndex: number, pickerMode: InternalMode, multiplePanel: boolean, - defaultPickerValue: RangeValueType = EMPTY_LIST, - pickerValue: RangeValueType = EMPTY_LIST, + defaultPickerValue: ValueType = EMPTY_LIST as ValueType, + pickerValue: ValueType = EMPTY_LIST as ValueType, // This is legacy from origin logic. // We will take `showTime.defaultValue` as the part of `pickerValue` - timeDefaultValue: RangeValueType = EMPTY_LIST, + timeDefaultValue: ValueType = EMPTY_LIST as ValueType, onPickerValueChange?: RangePickerProps['onPickerValueChange'], - minDate: DateType, - maxDate: DateType, + minDate?: DateType, + maxDate?: DateType, ): [currentIndexPickerValue: DateType, setCurrentIndexPickerValue: (value: DateType) => void] { // ======================== Active ======================== // `activeIndex` must be valid to avoid getting empty `pickerValue`