[v3] Support //wails:methodID <uint32> directive in bound method comments.

This commit is contained in:
Lea Anthony
2023-08-27 21:16:30 +10:00
parent e5571defb7
commit 5e1f29eda3
4 changed files with 28 additions and 8 deletions
+6
View File
@@ -8,10 +8,16 @@ type Person struct {
type GreetService struct {
}
// Greet greets a person
//
//wails:methodID 1
func (*GreetService) Greet(name string) string {
return "Hello " + name
}
// GreetPerson greets a person
//
//wails:methodID 2
func (*GreetService) GreetPerson(person Person) string {
return "Hello " + person.name
}
+4 -4
View File
@@ -10,19 +10,19 @@ window.go.main = {
/**
* GreetService.Greet
*
* Greet greets a person
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
Greet: function(name) { wails.CallByID(1, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.GreetPerson
*
* GreetPerson greets a person
* @param person {main.Person}
* @returns {Promise<string>}
**/
GreetPerson: function(person) { wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0)); },
GreetPerson: function(person) { wails.CallByID(2, ...Array.prototype.slice.call(arguments, 0)); },
},
};
-4
View File
@@ -16,10 +16,6 @@ func main() {
Bind: []any{
&GreetService{},
},
BindAliases: map[uint32]uint32{
1: 1411160069,
2: 4021313248,
},
Assets: application.AssetOptions{
FS: assets,
},