import { HttpClient } from '@angular/common/http'; import { DocumentResource, Service } from 'miam-jsonapi'; import { Observable } from 'rxjs'; import { UserService } from './user.service'; import { QuantityUnit, Ingredient, Recipe, IngredientDefinition } from '../_models'; import { IngredientsDefinitionsService } from './ingredients-definitions.service'; import * as i0 from "@angular/core"; export declare class IngredientsService extends Service { private http; private userService; private ingredientsdefinitionsService; resource: typeof Ingredient; type: string; private reviewedNames; private reviewedUnits; private isFetchingNames; private isFetchingUnits; constructor(http: HttpClient, userService: UserService, ingredientsdefinitionsService: IngredientsDefinitionsService); getReviewedNames(): string[]; getReviewedUnits(): string[]; /** * Check if ingredient is already known in backend * @param ingredientDef exemple : 'steak' */ isReviewedName(ingredientDef: string): Observable; /** * Check if unit is already known in backend * @param unit exemple : 'c. à c.' */ isReviewedUnit(unit: string): Observable; formatIngredients(listIngredient: string[]): Observable; /** * Merge Recipe Ingredients list with output of recipe forms ingredient list * it's link with RecipeFormComponent * @param recipe to update * @param ingredients list of ingredients */ createOrUpdateIngredients(recipe: Recipe, ingredients: Ingredient[]): Ingredient[]; /** * Create or update a list Of Ingredient * it'll create if Ingredient id is null otherwise update it * it's perform in parallel , Observable'll complet when all ingredents have been upserted * @param ingredients array of Ingredient */ upsertIngredientList(ingredients: Ingredient[]): Observable[]>; deleteIngredientList(ingredientIds: string[]): Observable; searchIngredientByName(name: string): Observable; searchUnitByName(name: string): Observable; fetchQuantityToAdd(ingredientId: string, guests: number, selectedItemId?: string): Observable; getConversion(ingredientName: string, quantityUnitId: string, quantity: string): Observable; private fetchReviewedNames; private fetchReviewedUnits; static ɵfac: i0.ɵɵFactoryDef; static ɵprov: i0.ɵɵInjectableDef; } //# sourceMappingURL=ingredients.service.d.ts.map