-
-
Notifications
You must be signed in to change notification settings - Fork 834
bug: Attribute reflected prop types causes an typescript error on components.d.ts #6183
Copy link
Copy link
Closed
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
^4.27.0
Current Behavior
Attribute reflected types are generated wrong.
Expected Behavior
It should be generated without an error.
System Info
Steps to Reproduce
1- Create a component
2- Add a prop @Prop({ attribute: 'role' }) hostRole?: 'button' | 'link' = 'button';
3- Go to components.d.ts
4- interface HTMLPlantCardElement extends Components.PlantCard, HTMLStencilElement this is where the error happens.
interface PlantCard {
"hostRole"?: 'button' | 'link';
/**
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
*/
"role"?: 'button' | 'link';
}Since role is not required in PlantCard interface but it is required in HTMLStencilElement and HTMLElement, it cannot be extended to both types simultaneously.
Code Reproduction URL
https://github.com/itsjustaplant/stencil-mono/tree/issue/type-generation
Additional Information
Related commit: 30f2a09
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil