You need a constructor to set default values ββfor a class property.
Try the following:
declare class Foo extends Bar { foo: number; constructor(){ this.foo = 60; } }
UPDATE: After a closer look at the code snippet, I noticed that you are using the declare keyword, in doing this, you just defined the class type, and this one does not require implementation.
UPDATE 2: You do not need a class constructor for this; you can initialize your properties with or without it.
If you delete the declare keyword, it should work fine.
class Foo extends Bar { foo: number; constructor(){ this.foo = 60; } }
source share