import { HttpClient } from '@angular/common/http'; import { EventEmitter } from '@angular/core'; import { DocumentCollection, Service } from 'miam-jsonapi'; import { BehaviorSubject, Observable } from 'rxjs'; import { Ingredient, Recipe, Tag } from '../_models'; import { RecipePricing } from '../_models/recipe-pricing'; import { RecipeFilters } from '../_types/recipe-filters'; import { AnalyticsService } from './analytics.service'; import { IngredientsService } from './ingredients.service'; import { PackageService } from './package.service'; import { PointOfSalesService } from './point-of-sales.service'; import { PreferencesService } from './preferences.service'; import { RecipeLikesService } from './recipe-likes.service'; import { RecipeProviderService } from './recipe-provider.service'; import { RecipeStatusService } from './recipe-status.service'; import { RecipeStepsService } from './recipe-steps.service'; import { RecipeTypeService } from './recipe-type.service'; import { SeoService } from './seo.service'; import { SponsorService } from './sponsor.service'; import { StoreLocatorService } from './store-locator.service'; import { SuppliersService } from './suppliers.service'; import { TagsService } from './tags.service'; import { MealsPlannerService } from './meals-planner.service'; import * as i0 from "@angular/core"; export interface RecipeDisplay { previewAllowed: boolean; recipe: Recipe; previewMode: boolean; wasAdded: boolean; force?: boolean; displayGuests?: boolean; helpButtonAllowed?: boolean; planner?: boolean; } export interface IRecipeDisplayParams { previewAllowed?: boolean; guests?: number; previewMode?: boolean; wasAdded?: boolean; displayGuests?: boolean; helpButtonAllowed?: boolean; planner?: boolean; } export declare class RecipesService extends Service { private http; private analyticsService; private providerService; private statusService; private typeService; private suppliersService; private posService; private ingredientsService; private recipeStepsService; private sponsorService; private packageService; private tagsService; private recipeLikesService; private seoService; private preferencesService; private storeLocatorService; private mealsPlannerService; resource: typeof Recipe; type: string; displayedRecipe$: BehaviorSubject; displayHelper$: BehaviorSubject; displayedRecipeChanged$: BehaviorSubject; recipeDetailsTabIndex$: BehaviorSubject; hidden: EventEmitter; suggestionsPrimaryButtonActions: { display: boolean; addToBasket: boolean; }; recipesPrimaryButtonActions: { display: boolean; addToBasket: boolean; }; reloadRecipes$: BehaviorSubject; difficultyLevels: { value: number; label: string; }[]; confirmationToaster: boolean; isRecipeDetailsFromPlanner: boolean; private randomSeed; private randomRecipeCount; private recipes; constructor(http: HttpClient, analyticsService: AnalyticsService, providerService: RecipeProviderService, statusService: RecipeStatusService, typeService: RecipeTypeService, suppliersService: SuppliersService, posService: PointOfSalesService, ingredientsService: IngredientsService, recipeStepsService: RecipeStepsService, sponsorService: SponsorService, packageService: PackageService, tagsService: TagsService, recipeLikesService: RecipeLikesService, seoService: SeoService, preferencesService: PreferencesService, storeLocatorService: StoreLocatorService, mealsPlannerService: MealsPlannerService); loadRecipes(recipesInfos: { id: string; guests?: string; }[]): Observable; /** * Adds mandatory data (guest, pos id) completion to the given filters. */ addMandatoryCompletionToFilter(filters: RecipeFilters): Observable; filter(filters: RecipeFilters, page: { number: number; size: number; }, includes?: string[], fields?: {}, guests?: number, random?: boolean, sort?: string): Observable; loadRecipesFromPackageId(packageId: string, page: number, size: number, guests: number): Observable; filterCount(filters: RecipeFilters, guests?: number, excludedRecipesIds?: string[], fromPreference?: boolean): Observable; private buildRemoteFilters; private buildRemoteFilter; getRandom(includes?: string[], fields?: {}): Observable; getSuggestionFromContext(context: { id: string; hasHighWeight?: boolean; }[], includes?: string[], fields?: {}): Observable; getSuggestedRecipes(): Observable; searchRecipeByExtId(recipeExtId: string): Observable; getPricing(recipeId: string, posId: string, serves?: number, isExtStoreId?: boolean): Observable; getIngredientsDefinitions(recipeId: string): Observable; generateFromPicture(imageBase64: string): Observable; display(recipeId: string, { previewAllowed, guests, previewMode, displayGuests, helpButtonAllowed }: IRecipeDisplayParams): void; displayObject(recipe: Recipe, { previewAllowed, guests, previewMode, wasAdded, displayGuests, helpButtonAllowed }: IRecipeDisplayParams): void; openRecipeDetails(recipeId: string, guests: number, initialTabIndex: number, path?: string, categoryId?: string): void; openStoreLocator(): void; toggleHelper(): void; hide(): void; addTagToRecipe(recipe: Recipe, tag: Tag): Observable; setRecipesPrimaryButtonActions(display?: boolean, addToBasket?: boolean): void; setSuggestionsPrimaryButtonActions(display?: boolean, addToBasket?: boolean): void; plan(budget: number, guests: number, recipesCount: number, includes?: string[], fields?: {}, inBasket?: boolean): Observable; maxPlannableRecipes(budget: number, guests: number, inBasket?: boolean): Observable; getIngredientsByRecipeId(recipeId: string): Observable; search(name: string, filters: { partner: boolean; statuses?: string[]; types: string[]; providers: string[]; packages: string[]; }, page: { size: number; number: number; }, include: string[], sort: string): Observable>; private getOrFetch; /** * help us to keep a track of random * and avoid to show same recipe mutiple times */ private initRandomSeed; private reloadAllRecipes; /** * Build suggestion request body based on context passed & current retailer basket */ private buildSuggestionBody; private buildfilterUrlFromPreferences; static ɵfac: i0.ɵɵFactoryDef; static ɵprov: i0.ɵɵInjectableDef; } //# sourceMappingURL=recipes.service.d.ts.map