Consider the following interface:
interface User {
id: number;
name: string;
email: string;
address: {
country: string;
city: string;
state: string;
street: string;
}
active: boolean;
}
I need to create a generic PrimaryKey type, but it should correspond only to either string or number and omit any other type.
So in the case of PrimaryKey<User>
only id, name, and email would be considered valid primary keys.
How do I achieve that?