I have a generated type like this : (I can't manipulate it)
type Users = Array<
| {
typename: "personal";
firstName: string;
lastName: string;
}
| {
typename: "socialMedia";
userName: string;
email: string;
}
>;
Now i want to write a new type that refers to Users > typename socialMedia
{
typename: "socialMedia";
userName: string;
email: string;
}
I want the new type to be the code above
type userSocialMediaInfo = ?????
is this possible?
typename: "socialMedial"What is wrong with the type you have given as an example? Does it not work for some reason?