I'd like to infer a property type from an enum like so:
enum Foo {
One, Two
}
type Bar = {...}
type BarOne = Bar & {...}
type BarTwo = Bar & {...}
export type MyType<T extends Foo> = {
data: // How do I set this type to be BarOne if Foo.One, BarTwo if Foo.Two, etc.?
}
Totally open to hearing a different approach if this is not ideal.