tkrajina / typescriptify-golang-structs

A Golang struct to TypeScript class/interface converter
Apache License 2.0
505 stars 87 forks source link

We should be able to insert imports on the top of the generated file #31

Closed shackra closed 3 years ago

shackra commented 3 years ago

I have this issue case where I need to import Decimal from decimal.js because I'm sending currency values back and forth between the frontend and the backend, and I wouldn't want to send strings instead, so, if I pass ts_type:"Decimal" I have this problem where the import does not happen anywhere in the file and the TS file is filled with linting errors and does not work at all.

Having a way to add custom imports would become handy to handle this sort of use cases.