Issue with Creating Union Types in TypeScript
Here's an odd question. I often create my types like this So, I get the interface name instead of type structure in IDEs like VSCode. The problem is
Does anyone know a more elegant way to do this? Either some VSCode switch to use type names instead of their structure or an easy way for union to use my other interface? Thanks!
S.union is obviously unaware of the interface and only uses the type. I find myself creating union types that are a union of the interfaces above rather than using S.Schema.To<typeof MyUnion> but then I frequently have to map my effects with .map(e => e as MyUnion) so it uses the handrolled union type. Here is a small example of what I mean: Does anyone know a more elegant way to do this? Either some VSCode switch to use type names instead of their structure or an easy way for union to use my other interface? Thanks!
