This PR introduces a refinement to the DatepickerType interface to leverage TypeScript's conditional types. The aim is to provide clearer typing based on the asSingle property value.
Details:
Introduced conditional types for the DatepickerType interface.
When asSingle is set to true, the value type becomes DateType.
When asSingle is set to false or is undefined, the value type defaults to DateValueType.
This enhancement ensures better type safety and improves readability when working with single date and date range scenarios in the Datepicker.
Overview:
This PR introduces a refinement to the
DatepickerType
interface to leverage TypeScript's conditional types. The aim is to provide clearer typing based on theasSingle
property value.Details:
DatepickerType
interface.asSingle
is set totrue
, thevalue
type becomesDateType
.asSingle
is set tofalse
or is undefined, thevalue
type defaults toDateValueType
.