File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
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?
You can’t perform that action at this time.
0 commit comments