I'd like to know the best way to do this, say I have two objects
var objectA = {
propertyA: 1,
propertyB: 2
...
propertyM: 13
}
var objectB = {
propertyN: 14,
propertyO: 15
...
propertyZ: 26
}
If objectC is created by
var objectC = Object.assign(objectA, objectB);
How can I declare/describe objectC, so the compiler/IDE knows that it has the properties of both objectA and objectB?
I'd like to find a way without the need of defining interfaces for objectA and objectB. I don't want to write declaration and definition/evaluation for the same property twice. This redundancy is significant if I have too many properties on an object.
(Is there an operator that can extract the interface/type of an existing object?)
Is it possible?