Diagram: Extend Shapes Types#32365
Open
mpreyskurantov wants to merge 3 commits intoDevExpress:26_1from
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the TypeScript type definition for the shapes property in the Diagram component from Array<ShapeType> | Array<string> to Array<ShapeType | string>. This change makes the type more accurate and flexible by allowing arrays that can contain both built-in ShapeType values and custom shape type strings, rather than requiring the array to contain only one type or the other.
Changes:
- Updated core TypeScript type definitions to use
Array<ShapeType | string>instead ofArray<ShapeType> | Array<string> - Regenerated framework wrappers (Angular, React, Vue) to reflect the updated type definitions
- Removed unnecessary type casts (
as anyandas unknown as DxDiagramTypes.ShapeType[]) from demo applications
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/ui/diagram.d.ts | Updated core type definition for shapes property in contextToolbox and toolbox.groups |
| packages/devextreme/ts/dx.all.d.ts | Updated type definition in dx.all bundle |
| packages/devextreme-react/src/diagram.ts | Regenerated React wrapper with updated type definitions |
| packages/devextreme-vue/src/diagram.ts | Regenerated Vue wrapper with updated type definitions |
| packages/devextreme-angular/src/ui/diagram/index.ts | Regenerated Angular main component with updated type definitions |
| packages/devextreme-angular/src/ui/diagram/nested/context-toolbox.ts | Regenerated Angular nested component for contextToolbox |
| packages/devextreme-angular/src/ui/diagram/nested/toolbox.ts | Regenerated Angular nested component for toolbox |
| packages/devextreme-angular/src/ui/diagram/nested/toolbox-group-dxi.ts | Regenerated Angular nested component for toolbox group |
| packages/devextreme-angular/src/ui/diagram/nested/group-dxi.ts | Regenerated Angular nested component for group |
| apps/demos/Demos/Diagram/OperationRestrictions/Vue/App.vue | Removed unnecessary type cast for shapes array |
| apps/demos/Demos/Diagram/OperationRestrictions/React/App.tsx | Removed unnecessary type casts for shapes array |
Closed
romanresh
approved these changes
Feb 3, 2026
anna-shakhova
approved these changes
Feb 3, 2026
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.