I am trying to migrate this simplified js code into ts:
let Test = {};
Test.a = { //error: prop a does not exist
someProp: true
};
Test.b = {
...Test.a,//self referencing
otherProp: true
};
export default Test;
I want to avoid extracting the object to an interface, because the object has many props and I don't want to repeat all the props in the implementation.
Any suggestions?
aproperty with value{someProp:true}and abproperty with value{someProp:true; otherProp: true}. Nowhere does an object reference itself. Can you clarify what you need?any.Testas{ a: someType; b: someOtherType; }DefinesomeTypeas{ someProp: boolean; }DefinesomeOtherTypeasextends someType { otherProp: boolean; }typescriptlang.org/play/index.html#code/…