mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-19 10:29:29 +08:00
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
// @ts-check
|
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
|
// This file is automatically generated. DO NOT EDIT
|
|
|
|
export namespace main {
|
|
|
|
|
|
export class Person {
|
|
name: string;
|
|
address: services.Address;
|
|
|
|
constructor(source: Partial<Person> = {}) {
|
|
const { name = "", address = null } = source;
|
|
this.name = name;
|
|
this.address = address;
|
|
}
|
|
|
|
static createFrom(source: string | object = {}): Person {
|
|
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
|
|
return new Person(parsedSource as Partial<Person>);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
export namespace services {
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
static createFrom(source: string | object = {}): Address {
|
|
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
|
|
return new Address(parsedSource as Partial<Address>);
|
|
}
|
|
|
|
}
|
|
|
|
} |