5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-10 07:11:52 +08:00
wails/v3/internal/parser/testdata/enum/frontend/bindings/main/models.js
Lea Anthony 2bb25b12ff
Update bindings generator to generate bindings in packages and files.
Remove unused JavaScript files
Update tests.
Update v3 docs
2023-12-22 20:01:42 +11:00

41 lines
1.1 KiB
JavaScript

// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// Title is a title
export const Title = {
// Mister is a title
Mister: "Mr",
Miss: "Miss",
Ms: "Ms",
Mrs: "Mrs",
Dr: "Dr",
};
// Person represents a person
export const Person = class {
/**
* Creates a new Person instance.
* @constructor
* @param {Object} source - The source object to create the Person.
* @param {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 {Person} A new Person instance.
*/
static createFrom(source) {
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
return new Person(parsedSource);
}
};