import { BehaviorSubject, Observable, Subject } from 'rxjs'; import { BasketEntry, Ingredient, Recipe } from '../_models'; import { EventTrace } from '../_types/event-trace'; import { AnalyticsService } from './analytics.service'; import { BasketsSynchronizerService } from './baskets-synchronizing'; import { BasketsService } from './baskets.service'; import { ContextRegistryService } from './context-registry.service'; import { IgnoredIngredientsService } from './ignored-ingredients.service'; import { ItemsService } from './items.service'; import { ParsedMethod, PendingBasketMethodsService } from './pending-basket-methods.service'; import { PointOfSalesService } from './point-of-sales.service'; import { PriceService, ProductPrice } from './price.service'; import { RecipesService } from './recipes.service'; import { BasketEntryToReplace } from './replace-item.service'; import { StoreOutOfStockService } from './store-out-of-stock.service'; import * as i0 from "@angular/core"; export interface Product { ingredient: Ingredient; basketEntry: BasketEntry; price: ProductPrice; } export interface ProductCategory { toPickProducts: Product[]; oftenIgnoredProducts: Product[]; } export declare class RecipeDetailsService { private analyticsService; private basketsService; private recipeService; private ignoredBasketsService; private pendingBasketMethodsService; private posService; private itemsService; private basketSynchroService; private priceService; private contextRegistryService; private storeOutOfStockService; locale: string; productsByCategory: ProductCategory; products: Product[]; recipe: Recipe; totalProducts$: BehaviorSubject; allIngredientsToBasketLoading$: BehaviorSubject; ingredientToBasketLoading$: BehaviorSubject; updateIngredientFromBasketLoading$: BehaviorSubject; productsLoading$: BehaviorSubject; recipeLoading$: BehaviorSubject; basketEntryToReplace$: BehaviorSubject; updateFooterDisplay$: Subject; hasReplaced: boolean; pageviewEventWasSent: boolean; onlyShowPreparation: boolean; noPosDisplay: boolean; invalidPosDisplay: boolean; productsByCategory$: BehaviorSubject; products$: BehaviorSubject; recipePrice: { remaining: number; inBasket: number; }; private subscriptions; constructor(analyticsService: AnalyticsService, basketsService: BasketsService, recipeService: RecipesService, ignoredBasketsService: IgnoredIngredientsService, pendingBasketMethodsService: PendingBasketMethodsService, posService: PointOfSalesService, itemsService: ItemsService, basketSynchroService: BasketsSynchronizerService, priceService: PriceService, contextRegistryService: ContextRegistryService, storeOutOfStockService: StoreOutOfStockService, locale: string); get remainingBasketEntries(): BasketEntry[]; get hasAddedAProduct(): boolean; get isSponsored(): boolean; get containsAlcohol(): boolean; get orderHistoryDate(): string; set basketEntryToReplace(toReplace: BasketEntryToReplace); set productsLoading(isLoading: boolean); set recipeLoading(isLoading: boolean); set ingredientToBasketLoading(isLoading: boolean); set allIngredientsToBasketLoading(isLoading: boolean); set updateIngredientFromBasketLoading(isLoading: boolean); initDefaultState(withLoading?: boolean): void; executeActionFromStorage(): void; resetOnHide(): void; checkIfPosIsInitializedAndValid(): void; getProducts(fromInit?: boolean): void; /** * Sets the products by category. * * This function categorizes the products based on certain criteria and * populates the "productsByCategory" object with the categorized products. * The categorized products are then emitted through the "productsByCategory$" * subject. * * @return This function does not return a value. */ setProductsByCategory(): void; calculateProductPrice(product: Product, price: ProductPrice): void; isProductsByCategorySet(): boolean; /** * Retrieves the entries of the ingredients basket. * * @return An observable that emits the products in the basket. */ getIngredientsBasketEntries(fromInit?: boolean): Observable; ingredientRemoved(ingredient: Ingredient, eventTrace: EventTrace): void; updateProductQuantity(basketEntry: BasketEntry, newQuantity: number, eventTrace: EventTrace): void; addAllIngredientsToBasket(eventTrace: EventTrace): void; updateGuests(eventTrace: EventTrace): void; replaceBasketEntry(basketEntry: BasketEntry, ignoreSelected: boolean): void; /** * Calls hookCallback before adding a product to basket & adds the recipes if products can be added * @param method is either 'addRecipeToBasket' or 'addIngredientToBasket' with arguments * @param eventTrace needed to add recipe to basket * @param recipe can be provided as an argument * @returns [islogged: boolean, posWasInitialized: boolean, recipeIsInBasket: boolean] */ canAddProductToBasket(method: ParsedMethod, eventTrace: EventTrace, recipe?: Recipe): Observable; updateRecipePrice(product: Product, ignore?: boolean): void; sendEmitToUpdateRecipePrice(): void; unsubscribe(): void; private remainingProducts; private updatePriceOnGuestChange; private basketEntryForIngredient; /** * Listens to the basket preview and updates the products' basket entry based on the provided recipe ID. */ private listenBasketPreview; private isIngredientIgnored; private categorizeProducts; private correctProductState; setProductOutOfStockInSession(products: { ingredientId: string; entry: BasketEntry; }[]): void; static ɵfac: i0.ɵɵFactoryDef; static ɵprov: i0.ɵɵInjectableDef; } //# sourceMappingURL=recipe-details.service.d.ts.map