I want to turn this:
type SomeRecord = {member1: any, member2: any}
into this:
type ResultingTuple = [keyof SomeRecord, keyof SomeRecord]
If the record has 3 members, the tuple should have 3 elements, and so on.
I want to turn this:
type SomeRecord = {member1: any, member2: any}
into this:
type ResultingTuple = [keyof SomeRecord, keyof SomeRecord]
If the record has 3 members, the tuple should have 3 elements, and so on.
If we import TuplifyUnion
from this answer, then :
type ResultingTuple = TuplifyUnion<keyof SomeRecord>
However, as mentioned by the author of TuplifyUnion
, the order of the keys cannot be maintained.