{{- /*gotype: efprojects.com/kitten-ipc/kitcom/internal/ts.tsGenData*/ -}} // Code generated by kitcom. DO NOT EDIT. import {ParentIPC, ChildIPC} from 'kitten-ipc'; {{ range $e := .Api.Endpoints }} export default class {{ $e.Name }} { protected ipc: ParentIPC | ChildIPC; constructor(ipc: ParentIPC | ChildIPC) { this.ipc = ipc; } {{ range $mtd := $e.Methods }} async {{ $mtd.Name }}( {{ range $par := $mtd.Params }}{{ $par.Name }}: {{ $par.Type | typedef }}, {{ end }} ): Promise<{{ if len $mtd.Ret }}{{ (index $mtd.Ret 0).Type | typedef }}{{ else }}void{{ end }}> { {{ range $par := $mtd.Params -}} {{ $par.Name }} = this.ipc.convType({{ $par.Name }}, '{{ $par.Type | typedef }}'); {{- end -}} const results = await this.ipc.call('{{ $e.Name }}.{{ $mtd.Name }}', {{ range $par := $mtd.Params }}{{ $par.Name }}, {{ end }} ); {{- range $i, $ret := $mtd.Ret -}} results[{{ $i }}] = this.ipc.convType(results[{{ $i }}], '{{ $ret.Type | typedef }}'); {{- end -}} return {{ range $i, $ret := $mtd.Ret }}{{ if $i }}, {{ end }}results[{{ $i }}] as {{ $ret.Type | typedef }}{{ end }} } {{ end }} } {{ end }}