-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
117 lines (98 loc) · 2.24 KB
/
types.d.ts
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
type GlobalState = {
recipes: RecipeDB[];
pantry: PantryItem[] | [];
searchKeyword: string
};
type GlobalContextType = {
state: GlobalState;
setState: Dispatch<SetStateAction<GlobalState>>;
};
interface CreateCompletionResponseData {
id: string;
object: string;
created: number;
model: string;
choices: string[];
}
type CreateCompletionResponse = AxiosResponse<CreateCompletionResponseData>;
type CreateImageResponse = AxiosResponse<CreateImageResponse>;
type PromptParams = {
ingredients: string[];
cuisines: string[];
dietaryPreferences: string[];
maxPrepTime: string[];
difficulty: string[];
allergies: string[];
keywords: string[];
category: RecipeCategory[];
};
// type RecipeCategory =
// "Side" | "Appetizer" | "Breakfast" | "Lunch" | "Dinner" | "Dessert" | "Snack" | "Drink"
type CheckboxNames = "maxPrepTime" | "allergies" | "ingredients" | "cuisines" | "dietaryPreferences";
type MenuOptions = {
cuisines: string[];
dietaryPreferences: string[];
maxPrepTimeOptions: number[];
difficulty: string[];
category: string[];
};
// type ParsedRecipe = {
// id: string;
// title: string;
// summary: string;
// instructions: string[];
// preptime: string;
// cooktime: string;
// };
type AuthCredentials = {
email: string;
password: string;
};
type AppContextType = [string, (value: string) => void];
type Ingredient = {
name: string;
quantity: string;
unit: string;
};
interface RecipeData {
title: string;
summary: string;
instructions: string[];
ingredients: Ingredient[];
preptime: string;
cooktime: string;
category: string;
image: string;
}
interface RecipeDB extends RecipeData {
id: number;
addedById: number;
addedAt: string;
rating: number | null;
}
interface RecipeGPT extends RecipeData {
id: string;
}
type EdamamIngredient = {
food: {
brand: string;
category: string;
categoryLabel: string;
foodId: string;
image: string;
knownAs: string;
label: string;
nutrients: {
CHOCDF: number;
ENERC_KCAL: number;
FAT: number;
FIBTG: number;
PROCNT: number;
};
};
};
type PantryItem = EdamamIngredient["food"] & {
id: number;
userId: number;
};
type PantryItemsCallback = (items: PantryItem[]) => void;