Files
calories-tracker/src/types.ts
T

47 lines
972 B
TypeScript
Raw Normal View History

2025-09-08 05:19:40 -03:00
type FoodCategory = 'fats' | 'proteins' | 'carbs' | 'leaves' | 'fruits' | 'low carb' | 'dairy';
2025-06-16 17:33:52 -03:00
2025-06-12 10:39:19 -03:00
export type FoodItem = {
name: string;
2025-12-01 18:15:09 -03:00
nameEn: string;
2025-06-18 16:56:11 -03:00
info: { calories: number, protein: number, fat: number, carbs: number, fiber: number, category: FoodCategory, alkaline: boolean }
2025-06-12 10:39:19 -03:00
}
export type FoodStorage = {
2025-06-12 18:30:11 -03:00
id?: string;
2025-06-12 10:39:19 -03:00
name: string;
grams: number;
calories: number;
protein: number;
fat: number;
carbs: number;
fiber: number;
time: string;
2025-06-12 18:30:11 -03:00
date: string;
2025-06-18 16:56:11 -03:00
alkaline: boolean | null;
2025-06-12 10:39:19 -03:00
};
2025-06-13 19:18:31 -03:00
export type UserSettings = {
id?: string;
2025-06-23 18:24:37 -03:00
caloriesGoal?: number;
2025-06-13 19:18:31 -03:00
proteinGoal: number;
fatGoal: number;
carboGoal: number;
fiberGoal: number;
};
2025-09-04 17:12:14 -03:00
export type DailyTotalCalories = {
documentId: string;
day: number;
totalCalories: number;
};
2025-10-30 13:18:01 -03:00
export type SharedDay = {
id?: string;
shareId: string;
userId: string;
userName: string;
date: string;
foodEntries: string; // JSON stringified FoodStorage[]
createdAt: string;
};