我有一个生成的联合类型,看起来像:
type Result = { type: 'car' } | { type: 'boat' }
Run Code Online (Sandbox Code Playgroud)
如何将它们分开,以便为每个类型创建单独的类型?例如:
type BoatResult = { type: 'boat' }
type CarResult = { type: 'card' }
Run Code Online (Sandbox Code Playgroud)
它们必须从原始Result类型创建。