I want to describe a type that has the following behavior
export class myData {
key : string;
display_name : string;
}
However I want to have dynamic name for key and display_name
eg. the following would be valid myData type
mySample1:myData =
{
myKey : 'myKeyValue'
myName : 'myNameValue'
}
mySample1:myData =
{
myKey2 : 'myKeyValue2'
myName2 : 'myNameValue2'
}
Is this possible in typescript? If it is possible, is this a good idea in typescript?
