I have a type as below
type IdAndName = {
id: number;
name: string;
}
Then I need a type that will be union from the values of keys of above type as follow -
type IdOrName = number | string;
Is there any way to achieve this dynamically?
I have a type as below
type IdAndName = {
id: number;
name: string;
}
Then I need a type that will be union from the values of keys of above type as follow -
type IdOrName = number | string;
Is there any way to achieve this dynamically?