Suppose I have the following type:
export type Step =
| {name: 'a'}
| {name: 'b'}
| {name: 'c', foo: string}
| {name: 'd'};
Is it possible to derive a tuple/array type that corresponds exactly to all the values of name
in any order?
For example:
const stepNames = ['d', 'a', 'b', 'c'] // good, contains all values of `name` in any order
const stepNames = ['d', 'a', 'b'] // bad, `c` is missing
const stepNames = ['d', 'a', 'b', 'c', 'c'] // bad, `c` is repeated