Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSL-2655] Update items parameter type in tracker module #166

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,9 @@ export interface SearchabilityConfiguration {
displayable?: boolean,
hidden?: boolean,
}

export interface ItemTracked {
itemName?: string;
itemId?: string;
variationId?: string;
}
9 changes: 4 additions & 5 deletions src/types/tracker.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from 'events';
import { ConstructorClientOptions, NetworkParameters } from '.';
import { ConstructorClientOptions, NetworkParameters, ItemTracked } from '.';

export default Tracker;

Expand Down Expand Up @@ -72,7 +72,7 @@ declare class Tracker {
term: string,
parameters: {
numResults: number;
itemIds?: string[];
itemIds: string[];
},
userParameters?: TrackerUserParameters,
networkParameters?: NetworkParameters
Expand Down Expand Up @@ -111,7 +111,7 @@ declare class Tracker {

trackPurchase(
parameters: {
items: object[];
items: ItemTracked & {quantity: number}[];
revenue: number;
orderId?: string;
section?: string;
Expand All @@ -125,7 +125,6 @@ declare class Tracker {
url: string;
podId: string;
numResultsViewed: number;
items?: object[];
resultCount?: number;
resultPage?: number;
resultId?: string;
Expand Down Expand Up @@ -165,7 +164,7 @@ declare class Tracker {
selectedFilters?: object;
sortOrder?: string;
sortBy?: string;
items?: object[];
items: ItemTracked[];
},
userParameters?: TrackerUserParameters,
networkParameters?: NetworkParameters
Expand Down
Loading