ManageType can define custom options for fields of a specified type. This can be used instead of setting ts_type and ts_transform for all fields of a certain type.
(fld interface{}, opts TypeOptions)
| 196 | // |
| 197 | // This can be used instead of setting ts_type and ts_transform for all fields of a certain type. |
| 198 | func (t *TypeScriptify) ManageType(fld interface{}, opts TypeOptions) *TypeScriptify { |
| 199 | var typ reflect.Type |
| 200 | switch t := fld.(type) { |
| 201 | case reflect.Type: |
| 202 | typ = t |
| 203 | default: |
| 204 | typ = reflect.TypeOf(fld) |
| 205 | } |
| 206 | if t.fieldTypeOptions == nil { |
| 207 | t.fieldTypeOptions = map[reflect.Type]TypeOptions{} |
| 208 | } |
| 209 | t.fieldTypeOptions[typ] = opts |
| 210 | return t |
| 211 | } |
| 212 | |
| 213 | func (t *TypeScriptify) GetGeneratedStructs() []string { |
| 214 | var result []string |
nothing calls this directly
no outgoing calls
no test coverage detected