This main.go generates typescript types from the codersdk types in Go.
- Supports Go types
- Basics (string/int/etc)
- Maps
- Slices
- Enums
- Pointers
- External Types (uses
anyatm)- Some custom external types are hardcoded in (eg: time.Time)
type Foo struct {
// Force the typescript type to be a number
CreatedAt time.Duration `json:"created_at" typescript:"number"`
}Do not generate ignored types.
// @typescript-ignore InternalType
type InternalType struct {
// ...
}- Use a yaml config for overriding certain types