Support bindings, model & enum generation

This commit is contained in:
Lea Anthony
2023-12-12 21:51:40 +11:00
parent 43c4966873
commit 4b04c10f14
44 changed files with 3910 additions and 3126 deletions
@@ -6,15 +6,12 @@
* @typedef {import('./models').main.Person} mainPerson
*/
window.go = window.go || {};
window.go.main = {
GreetService: {
export const GreetService = {
/**
* GreetService.Greet
* Greet does XYZ
* @param name {string}
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { return wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
@@ -22,9 +19,9 @@ window.go.main = {
/**
* GreetService.NewPerson
* NewPerson creates a new person
* @param name {string}
* @param name {string}
* @returns {Promise<mainPerson>}
**/
NewPerson: function(name) { return wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); },
},
};
@@ -6,17 +6,14 @@
* @typedef {import('./models').services.Address} servicesAddress
*/
window.go = window.go || {};
window.go.services = {
OtherService: {
export const OtherService = {
/**
* OtherService.Yay
*
*
*
* @returns {Promise<servicesAddress>}
**/
Yay: function() { return wails.CallByID(302702907, ...Array.prototype.slice.call(arguments, 0)); },
},
};
@@ -3,49 +3,46 @@
// This file is automatically generated. DO NOT EDIT
export namespace main {
export class Person {
name: string;
address: services.Address;
static createFrom(source: any = {}) {
return new Person(source);
}
export class Person {
name: string;
address: services.Address;
constructor(source: Partial<Person> = {}) {
const { name = "", address = null } = source;
this.name = name;
this.address = address;
}
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'];
this.address = services.Address.createFrom(source['address']);
}
}
}
export namespace services {
export class Address {
street: string;
state: string;
country: string;
static createFrom(source: any = {}) {
return new Address(source);
}
export class Address {
street: string;
state: string;
country: string;
constructor(source: Partial<Address> = {}) {
const { street = "", state = "", country = "" } = source;
this.street = street;
this.state = state;
this.country = country;
}
constructor(source: any = {}) {
if ('string' === typeof source) {
source = JSON.parse(source);
}
static createFrom(source: string | object = {}): Address {
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
return new Address(parsedSource as Partial<Address>);
}
this.street = source['street'];
this.state = source['state'];
this.country = source['country'];
}
}
}
}