When subclassing a lit-element Class to add further typing, should the @property decorator be overridden or just the type and initializer? In otherwords, suppose I have this code:
interface AB {
a: number,
b: string,
}
@customElement('my-parent')
class MyParent extends LitElement {
@property({type: Array}) stuff: readonly any[] = [];
}
which of the following would be right as a way of subclassing:
@customElement('my-child')
class MyChild extends MyParent {
override @property({type: Array}) stuff: readonly Readonly<AB>[] = [];
}
or
@customElement('my-child')
class MyChild extends MyParent {
override stuff: readonly Readonly<AB>[] = [];
}
Both seem to be working in my codebase, so I'm not sure which to standardize to.