Skip to content

Scheduler — Refactor scheduler.d.ts file#34269

Open
sjbur wants to merge 8 commits into
mainfrom
feature/refactor-scheduler-dts-4569
Open

Scheduler — Refactor scheduler.d.ts file#34269
sjbur wants to merge 8 commits into
mainfrom
feature/refactor-scheduler-dts-4569

Conversation

@sjbur

@sjbur sjbur commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@sjbur sjbur self-assigned this Jul 10, 2026
@sjbur sjbur added the 26_2 label Jul 10, 2026
@github-actions github-actions Bot added the .d.ts label Jul 10, 2026
menuItemTemplate: {},
name: String as PropType<string | FormPredefinedButtonItem | SchedulerPredefinedToolbarItem>,
options: Object as PropType<DateNavigatorItemProperties | Record<string, any> | dxButtonGroupOptions>,
options: Object as PropType<DateNavigatorItemProperties | Record<string, any>>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DateNavigatorItemProperties extends dxButtonGroupOptions, so no point of including dxButtonGroupOptions here

@sjbur sjbur marked this pull request as ready for review July 10, 2026 13:58
@sjbur sjbur requested a review from a team as a code owner July 10, 2026 13:58
Copilot AI review requested due to automatic review settings July 10, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Scheduler TypeScript declarations to align dxScheduler with the Properties-based typing pattern and to reuse canonical Properties/Item types from related widgets (ButtonGroup/Toolbar). It also updates the Vue Scheduler wrapper typings accordingly.

Changes:

  • Updated dxScheduler to extend Widget<DevExpress.ui.dxScheduler.Properties> instead of Widget<dxSchedulerOptions>.
  • Refactored Scheduler-related composite types (e.g., DateNavigatorItemProperties, toolbar item base types) to use dxButtonGroup.Properties/dxButtonGroup.Item and dxToolbar.Item.
  • Updated the Vue wrapper Scheduler component prop typings (notably the options prop unions).

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/devextreme/ts/dx.all.d.ts Aligns dxScheduler generics and refactors Scheduler namespace types to use canonical ButtonGroup/Toolbar Properties/Item types.
packages/devextreme/js/ui/scheduler.d.ts Refactors imports/types, adds explicit base-widget event overrides in dxSchedulerOptions, and switches the class generic to Properties.
packages/devextreme-vue/src/scheduler.ts Updates Vue wrapper prop typings for Scheduler toolbar/date navigator options.
Comments suppressed due to low confidence (2)

packages/devextreme-vue/src/scheduler.ts:126

  • packages/devextreme-vue/src/scheduler.ts is generated output (see packages/devextreme-vue/project.json target generate-components, which outputs {projectRoot}/src/**/*). Direct edits here are likely to be overwritten on regeneration; the change should be made in the Vue wrapper generator/metadata and then nx generate-components devextreme-vue (or nx run devextreme-vue:regenerate) should be run to update src/.
import {
 dxButtonGroupItem,
 ContentReadyEvent as ButtonGroupContentReadyEvent,
 DisposingEvent as ButtonGroupDisposingEvent,
 InitializedEvent as ButtonGroupInitializedEvent,

packages/devextreme-vue/src/scheduler.ts:126

  • dxButtonGroupOptions was removed from the devextreme/ui/button_group imports, but it is still needed if options props accept values typed as dxButtonGroupOptions. Without it, the remaining union uses Record<string, any>, and a dxButtonGroupOptions-typed variable is not assignable to Record<string, any> because it lacks an index signature (TypeScript will report an error).
import {
 dxButtonGroupItem,
 ContentReadyEvent as ButtonGroupContentReadyEvent,
 DisposingEvent as ButtonGroupDisposingEvent,
 InitializedEvent as ButtonGroupInitializedEvent,

menuItemTemplate: {},
name: String as PropType<string | FormPredefinedButtonItem | SchedulerPredefinedToolbarItem>,
options: Object as PropType<DateNavigatorItemProperties | Record<string, any> | dxButtonGroupOptions>,
options: Object as PropType<DateNavigatorItemProperties | Record<string, any>>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a test script:

const options: dxButtonGroupOptions = {}
let accepted: DateNavigatorItemProperties | Record<string, any> = options;
accepted = options;

No type errors.

menuItemTemplate: {},
name: String as PropType<SchedulerPredefinedToolbarItem>,
options: Object as PropType<DateNavigatorItemProperties | Record<string, any> | dxButtonGroupOptions>,
options: Object as PropType<DateNavigatorItemProperties | Record<string, any>>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a test script:

const options: dxButtonGroupOptions = {}
let accepted: DateNavigatorItemProperties | Record<string, any> = options;
accepted = options;

No type errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants