You can use a type query with the result of keyof
:
type V = X[keyof X]
Generally a type query will return a union of all possible field types, so X['a'] | X['b']
is the same as X['a' | 'b']
. This is why X[keyof X]
works, as keyof
will return a union of string literal types representing all keys in the object.