From d1255d3a9dbcc9f307317b53e95858f1fc773eb4 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sat, 23 Dec 2023 08:49:58 +1100 Subject: [PATCH] Support TS bindings. Update tests. Tidy up. --- v3/internal/parser/bindings.go | 228 ++++++--- v3/internal/parser/bindings_test.go | 432 ++++++++++++++++-- v3/internal/parser/parser.go | 8 +- .../frontend/bindings/main/GreetService.js | 4 +- .../bindings/main/GreetService.name.js | 4 +- .../bindings/main/GreetService.name.ts | 16 + .../frontend/bindings/main/GreetService.ts | 16 + .../frontend/bindings/main/GreetService.js | 2 +- .../bindings/main/GreetService.name.js | 2 +- .../bindings/main/GreetService.name.ts | 10 + .../frontend/bindings/main/GreetService.ts | 10 + .../frontend/bindings/main/GreetService.js | 4 +- .../bindings/main/GreetService.name.js | 4 +- .../bindings/main/GreetService.name.ts | 15 + .../frontend/bindings/main/GreetService.ts | 15 + .../bindings/services/OtherService.js | 2 +- .../bindings/services/OtherService.name.js | 2 +- .../bindings/services/OtherService.name.ts | 10 + .../bindings/services/OtherService.ts | 10 + .../frontend/bindings/main/GreetService.js | 4 +- .../bindings/main/GreetService.name.js | 4 +- .../bindings/main/GreetService.name.ts | 15 + .../frontend/bindings/main/GreetService.ts | 15 + .../bindings/services/other/OtherService.js | 2 +- .../services/other/OtherService.name.js | 2 +- .../services/other/OtherService.name.ts | 10 + .../bindings/services/other/OtherService.ts | 10 + .../frontend/bindings/main/GreetService.js | 2 +- .../bindings/main/GreetService.name.js | 2 +- .../bindings/main/GreetService.name.ts | 8 + .../frontend/bindings/main/GreetService.ts | 8 + .../frontend/bindings/main/GreetService.js | 2 +- .../bindings/main/GreetService.name.js | 2 +- .../frontend/bindings/main/OtherService.js | 2 +- .../bindings/main/OtherService.name.js | 2 +- .../frontend/bindings/main/GreetService.js | 2 +- .../bindings/main/GreetService.name.js | 2 +- .../bindings/main/GreetService.name.ts | 7 + .../frontend/bindings/main/GreetService.ts | 7 + .../frontend/bindings/main/OtherService.js | 2 +- .../bindings/main/OtherService.name.js | 2 +- .../bindings/main/OtherService.name.ts | 7 + .../frontend/bindings/main/OtherService.ts | 7 + .../frontend/bindings/main/GreetService.js | 4 +- .../bindings/main/GreetService.name.js | 4 +- .../bindings/main/GreetService.name.ts | 15 + .../frontend/bindings/main/GreetService.ts | 15 + .../bindings/services/OtherService.js | 2 +- .../bindings/services/OtherService.name.js | 2 +- .../bindings/services/OtherService.name.ts | 10 + .../bindings/services/OtherService.ts | 10 + .../frontend/bindings/main/GreetService.js | 86 ++-- .../bindings/main/GreetService.name.js | 86 ++-- .../bindings/main/GreetService.name.ts | 178 ++++++++ .../frontend/bindings/main/GreetService.ts | 178 ++++++++ .../frontend/bindings/main/GreetService.js | 86 ++-- .../bindings/main/GreetService.name.js | 86 ++-- .../bindings/main/GreetService.name.ts | 178 ++++++++ .../frontend/bindings/main/GreetService.ts | 178 ++++++++ .../frontend/bindings/main/GreetService.js | 2 +- .../bindings/main/GreetService.name.js | 2 +- .../bindings/main/GreetService.name.ts | 8 + .../frontend/bindings/main/GreetService.ts | 8 + .../frontend/bindings/main/GreetService.js | 2 +- .../bindings/main/GreetService.name.js | 2 +- .../bindings/main/GreetService.name.ts | 8 + .../frontend/bindings/main/GreetService.ts | 8 + .../frontend/bindings/main/GreetService.js | 4 +- .../bindings/main/GreetService.name.js | 4 +- .../bindings/main/GreetService.name.ts | 15 + .../frontend/bindings/main/GreetService.ts | 15 + .../bindings/services/OtherService.js | 2 +- .../bindings/services/OtherService.name.js | 2 +- .../bindings/services/OtherService.name.ts | 10 + .../bindings/services/OtherService.ts | 10 + 75 files changed, 1824 insertions(+), 316 deletions(-) create mode 100644 v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.ts create mode 100644 v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.ts create mode 100644 v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.ts create mode 100644 v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.ts create mode 100644 v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.ts create mode 100644 v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.ts create mode 100644 v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.ts create mode 100644 v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.ts create mode 100644 v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.ts create mode 100644 v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.ts diff --git a/v3/internal/parser/bindings.go b/v3/internal/parser/bindings.go index 0efa8a10..d4f8bc1b 100644 --- a/v3/internal/parser/bindings.go +++ b/v3/internal/parser/bindings.go @@ -3,7 +3,6 @@ package parser import ( "fmt" "sort" - "strconv" "strings" "github.com/samber/lo" @@ -15,29 +14,41 @@ const header = `// @ts-check ` +const headerTypescript = `// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +` + const bindingTemplate = ` /**Comments * @function {{methodName}}* @param names {string} * @returns {Promise} **/ ` +const bindingTemplateTypescript = `Comments` -const callByID = `export function {{methodName}}({{inputs}}) { +const callByIDTypescript = `export async function {{methodName}}({{inputs}}) : {{ReturnType}} { + return wails.CallByID({{ID}}{{params}}); +} + +` + +const callByNameTypescript = `export async function {{methodName}}({{inputs}}) : {{ReturnType}} { + return wails.CallByName("{{Name}}"{{params}}); +} + +` + +const callByID = `export async function {{methodName}}({{inputs}}) { return wails.CallByID({{ID}}, ...Array.prototype.slice.call(arguments, 0)); } ` -const callByName = `export function {{methodName}}({{inputs}}) { +const callByName = `export async function {{methodName}}({{inputs}}) { return wails.CallByName("{{Name}}", ...Array.prototype.slice.call(arguments, 0)); } ` -const enumTemplate = ` - export enum {{.EnumName}} { - {{.EnumValues}} - } -` - var reservedWords = []string{ "abstract", "arguments", @@ -219,6 +230,102 @@ func GenerateBinding(thisStructName string, method *BoundMethod, useIDs bool) (s return result, lo.Uniq(models), externalStructs } +func GenerateBindingTypescript(thisStructName string, method *BoundMethod, useIDs bool) (string, []string, map[packagePath]map[string]*ExternalStruct) { + var externalStructs = make(map[packagePath]map[string]*ExternalStruct) + var models []string + template := bindingTemplateTypescript + if useIDs { + template += callByIDTypescript + } else { + template += callByNameTypescript + } + result := strings.ReplaceAll(template, "{{structName}}", thisStructName) + result = strings.ReplaceAll(result, "{{methodName}}", method.Name) + result = strings.ReplaceAll(result, "{{ID}}", fmt.Sprintf("%v", method.ID)) + + // get last part of method.Package path + parts := strings.Split(method.Package, "/") + packageName := parts[len(parts)-1] + + result = strings.ReplaceAll(result, "{{Name}}", fmt.Sprintf("%v.%v.%v", packageName, thisStructName, method.Name)) + comments := strings.TrimSpace(method.DocComment) + if comments != "" { + comments = "// " + comments + "\n" + } + result = strings.ReplaceAll(result, "Comments", comments) + var params string + for _, input := range method.Inputs { + inputName := sanitiseJSVarName(input.Name) + pkgName := getPackageName(input) + if pkgName != "" { + models = append(models, pkgName) + } + if input.Type.IsStruct || input.Type.IsEnum { + if _, ok := externalStructs[input.Type.Package]; !ok { + externalStructs[input.Type.Package] = make(map[string]*ExternalStruct) + } + externalStructs[input.Type.Package][input.Type.Name] = &ExternalStruct{ + Package: input.Type.Package, + Name: input.Type.Name, + } + } + params += ", " + inputName + } + result = strings.ReplaceAll(result, "{{params}}", params) + //if len(params) > 0 { + // params = "\n" + params + //} + var inputs string + for _, input := range method.Inputs { + pkgName := getPackageName(input) + if pkgName != "" { + models = append(models, pkgName) + } + inputs += sanitiseJSVarName(input.Name) + ": " + input.JSType(packageName) + ", " + } + inputs = strings.TrimSuffix(inputs, ", ") + args := inputs + if len(args) > 0 { + args = ", " + args + } + result = strings.ReplaceAll(result, "{{inputs}}", inputs) + result = strings.ReplaceAll(result, "{{args}}", args) + + // outputs + var returns string + if len(method.Outputs) == 0 { + returns = "Promise" + } else { + returns = "Promise<" + for _, output := range method.Outputs { + pkgName := getPackageName(output) + if pkgName != "" { + models = append(models, pkgName) + } + jsType := output.JSType(packageName) + if jsType == "error" { + jsType = "void" + } + if output.Type.IsStruct { + if _, ok := externalStructs[output.Type.Package]; !ok { + externalStructs[output.Type.Package] = make(map[string]*ExternalStruct) + } + externalStructs[output.Type.Package][output.Type.Name] = &ExternalStruct{ + Package: output.Type.Package, + Name: output.Type.Name, + } + jsType = output.NamespacedStructVariable(output.Type.Package) + } + returns += jsType + ", " + } + returns = strings.TrimSuffix(returns, ", ") + returns += ">" + } + result = strings.ReplaceAll(result, "{{ReturnType}}", returns) + + return result, lo.Uniq(models), externalStructs +} + func getPackageName(input *Parameter) string { if !input.Type.IsStruct { return "" @@ -230,37 +337,7 @@ func getPackageName(input *Parameter) string { return result } -func normalisePackageNames(packageNames []string) map[string]string { - // We iterate over the package names and determine if any of them - // have a forward slash. If this is the case, we assume that the - // package name is the last element of the path. If this has already - // been found, then we need to add a digit to the end of the package - // name to make it unique. We return a map of the original package - // name to the new package name. - var result = make(map[string]string) - var packagesConverted = make(map[string]struct{}) - var count = 1 - for _, packageName := range packageNames { - var originalPackageName = packageName - if strings.Contains(packageName, "/") { - parts := strings.Split(packageName, "/") - packageName = parts[len(parts)-1] - } - if _, ok := packagesConverted[packageName]; ok { - // We've already seen this package name. Add a digit - // to the end of the package name to make it unique - count += 1 - packageName += strconv.Itoa(count) - - } - packagesConverted[packageName] = struct{}{} - result[originalPackageName] = packageName - } - - return result -} - -func (p *Project) GenerateBindings(bindings map[string]map[string][]*BoundMethod, useIDs bool) map[string]map[string]string { +func (p *Project) GenerateBindings(bindings map[string]map[string][]*BoundMethod, useIDs bool, useTypescript bool) map[string]map[string]string { var result = make(map[string]map[string]string) @@ -288,7 +365,11 @@ func (p *Project) GenerateBindings(bindings map[string]map[string][]*BoundMethod var thisBinding string var models []string for _, method := range methods { - thisBinding, models, namespacedStructs = GenerateBinding(structName, method, useIDs) + if useTypescript { + thisBinding, models, namespacedStructs = GenerateBindingTypescript(structName, method, useIDs) + } else { + thisBinding, models, namespacedStructs = GenerateBinding(structName, method, useIDs) + } // Merge the namespaced structs allNamespacedStructs = mergeNamespacedStructs(allNamespacedStructs, namespacedStructs) allModels = append(allModels, models...) @@ -297,27 +378,58 @@ func (p *Project) GenerateBindings(bindings map[string]map[string][]*BoundMethod if len(allNamespacedStructs) > 0 { thisPkg := p.packageCache[packageName] - typedefs := "/**\n" - for externalPackageName, namespacedStruct := range allNamespacedStructs { - pkgInfo := p.packageCache[externalPackageName] - relativePackageDir := p.RelativeBindingsDir(thisPkg, pkgInfo) - namePrefix := "" - if pkgInfo.Name != "" && pkgInfo.Path != thisPkg.Path { - namePrefix = pkgInfo.Name - } + if !useTypescript { + typedefs := "/**\n" + for externalPackageName, namespacedStruct := range allNamespacedStructs { + pkgInfo := p.packageCache[externalPackageName] + relativePackageDir := p.RelativeBindingsDir(thisPkg, pkgInfo) + namePrefix := "" + if pkgInfo.Name != "" && pkgInfo.Path != thisPkg.Path { + namePrefix = pkgInfo.Name + } - // Get keys from namespacedStruct and iterate over them in sorted order - namespacedStructNames := lo.Keys(namespacedStruct) - sort.Strings(namespacedStructNames) - for _, thisStructName := range namespacedStructNames { - structInfo := namespacedStruct[thisStructName] - typedefs += " * @typedef {import('" + relativePackageDir + "/models')." + thisStructName + "} " + namePrefix + structInfo.Name + "\n" + // Get keys from namespacedStruct and iterate over them in sorted order + namespacedStructNames := lo.Keys(namespacedStruct) + sort.Strings(namespacedStructNames) + for _, thisStructName := range namespacedStructNames { + structInfo := namespacedStruct[thisStructName] + typedefs += " * @typedef {import('" + relativePackageDir + "/models')." + thisStructName + "} " + namePrefix + structInfo.Name + "\n" + } } + typedefs += " */\n" + result[relativePackageDir][structName] = typedefs + result[relativePackageDir][structName] + } else { + // Generate imports instead of typedefs + imports := "" + for externalPackageName, namespacedStruct := range allNamespacedStructs { + pkgInfo := p.packageCache[externalPackageName] + relativePackageDir := p.RelativeBindingsDir(thisPkg, pkgInfo) + namePrefix := "" + if pkgInfo.Name != "" && pkgInfo.Path != thisPkg.Path { + namePrefix = pkgInfo.Name + } + + // Get keys from namespacedStruct and iterate over them in sorted order + namespacedStructNames := lo.Keys(namespacedStruct) + sort.Strings(namespacedStructNames) + for _, thisStructName := range namespacedStructNames { + structInfo := namespacedStruct[thisStructName] + if namePrefix != "" { + imports += "import {" + thisStructName + " as " + namePrefix + structInfo.Name + "} from '" + relativePackageDir + "/models';\n" + } else { + imports += "import {" + thisStructName + "} from '" + relativePackageDir + "/models';\n" + } + } + } + imports += "\n" + result[relativePackageDir][structName] = imports + result[relativePackageDir][structName] } - typedefs += " */\n" - result[relativePackageDir][structName] = typedefs + result[relativePackageDir][structName] } - result[relativePackageDir][structName] = header + result[relativePackageDir][structName] + if useTypescript { + result[relativePackageDir][structName] = headerTypescript + result[relativePackageDir][structName] + } else { + result[relativePackageDir][structName] = header + result[relativePackageDir][structName] + } } } diff --git a/v3/internal/parser/bindings_test.go b/v3/internal/parser/bindings_test.go index 58977cb8..bd0675a1 100644 --- a/v3/internal/parser/bindings_test.go +++ b/v3/internal/parser/bindings_test.go @@ -16,7 +16,7 @@ func getFile(filename string) string { // get the file from the testdata FS file, err := fs.ReadFile(testdata, filename) if err != nil { - panic(err) + return "" } return string(file) } @@ -24,12 +24,15 @@ func getFile(filename string) string { func TestGenerateBindings(t *testing.T) { tests := []struct { - dir string - want map[string]map[string]string - useIDs bool + name string + dir string + want map[string]map[string]string + useIDs bool + useTypescript bool }{ { - dir: "testdata/enum", + name: "enum", + dir: "testdata/enum", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/enum/frontend/bindings/main/GreetService.js"), @@ -38,7 +41,30 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/enum", + name: "enum - Typescript - CallByID", + dir: "testdata/enum", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/enum/frontend/bindings/main/GreetService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "enum - Typescript - CallByName", + dir: "testdata/enum", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/enum/frontend/bindings/main/GreetService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "enum", + dir: "testdata/enum", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/enum/frontend/bindings/main/GreetService.name.js"), @@ -46,7 +72,8 @@ func TestGenerateBindings(t *testing.T) { }, }, { - dir: "testdata/enum_from_imported_package", + name: "enum_from_imported_package", + dir: "testdata/enum_from_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.js"), @@ -54,7 +81,8 @@ func TestGenerateBindings(t *testing.T) { }, }, { - dir: "testdata/enum_from_imported_package", + name: "enum_from_imported_package", + dir: "testdata/enum_from_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/enum_from_imported_package/frontend/bindings/main/GreetService.js"), @@ -63,7 +91,30 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/function_single", + name: "enum_from_imported_package - Typescript - CallByID", + dir: "testdata/enum_from_imported_package", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/enum_from_imported_package/frontend/bindings/main/GreetService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "enum_from_imported_package - Typescript - CallByName", + dir: "testdata/enum_from_imported_package", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "function_single", + dir: "testdata/function_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_single/frontend/bindings/main/GreetService.js"), @@ -72,7 +123,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/function_single", + name: "function_single", + dir: "testdata/function_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_single/frontend/bindings/main/GreetService.name.js"), @@ -81,7 +133,30 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/function_from_imported_package", + name: "function single - Typescript - CallByID", + dir: "testdata/function_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/function_single/frontend/bindings/main/GreetService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "function single - Typescript - CallByName", + dir: "testdata/function_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/function_single/frontend/bindings/main/GreetService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "function_from_imported_package", + dir: "testdata/function_from_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.js"), @@ -93,7 +168,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/function_from_imported_package", + name: "function_from_imported_package", + dir: "testdata/function_from_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_from_imported_package/frontend/bindings/main/GreetService.js"), @@ -105,7 +181,36 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/function_from_nested_imported_package", + name: "function_from_imported_package - Typescript - CallByID", + dir: "testdata/function_from_imported_package", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/function_from_imported_package/frontend/bindings/main/GreetService.ts"), + }, + "services": { + "OtherService": getFile("testdata/function_from_imported_package/frontend/bindings/services/OtherService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "function_from_imported_package - Typescript - CallByName", + dir: "testdata/function_from_imported_package", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.ts"), + }, + "services": { + "OtherService": getFile("testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "function_from_nested_imported_package", + dir: "testdata/function_from_nested_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.js"), @@ -117,7 +222,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/function_from_nested_imported_package", + name: "function_from_nested_imported_package", + dir: "testdata/function_from_nested_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.js"), @@ -129,7 +235,36 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/struct_literal_multiple", + name: "function_from_nested_imported_package - Typescript - CallByID", + dir: "testdata/function_from_nested_imported_package", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.ts"), + }, + "services/other": { + "OtherService": getFile("testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "function_from_nested_imported_package - Typescript - CallByName", + dir: "testdata/function_from_nested_imported_package", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.ts"), + }, + "services/other": { + "OtherService": getFile("testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "struct_literal_multiple", + dir: "testdata/struct_literal_multiple", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_multiple/frontend/bindings/main/GreetService.js"), @@ -139,7 +274,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/struct_literal_multiple", + name: "struct_literal_multiple", + dir: "testdata/struct_literal_multiple", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_multiple/frontend/bindings/main/GreetService.name.js"), @@ -149,7 +285,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/function_from_imported_package", + name: "function_from_imported_package", + dir: "testdata/function_from_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_from_imported_package/frontend/bindings/main/GreetService.js"), @@ -161,7 +298,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/function_from_imported_package", + name: "function_from_imported_package", + dir: "testdata/function_from_imported_package", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.js"), @@ -173,7 +311,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/variable_single", + name: "variable_single", + dir: "testdata/variable_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/variable_single/frontend/bindings/main/GreetService.name.js"), @@ -182,7 +321,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/variable_single", + name: "variable_single", + dir: "testdata/variable_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/variable_single/frontend/bindings/main/GreetService.js"), @@ -191,7 +331,30 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/variable_single_from_function", + name: "variable_single - Typescript - CallByID", + dir: "testdata/variable_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/variable_single/frontend/bindings/main/GreetService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "variable_single - Typescript - CallByName", + dir: "testdata/variable_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/variable_single/frontend/bindings/main/GreetService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "variable_single_from_function", + dir: "testdata/variable_single_from_function", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.js"), @@ -200,7 +363,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/variable_single_from_function", + name: "variable_single_from_function", + dir: "testdata/variable_single_from_function", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/variable_single_from_function/frontend/bindings/main/GreetService.js"), @@ -209,7 +373,30 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/variable_single_from_other_function", + name: "variable_single_from_function - Typescript - CallByID", + dir: "testdata/variable_single_from_function", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/variable_single_from_function/frontend/bindings/main/GreetService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "variable_single_from_function - Typescript - CallByName", + dir: "testdata/variable_single_from_function", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "variable_single_from_other_function", + dir: "testdata/variable_single_from_other_function", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.js"), @@ -221,7 +408,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/variable_single_from_other_function", + name: "variable_single_from_other_function", + dir: "testdata/variable_single_from_other_function", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.js"), @@ -233,7 +421,36 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/struct_literal_single", + name: "variable_single_from_other_function - Typescript - CallByID", + dir: "testdata/variable_single_from_other_function", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.ts"), + }, + "services": { + "OtherService": getFile("testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "variable_single_from_other_function - Typescript - CallByName", + dir: "testdata/variable_single_from_other_function", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.ts"), + }, + "services": { + "OtherService": getFile("testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "struct_literal_single", + dir: "testdata/struct_literal_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_single/frontend/bindings/main/GreetService.name.js"), @@ -242,7 +459,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/struct_literal_single", + name: "struct_literal_single", + dir: "testdata/struct_literal_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_single/frontend/bindings/main/GreetService.js"), @@ -251,7 +469,30 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/struct_literal_multiple_other", + name: "struct_literal_single - Typescript - CallByID", + dir: "testdata/struct_literal_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_single/frontend/bindings/main/GreetService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "struct_literal_single - Typescript - CallByName", + dir: "testdata/struct_literal_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_single/frontend/bindings/main/GreetService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "struct_literal_multiple_other", + dir: "testdata/struct_literal_multiple_other", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.js"), @@ -263,7 +504,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/struct_literal_multiple_other", + name: "struct_literal_multiple_other", + dir: "testdata/struct_literal_multiple_other", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.js"), @@ -275,7 +517,36 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/struct_literal_non_pointer_single", + name: "struct_literal_multiple_other - Typescript - CallByID", + dir: "testdata/struct_literal_multiple_other", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.ts"), + }, + "services": { + "OtherService": getFile("testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "struct_literal_multiple_other - Typescript - CallByName", + dir: "testdata/struct_literal_multiple_other", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.ts"), + }, + "services": { + "OtherService": getFile("testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "struct_literal_non_pointer_single", + dir: "testdata/struct_literal_non_pointer_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.js"), @@ -284,7 +555,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/struct_literal_non_pointer_single", + name: "struct_literal_non_pointer_single", + dir: "testdata/struct_literal_non_pointer_single", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.js"), @@ -293,7 +565,30 @@ func TestGenerateBindings(t *testing.T) { useIDs: true, }, { - dir: "testdata/struct_literal_multiple_files", + name: "struct_literal_non_pointer_single - Typescript - CallByID", + dir: "testdata/struct_literal_non_pointer_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "struct_literal_non_pointer_single - Typescript - CallByName", + dir: "testdata/struct_literal_non_pointer_single", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, + { + name: "struct_literal_multiple_files", + dir: "testdata/struct_literal_multiple_files", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.js"), @@ -303,7 +598,8 @@ func TestGenerateBindings(t *testing.T) { useIDs: false, }, { - dir: "testdata/struct_literal_multiple_files", + name: "struct_literal_multiple_files", + dir: "testdata/struct_literal_multiple_files", want: map[string]map[string]string{ "main": { "GreetService": getFile("testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.js"), @@ -312,9 +608,33 @@ func TestGenerateBindings(t *testing.T) { }, useIDs: true, }, + { + name: "struct_literal_multiple_files - Typescript - CallByID", + dir: "testdata/struct_literal_multiple_files", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.ts"), + "OtherService": getFile("testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.ts"), + }, + }, + useIDs: true, + useTypescript: true, + }, + { + name: "struct_literal_multiple_files - Typescript - CallByName", + dir: "testdata/struct_literal_multiple_files", + want: map[string]map[string]string{ + "main": { + "GreetService": getFile("testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.ts"), + "OtherService": getFile("testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.ts"), + }, + }, + useIDs: false, + useTypescript: true, + }, } for _, tt := range tests { - t.Run(tt.dir, func(t *testing.T) { + t.Run(tt.name, func(t *testing.T) { // Run parser on directory absDir, err := filepath.Abs(tt.dir) if err != nil { @@ -330,21 +650,37 @@ func TestGenerateBindings(t *testing.T) { project.outputDirectory = "frontend/bindings" // Generate Bindings - got := project.GenerateBindings(project.BoundMethods, tt.useIDs) + got := project.GenerateBindings(project.BoundMethods, tt.useIDs, tt.useTypescript) for dirName, structDetails := range got { // iterate the struct names in structDetails for name, binding := range structDetails { expected, ok := tt.want[dirName][name] if !ok { - outFile := filepath.Join(tt.dir, project.outputDirectory, dirName, name+".got.js") + outFileName := name + ".got.js" + originalFilename := name + ".js" + if tt.useTypescript { + if tt.useIDs { + originalFilename = name + ".ts" + } else { + originalFilename = name + ".name.ts" + } + outFileName = name + ".got.ts" + } + originalFile := filepath.Join(tt.dir, project.outputDirectory, dirName, originalFilename) + // Check if file exists + if _, err := os.Stat(originalFile); err != nil { + outFileName = originalFilename + } + + outFile := filepath.Join(tt.dir, project.outputDirectory, dirName, outFileName) err = os.WriteFile(outFile, []byte(binding), 0644) if err != nil { t.Errorf("os.WriteFile() error = %v", err) - return + continue } t.Errorf("GenerateBindings() unexpected binding = %v", name) - return + continue } // compare the binding @@ -353,13 +689,29 @@ func TestGenerateBindings(t *testing.T) { expected = convertLineEndings(expected) if diff := cmp.Diff(expected, binding); diff != "" { - outFile := filepath.Join(tt.dir, project.outputDirectory, dirName, name+".got.js") + outFileName := name + ".got.js" + originalFilename := name + ".js" + if tt.useTypescript { + if tt.useIDs { + originalFilename = name + ".ts" + } else { + originalFilename = name + ".name.ts" + } + outFileName = name + ".got.ts" + } + originalFile := filepath.Join(tt.dir, project.outputDirectory, dirName, originalFilename) + // Check if file exists + if _, err := os.Stat(originalFile); err != nil { + outFileName = originalFilename + } + + outFile := filepath.Join(tt.dir, project.outputDirectory, dirName, outFileName) err = os.WriteFile(outFile, []byte(binding), 0644) if err != nil { t.Errorf("os.WriteFile() error = %v", err) - return + continue } - t.Fatalf("GenerateBindings() mismatch (-want +got):\n%s", diff) + t.Errorf("GenerateBindings() mismatch (-want +got):\n%s", diff) } } } diff --git a/v3/internal/parser/parser.go b/v3/internal/parser/parser.go index 59e354bf..b8ef2ac4 100644 --- a/v3/internal/parser/parser.go +++ b/v3/internal/parser/parser.go @@ -331,7 +331,7 @@ func GenerateBindingsAndModels(options *flags.GenerateBindingsOptions) error { } p.Stats.NumMethods = len(p.BoundMethods) p.outputDirectory = options.OutputDirectory - generatedMethods := p.GenerateBindings(p.BoundMethods, options.UseIDs) + generatedMethods := p.GenerateBindings(p.BoundMethods, options.UseIDs, options.TS) for pkg, structs := range generatedMethods { // Write the directory err = os.MkdirAll(filepath.Join(options.OutputDirectory, pkg), 0755) @@ -340,7 +340,11 @@ func GenerateBindingsAndModels(options *flags.GenerateBindingsOptions) error { } // Write the files for structName, text := range structs { - err = os.WriteFile(filepath.Join(options.OutputDirectory, pkg, structName+".js"), []byte(text), 0644) + filename := structName + ".js" + if options.TS { + filename = structName + ".ts" + } + err = os.WriteFile(filepath.Join(options.OutputDirectory, pkg, filename), []byte(text), 0644) if err != nil { return err } diff --git a/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.js index f368ca8b..adaa0863 100644 --- a/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.js @@ -14,7 +14,7 @@ * @param title {Title} * @returns {Promise} **/ -export function Greet(name, title) { +export async function Greet(name, title) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } @@ -24,6 +24,6 @@ export function Greet(name, title) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.js index 96d1ab60..25facc4d 100644 --- a/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.js @@ -14,7 +14,7 @@ * @param title {Title} * @returns {Promise} **/ -export function Greet(name, title) { +export async function Greet(name, title) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } @@ -24,6 +24,6 @@ export function Greet(name, title) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByName("main.GreetService.NewPerson", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..45e0d291 --- /dev/null +++ b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,16 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; +import {Title} from './models'; + +// Greet does XYZ +export async function Greet(name: string, title: Title) : Promise { + return wails.CallByName("main.GreetService.Greet", name, title); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByName("main.GreetService.NewPerson", name); +} + diff --git a/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..abec1c6b --- /dev/null +++ b/v3/internal/parser/testdata/enum/frontend/bindings/main/GreetService.ts @@ -0,0 +1,16 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; +import {Title} from './models'; + +// Greet does XYZ +export async function Greet(name: string, title: Title) : Promise { + return wails.CallByID(1411160069, name, title); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByID(1661412647, name); +} + diff --git a/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.js index 17bb36f6..f6caa476 100644 --- a/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.js @@ -13,6 +13,6 @@ * @param title {servicesTitle} * @returns {Promise} **/ -export function Greet(name, title) { +export async function Greet(name, title) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.js index 37c044e5..57f1fbc5 100644 --- a/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.js @@ -13,6 +13,6 @@ * @param title {servicesTitle} * @returns {Promise} **/ -export function Greet(name, title) { +export async function Greet(name, title) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..90a7c0f5 --- /dev/null +++ b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Title as servicesTitle} from '../services/models'; + +// Greet does XYZ +export async function Greet(name: string, title: servicesTitle) : Promise { + return wails.CallByName("main.GreetService.Greet", name, title); +} + diff --git a/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..0a980167 --- /dev/null +++ b/v3/internal/parser/testdata/enum_from_imported_package/frontend/bindings/main/GreetService.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Title as servicesTitle} from '../services/models'; + +// Greet does XYZ +export async function Greet(name: string, title: servicesTitle) : Promise { + return wails.CallByID(1411160069, name, title); +} + diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.js index e654b5d6..dee2ada3 100644 --- a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.js index 56f3bea1..9c4f2666 100644 --- a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByName("main.GreetService.NewPerson", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..e7cc3292 --- /dev/null +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByName("main.GreetService.NewPerson", name); +} + diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..a66bf118 --- /dev/null +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/main/GreetService.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByID(1661412647, name); +} + diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.js b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.js index 2906a2a4..31320da9 100644 --- a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.js +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByID(1592414782, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.js b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.js index 43a778cd..f6af59d6 100644 --- a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.js +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByName("services.OtherService.Yay", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.ts b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.ts new file mode 100644 index 00000000..bc71aefc --- /dev/null +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.name.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByName("services.OtherService.Yay"); +} + diff --git a/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.ts b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.ts new file mode 100644 index 00000000..b4aa3137 --- /dev/null +++ b/v3/internal/parser/testdata/function_from_imported_package/frontend/bindings/services/OtherService.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByID(1592414782); +} + diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.js index e654b5d6..dee2ada3 100644 --- a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.js index 56f3bea1..9c4f2666 100644 --- a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByName("main.GreetService.NewPerson", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..e7cc3292 --- /dev/null +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByName("main.GreetService.NewPerson", name); +} + diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..a66bf118 --- /dev/null +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/main/GreetService.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByID(1661412647, name); +} + diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.js b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.js index 7c3ec1d6..21ebd90b 100644 --- a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.js +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByID(2189323817, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.js b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.js index 5f56bd68..8b3d9c0a 100644 --- a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.js +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByName("other.OtherService.Yay", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.ts b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.ts new file mode 100644 index 00000000..699ad3e7 --- /dev/null +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.name.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByName("other.OtherService.Yay"); +} + diff --git a/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.ts b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.ts new file mode 100644 index 00000000..e80ce6b5 --- /dev/null +++ b/v3/internal/parser/testdata/function_from_nested_imported_package/frontend/bindings/services/other/OtherService.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByID(2189323817); +} + diff --git a/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.js index d60dc218..a6214ec0 100644 --- a/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.js @@ -9,6 +9,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.js index bcb53f12..28e42b26 100644 --- a/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.js @@ -9,6 +9,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..4078d56c --- /dev/null +++ b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,8 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + diff --git a/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..d16dfd2b --- /dev/null +++ b/v3/internal/parser/testdata/function_single/frontend/bindings/main/GreetService.ts @@ -0,0 +1,8 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.js index f74993c0..9dcfc2bb 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.js @@ -8,6 +8,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.name.js index 7531fd45..2019a460 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/GreetService.name.js @@ -8,6 +8,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.js b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.js index fbf49bdf..b01c4e57 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.js +++ b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.js @@ -7,6 +7,6 @@ * @function Hello * @returns {Promise} **/ -export function Hello() { +export async function Hello() { return wails.CallByID(4249972365, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.name.js b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.name.js index 05bcf975..2480d324 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.name.js +++ b/v3/internal/parser/testdata/struct_literal_multiple/frontend/bindings/main/OtherService.name.js @@ -7,6 +7,6 @@ * @function Hello * @returns {Promise} **/ -export function Hello() { +export async function Hello() { return wails.CallByName("main.OtherService.Hello", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.js index f74993c0..9dcfc2bb 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.js @@ -8,6 +8,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.js index 7531fd45..2019a460 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.js @@ -8,6 +8,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..e256210d --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,7 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..9b05eb45 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/GreetService.ts @@ -0,0 +1,7 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.js b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.js index fbf49bdf..b01c4e57 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.js @@ -7,6 +7,6 @@ * @function Hello * @returns {Promise} **/ -export function Hello() { +export async function Hello() { return wails.CallByID(4249972365, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.js b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.js index 05bcf975..2480d324 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.js @@ -7,6 +7,6 @@ * @function Hello * @returns {Promise} **/ -export function Hello() { +export async function Hello() { return wails.CallByName("main.OtherService.Hello", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.ts b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.ts new file mode 100644 index 00000000..3d20ab26 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.name.ts @@ -0,0 +1,7 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +export async function Hello() : Promise { + return wails.CallByName("main.OtherService.Hello"); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.ts b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.ts new file mode 100644 index 00000000..211c351a --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_files/frontend/bindings/main/OtherService.ts @@ -0,0 +1,7 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +export async function Hello() : Promise { + return wails.CallByID(4249972365); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.js index e654b5d6..dee2ada3 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.js index 56f3bea1..9c4f2666 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByName("main.GreetService.NewPerson", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..e7cc3292 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByName("main.GreetService.NewPerson", name); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..a66bf118 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/main/GreetService.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByID(1661412647, name); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.js b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.js index ffdac47f..a6b67d2a 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByID(469445984, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.js b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.js index 43a778cd..f6af59d6 100644 --- a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.js +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByName("services.OtherService.Yay", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.ts b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.ts new file mode 100644 index 00000000..bc71aefc --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.name.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByName("services.OtherService.Yay"); +} + diff --git a/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.ts b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.ts new file mode 100644 index 00000000..fc36f869 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_multiple_other/frontend/bindings/services/OtherService.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByID(469445984); +} + diff --git a/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.js index 41faca33..6f884468 100644 --- a/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.js @@ -11,7 +11,7 @@ * @param _in {number[]} * @returns {Promise} **/ -export function ArrayInt(_in) { +export async function ArrayInt(_in) { return wails.CallByID(3862002418, ...Array.prototype.slice.call(arguments, 0)); } @@ -20,7 +20,7 @@ export function ArrayInt(_in) { * @param _in {boolean} * @returns {Promise} **/ -export function BoolInBoolOut(_in) { +export async function BoolInBoolOut(_in) { return wails.CallByID(2424639793, ...Array.prototype.slice.call(arguments, 0)); } @@ -29,7 +29,7 @@ export function BoolInBoolOut(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float32InFloat32Out(_in) { +export async function Float32InFloat32Out(_in) { return wails.CallByID(3132595881, ...Array.prototype.slice.call(arguments, 0)); } @@ -38,7 +38,7 @@ export function Float32InFloat32Out(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float64InFloat64Out(_in) { +export async function Float64InFloat64Out(_in) { return wails.CallByID(2182412247, ...Array.prototype.slice.call(arguments, 0)); } @@ -48,7 +48,7 @@ export function Float64InFloat64Out(_in) { * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } @@ -57,7 +57,7 @@ export function Greet(name) { * @param _in {number} * @returns {Promise} **/ -export function Int16InIntOut(_in) { +export async function Int16InIntOut(_in) { return wails.CallByID(3306292566, ...Array.prototype.slice.call(arguments, 0)); } @@ -66,7 +66,7 @@ export function Int16InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int16PointerInAndOutput(_in) { +export async function Int16PointerInAndOutput(_in) { return wails.CallByID(1754277916, ...Array.prototype.slice.call(arguments, 0)); } @@ -75,7 +75,7 @@ export function Int16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int32InIntOut(_in) { +export async function Int32InIntOut(_in) { return wails.CallByID(1909469092, ...Array.prototype.slice.call(arguments, 0)); } @@ -84,7 +84,7 @@ export function Int32InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int32PointerInAndOutput(_in) { +export async function Int32PointerInAndOutput(_in) { return wails.CallByID(4251088558, ...Array.prototype.slice.call(arguments, 0)); } @@ -93,7 +93,7 @@ export function Int32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int64InIntOut(_in) { +export async function Int64InIntOut(_in) { return wails.CallByID(1343888303, ...Array.prototype.slice.call(arguments, 0)); } @@ -102,7 +102,7 @@ export function Int64InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int64PointerInAndOutput(_in) { +export async function Int64PointerInAndOutput(_in) { return wails.CallByID(2205561041, ...Array.prototype.slice.call(arguments, 0)); } @@ -111,7 +111,7 @@ export function Int64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int8InIntOut(_in) { +export async function Int8InIntOut(_in) { return wails.CallByID(572240879, ...Array.prototype.slice.call(arguments, 0)); } @@ -120,7 +120,7 @@ export function Int8InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int8PointerInAndOutput(_in) { +export async function Int8PointerInAndOutput(_in) { return wails.CallByID(2189402897, ...Array.prototype.slice.call(arguments, 0)); } @@ -129,7 +129,7 @@ export function Int8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function IntInIntOut(_in) { +export async function IntInIntOut(_in) { return wails.CallByID(642881729, ...Array.prototype.slice.call(arguments, 0)); } @@ -138,7 +138,7 @@ export function IntInIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInAndOutput(_in) { +export async function IntPointerInAndOutput(_in) { return wails.CallByID(1066151743, ...Array.prototype.slice.call(arguments, 0)); } @@ -147,7 +147,7 @@ export function IntPointerInAndOutput(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInputNamedOutputs(_in) { +export async function IntPointerInputNamedOutputs(_in) { return wails.CallByID(2718999663, ...Array.prototype.slice.call(arguments, 0)); } @@ -156,7 +156,7 @@ export function IntPointerInputNamedOutputs(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntInt(_in) { +export async function MapIntInt(_in) { return wails.CallByID(2386486356, ...Array.prototype.slice.call(arguments, 0)); } @@ -165,7 +165,7 @@ export function MapIntInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntPointerInt(_in) { +export async function MapIntPointerInt(_in) { return wails.CallByID(550413585, ...Array.prototype.slice.call(arguments, 0)); } @@ -174,7 +174,7 @@ export function MapIntPointerInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceInt(_in) { +export async function MapIntSliceInt(_in) { return wails.CallByID(2900172572, ...Array.prototype.slice.call(arguments, 0)); } @@ -183,7 +183,7 @@ export function MapIntSliceInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceIntInMapIntSliceIntOut(_in) { +export async function MapIntSliceIntInMapIntSliceIntOut(_in) { return wails.CallByID(881980169, ...Array.prototype.slice.call(arguments, 0)); } @@ -191,7 +191,7 @@ export function MapIntSliceIntInMapIntSliceIntOut(_in) { * @function NoInputsStringOut * @returns {Promise} **/ -export function NoInputsStringOut() { +export async function NoInputsStringOut() { return wails.CallByID(1075577233, ...Array.prototype.slice.call(arguments, 0)); } @@ -200,7 +200,7 @@ export function NoInputsStringOut() { * @param _in {boolean | null} * @returns {Promise} **/ -export function PointerBoolInBoolOut(_in) { +export async function PointerBoolInBoolOut(_in) { return wails.CallByID(3589606958, ...Array.prototype.slice.call(arguments, 0)); } @@ -209,7 +209,7 @@ export function PointerBoolInBoolOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat32InFloat32Out(_in) { +export async function PointerFloat32InFloat32Out(_in) { return wails.CallByID(224675106, ...Array.prototype.slice.call(arguments, 0)); } @@ -218,7 +218,7 @@ export function PointerFloat32InFloat32Out(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat64InFloat64Out(_in) { +export async function PointerFloat64InFloat64Out(_in) { return wails.CallByID(2124953624, ...Array.prototype.slice.call(arguments, 0)); } @@ -227,7 +227,7 @@ export function PointerFloat64InFloat64Out(_in) { * @param _in {map | null} * @returns {Promise} **/ -export function PointerMapIntInt(_in) { +export async function PointerMapIntInt(_in) { return wails.CallByID(3516977899, ...Array.prototype.slice.call(arguments, 0)); } @@ -236,7 +236,7 @@ export function PointerMapIntInt(_in) { * @param _in {string | null} * @returns {Promise} **/ -export function PointerStringInStringOut(_in) { +export async function PointerStringInStringOut(_in) { return wails.CallByID(229603958, ...Array.prototype.slice.call(arguments, 0)); } @@ -245,7 +245,7 @@ export function PointerStringInStringOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutput(_in) { +export async function StringArrayInputNamedOutput(_in) { return wails.CallByID(3678582682, ...Array.prototype.slice.call(arguments, 0)); } @@ -254,7 +254,7 @@ export function StringArrayInputNamedOutput(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutputs(_in) { +export async function StringArrayInputNamedOutputs(_in) { return wails.CallByID(319259595, ...Array.prototype.slice.call(arguments, 0)); } @@ -263,7 +263,7 @@ export function StringArrayInputNamedOutputs(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringArrayOut(_in) { +export async function StringArrayInputStringArrayOut(_in) { return wails.CallByID(383995060, ...Array.prototype.slice.call(arguments, 0)); } @@ -272,7 +272,7 @@ export function StringArrayInputStringArrayOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringOut(_in) { +export async function StringArrayInputStringOut(_in) { return wails.CallByID(1091960237, ...Array.prototype.slice.call(arguments, 0)); } @@ -281,7 +281,7 @@ export function StringArrayInputStringOut(_in) { * @param _in {Person} * @returns {Promise} **/ -export function StructInputStructOutput(_in) { +export async function StructInputStructOutput(_in) { return wails.CallByID(3835643147, ...Array.prototype.slice.call(arguments, 0)); } @@ -290,7 +290,7 @@ export function StructInputStructOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputErrorOutput(_in) { +export async function StructPointerInputErrorOutput(_in) { return wails.CallByID(2447692557, ...Array.prototype.slice.call(arguments, 0)); } @@ -299,7 +299,7 @@ export function StructPointerInputErrorOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputStructPointerOutput(_in) { +export async function StructPointerInputStructPointerOutput(_in) { return wails.CallByID(2943477349, ...Array.prototype.slice.call(arguments, 0)); } @@ -308,7 +308,7 @@ export function StructPointerInputStructPointerOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt16InUIntOut(_in) { +export async function UInt16InUIntOut(_in) { return wails.CallByID(3401034892, ...Array.prototype.slice.call(arguments, 0)); } @@ -317,7 +317,7 @@ export function UInt16InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt16PointerInAndOutput(_in) { +export async function UInt16PointerInAndOutput(_in) { return wails.CallByID(1236957573, ...Array.prototype.slice.call(arguments, 0)); } @@ -326,7 +326,7 @@ export function UInt16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt32InUIntOut(_in) { +export async function UInt32InUIntOut(_in) { return wails.CallByID(1160383782, ...Array.prototype.slice.call(arguments, 0)); } @@ -335,7 +335,7 @@ export function UInt32InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt32PointerInAndOutput(_in) { +export async function UInt32PointerInAndOutput(_in) { return wails.CallByID(1739300671, ...Array.prototype.slice.call(arguments, 0)); } @@ -344,7 +344,7 @@ export function UInt32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt64InUIntOut(_in) { +export async function UInt64InUIntOut(_in) { return wails.CallByID(793803239, ...Array.prototype.slice.call(arguments, 0)); } @@ -353,7 +353,7 @@ export function UInt64InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt64PointerInAndOutput(_in) { +export async function UInt64PointerInAndOutput(_in) { return wails.CallByID(1403757716, ...Array.prototype.slice.call(arguments, 0)); } @@ -362,7 +362,7 @@ export function UInt64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt8InUIntOut(_in) { +export async function UInt8InUIntOut(_in) { return wails.CallByID(2988345717, ...Array.prototype.slice.call(arguments, 0)); } @@ -371,7 +371,7 @@ export function UInt8InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt8PointerInAndOutput(_in) { +export async function UInt8PointerInAndOutput(_in) { return wails.CallByID(518250834, ...Array.prototype.slice.call(arguments, 0)); } @@ -380,7 +380,7 @@ export function UInt8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UIntInUIntOut(_in) { +export async function UIntInUIntOut(_in) { return wails.CallByID(2836661285, ...Array.prototype.slice.call(arguments, 0)); } @@ -389,6 +389,6 @@ export function UIntInUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UIntPointerInAndOutput(_in) { +export async function UIntPointerInAndOutput(_in) { return wails.CallByID(1367187362, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.js index a40109ed..ca80e283 100644 --- a/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.js @@ -11,7 +11,7 @@ * @param _in {number[]} * @returns {Promise} **/ -export function ArrayInt(_in) { +export async function ArrayInt(_in) { return wails.CallByName("main.GreetService.ArrayInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -20,7 +20,7 @@ export function ArrayInt(_in) { * @param _in {boolean} * @returns {Promise} **/ -export function BoolInBoolOut(_in) { +export async function BoolInBoolOut(_in) { return wails.CallByName("main.GreetService.BoolInBoolOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -29,7 +29,7 @@ export function BoolInBoolOut(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float32InFloat32Out(_in) { +export async function Float32InFloat32Out(_in) { return wails.CallByName("main.GreetService.Float32InFloat32Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -38,7 +38,7 @@ export function Float32InFloat32Out(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float64InFloat64Out(_in) { +export async function Float64InFloat64Out(_in) { return wails.CallByName("main.GreetService.Float64InFloat64Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -48,7 +48,7 @@ export function Float64InFloat64Out(_in) { * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } @@ -57,7 +57,7 @@ export function Greet(name) { * @param _in {number} * @returns {Promise} **/ -export function Int16InIntOut(_in) { +export async function Int16InIntOut(_in) { return wails.CallByName("main.GreetService.Int16InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -66,7 +66,7 @@ export function Int16InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int16PointerInAndOutput(_in) { +export async function Int16PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int16PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -75,7 +75,7 @@ export function Int16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int32InIntOut(_in) { +export async function Int32InIntOut(_in) { return wails.CallByName("main.GreetService.Int32InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -84,7 +84,7 @@ export function Int32InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int32PointerInAndOutput(_in) { +export async function Int32PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int32PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -93,7 +93,7 @@ export function Int32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int64InIntOut(_in) { +export async function Int64InIntOut(_in) { return wails.CallByName("main.GreetService.Int64InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -102,7 +102,7 @@ export function Int64InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int64PointerInAndOutput(_in) { +export async function Int64PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int64PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -111,7 +111,7 @@ export function Int64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int8InIntOut(_in) { +export async function Int8InIntOut(_in) { return wails.CallByName("main.GreetService.Int8InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -120,7 +120,7 @@ export function Int8InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int8PointerInAndOutput(_in) { +export async function Int8PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int8PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -129,7 +129,7 @@ export function Int8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function IntInIntOut(_in) { +export async function IntInIntOut(_in) { return wails.CallByName("main.GreetService.IntInIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -138,7 +138,7 @@ export function IntInIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInAndOutput(_in) { +export async function IntPointerInAndOutput(_in) { return wails.CallByName("main.GreetService.IntPointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -147,7 +147,7 @@ export function IntPointerInAndOutput(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInputNamedOutputs(_in) { +export async function IntPointerInputNamedOutputs(_in) { return wails.CallByName("main.GreetService.IntPointerInputNamedOutputs", ...Array.prototype.slice.call(arguments, 0)); } @@ -156,7 +156,7 @@ export function IntPointerInputNamedOutputs(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntInt(_in) { +export async function MapIntInt(_in) { return wails.CallByName("main.GreetService.MapIntInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -165,7 +165,7 @@ export function MapIntInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntPointerInt(_in) { +export async function MapIntPointerInt(_in) { return wails.CallByName("main.GreetService.MapIntPointerInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -174,7 +174,7 @@ export function MapIntPointerInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceInt(_in) { +export async function MapIntSliceInt(_in) { return wails.CallByName("main.GreetService.MapIntSliceInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -183,7 +183,7 @@ export function MapIntSliceInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceIntInMapIntSliceIntOut(_in) { +export async function MapIntSliceIntInMapIntSliceIntOut(_in) { return wails.CallByName("main.GreetService.MapIntSliceIntInMapIntSliceIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -191,7 +191,7 @@ export function MapIntSliceIntInMapIntSliceIntOut(_in) { * @function NoInputsStringOut * @returns {Promise} **/ -export function NoInputsStringOut() { +export async function NoInputsStringOut() { return wails.CallByName("main.GreetService.NoInputsStringOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -200,7 +200,7 @@ export function NoInputsStringOut() { * @param _in {boolean | null} * @returns {Promise} **/ -export function PointerBoolInBoolOut(_in) { +export async function PointerBoolInBoolOut(_in) { return wails.CallByName("main.GreetService.PointerBoolInBoolOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -209,7 +209,7 @@ export function PointerBoolInBoolOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat32InFloat32Out(_in) { +export async function PointerFloat32InFloat32Out(_in) { return wails.CallByName("main.GreetService.PointerFloat32InFloat32Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -218,7 +218,7 @@ export function PointerFloat32InFloat32Out(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat64InFloat64Out(_in) { +export async function PointerFloat64InFloat64Out(_in) { return wails.CallByName("main.GreetService.PointerFloat64InFloat64Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -227,7 +227,7 @@ export function PointerFloat64InFloat64Out(_in) { * @param _in {map | null} * @returns {Promise} **/ -export function PointerMapIntInt(_in) { +export async function PointerMapIntInt(_in) { return wails.CallByName("main.GreetService.PointerMapIntInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -236,7 +236,7 @@ export function PointerMapIntInt(_in) { * @param _in {string | null} * @returns {Promise} **/ -export function PointerStringInStringOut(_in) { +export async function PointerStringInStringOut(_in) { return wails.CallByName("main.GreetService.PointerStringInStringOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -245,7 +245,7 @@ export function PointerStringInStringOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutput(_in) { +export async function StringArrayInputNamedOutput(_in) { return wails.CallByName("main.GreetService.StringArrayInputNamedOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -254,7 +254,7 @@ export function StringArrayInputNamedOutput(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutputs(_in) { +export async function StringArrayInputNamedOutputs(_in) { return wails.CallByName("main.GreetService.StringArrayInputNamedOutputs", ...Array.prototype.slice.call(arguments, 0)); } @@ -263,7 +263,7 @@ export function StringArrayInputNamedOutputs(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringArrayOut(_in) { +export async function StringArrayInputStringArrayOut(_in) { return wails.CallByName("main.GreetService.StringArrayInputStringArrayOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -272,7 +272,7 @@ export function StringArrayInputStringArrayOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringOut(_in) { +export async function StringArrayInputStringOut(_in) { return wails.CallByName("main.GreetService.StringArrayInputStringOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -281,7 +281,7 @@ export function StringArrayInputStringOut(_in) { * @param _in {Person} * @returns {Promise} **/ -export function StructInputStructOutput(_in) { +export async function StructInputStructOutput(_in) { return wails.CallByName("main.GreetService.StructInputStructOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -290,7 +290,7 @@ export function StructInputStructOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputErrorOutput(_in) { +export async function StructPointerInputErrorOutput(_in) { return wails.CallByName("main.GreetService.StructPointerInputErrorOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -299,7 +299,7 @@ export function StructPointerInputErrorOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputStructPointerOutput(_in) { +export async function StructPointerInputStructPointerOutput(_in) { return wails.CallByName("main.GreetService.StructPointerInputStructPointerOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -308,7 +308,7 @@ export function StructPointerInputStructPointerOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt16InUIntOut(_in) { +export async function UInt16InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt16InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -317,7 +317,7 @@ export function UInt16InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt16PointerInAndOutput(_in) { +export async function UInt16PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt16PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -326,7 +326,7 @@ export function UInt16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt32InUIntOut(_in) { +export async function UInt32InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt32InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -335,7 +335,7 @@ export function UInt32InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt32PointerInAndOutput(_in) { +export async function UInt32PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt32PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -344,7 +344,7 @@ export function UInt32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt64InUIntOut(_in) { +export async function UInt64InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt64InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -353,7 +353,7 @@ export function UInt64InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt64PointerInAndOutput(_in) { +export async function UInt64PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt64PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -362,7 +362,7 @@ export function UInt64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt8InUIntOut(_in) { +export async function UInt8InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt8InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -371,7 +371,7 @@ export function UInt8InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt8PointerInAndOutput(_in) { +export async function UInt8PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt8PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -380,7 +380,7 @@ export function UInt8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UIntInUIntOut(_in) { +export async function UIntInUIntOut(_in) { return wails.CallByName("main.GreetService.UIntInUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -389,6 +389,6 @@ export function UIntInUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UIntPointerInAndOutput(_in) { +export async function UIntPointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UIntPointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..0c12fd69 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,178 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +export async function ArrayInt(_in: number[]) : Promise { + return wails.CallByName("main.GreetService.ArrayInt", _in); +} + +export async function BoolInBoolOut(_in: boolean) : Promise { + return wails.CallByName("main.GreetService.BoolInBoolOut", _in); +} + +export async function Float32InFloat32Out(_in: number) : Promise { + return wails.CallByName("main.GreetService.Float32InFloat32Out", _in); +} + +export async function Float64InFloat64Out(_in: number) : Promise { + return wails.CallByName("main.GreetService.Float64InFloat64Out", _in); +} + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + +export async function Int16InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int16InIntOut", _in); +} + +export async function Int16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int16PointerInAndOutput", _in); +} + +export async function Int32InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int32InIntOut", _in); +} + +export async function Int32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int32PointerInAndOutput", _in); +} + +export async function Int64InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int64InIntOut", _in); +} + +export async function Int64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int64PointerInAndOutput", _in); +} + +export async function Int8InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int8InIntOut", _in); +} + +export async function Int8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int8PointerInAndOutput", _in); +} + +export async function IntInIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.IntInIntOut", _in); +} + +export async function IntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.IntPointerInAndOutput", _in); +} + +export async function IntPointerInputNamedOutputs(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.IntPointerInputNamedOutputs", _in); +} + +export async function MapIntInt(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntInt", _in); +} + +export async function MapIntPointerInt(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntPointerInt", _in); +} + +export async function MapIntSliceInt(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntSliceInt", _in); +} + +export async function MapIntSliceIntInMapIntSliceIntOut(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntSliceIntInMapIntSliceIntOut", _in); +} + +export async function NoInputsStringOut() : Promise { + return wails.CallByName("main.GreetService.NoInputsStringOut"); +} + +export async function PointerBoolInBoolOut(_in: boolean | null) : Promise { + return wails.CallByName("main.GreetService.PointerBoolInBoolOut", _in); +} + +export async function PointerFloat32InFloat32Out(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.PointerFloat32InFloat32Out", _in); +} + +export async function PointerFloat64InFloat64Out(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.PointerFloat64InFloat64Out", _in); +} + +export async function PointerMapIntInt(_in: map | null) : Promise { + return wails.CallByName("main.GreetService.PointerMapIntInt", _in); +} + +export async function PointerStringInStringOut(_in: string | null) : Promise { + return wails.CallByName("main.GreetService.PointerStringInStringOut", _in); +} + +export async function StringArrayInputNamedOutput(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputNamedOutput", _in); +} + +export async function StringArrayInputNamedOutputs(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputNamedOutputs", _in); +} + +export async function StringArrayInputStringArrayOut(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputStringArrayOut", _in); +} + +export async function StringArrayInputStringOut(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputStringOut", _in); +} + +export async function StructInputStructOutput(_in: Person) : Promise { + return wails.CallByName("main.GreetService.StructInputStructOutput", _in); +} + +export async function StructPointerInputErrorOutput(_in: Person | null) : Promise { + return wails.CallByName("main.GreetService.StructPointerInputErrorOutput", _in); +} + +export async function StructPointerInputStructPointerOutput(_in: Person | null) : Promise { + return wails.CallByName("main.GreetService.StructPointerInputStructPointerOutput", _in); +} + +export async function UInt16InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt16InUIntOut", _in); +} + +export async function UInt16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt16PointerInAndOutput", _in); +} + +export async function UInt32InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt32InUIntOut", _in); +} + +export async function UInt32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt32PointerInAndOutput", _in); +} + +export async function UInt64InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt64InUIntOut", _in); +} + +export async function UInt64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt64PointerInAndOutput", _in); +} + +export async function UInt8InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt8InUIntOut", _in); +} + +export async function UInt8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt8PointerInAndOutput", _in); +} + +export async function UIntInUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UIntInUIntOut", _in); +} + +export async function UIntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UIntPointerInAndOutput", _in); +} + diff --git a/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..d7cdb677 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_non_pointer_single/frontend/bindings/main/GreetService.ts @@ -0,0 +1,178 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +export async function ArrayInt(_in: number[]) : Promise { + return wails.CallByID(3862002418, _in); +} + +export async function BoolInBoolOut(_in: boolean) : Promise { + return wails.CallByID(2424639793, _in); +} + +export async function Float32InFloat32Out(_in: number) : Promise { + return wails.CallByID(3132595881, _in); +} + +export async function Float64InFloat64Out(_in: number) : Promise { + return wails.CallByID(2182412247, _in); +} + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + +export async function Int16InIntOut(_in: number) : Promise { + return wails.CallByID(3306292566, _in); +} + +export async function Int16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1754277916, _in); +} + +export async function Int32InIntOut(_in: number) : Promise { + return wails.CallByID(1909469092, _in); +} + +export async function Int32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(4251088558, _in); +} + +export async function Int64InIntOut(_in: number) : Promise { + return wails.CallByID(1343888303, _in); +} + +export async function Int64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(2205561041, _in); +} + +export async function Int8InIntOut(_in: number) : Promise { + return wails.CallByID(572240879, _in); +} + +export async function Int8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(2189402897, _in); +} + +export async function IntInIntOut(_in: number) : Promise { + return wails.CallByID(642881729, _in); +} + +export async function IntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1066151743, _in); +} + +export async function IntPointerInputNamedOutputs(_in: number | null) : Promise { + return wails.CallByID(2718999663, _in); +} + +export async function MapIntInt(_in: map) : Promise { + return wails.CallByID(2386486356, _in); +} + +export async function MapIntPointerInt(_in: map) : Promise { + return wails.CallByID(550413585, _in); +} + +export async function MapIntSliceInt(_in: map) : Promise { + return wails.CallByID(2900172572, _in); +} + +export async function MapIntSliceIntInMapIntSliceIntOut(_in: map) : Promise { + return wails.CallByID(881980169, _in); +} + +export async function NoInputsStringOut() : Promise { + return wails.CallByID(1075577233); +} + +export async function PointerBoolInBoolOut(_in: boolean | null) : Promise { + return wails.CallByID(3589606958, _in); +} + +export async function PointerFloat32InFloat32Out(_in: number | null) : Promise { + return wails.CallByID(224675106, _in); +} + +export async function PointerFloat64InFloat64Out(_in: number | null) : Promise { + return wails.CallByID(2124953624, _in); +} + +export async function PointerMapIntInt(_in: map | null) : Promise { + return wails.CallByID(3516977899, _in); +} + +export async function PointerStringInStringOut(_in: string | null) : Promise { + return wails.CallByID(229603958, _in); +} + +export async function StringArrayInputNamedOutput(_in: string[]) : Promise { + return wails.CallByID(3678582682, _in); +} + +export async function StringArrayInputNamedOutputs(_in: string[]) : Promise { + return wails.CallByID(319259595, _in); +} + +export async function StringArrayInputStringArrayOut(_in: string[]) : Promise { + return wails.CallByID(383995060, _in); +} + +export async function StringArrayInputStringOut(_in: string[]) : Promise { + return wails.CallByID(1091960237, _in); +} + +export async function StructInputStructOutput(_in: Person) : Promise { + return wails.CallByID(3835643147, _in); +} + +export async function StructPointerInputErrorOutput(_in: Person | null) : Promise { + return wails.CallByID(2447692557, _in); +} + +export async function StructPointerInputStructPointerOutput(_in: Person | null) : Promise { + return wails.CallByID(2943477349, _in); +} + +export async function UInt16InUIntOut(_in: number) : Promise { + return wails.CallByID(3401034892, _in); +} + +export async function UInt16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1236957573, _in); +} + +export async function UInt32InUIntOut(_in: number) : Promise { + return wails.CallByID(1160383782, _in); +} + +export async function UInt32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1739300671, _in); +} + +export async function UInt64InUIntOut(_in: number) : Promise { + return wails.CallByID(793803239, _in); +} + +export async function UInt64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1403757716, _in); +} + +export async function UInt8InUIntOut(_in: number) : Promise { + return wails.CallByID(2988345717, _in); +} + +export async function UInt8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(518250834, _in); +} + +export async function UIntInUIntOut(_in: number) : Promise { + return wails.CallByID(2836661285, _in); +} + +export async function UIntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1367187362, _in); +} + diff --git a/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.js index 41faca33..6f884468 100644 --- a/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.js @@ -11,7 +11,7 @@ * @param _in {number[]} * @returns {Promise} **/ -export function ArrayInt(_in) { +export async function ArrayInt(_in) { return wails.CallByID(3862002418, ...Array.prototype.slice.call(arguments, 0)); } @@ -20,7 +20,7 @@ export function ArrayInt(_in) { * @param _in {boolean} * @returns {Promise} **/ -export function BoolInBoolOut(_in) { +export async function BoolInBoolOut(_in) { return wails.CallByID(2424639793, ...Array.prototype.slice.call(arguments, 0)); } @@ -29,7 +29,7 @@ export function BoolInBoolOut(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float32InFloat32Out(_in) { +export async function Float32InFloat32Out(_in) { return wails.CallByID(3132595881, ...Array.prototype.slice.call(arguments, 0)); } @@ -38,7 +38,7 @@ export function Float32InFloat32Out(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float64InFloat64Out(_in) { +export async function Float64InFloat64Out(_in) { return wails.CallByID(2182412247, ...Array.prototype.slice.call(arguments, 0)); } @@ -48,7 +48,7 @@ export function Float64InFloat64Out(_in) { * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } @@ -57,7 +57,7 @@ export function Greet(name) { * @param _in {number} * @returns {Promise} **/ -export function Int16InIntOut(_in) { +export async function Int16InIntOut(_in) { return wails.CallByID(3306292566, ...Array.prototype.slice.call(arguments, 0)); } @@ -66,7 +66,7 @@ export function Int16InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int16PointerInAndOutput(_in) { +export async function Int16PointerInAndOutput(_in) { return wails.CallByID(1754277916, ...Array.prototype.slice.call(arguments, 0)); } @@ -75,7 +75,7 @@ export function Int16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int32InIntOut(_in) { +export async function Int32InIntOut(_in) { return wails.CallByID(1909469092, ...Array.prototype.slice.call(arguments, 0)); } @@ -84,7 +84,7 @@ export function Int32InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int32PointerInAndOutput(_in) { +export async function Int32PointerInAndOutput(_in) { return wails.CallByID(4251088558, ...Array.prototype.slice.call(arguments, 0)); } @@ -93,7 +93,7 @@ export function Int32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int64InIntOut(_in) { +export async function Int64InIntOut(_in) { return wails.CallByID(1343888303, ...Array.prototype.slice.call(arguments, 0)); } @@ -102,7 +102,7 @@ export function Int64InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int64PointerInAndOutput(_in) { +export async function Int64PointerInAndOutput(_in) { return wails.CallByID(2205561041, ...Array.prototype.slice.call(arguments, 0)); } @@ -111,7 +111,7 @@ export function Int64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int8InIntOut(_in) { +export async function Int8InIntOut(_in) { return wails.CallByID(572240879, ...Array.prototype.slice.call(arguments, 0)); } @@ -120,7 +120,7 @@ export function Int8InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int8PointerInAndOutput(_in) { +export async function Int8PointerInAndOutput(_in) { return wails.CallByID(2189402897, ...Array.prototype.slice.call(arguments, 0)); } @@ -129,7 +129,7 @@ export function Int8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function IntInIntOut(_in) { +export async function IntInIntOut(_in) { return wails.CallByID(642881729, ...Array.prototype.slice.call(arguments, 0)); } @@ -138,7 +138,7 @@ export function IntInIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInAndOutput(_in) { +export async function IntPointerInAndOutput(_in) { return wails.CallByID(1066151743, ...Array.prototype.slice.call(arguments, 0)); } @@ -147,7 +147,7 @@ export function IntPointerInAndOutput(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInputNamedOutputs(_in) { +export async function IntPointerInputNamedOutputs(_in) { return wails.CallByID(2718999663, ...Array.prototype.slice.call(arguments, 0)); } @@ -156,7 +156,7 @@ export function IntPointerInputNamedOutputs(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntInt(_in) { +export async function MapIntInt(_in) { return wails.CallByID(2386486356, ...Array.prototype.slice.call(arguments, 0)); } @@ -165,7 +165,7 @@ export function MapIntInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntPointerInt(_in) { +export async function MapIntPointerInt(_in) { return wails.CallByID(550413585, ...Array.prototype.slice.call(arguments, 0)); } @@ -174,7 +174,7 @@ export function MapIntPointerInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceInt(_in) { +export async function MapIntSliceInt(_in) { return wails.CallByID(2900172572, ...Array.prototype.slice.call(arguments, 0)); } @@ -183,7 +183,7 @@ export function MapIntSliceInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceIntInMapIntSliceIntOut(_in) { +export async function MapIntSliceIntInMapIntSliceIntOut(_in) { return wails.CallByID(881980169, ...Array.prototype.slice.call(arguments, 0)); } @@ -191,7 +191,7 @@ export function MapIntSliceIntInMapIntSliceIntOut(_in) { * @function NoInputsStringOut * @returns {Promise} **/ -export function NoInputsStringOut() { +export async function NoInputsStringOut() { return wails.CallByID(1075577233, ...Array.prototype.slice.call(arguments, 0)); } @@ -200,7 +200,7 @@ export function NoInputsStringOut() { * @param _in {boolean | null} * @returns {Promise} **/ -export function PointerBoolInBoolOut(_in) { +export async function PointerBoolInBoolOut(_in) { return wails.CallByID(3589606958, ...Array.prototype.slice.call(arguments, 0)); } @@ -209,7 +209,7 @@ export function PointerBoolInBoolOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat32InFloat32Out(_in) { +export async function PointerFloat32InFloat32Out(_in) { return wails.CallByID(224675106, ...Array.prototype.slice.call(arguments, 0)); } @@ -218,7 +218,7 @@ export function PointerFloat32InFloat32Out(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat64InFloat64Out(_in) { +export async function PointerFloat64InFloat64Out(_in) { return wails.CallByID(2124953624, ...Array.prototype.slice.call(arguments, 0)); } @@ -227,7 +227,7 @@ export function PointerFloat64InFloat64Out(_in) { * @param _in {map | null} * @returns {Promise} **/ -export function PointerMapIntInt(_in) { +export async function PointerMapIntInt(_in) { return wails.CallByID(3516977899, ...Array.prototype.slice.call(arguments, 0)); } @@ -236,7 +236,7 @@ export function PointerMapIntInt(_in) { * @param _in {string | null} * @returns {Promise} **/ -export function PointerStringInStringOut(_in) { +export async function PointerStringInStringOut(_in) { return wails.CallByID(229603958, ...Array.prototype.slice.call(arguments, 0)); } @@ -245,7 +245,7 @@ export function PointerStringInStringOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutput(_in) { +export async function StringArrayInputNamedOutput(_in) { return wails.CallByID(3678582682, ...Array.prototype.slice.call(arguments, 0)); } @@ -254,7 +254,7 @@ export function StringArrayInputNamedOutput(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutputs(_in) { +export async function StringArrayInputNamedOutputs(_in) { return wails.CallByID(319259595, ...Array.prototype.slice.call(arguments, 0)); } @@ -263,7 +263,7 @@ export function StringArrayInputNamedOutputs(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringArrayOut(_in) { +export async function StringArrayInputStringArrayOut(_in) { return wails.CallByID(383995060, ...Array.prototype.slice.call(arguments, 0)); } @@ -272,7 +272,7 @@ export function StringArrayInputStringArrayOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringOut(_in) { +export async function StringArrayInputStringOut(_in) { return wails.CallByID(1091960237, ...Array.prototype.slice.call(arguments, 0)); } @@ -281,7 +281,7 @@ export function StringArrayInputStringOut(_in) { * @param _in {Person} * @returns {Promise} **/ -export function StructInputStructOutput(_in) { +export async function StructInputStructOutput(_in) { return wails.CallByID(3835643147, ...Array.prototype.slice.call(arguments, 0)); } @@ -290,7 +290,7 @@ export function StructInputStructOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputErrorOutput(_in) { +export async function StructPointerInputErrorOutput(_in) { return wails.CallByID(2447692557, ...Array.prototype.slice.call(arguments, 0)); } @@ -299,7 +299,7 @@ export function StructPointerInputErrorOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputStructPointerOutput(_in) { +export async function StructPointerInputStructPointerOutput(_in) { return wails.CallByID(2943477349, ...Array.prototype.slice.call(arguments, 0)); } @@ -308,7 +308,7 @@ export function StructPointerInputStructPointerOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt16InUIntOut(_in) { +export async function UInt16InUIntOut(_in) { return wails.CallByID(3401034892, ...Array.prototype.slice.call(arguments, 0)); } @@ -317,7 +317,7 @@ export function UInt16InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt16PointerInAndOutput(_in) { +export async function UInt16PointerInAndOutput(_in) { return wails.CallByID(1236957573, ...Array.prototype.slice.call(arguments, 0)); } @@ -326,7 +326,7 @@ export function UInt16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt32InUIntOut(_in) { +export async function UInt32InUIntOut(_in) { return wails.CallByID(1160383782, ...Array.prototype.slice.call(arguments, 0)); } @@ -335,7 +335,7 @@ export function UInt32InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt32PointerInAndOutput(_in) { +export async function UInt32PointerInAndOutput(_in) { return wails.CallByID(1739300671, ...Array.prototype.slice.call(arguments, 0)); } @@ -344,7 +344,7 @@ export function UInt32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt64InUIntOut(_in) { +export async function UInt64InUIntOut(_in) { return wails.CallByID(793803239, ...Array.prototype.slice.call(arguments, 0)); } @@ -353,7 +353,7 @@ export function UInt64InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt64PointerInAndOutput(_in) { +export async function UInt64PointerInAndOutput(_in) { return wails.CallByID(1403757716, ...Array.prototype.slice.call(arguments, 0)); } @@ -362,7 +362,7 @@ export function UInt64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt8InUIntOut(_in) { +export async function UInt8InUIntOut(_in) { return wails.CallByID(2988345717, ...Array.prototype.slice.call(arguments, 0)); } @@ -371,7 +371,7 @@ export function UInt8InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt8PointerInAndOutput(_in) { +export async function UInt8PointerInAndOutput(_in) { return wails.CallByID(518250834, ...Array.prototype.slice.call(arguments, 0)); } @@ -380,7 +380,7 @@ export function UInt8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UIntInUIntOut(_in) { +export async function UIntInUIntOut(_in) { return wails.CallByID(2836661285, ...Array.prototype.slice.call(arguments, 0)); } @@ -389,6 +389,6 @@ export function UIntInUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UIntPointerInAndOutput(_in) { +export async function UIntPointerInAndOutput(_in) { return wails.CallByID(1367187362, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.js index a40109ed..ca80e283 100644 --- a/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.js @@ -11,7 +11,7 @@ * @param _in {number[]} * @returns {Promise} **/ -export function ArrayInt(_in) { +export async function ArrayInt(_in) { return wails.CallByName("main.GreetService.ArrayInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -20,7 +20,7 @@ export function ArrayInt(_in) { * @param _in {boolean} * @returns {Promise} **/ -export function BoolInBoolOut(_in) { +export async function BoolInBoolOut(_in) { return wails.CallByName("main.GreetService.BoolInBoolOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -29,7 +29,7 @@ export function BoolInBoolOut(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float32InFloat32Out(_in) { +export async function Float32InFloat32Out(_in) { return wails.CallByName("main.GreetService.Float32InFloat32Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -38,7 +38,7 @@ export function Float32InFloat32Out(_in) { * @param _in {number} * @returns {Promise} **/ -export function Float64InFloat64Out(_in) { +export async function Float64InFloat64Out(_in) { return wails.CallByName("main.GreetService.Float64InFloat64Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -48,7 +48,7 @@ export function Float64InFloat64Out(_in) { * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } @@ -57,7 +57,7 @@ export function Greet(name) { * @param _in {number} * @returns {Promise} **/ -export function Int16InIntOut(_in) { +export async function Int16InIntOut(_in) { return wails.CallByName("main.GreetService.Int16InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -66,7 +66,7 @@ export function Int16InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int16PointerInAndOutput(_in) { +export async function Int16PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int16PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -75,7 +75,7 @@ export function Int16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int32InIntOut(_in) { +export async function Int32InIntOut(_in) { return wails.CallByName("main.GreetService.Int32InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -84,7 +84,7 @@ export function Int32InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int32PointerInAndOutput(_in) { +export async function Int32PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int32PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -93,7 +93,7 @@ export function Int32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int64InIntOut(_in) { +export async function Int64InIntOut(_in) { return wails.CallByName("main.GreetService.Int64InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -102,7 +102,7 @@ export function Int64InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int64PointerInAndOutput(_in) { +export async function Int64PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int64PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -111,7 +111,7 @@ export function Int64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function Int8InIntOut(_in) { +export async function Int8InIntOut(_in) { return wails.CallByName("main.GreetService.Int8InIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -120,7 +120,7 @@ export function Int8InIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function Int8PointerInAndOutput(_in) { +export async function Int8PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.Int8PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -129,7 +129,7 @@ export function Int8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function IntInIntOut(_in) { +export async function IntInIntOut(_in) { return wails.CallByName("main.GreetService.IntInIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -138,7 +138,7 @@ export function IntInIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInAndOutput(_in) { +export async function IntPointerInAndOutput(_in) { return wails.CallByName("main.GreetService.IntPointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -147,7 +147,7 @@ export function IntPointerInAndOutput(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function IntPointerInputNamedOutputs(_in) { +export async function IntPointerInputNamedOutputs(_in) { return wails.CallByName("main.GreetService.IntPointerInputNamedOutputs", ...Array.prototype.slice.call(arguments, 0)); } @@ -156,7 +156,7 @@ export function IntPointerInputNamedOutputs(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntInt(_in) { +export async function MapIntInt(_in) { return wails.CallByName("main.GreetService.MapIntInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -165,7 +165,7 @@ export function MapIntInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntPointerInt(_in) { +export async function MapIntPointerInt(_in) { return wails.CallByName("main.GreetService.MapIntPointerInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -174,7 +174,7 @@ export function MapIntPointerInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceInt(_in) { +export async function MapIntSliceInt(_in) { return wails.CallByName("main.GreetService.MapIntSliceInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -183,7 +183,7 @@ export function MapIntSliceInt(_in) { * @param _in {map} * @returns {Promise} **/ -export function MapIntSliceIntInMapIntSliceIntOut(_in) { +export async function MapIntSliceIntInMapIntSliceIntOut(_in) { return wails.CallByName("main.GreetService.MapIntSliceIntInMapIntSliceIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -191,7 +191,7 @@ export function MapIntSliceIntInMapIntSliceIntOut(_in) { * @function NoInputsStringOut * @returns {Promise} **/ -export function NoInputsStringOut() { +export async function NoInputsStringOut() { return wails.CallByName("main.GreetService.NoInputsStringOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -200,7 +200,7 @@ export function NoInputsStringOut() { * @param _in {boolean | null} * @returns {Promise} **/ -export function PointerBoolInBoolOut(_in) { +export async function PointerBoolInBoolOut(_in) { return wails.CallByName("main.GreetService.PointerBoolInBoolOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -209,7 +209,7 @@ export function PointerBoolInBoolOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat32InFloat32Out(_in) { +export async function PointerFloat32InFloat32Out(_in) { return wails.CallByName("main.GreetService.PointerFloat32InFloat32Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -218,7 +218,7 @@ export function PointerFloat32InFloat32Out(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function PointerFloat64InFloat64Out(_in) { +export async function PointerFloat64InFloat64Out(_in) { return wails.CallByName("main.GreetService.PointerFloat64InFloat64Out", ...Array.prototype.slice.call(arguments, 0)); } @@ -227,7 +227,7 @@ export function PointerFloat64InFloat64Out(_in) { * @param _in {map | null} * @returns {Promise} **/ -export function PointerMapIntInt(_in) { +export async function PointerMapIntInt(_in) { return wails.CallByName("main.GreetService.PointerMapIntInt", ...Array.prototype.slice.call(arguments, 0)); } @@ -236,7 +236,7 @@ export function PointerMapIntInt(_in) { * @param _in {string | null} * @returns {Promise} **/ -export function PointerStringInStringOut(_in) { +export async function PointerStringInStringOut(_in) { return wails.CallByName("main.GreetService.PointerStringInStringOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -245,7 +245,7 @@ export function PointerStringInStringOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutput(_in) { +export async function StringArrayInputNamedOutput(_in) { return wails.CallByName("main.GreetService.StringArrayInputNamedOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -254,7 +254,7 @@ export function StringArrayInputNamedOutput(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputNamedOutputs(_in) { +export async function StringArrayInputNamedOutputs(_in) { return wails.CallByName("main.GreetService.StringArrayInputNamedOutputs", ...Array.prototype.slice.call(arguments, 0)); } @@ -263,7 +263,7 @@ export function StringArrayInputNamedOutputs(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringArrayOut(_in) { +export async function StringArrayInputStringArrayOut(_in) { return wails.CallByName("main.GreetService.StringArrayInputStringArrayOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -272,7 +272,7 @@ export function StringArrayInputStringArrayOut(_in) { * @param _in {string[]} * @returns {Promise} **/ -export function StringArrayInputStringOut(_in) { +export async function StringArrayInputStringOut(_in) { return wails.CallByName("main.GreetService.StringArrayInputStringOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -281,7 +281,7 @@ export function StringArrayInputStringOut(_in) { * @param _in {Person} * @returns {Promise} **/ -export function StructInputStructOutput(_in) { +export async function StructInputStructOutput(_in) { return wails.CallByName("main.GreetService.StructInputStructOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -290,7 +290,7 @@ export function StructInputStructOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputErrorOutput(_in) { +export async function StructPointerInputErrorOutput(_in) { return wails.CallByName("main.GreetService.StructPointerInputErrorOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -299,7 +299,7 @@ export function StructPointerInputErrorOutput(_in) { * @param _in {Person | null} * @returns {Promise} **/ -export function StructPointerInputStructPointerOutput(_in) { +export async function StructPointerInputStructPointerOutput(_in) { return wails.CallByName("main.GreetService.StructPointerInputStructPointerOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -308,7 +308,7 @@ export function StructPointerInputStructPointerOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt16InUIntOut(_in) { +export async function UInt16InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt16InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -317,7 +317,7 @@ export function UInt16InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt16PointerInAndOutput(_in) { +export async function UInt16PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt16PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -326,7 +326,7 @@ export function UInt16PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt32InUIntOut(_in) { +export async function UInt32InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt32InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -335,7 +335,7 @@ export function UInt32InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt32PointerInAndOutput(_in) { +export async function UInt32PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt32PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -344,7 +344,7 @@ export function UInt32PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt64InUIntOut(_in) { +export async function UInt64InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt64InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -353,7 +353,7 @@ export function UInt64InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt64PointerInAndOutput(_in) { +export async function UInt64PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt64PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -362,7 +362,7 @@ export function UInt64PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UInt8InUIntOut(_in) { +export async function UInt8InUIntOut(_in) { return wails.CallByName("main.GreetService.UInt8InUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -371,7 +371,7 @@ export function UInt8InUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UInt8PointerInAndOutput(_in) { +export async function UInt8PointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UInt8PointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } @@ -380,7 +380,7 @@ export function UInt8PointerInAndOutput(_in) { * @param _in {number} * @returns {Promise} **/ -export function UIntInUIntOut(_in) { +export async function UIntInUIntOut(_in) { return wails.CallByName("main.GreetService.UIntInUIntOut", ...Array.prototype.slice.call(arguments, 0)); } @@ -389,6 +389,6 @@ export function UIntInUIntOut(_in) { * @param _in {number | null} * @returns {Promise} **/ -export function UIntPointerInAndOutput(_in) { +export async function UIntPointerInAndOutput(_in) { return wails.CallByName("main.GreetService.UIntPointerInAndOutput", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..0c12fd69 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,178 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +export async function ArrayInt(_in: number[]) : Promise { + return wails.CallByName("main.GreetService.ArrayInt", _in); +} + +export async function BoolInBoolOut(_in: boolean) : Promise { + return wails.CallByName("main.GreetService.BoolInBoolOut", _in); +} + +export async function Float32InFloat32Out(_in: number) : Promise { + return wails.CallByName("main.GreetService.Float32InFloat32Out", _in); +} + +export async function Float64InFloat64Out(_in: number) : Promise { + return wails.CallByName("main.GreetService.Float64InFloat64Out", _in); +} + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + +export async function Int16InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int16InIntOut", _in); +} + +export async function Int16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int16PointerInAndOutput", _in); +} + +export async function Int32InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int32InIntOut", _in); +} + +export async function Int32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int32PointerInAndOutput", _in); +} + +export async function Int64InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int64InIntOut", _in); +} + +export async function Int64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int64PointerInAndOutput", _in); +} + +export async function Int8InIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.Int8InIntOut", _in); +} + +export async function Int8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.Int8PointerInAndOutput", _in); +} + +export async function IntInIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.IntInIntOut", _in); +} + +export async function IntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.IntPointerInAndOutput", _in); +} + +export async function IntPointerInputNamedOutputs(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.IntPointerInputNamedOutputs", _in); +} + +export async function MapIntInt(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntInt", _in); +} + +export async function MapIntPointerInt(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntPointerInt", _in); +} + +export async function MapIntSliceInt(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntSliceInt", _in); +} + +export async function MapIntSliceIntInMapIntSliceIntOut(_in: map) : Promise { + return wails.CallByName("main.GreetService.MapIntSliceIntInMapIntSliceIntOut", _in); +} + +export async function NoInputsStringOut() : Promise { + return wails.CallByName("main.GreetService.NoInputsStringOut"); +} + +export async function PointerBoolInBoolOut(_in: boolean | null) : Promise { + return wails.CallByName("main.GreetService.PointerBoolInBoolOut", _in); +} + +export async function PointerFloat32InFloat32Out(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.PointerFloat32InFloat32Out", _in); +} + +export async function PointerFloat64InFloat64Out(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.PointerFloat64InFloat64Out", _in); +} + +export async function PointerMapIntInt(_in: map | null) : Promise { + return wails.CallByName("main.GreetService.PointerMapIntInt", _in); +} + +export async function PointerStringInStringOut(_in: string | null) : Promise { + return wails.CallByName("main.GreetService.PointerStringInStringOut", _in); +} + +export async function StringArrayInputNamedOutput(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputNamedOutput", _in); +} + +export async function StringArrayInputNamedOutputs(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputNamedOutputs", _in); +} + +export async function StringArrayInputStringArrayOut(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputStringArrayOut", _in); +} + +export async function StringArrayInputStringOut(_in: string[]) : Promise { + return wails.CallByName("main.GreetService.StringArrayInputStringOut", _in); +} + +export async function StructInputStructOutput(_in: Person) : Promise { + return wails.CallByName("main.GreetService.StructInputStructOutput", _in); +} + +export async function StructPointerInputErrorOutput(_in: Person | null) : Promise { + return wails.CallByName("main.GreetService.StructPointerInputErrorOutput", _in); +} + +export async function StructPointerInputStructPointerOutput(_in: Person | null) : Promise { + return wails.CallByName("main.GreetService.StructPointerInputStructPointerOutput", _in); +} + +export async function UInt16InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt16InUIntOut", _in); +} + +export async function UInt16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt16PointerInAndOutput", _in); +} + +export async function UInt32InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt32InUIntOut", _in); +} + +export async function UInt32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt32PointerInAndOutput", _in); +} + +export async function UInt64InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt64InUIntOut", _in); +} + +export async function UInt64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt64PointerInAndOutput", _in); +} + +export async function UInt8InUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UInt8InUIntOut", _in); +} + +export async function UInt8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UInt8PointerInAndOutput", _in); +} + +export async function UIntInUIntOut(_in: number) : Promise { + return wails.CallByName("main.GreetService.UIntInUIntOut", _in); +} + +export async function UIntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByName("main.GreetService.UIntPointerInAndOutput", _in); +} + diff --git a/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..d7cdb677 --- /dev/null +++ b/v3/internal/parser/testdata/struct_literal_single/frontend/bindings/main/GreetService.ts @@ -0,0 +1,178 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +export async function ArrayInt(_in: number[]) : Promise { + return wails.CallByID(3862002418, _in); +} + +export async function BoolInBoolOut(_in: boolean) : Promise { + return wails.CallByID(2424639793, _in); +} + +export async function Float32InFloat32Out(_in: number) : Promise { + return wails.CallByID(3132595881, _in); +} + +export async function Float64InFloat64Out(_in: number) : Promise { + return wails.CallByID(2182412247, _in); +} + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + +export async function Int16InIntOut(_in: number) : Promise { + return wails.CallByID(3306292566, _in); +} + +export async function Int16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1754277916, _in); +} + +export async function Int32InIntOut(_in: number) : Promise { + return wails.CallByID(1909469092, _in); +} + +export async function Int32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(4251088558, _in); +} + +export async function Int64InIntOut(_in: number) : Promise { + return wails.CallByID(1343888303, _in); +} + +export async function Int64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(2205561041, _in); +} + +export async function Int8InIntOut(_in: number) : Promise { + return wails.CallByID(572240879, _in); +} + +export async function Int8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(2189402897, _in); +} + +export async function IntInIntOut(_in: number) : Promise { + return wails.CallByID(642881729, _in); +} + +export async function IntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1066151743, _in); +} + +export async function IntPointerInputNamedOutputs(_in: number | null) : Promise { + return wails.CallByID(2718999663, _in); +} + +export async function MapIntInt(_in: map) : Promise { + return wails.CallByID(2386486356, _in); +} + +export async function MapIntPointerInt(_in: map) : Promise { + return wails.CallByID(550413585, _in); +} + +export async function MapIntSliceInt(_in: map) : Promise { + return wails.CallByID(2900172572, _in); +} + +export async function MapIntSliceIntInMapIntSliceIntOut(_in: map) : Promise { + return wails.CallByID(881980169, _in); +} + +export async function NoInputsStringOut() : Promise { + return wails.CallByID(1075577233); +} + +export async function PointerBoolInBoolOut(_in: boolean | null) : Promise { + return wails.CallByID(3589606958, _in); +} + +export async function PointerFloat32InFloat32Out(_in: number | null) : Promise { + return wails.CallByID(224675106, _in); +} + +export async function PointerFloat64InFloat64Out(_in: number | null) : Promise { + return wails.CallByID(2124953624, _in); +} + +export async function PointerMapIntInt(_in: map | null) : Promise { + return wails.CallByID(3516977899, _in); +} + +export async function PointerStringInStringOut(_in: string | null) : Promise { + return wails.CallByID(229603958, _in); +} + +export async function StringArrayInputNamedOutput(_in: string[]) : Promise { + return wails.CallByID(3678582682, _in); +} + +export async function StringArrayInputNamedOutputs(_in: string[]) : Promise { + return wails.CallByID(319259595, _in); +} + +export async function StringArrayInputStringArrayOut(_in: string[]) : Promise { + return wails.CallByID(383995060, _in); +} + +export async function StringArrayInputStringOut(_in: string[]) : Promise { + return wails.CallByID(1091960237, _in); +} + +export async function StructInputStructOutput(_in: Person) : Promise { + return wails.CallByID(3835643147, _in); +} + +export async function StructPointerInputErrorOutput(_in: Person | null) : Promise { + return wails.CallByID(2447692557, _in); +} + +export async function StructPointerInputStructPointerOutput(_in: Person | null) : Promise { + return wails.CallByID(2943477349, _in); +} + +export async function UInt16InUIntOut(_in: number) : Promise { + return wails.CallByID(3401034892, _in); +} + +export async function UInt16PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1236957573, _in); +} + +export async function UInt32InUIntOut(_in: number) : Promise { + return wails.CallByID(1160383782, _in); +} + +export async function UInt32PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1739300671, _in); +} + +export async function UInt64InUIntOut(_in: number) : Promise { + return wails.CallByID(793803239, _in); +} + +export async function UInt64PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1403757716, _in); +} + +export async function UInt8InUIntOut(_in: number) : Promise { + return wails.CallByID(2988345717, _in); +} + +export async function UInt8PointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(518250834, _in); +} + +export async function UIntInUIntOut(_in: number) : Promise { + return wails.CallByID(2836661285, _in); +} + +export async function UIntPointerInAndOutput(_in: number | null) : Promise { + return wails.CallByID(1367187362, _in); +} + diff --git a/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.js index d60dc218..a6214ec0 100644 --- a/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.js @@ -9,6 +9,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.js index bcb53f12..28e42b26 100644 --- a/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.js @@ -9,6 +9,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..4078d56c --- /dev/null +++ b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,8 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + diff --git a/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..d16dfd2b --- /dev/null +++ b/v3/internal/parser/testdata/variable_single/frontend/bindings/main/GreetService.ts @@ -0,0 +1,8 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + diff --git a/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.js index d60dc218..a6214ec0 100644 --- a/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.js @@ -9,6 +9,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.js index bcb53f12..28e42b26 100644 --- a/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.js @@ -9,6 +9,6 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..4078d56c --- /dev/null +++ b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,8 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + diff --git a/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..d16dfd2b --- /dev/null +++ b/v3/internal/parser/testdata/variable_single_from_function/frontend/bindings/main/GreetService.ts @@ -0,0 +1,8 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// Greet someone +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.js b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.js index e654b5d6..dee2ada3 100644 --- a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.js +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.js b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.js index 56f3bea1..9c4f2666 100644 --- a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.js +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.js @@ -12,7 +12,7 @@ * @param name {string} * @returns {Promise} **/ -export function Greet(name) { +export async function Greet(name) { return wails.CallByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0)); } @@ -22,6 +22,6 @@ export function Greet(name) { * @param name {string} * @returns {Promise} **/ -export function NewPerson(name) { +export async function NewPerson(name) { return wails.CallByName("main.GreetService.NewPerson", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.ts b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.ts new file mode 100644 index 00000000..e7cc3292 --- /dev/null +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.name.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByName("main.GreetService.Greet", name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByName("main.GreetService.NewPerson", name); +} + diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.ts b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.ts new file mode 100644 index 00000000..a66bf118 --- /dev/null +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/main/GreetService.ts @@ -0,0 +1,15 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Person} from './models'; + +// Greet does XYZ +export async function Greet(name: string) : Promise { + return wails.CallByID(1411160069, name); +} + +// NewPerson creates a new person +export async function NewPerson(name: string) : Promise { + return wails.CallByID(1661412647, name); +} + diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.js b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.js index 78c9f851..59fa5a85 100644 --- a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.js +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByID(302702907, ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.js b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.js index 43a778cd..f6af59d6 100644 --- a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.js +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.js @@ -11,6 +11,6 @@ * @function Yay * @returns {Promise
} **/ -export function Yay() { +export async function Yay() { return wails.CallByName("services.OtherService.Yay", ...Array.prototype.slice.call(arguments, 0)); } diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.ts b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.ts new file mode 100644 index 00000000..bc71aefc --- /dev/null +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.name.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByName("services.OtherService.Yay"); +} + diff --git a/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.ts b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.ts new file mode 100644 index 00000000..57ae3a80 --- /dev/null +++ b/v3/internal/parser/testdata/variable_single_from_other_function/frontend/bindings/services/OtherService.ts @@ -0,0 +1,10 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Address} from './models'; + +// Yay does this and that +export async function Yay() : Promise
{ + return wails.CallByID(302702907); +} +