20 lines
504 B
TypeScript
20 lines
504 B
TypeScript
export default class AppState {
|
|
/** Json data as exported from zip and compliant with schemas */
|
|
private jsonData: TypeApp;
|
|
|
|
constructor(jsonData: TypeApp) {
|
|
this.jsonData = jsonData;
|
|
}
|
|
|
|
public settings(): TypeSettings {
|
|
return this.jsonData.settings;
|
|
}
|
|
|
|
public brands(): Array<TypeBrand> {
|
|
return this.jsonData.items;
|
|
}
|
|
|
|
public brand(id:number): TypeBrand|undefined {
|
|
return this.jsonData.items.find(brand => brand.id === id);
|
|
}
|
|
}
|