It would be helpful, if the type parser could also resolve default values of properties.
StencilJS example
// my-component.tsx
import { Component, Prop, h } from '@stencil/core';
const Position = {
LEFT: 'left',
RIGHT: 'right',
} as const;
type Position = (typeof Position)[keyof typeof Position];
@Component({
tag: 'my-greeting',
shadow: true
})
export class MyGreeting {
@Prop() position: Position = Position.LEFT; // 1. default value is set here
render() {
return (
<div class={this.position}>
Hello World
</div>
);
}
}
// custom-elements.json
{
"kind": "field",
"name": "position",
"type": {
"text": "Position"
},
"parsedType": {
"text": "'left' | 'right'"
},
"default": "'left'", // 2. this information is currently not provided
},
It would be helpful, if the type parser could also resolve default values of properties.
StencilJS example