Say we have two variables
const x='property1'
const y='property2'
and we have function
function foo<key extends keyof MapInterface>(name: key, props: (MapInterface[key]))
This interface should look like
interface MapInterface{
'property1':any;
'property2':any;
}
Is it possible to have the interface be generically created like by calling the variables x,y
interface MapInterface{
x:any; //return 'property1':any;
y:any; //return 'property2':any;
}