Update bindings example

This commit is contained in:
Lea Anthony
2023-12-16 20:57:00 +11:00
parent 182f43004a
commit 371e57588f
4 changed files with 29 additions and 29 deletions
@@ -2,15 +2,16 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
/**
* @typedef {import('./models').main.Person} mainPerson
*/
window.go = window.go || {};
window.go.main = {
GreetService: {
export const GreetService = {
/**
* GreetService.Greet
* Greet greets a person
* @param name {string}
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
@@ -18,9 +19,9 @@ window.go.main = {
/**
* GreetService.GreetPerson
* GreetPerson greets a person
* @param person {main.Person}
* @param person {mainPerson}
* @returns {Promise<string>}
**/
GreetPerson: function(person) { return wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0)); },
},
};
+14 -15
View File
@@ -3,22 +3,21 @@
// This file is automatically generated. DO NOT EDIT
export namespace main {
export class Person {
name: string; // Warning: this is unexported in the Go struct.
static createFrom(source: any = {}) {
return new Person(source);
}
export class Person {
name: string; // Warning: this is unexported in the Go struct.
constructor(source: Partial<Person> = {}) {
const { name = "" } = source;
this.name = name;
}
constructor(source: any = {}) {
if ('string' === typeof source) {
source = JSON.parse(source);
}
static createFrom(source: string | object = {}): Person {
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
return new Person(parsedSource as Partial<Person>);
}
this.name = source['name'];
}
}
}
}