type Tuple=[{a:string,x:string,z:string},{b:string,x:string,z:string}]
type IntersectionOfTupleElementKeys<T>=...
type MyType = IntersectionOfTupleElementKeys<Tuple> // = ('a'|'x'|'z')&('b'|'x'|'z')='x'|'z'
I am working with a tuple type that has shared fields across each element (like the x and z
in type Tuple
). How can I find the intersection of these common fields ('x'|'z'
)?