@azzas/azzas-tracker-web 2.0.0-preview.5 → 2.0.0-preview.7

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.
package/dist/mod.d.cts CHANGED
@@ -1401,29 +1401,14 @@ declare global {
1401
1401
  }
1402
1402
  }
1403
1403
  type EventName = keyof typeof EVENTS;
1404
+ type InitialConfig = {
1405
+ brand: string;
1406
+ currency: string;
1407
+ };
1404
1408
  type ProductMeta = {
1405
1409
  index?: number;
1406
1410
  item_list_name?: string | undefined | null;
1407
1411
  };
1408
- type AdapterPayload = {
1409
- adapter: 'HEADLESS';
1410
- zone: 'PDP';
1411
- products: (ProductType_PDP & ProductMeta)[];
1412
- } | {
1413
- adapter: 'HEADLESS';
1414
- zone: 'PDC';
1415
- products: (ProductType_PDC & ProductMeta)[];
1416
- } | {
1417
- adapter: 'HEADLESS';
1418
- zone: 'Minicart';
1419
- products: (ProductType_Minicart & ProductMeta)[];
1420
- } | {
1421
- adapter: 'DECO';
1422
- products: (Product & ProductMeta)[];
1423
- } | {
1424
- adapter: 'ORDERFORM';
1425
- orderForm: (OrderForm & ProductMeta)[];
1426
- };
1427
1412
  interface TrackMeta {
1428
1413
  region?: string;
1429
1414
  pre_filled?: boolean;
@@ -1439,11 +1424,33 @@ interface TrackMeta {
1439
1424
  creative_name?: string;
1440
1425
  creative_slot?: string;
1441
1426
  coupon_code?: string;
1442
- currency?: string;
1443
1427
  }
1428
+ type CallOverrides = {
1429
+ brand?: string;
1430
+ };
1431
+ type AdapterPayload = ({
1432
+ adapter: 'DECO';
1433
+ products: (Product & ProductMeta)[];
1434
+ } | {
1435
+ adapter: 'ORDERFORM';
1436
+ orderForm: (OrderForm & ProductMeta)[];
1437
+ } | {
1438
+ adapter: 'HEADLESS';
1439
+ zone: 'PDP';
1440
+ products: (ProductType_PDP & ProductMeta)[];
1441
+ } | {
1442
+ adapter: 'HEADLESS';
1443
+ zone: 'PDC';
1444
+ products: (ProductType_PDC & ProductMeta)[];
1445
+ } | {
1446
+ adapter: 'HEADLESS';
1447
+ zone: 'Minicart';
1448
+ products: (ProductType_Minicart & ProductMeta)[];
1449
+ }) & CallOverrides;
1444
1450
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1445
1451
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1446
1452
 
1453
+ declare function initTracker(c: InitialConfig): void;
1447
1454
  declare function trackWebEvent<E extends EventName>(event: E, context: AdapterPayload & {
1448
1455
  meta: MetaForEvent<E>;
1449
1456
  window?: unknown;
@@ -1629,4 +1636,4 @@ declare const _default: {
1629
1636
  };
1630
1637
  };
1631
1638
 
1632
- export { EVENTS, _default as default, trackWebEvent };
1639
+ export { EVENTS, _default as default, initTracker, trackWebEvent };
package/dist/mod.d.ts CHANGED
@@ -1401,29 +1401,14 @@ declare global {
1401
1401
  }
1402
1402
  }
1403
1403
  type EventName = keyof typeof EVENTS;
1404
+ type InitialConfig = {
1405
+ brand: string;
1406
+ currency: string;
1407
+ };
1404
1408
  type ProductMeta = {
1405
1409
  index?: number;
1406
1410
  item_list_name?: string | undefined | null;
1407
1411
  };
1408
- type AdapterPayload = {
1409
- adapter: 'HEADLESS';
1410
- zone: 'PDP';
1411
- products: (ProductType_PDP & ProductMeta)[];
1412
- } | {
1413
- adapter: 'HEADLESS';
1414
- zone: 'PDC';
1415
- products: (ProductType_PDC & ProductMeta)[];
1416
- } | {
1417
- adapter: 'HEADLESS';
1418
- zone: 'Minicart';
1419
- products: (ProductType_Minicart & ProductMeta)[];
1420
- } | {
1421
- adapter: 'DECO';
1422
- products: (Product & ProductMeta)[];
1423
- } | {
1424
- adapter: 'ORDERFORM';
1425
- orderForm: (OrderForm & ProductMeta)[];
1426
- };
1427
1412
  interface TrackMeta {
1428
1413
  region?: string;
1429
1414
  pre_filled?: boolean;
@@ -1439,11 +1424,33 @@ interface TrackMeta {
1439
1424
  creative_name?: string;
1440
1425
  creative_slot?: string;
1441
1426
  coupon_code?: string;
1442
- currency?: string;
1443
1427
  }
1428
+ type CallOverrides = {
1429
+ brand?: string;
1430
+ };
1431
+ type AdapterPayload = ({
1432
+ adapter: 'DECO';
1433
+ products: (Product & ProductMeta)[];
1434
+ } | {
1435
+ adapter: 'ORDERFORM';
1436
+ orderForm: (OrderForm & ProductMeta)[];
1437
+ } | {
1438
+ adapter: 'HEADLESS';
1439
+ zone: 'PDP';
1440
+ products: (ProductType_PDP & ProductMeta)[];
1441
+ } | {
1442
+ adapter: 'HEADLESS';
1443
+ zone: 'PDC';
1444
+ products: (ProductType_PDC & ProductMeta)[];
1445
+ } | {
1446
+ adapter: 'HEADLESS';
1447
+ zone: 'Minicart';
1448
+ products: (ProductType_Minicart & ProductMeta)[];
1449
+ }) & CallOverrides;
1444
1450
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1445
1451
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1446
1452
 
1453
+ declare function initTracker(c: InitialConfig): void;
1447
1454
  declare function trackWebEvent<E extends EventName>(event: E, context: AdapterPayload & {
1448
1455
  meta: MetaForEvent<E>;
1449
1456
  window?: unknown;
@@ -1629,4 +1636,4 @@ declare const _default: {
1629
1636
  };
1630
1637
  };
1631
1638
 
1632
- export { EVENTS, _default as default, trackWebEvent };
1639
+ export { EVENTS, _default as default, initTracker, trackWebEvent };