397 lines
11 KiB
TypeScript
397 lines
11 KiB
TypeScript
export namespace main {
|
|
|
|
export class AggregatedFood {
|
|
period: string;
|
|
amount: number;
|
|
avgPer100: number;
|
|
energy: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new AggregatedFood(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.period = source["period"];
|
|
this.amount = source["amount"];
|
|
this.avgPer100 = source["avgPer100"];
|
|
this.energy = source["energy"];
|
|
}
|
|
}
|
|
export class AggregatedWeight {
|
|
period: string;
|
|
amount: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new AggregatedWeight(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.period = source["period"];
|
|
this.amount = source["amount"];
|
|
}
|
|
}
|
|
export class Food {
|
|
id: number;
|
|
date: string;
|
|
food: string;
|
|
description: string;
|
|
amount: number;
|
|
per100: number;
|
|
energy: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Food(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.id = source["id"];
|
|
this.date = source["date"];
|
|
this.food = source["food"];
|
|
this.description = source["description"];
|
|
this.amount = source["amount"];
|
|
this.per100 = source["per100"];
|
|
this.energy = source["energy"];
|
|
}
|
|
}
|
|
export class FoodSearch {
|
|
id: number;
|
|
date: string;
|
|
food: string;
|
|
description: string;
|
|
amount: number;
|
|
per100: number;
|
|
energy: number;
|
|
score: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new FoodSearch(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.id = source["id"];
|
|
this.date = source["date"];
|
|
this.food = source["food"];
|
|
this.description = source["description"];
|
|
this.amount = source["amount"];
|
|
this.per100 = source["per100"];
|
|
this.energy = source["energy"];
|
|
this.score = source["score"];
|
|
}
|
|
}
|
|
export class WailsAggregateFood {
|
|
data: AggregatedFood[];
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsAggregateFood(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data = this.convertValues(source["data"], AggregatedFood);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
export class WailsAggregateWeight {
|
|
data: AggregatedWeight[];
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsAggregateWeight(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data = this.convertValues(source["data"], AggregatedWeight);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
export class WailsFood {
|
|
data: Food[];
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsFood(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data = this.convertValues(source["data"], Food);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
export class WailsFood1 {
|
|
data: Food;
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsFood1(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data = this.convertValues(source["data"], Food);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
export class WailsFoodSearch {
|
|
data: FoodSearch[];
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsFoodSearch(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data = this.convertValues(source["data"], FoodSearch);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
export class WailsGenericAck {
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsGenericAck(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
}
|
|
export class Weight {
|
|
id: number;
|
|
date: string;
|
|
weight: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Weight(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.id = source["id"];
|
|
this.date = source["date"];
|
|
this.weight = source["weight"];
|
|
}
|
|
}
|
|
export class WailsWeight {
|
|
data: Weight[];
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsWeight(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data = this.convertValues(source["data"], Weight);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
export class WailsWeight1 {
|
|
data: Weight;
|
|
success: boolean;
|
|
error?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new WailsWeight1(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data = this.convertValues(source["data"], Weight);
|
|
this.success = source["success"];
|
|
this.error = source["error"];
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
|
|
export class settings {
|
|
foodDaysLookback: number;
|
|
foodAggregatedDaysLookback: number;
|
|
foodDailyLookback: number;
|
|
foodWeeklyLookback: number;
|
|
foodMonthlyLookback: number;
|
|
foodYearlyLookback: number;
|
|
weightDaysLookback: number;
|
|
weightAggregatedDaysLookback: number;
|
|
weightDailyLookback: number;
|
|
weightWeeklyLookback: number;
|
|
weightMonthlyLookback: number;
|
|
weightYearlyLookback: number;
|
|
target: number;
|
|
limit: number;
|
|
searchLimit: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new settings(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.foodDaysLookback = source["foodDaysLookback"];
|
|
this.foodAggregatedDaysLookback = source["foodAggregatedDaysLookback"];
|
|
this.foodDailyLookback = source["foodDailyLookback"];
|
|
this.foodWeeklyLookback = source["foodWeeklyLookback"];
|
|
this.foodMonthlyLookback = source["foodMonthlyLookback"];
|
|
this.foodYearlyLookback = source["foodYearlyLookback"];
|
|
this.weightDaysLookback = source["weightDaysLookback"];
|
|
this.weightAggregatedDaysLookback = source["weightAggregatedDaysLookback"];
|
|
this.weightDailyLookback = source["weightDailyLookback"];
|
|
this.weightWeeklyLookback = source["weightWeeklyLookback"];
|
|
this.weightMonthlyLookback = source["weightMonthlyLookback"];
|
|
this.weightYearlyLookback = source["weightYearlyLookback"];
|
|
this.target = source["target"];
|
|
this.limit = source["limit"];
|
|
this.searchLimit = source["searchLimit"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|