MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / generateTSMethodTypes

Function generateTSMethodTypes

pkg/tsgen/tsgen.go:76–89  ·  view source on GitHub ↗
(method reflect.Method, tsTypesMap map[reflect.Type]string, skipFirstArg bool)

Source from the content-addressed store, hash-verified

74var wshRpcInterfaceRType = reflect.TypeOf((*wshrpc.WshRpcInterface)(nil)).Elem()
75
76func generateTSMethodTypes(method reflect.Method, tsTypesMap map[reflect.Type]string, skipFirstArg bool) error {
77 for idx := 0; idx < method.Type.NumIn(); idx++ {
78 if skipFirstArg && idx == 0 {
79 continue
80 }
81 inType := method.Type.In(idx)
82 GenerateTSType(inType, tsTypesMap)
83 }
84 for idx := 0; idx < method.Type.NumOut(); idx++ {
85 outType := method.Type.Out(idx)
86 GenerateTSType(outType, tsTypesMap)
87 }
88 return nil
89}
90
91func getTSFieldName(field reflect.StructField) string {
92 tsFieldTag := field.Tag.Get("tsfield")

Callers 2

GenerateServiceTypesFunction · 0.85
GenerateWshServerTypesFunction · 0.85

Calls 1

GenerateTSTypeFunction · 0.85

Tested by

no test coverage detected