gcanti / io-ts-types

A collection of codecs and combinators for use with io-ts
https://gcanti.github.io/io-ts-types/
MIT License
311 stars 40 forks source link

Autogen lenses from interfaces? #81

Closed dwhitney closed 5 years ago

dwhitney commented 5 years ago

Is there a script that will autogen lenses from a given typescript interface? I'd like to run a script that took a given typescript file as input and it output lenses for all of the interfaces in the given file. I can build it myself, but I thought I'd ask before doing so. Thanks

gcanti commented 5 years ago

@dwhitney no, there's a lensesFromInterface.ts helper but is based on io-ts codecs

dwhitney commented 5 years ago

I've got to have a Codec for that to work, right?

gcanti commented 5 years ago

Yes, see https://github.com/gcanti/io-ts-types#lensesfrominterface