@mailbiz/onsite-vtex-vendor 0.10.3 → 0.11.1

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.
@@ -1,4 +1,5 @@
1
- import { OnsiteCoreWindow } from "@mailbiz/onsite-core";
1
+ import { OnsiteCoreWindow, EventData, Events } from "@mailbiz/onsite-core";
2
+ import { ProductPropertiesEvent } from "@mailbiz/tracker-core";
2
3
  //#region [Window]
3
4
  interface VtexLocalStorage {
4
5
  orderform?: string; // VtexIOOrderFrom JSON string
@@ -504,7 +505,33 @@ interface VtexLegacyCatalog {
504
505
  getShippingValue: () => {};
505
506
  setProductWithVariationsCache: () => {};
506
507
  }
508
+ interface UniversalEventTracker {
509
+ (eventName: Events, eventData: EventData): void;
510
+ q?: Array<[
511
+ Events,
512
+ EventData
513
+ ]>;
514
+ }
515
+ //#region [Window]
516
+ interface UniversalWindow extends OnsiteCoreWindow {
517
+ mb_track: UniversalEventTracker;
518
+ mb_recover_cart?: (payload: CartRecoveryPayload) => void;
519
+ }
520
+ //#endregion
521
+ interface CartRecoveryPayload {
522
+ cart_id: string;
523
+ user_id: string;
524
+ products: CartRecoveryProduct[];
525
+ }
526
+ interface CartRecoveryProduct {
527
+ product_id: string;
528
+ sku: string;
529
+ quantity: number;
530
+ recovery_properties?: ProductPropertiesEvent;
531
+ }
507
532
  declare global {
533
+ interface Window extends UniversalWindow {
534
+ }
508
535
  interface Window extends VtexWindow {
509
536
  }
510
537
  }