gcanti / io-ts-codegen

Code generation for io-ts
https://gcanti.github.io/io-ts-codegen/
MIT License
155 stars 14 forks source link

Output an interface for branded interfaces #61

Closed cyberixae closed 4 years ago

cyberixae commented 4 years ago

I ran into trouble because a huge amount of type aliases got inlined for declaration files. This PR adds support for branding interfaces. I did not add test cases for recursive or double branded types but all the basic interfaces should work as expected.

cyberixae commented 4 years ago

Actually, I think I'm going to try naming the unbranded variants. They might be useful for doing some simplified static validation for validator inputs. The changes in this PR might be useful for other purposes though.

cyberixae commented 4 years ago

This isn't really solving my problem so I'm closing it for now. We can revisit it in the future if it seems useful.