We are currently using TS 2.3 (can't upgrade to 2.4 at the moment so using enums for this isn't an option).
We have an object type for something that looks like this
type myObject = {
keyOn: 'valueOne';
keyTwo: 'valueTwo';
keyThree: 'valueThree;
}
Ideally, I would like to be able to create a type that is made up of the string literals that are the values on that object type. So something like this:
type valueLiterals = 'valueOne' | 'valueTwo' | 'valueThree'
Similar to what you would be able to produce for the keys by using
type objectKeys = keyOf myObject
Is there some version of a valueof
or similar that would allow automatic generation of the valueLiterals
type?