Skip to content

Conversation

@matteocelani
Copy link

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 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.
Refined the DatepickerType interface to use conditional types. Now, the value type is determined by the asSingle property. When asSingle is true, value is of type DateType, otherwise, it's DateValueType.
@matteocelani matteocelani deleted the master-1 branch August 23, 2023 16:31
@matteocelani matteocelani restored the master-1 branch August 23, 2023 16:31
@matteocelani matteocelani deleted the master-1 branch August 23, 2023 16:31
@matteocelani matteocelani restored the master-1 branch August 23, 2023 16:32
@matteocelani matteocelani deleted the master-1 branch October 17, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants