mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Support bindings, model & enum generation
This commit is contained in:
+4
-7
@@ -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)); },
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
+3
-6
@@ -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)); },
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
+33
-36
@@ -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'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user