Rename method from fetchNutrientsForPassioFoodItemto getNutrientsOfPassioFoodItem
Rename method from fetchNutrientsSelectedSizeForPassioFoodItemto getNutrientsSelectedSizeOfPassioFoodItem
Rename method from fetchNutrientsReferenceForPassioFoodItemto getNutrientsReferenceOfPassioFoodItem
3.0.2-2
Fixed IOS weight gram value.
3.0.2-1
Fixed symbol unit for iOS.
Wide Angle camera issue resolved.
3.0.2
Added carbs , protein and fat in PassioSearchNutritionPreview
Added API
/** * fetch a suggestions for particular meal time 'breakfast' | 'lunch' | 'dinner' | 'snack' and returning results. * @param mealTime - 'breakfast' | 'lunch' | 'dinner' | 'snack', * @returns A `Promise` resolving to a `PassioFoodItem` object if the record exists in the database or `null` if not. */fetchSuggestions(mealTime: MealTime): Promise<FoodSearchResult[] |null>/** * Detail of search food with a given search result. * @param result - Provide `PassioSearchResult` object get `PassioFoodItem` detail. * @returns A `Promise` resolving to `PassioFoodItem` detail. */fetchFoodItemForSuggestion( result: FoodSearchResult ): Promise<PassioFoodItem |null>
searchForFood now returns PassioSearchResult and a list of search options. The PassioSearchResult represent a specific food item associated with the search term, while search options provide a list of possible suggested search terms connected to the input term.
To retrieve all macro and micronutrient values using PassioFoodItemNutrients by passing a passioFoodItem, you would typically follow these steps:
new PassioFoodItemNutrients(passioFoodItem).nutrientsSelectedSize()
new PassioFoodItemNutrients(passioFoodItem).nutrientsReference()
new PassioFoodItemNutrients(passioFoodItem).nutrients({
unit: calculatedWeightUnit,
value: calculatedWeight,
})
2.3.15-2
Fixed issue with number format exception on some locales
2.3.15
Added fetchNutrientsFor API.
/**
* fetch a map of nutrients for a 100 grams of a specific food item
* @param passioID - The Passio ID for the attributes query.
* @returns A `Promise` resolving to a `PassioNutrient` object if the record exists in the database or `null` if not.
*/
fetchNutrientsFor(passioID: PassioID): Promise<PassioNutrient[] | null>
export interface PassioNutrient {
// The name of the nutrient.
name: string
// The amount of the nutrient, measured in a specific unit.
amount?: number
// The unit in which the nutrient amount is measured (e.g., grams, milligrams).
unit: string
// The inflammatory effect score associated with the nutrient.
inflammatoryEffectScore?: number
}