I have a constant:
const name = 'some/property';
I would like to define an interface that uses the name as a key for a property in a similar way, using it in an object declaration as follows:
{[name]: 'Bob'}
I tried the following, but it looks like it is doing something else:
interface MyInterface { [name]: string; }
dynamically defines property names supported in typescript?
source share