'Getting types of another types properties in TypeScript?
Given this type:
type Foo = {
Prop1: Bar1,
Prop2: Bar2
}
From this type I want to extract a union type equivalent to:
type NewType = Bar1 | Bar2;
Can this be done in TypeScript?
Solution 1:[1]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lesiak |
