5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-06 04:51:13 +08:00
wails/v3/internal/parser/testdata/enum/models.js
2023-12-16 14:02:19 +11:00

42 lines
1.1 KiB
JavaScript

// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// Defining the main namespace
export const main = {};
// Simulating the enum with an object
main.Title = {
// Mister is a title
Mister: "Mr",
Miss: "Miss",
Ms: "Ms",
Mrs: "Mrs",
Dr: "Dr",
};
main.Person = class {
/**
* Creates a new Person instance.
* @constructor
* @param {Object} source - The source object to create the Person.
* @param {main.Title} source.Title
* @param {string} source.Name
*/
constructor(source = {}) {
const { title = null, name = "" } = source;
this.title = title;
this.name = name;
}
/**
* Creates a new Person instance from a string or object.
* @param {string|object} source - The source data to create a Person instance from.
* @returns main.Person A new Person instance.
*/
static createFrom(source = {}) {
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
return new main.Person(parsedSource);
}
};