webc-miam 8.4.2 → 8.6.0

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.
@@ -2,8 +2,7 @@ import { EventEmitter } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { ComparableProduct } from './comparable-product';
4
4
  import { DocumentCollection } from 'miam-jsonapi';
5
- import { PointOfSale } from '../../_models';
6
- import { Coordinates } from '../coordinates';
5
+ import { PointOfSale, Supplier } from '../../_models';
7
6
 
8
7
  export interface MiamInterface {
9
8
  /**
@@ -124,10 +123,20 @@ export interface MiamInterface {
124
123
  * @param antiInflation if you want to use the anti inflation
125
124
  */
126
125
  enableMealsPlanner: (url: string, antiInflation?: boolean) => void;
126
+
127
+ /**
128
+ * Call to enable SEO (Title and meta tags on recipe display)
129
+ */
130
+ enableSeo: () => void
127
131
  /**
128
132
  * Call to enable guests input on my-meals cards
129
133
  */
130
134
  enableGuestsInputOnMyMeals: () => void;
135
+
136
+ /**
137
+ * Call to enable collapsing of unavailable products by default
138
+ */
139
+ collapseUnavailableProductsByDefault: () => void;
131
140
  };
132
141
 
133
142
  // ---------------------------------------------------------------------------------------------------
@@ -143,6 +152,13 @@ export interface MiamInterface {
143
152
  * or to show your point of sale picker if the user has not chosen one
144
153
  */
145
154
  setHookCallback: (callback: (isLogged, isPosValid) => boolean) => void;
155
+ /**
156
+ * Set up a callback which Miam will call when it needs to force the POS
157
+ * (only used when tranfering a basket from an affiliated website)
158
+ *
159
+ * @param callback a method that will be called passing :
160
+ * - posExtId, the id of the POS (in your database)
161
+ */
146
162
  setForcePosCallback: (callback: (posExtId: string) => boolean) => void;
147
163
  };
148
164
 
@@ -157,8 +173,14 @@ export interface MiamInterface {
157
173
  */
158
174
  load: (externalId) => void;
159
175
 
160
- getByAddress: (address: string, radius: string) => Observable<DocumentCollection<PointOfSale>>
161
- getByCoordinates: (longitude: number, latitude: number, radius: number) => Observable<DocumentCollection<PointOfSale>>
176
+ /**
177
+ * This is an internal method that will be moved elsewhere soon. Do not call
178
+ */
179
+ getByAddress: (address: string, radius: string, suppliers: string[]) => Observable<DocumentCollection<PointOfSale>>;
180
+ /**
181
+ * This is an internal method that will be moved elsewhere soon. Do not call
182
+ */
183
+ getByCoordinates: (longitude: number, latitude: number, radius: number, suppliers: string[]) => Observable<DocumentCollection<PointOfSale>>;
162
184
  };
163
185
 
164
186
  // ---------------------------------------------------------------------------------------------------
@@ -251,6 +273,8 @@ export interface MiamInterface {
251
273
  * @param token a single token containing the information for supplierId, origin & plausible domain
252
274
  */
253
275
  setupWithToken: (token: string) => void;
276
+
277
+ getAffiliateSuppliers: () => Observable<Supplier[]>;
254
278
  };
255
279
 
256
280
  // ---------------------------------------------------------------------------------------------------
@@ -282,7 +306,7 @@ export interface MiamInterface {
282
306
  * User location can be set from the user's browser if they allowed it
283
307
  * @param coords must provide latitude (number) and longitude (number) and optionally an accuracy (number)
284
308
  */
285
- setLocation: (coords: Coordinates) => void;
309
+ setLocation: (coords: GeolocationPosition) => void;
286
310
  };
287
311
 
288
312
  // ---------------------------------------------------------------------------------------------------