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