When extending a class, typings of objects on the class are thrown out and I'm able to add whatever properties I want. How can I prevent this?
type StaticObject = {
a: string[];
};
class System {
staticObject?: StaticObject;
}
export default class ToggleInputSystem extends System {
staticObject = { // Should be a type error but none appears
a: ["hi"],
added: true
};
}
https://codesandbox.io/s/typescript-playground-export-ed1vx?file=/index.ts:0-254