blob: 8ace01a33c25fb90329196c27b19cf9d727d5cab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
export interface IRecipePreview {
id: string;
name: string;
icon: string;
featured: boolean;
aliases: string[];
isDevRecipe?: boolean;
icons?: {
svg: string;
};
}
export default class RecipePreview {
id: string = '';
name: string = '';
icon: string = '';
featured: boolean = false;
aliases: string[] = [];
isDevRecipe?: boolean;
icons?: {
svg: string;
};
constructor(data: IRecipePreview) {
if (!data) {
throw new Error('RecipePreview config not valid');
}
if (!data.id) {
throw new Error(`RecipePreview '${data.name}' requires Id`);
}
Object.assign(this, data);
}
}
|