The items property (which is a property in my WebComponent class) is annotated with the @readonly JSDoc tag but is still serialized without the readonly modifier afterwards in the JSON file. I’m using the --format json2 flag.
Is there any other way to make the read-only modifier available in the JSON file?
// ......
/**
* Gets or sets the `items` property.
*
* @public
* @readonly <- it should be readonly but is missing in the generated json file.
*/
public get items(): Array<HTMLElement> {
return this._slot?.assignedElements() as Array<HTMLElement> ?? [];
}
// ......