struct2ts
struct2ts copied to clipboard
Anything that is not `-` or `date` should be use as type for interfaces
As stated.
Something like:
type Custom struct {
MyValue `ts:"MyCustomType"`
}
Should become:
interface Custom {
my_value: MyCustomType
}
For importing the types, I use a script with something like echo "import {Type} from '@types'" > src/types/golang.ts
before running struct2ts, if someone is wondering.