5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 16:02:07 +08:00
wails/v3/internal/parser/testdata/struct_literal_single/models.ts
Adam Tenderholt 130fab6c01 Feature/v3 parser: expand TS model generation tests & some fixes (#2485)
* v3 parser: add tests for model generation

* v3 parser: use single quotes for got model.ts

* v3 parser: fixes for some failing tests

* v3 parser: misc simplification and cleanup

* v3 parser: fix model tests when no structs returned

* v3 parser: fix last failing test case

* Update contributors list

* v3 parser: update README

* Revert "Update contributors list"

This reverts commit f429d2ba89.

* Changelog: add line about my contribution
2023-03-25 10:09:17 +11:00

65 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;
parent: Person;
details: anon1;
static createFrom(source: any = {}) {
return new Person(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) {
source = JSON.parse(source);
}
this.name = source['name'];
this.parent = Person.createFrom(source['parent']);
this.details = anon1.createFrom(source['details']);
}
}
export class anon1 {
age: number;
address: anon2;
static createFrom(source: any = {}) {
return new anon1(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) {
source = JSON.parse(source);
}
this.age = source['age'];
this.address = anon2.createFrom(source['address']);
}
}
export class anon2 {
street: string;
static createFrom(source: any = {}) {
return new anon2(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) {
source = JSON.parse(source);
}
this.street = source['street'];
}
}
}