collectype / types/utility / ValueOf
ValueOf<
T> =T[keyofT]
Defined in: types/utility.ts:67
Utility type to get the value types of an enum or object.
T
The enum or object type.
enum E { A = 'a', B = 'b' }
type Example = ValueOf<E>; // 'a' | 'b'
type ExampleObj = ValueOf<{ x: 1, y: 2 }>; // 1 | 2