Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves TypeScript typing across the DateBox component and its strategy classes. The changes focus on adding explicit type annotations, converting legacy ctor methods to proper TypeScript constructors, improving import paths, and refining return types throughout the codebase.
Changes:
- Migrated strategy classes from
ctorto proper TypeScriptconstructormethods with typed parameters - Added explicit return type annotations to methods across all DateBox strategies
- Changed Calendar import path from
@js/ui/calendarto@ts/ui/calendar/calendarfor consistency - Improved type safety by replacing
voidwithboolean | undefinedfor keyboard handler return types - Removed numerous
@ts-expect-errorsuppressions where typing improvements made them unnecessary
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| m_text_editor.base.ts | Made element parameter optional in _hasFocusClass and changed || to ?? operator |
| editor.ts | Removed unnecessary eslint disable comment for showValidationMessageTimeout |
| m_rangeCalendar.ts | Updated Calendar import path, added @ts-expect-error for dateBox type mismatch, improved getValue() typing |
| m_multiselect_date_box.ts | Removed multiple @ts-expect-error suppressions for Calendar private methods |
| m_date_box.strategy.ts | Converted ctor to constructor, added comprehensive type annotations for base strategy class |
| m_date_box.strategy.native.ts | Converted ctor to constructor, added return types and parameter types |
| m_date_box.strategy.list.ts | Converted ctor to constructor, improved typing throughout, fixed getDefaultDate() to use new Date(0) |
| m_date_box.strategy.date_view.ts | Converted ctor to constructor, improved popup configuration typing |
| m_date_box.strategy.calendar_with_time.ts | Converted ctor to constructor, improved typing and removed @ts-expect-error comments |
| m_date_box.strategy.calendar.ts | Converted ctor to constructor, updated Calendar import path, improved typing |
| date_view.ts | Added default value for type option |
| date_utils.ts | Improved getStringFormat to use 'type' in format check |
| date_box.mask.ts | Updated return types for keyboard handlers and removed unused import |
| date_box.base.ts | Updated event type from ValueChangedEvent to InteractionEvent, improved typing |
packages/devextreme/js/__internal/ui/date_range_box/strategy/m_rangeCalendar.ts
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.