Struggling to find the correct TS syntax with Typescript 3.7.3.
I have a random object, for example:
var obj = {
one: ...,
two: ...
three: ...
};
I want to create a type that includes all keys from that object, like this:
type ObjKeys = 'one' | 'two' | 'three';
I've heard that using this syntax should work, but it seems like it might be outdated.
type ObjKeys = keyof typeof obj;
Any suggestions?