webc-miam 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,12 @@ export interface MiamInterface {
34
34
  * side), so you can start the basket-sync earlier
35
35
  */
36
36
  initialize: () => void;
37
+ /**
38
+ * If you have different price tables (or pricebooks) for the same point of sale, you can call this
39
+ * method to make Miam know on which pricebook you are using
40
+ * For example, prices can be different depending on if the user chose home delivery or drive-in
41
+ */
42
+ updatePricebook: (pricebookName: string) => void,
37
43
  };
38
44
 
39
45
  basketSync: {
@@ -44,6 +50,13 @@ export interface MiamInterface {
44
50
  * products if their quantity is positive, and removing them if their quantity is negative
45
51
  */
46
52
  definePushProductsToBasket: (pushProductsToBasket: (products: ComparableProduct[]) => void) => void;
53
+ /**
54
+ * The callback parameter is called when Miam's basket changes to update the user's cart accordingly
55
+ *
56
+ * @param pushProductsToBasket a method that updates the user's cart with the pruducts passed in parameter, by adding
57
+ * products if their quantity is positive, and removing them if their quantity is negative
58
+ */
59
+ definePushBasketEntriesToBasket: (pushProductsToBasket: (products: ComparableProduct[]) => void) => void;
47
60
  /**
48
61
  * Call to notify Miam that the user's cart has been updated
49
62
  *
@@ -116,6 +129,10 @@ export interface MiamInterface {
116
129
  * Returns an observable that will emit true if the recipe passed in parameter is in Miam's GroceriesList
117
130
  */
118
131
  hasRecipe: (recipeId: string) => Observable<boolean>;
132
+ /**
133
+ * @returns A BehaviorSubject that emits the current number of recipes in Miam's GroceriesList
134
+ */
135
+ recipeCount: Observable<number>;
119
136
  };
120
137
 
121
138
  // ---------------------------------------------------------------------------------------------------
@@ -125,9 +142,9 @@ export interface MiamInterface {
125
142
  * Call to inform Miam of the point of sale the user is currently on. Do not forget to call the method
126
143
  * if it changes after user loads the page
127
144
  *
128
- * @param extId the id of the PointOfSale in client's database
145
+ * @param externalId the id of the PointOfSale in client's database
129
146
  */
130
- loadWithExtId: (extId) => void;
147
+ load: (externalId) => void;
131
148
  };
132
149
 
133
150
  // ---------------------------------------------------------------------------------------------------
@@ -162,6 +179,10 @@ export interface MiamInterface {
162
179
  // * /!\ DEPRECATED: DO NOT USE /!\
163
180
  // */
164
181
  // setSuggestionsPrimaryButtonActions: (display: boolean, addToBasket: boolean) => void;
182
+ /**
183
+ * If called, adding a recipe to Miam's basket will display a confirmation toaster
184
+ */
185
+ showConfirmationToaster: () => void;
165
186
  };
166
187
 
167
188
  // ---------------------------------------------------------------------------------------------------