A function should return object { a: number, b: number }
, so I'm creating the object and fill it up later:
const output = {};
output.a = 1;
output.b = 2;
return output;
But TS gives me the error:
Type '{}' is missing the following properties from type 'Output': a, b ts(2739)
I'm expecting TS to understand I've added required fields to the const object as the function is running.