1

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?

Abhinandan Khilari
  • 947
  • 3
  • 11
  • 26

0 Answers0