custom-elements-manifest
custom-elements-manifest copied to clipboard
Add readonly flag to properties
It would be helpful to mark a class field or property as readonly (i.e. getter only or defined as writable: false)
{
"name": "elements",
"type": "readonly ApolloElementElement[]",
"readonly": true,
"attribute": false,
"summary": "List of all ApolloElements registered to this client."
},
This could be even useful with CSS props.
I have a map component and 2 marker components that expose 3 readonly properties, I used to annotate them like this:
/** @readonly */
this.size = [16, 16];
/** @readonly */
this.anchor = [8, 8];
/** @readonly */
this.tooltip = [0, 0];
I decided to move those to getters (without setters) and I'll create a CEM analyzer plugin that used this "getter but no setter" to identify fields as readonly.