Skip to content

Commit 9a3d7e3

Browse files
committed
Add basic readme
1 parent 21d1687 commit 9a3d7e3

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

scripts/apitypings/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# APITypings
2+
3+
This main.go generates typescript types from the codersdk types in Go.
4+
5+
# Features
6+
7+
- Supports Go types
8+
- [x] Basics (string/int/etc)
9+
- [x] Maps
10+
- [x] Slices
11+
- [x] Enums
12+
- [x] Pointers
13+
- [ ] External Types (uses `any` atm)
14+
- Some custom external types are hardcoded in (eg: time.Time)
15+
16+
17+
## Type overrides
18+
19+
```golang
20+
type Foo struct {
21+
// Force the typescript type to be a number
22+
CreatedAt time.Duration `json:"created_at" typescript:"number"`
23+
}
24+
```
25+
26+
## Ignore Types
27+
28+
Do not generate ignored types.
29+
30+
```golang
31+
// @typescript-ignore InternalType
32+
type InternalType struct {
33+
// ...
34+
}
35+
```
36+
37+
# Future Ideas
38+
39+
- Should `omitempty` in the `json` tag indicate optional?

0 commit comments

Comments
 (0)