From ac033531c53744cc34b51e35e8cfe5a1baf6b3a8 Mon Sep 17 00:00:00 2001 From: Enes Kutay SEZEN Date: Tue, 8 Aug 2023 16:00:44 -0400 Subject: [PATCH 1/2] Update types --- src/types/index.d.ts | 6 ++++++ src/types/tracker.d.ts | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 318635a8..ee0d7816 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -332,3 +332,9 @@ export interface SearchabilityConfiguration { displayable?: boolean, hidden?: boolean, } + +export interface ItemTracked { + itemName?: string; + itemId?: string; + variationId?: string; +} diff --git a/src/types/tracker.d.ts b/src/types/tracker.d.ts index 2d1a3ef5..2bac5bf8 100644 --- a/src/types/tracker.d.ts +++ b/src/types/tracker.d.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'events'; -import { ConstructorClientOptions, NetworkParameters } from '.'; +import { ConstructorClientOptions, NetworkParameters, ItemTracked } from '.'; export default Tracker; @@ -72,7 +72,7 @@ declare class Tracker { term: string, parameters: { numResults: number; - itemIds?: string[]; + itemIds: string[]; }, userParameters?: TrackerUserParameters, networkParameters?: NetworkParameters @@ -111,7 +111,7 @@ declare class Tracker { trackPurchase( parameters: { - items: object[]; + items: ItemTracked & {quantity: number}[]; revenue: number; orderId?: string; section?: string; @@ -125,7 +125,7 @@ declare class Tracker { url: string; podId: string; numResultsViewed: number; - items?: object[]; + items?: ItemTracked[]; resultCount?: number; resultPage?: number; resultId?: string; @@ -165,7 +165,7 @@ declare class Tracker { selectedFilters?: object; sortOrder?: string; sortBy?: string; - items?: object[]; + items: ItemTracked[]; }, userParameters?: TrackerUserParameters, networkParameters?: NetworkParameters From 272a1298d30287d70f36dc1b94c4f999b558a4e9 Mon Sep 17 00:00:00 2001 From: Enes Kutay SEZEN Date: Wed, 9 Aug 2023 08:33:09 -0400 Subject: [PATCH 2/2] Remove items from trackRecommendationView type --- src/types/tracker.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/types/tracker.d.ts b/src/types/tracker.d.ts index 2bac5bf8..e6be0108 100644 --- a/src/types/tracker.d.ts +++ b/src/types/tracker.d.ts @@ -125,7 +125,6 @@ declare class Tracker { url: string; podId: string; numResultsViewed: number; - items?: ItemTracked[]; resultCount?: number; resultPage?: number; resultId?: string;