Is it possible to map a union type to another union type in TypeScript?
What I'd Like to be able to do
e.g. Given a union type A:
type A = 'one' | 'two' | 'three';
I'd like to be able to map it to union type B:
type B = { type: 'one' } | { type: 'two'} | { type: 'three' };
What I have tried
type B = { type: A };
But this results in:
type B = { type: 'one' | 'two' | 'three' };
which is not quite what I want.