codedownio / aeson-typescript

Generate TypeScript definition files from your ADTs
BSD 3-Clause "New" or "Revised" License
60 stars 27 forks source link

Allow to export types easily #22

Closed picnoir closed 3 years ago

picnoir commented 3 years ago

Hi!

I'd need to generate some types for a typescript module, however, there's currently no way to export the generated types.

17, added this feature, however, the PR seems to have stalled by now. This PR is just a cherry pick of 13822f06e45b632446bf6e9b6e8368c060e159b5 rebased on the current master. I took the liberty to add a tiny bit of documentation.

Allow to export types easily

In some cases, we'd like to use the generated types in a typescript
module instead of a declaration file. When used in a module, the types
need to be explicitely exported to be re-used elsewhere.

Adding a new exportTypes FormattingOption in charge of prefixing the
generated types with "export".
picnoir commented 3 years ago

My apologies for the delay, I missed the notification.

thomasjm commented 3 years ago

Perfect, thanks! Merging now