How do I retrieve the data type of User.name
?
interface User {
id: number;
name: string;
}
I am looking to specify my other type as follows.
type UserInstance {
name: <infer type "string" from User interface>;
...
}
The goal is to ensure flexibility: If the type "string" changes in the future, I won't have to update it in multiple places.