MCPcopy Create free account
hub / github.com/wailsapp/wails / ManageType

Method ManageType

v2/internal/typescriptify/typescriptify.go:198–211  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

196//
197// This can be used instead of setting ts_type and ts_transform for all fields of a certain type.
198func (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
213func (t *TypeScriptify) GetGeneratedStructs() []string {
214 var result []string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected