I am trying to create a more dynamic object typing. Right now I have the following:
interface MyGeneric<T> {
value: T
}
interface MyObject {
[name: string]: MyGeneric<any>;
}
But I want to abstract it to look more like this:
interface MyGeneric<T> {
value: T
}
interface MyObject {
[name: string]<T>: MyGeneric<T>;
}
This syntax does not work, but what I want would allow each prop on the object to have its own generic type.
Any advice on what this might look like?