I have an object in which for each key of the object, I want to create a tuple such that it is of the format
[k, typeof O[k]]
Where O
is the Object, k
is a key in the object.
So for example, consider the object below
{ content: "", isReady: false }
I want to generate a tuple type annotation that is as follows
['content', string]|['isReady', boolean]
How do I do that? By the way, I am using jsDoc to document the types, but I don’t mind getting the typescript typing version. Thank you in advance
I tried using the following type annotation
[keyof typeof Object, typeof Object[keyof typeof Object]]
But it’s not giving me the desired result