I have a JSON like this:
{ users: {
"username": {"name": "text","last_name": "other text"},
"username2": {"name": "text","last_name": "other text"},
"username3": {"name": "text","last_name": "other text"}
...
}
And I want to type this as generic, something like this:
type UserInfo = {name:string, last_name:string}
type user<T> = {
T: UserInfo
}
type users = {
users: user<string>
}
I'm trying to use the generic of user as the key for the object, so I don't have to define a key for username, username2, etc and to make it extensible to "n" username. but it is not working