In my data store, I have two properties
data, backupData
I am trying to define that backupData must be of the same type as data.
However,
class ClassC{
data: InterfaceA | InterfaceB
backupData: InterfaceA | InterfaceB
}
does not ensure that backup is the SAME type as data.
Should backupData be of type any or is there a way to write this?
As a follow up for others who come across this, the solution worked using the answer below by doing:
class ClassC<T>{
data: T;
backupData: T;
}