/* eslint-disable @typescript-eslint/camelcase */ import { PageType } from "../../../commons/types/page-type"; import { Event, EventType } from "../../../event/core/event"; export enum AutocompleteClickType { ProductClick = "product_click", SearchSuggestionClick = "search_suggestion_click", TopSearchClick = "top_search_click", HistoryClick = "history_click", SeeAllClick = "see_all_click", } export interface ClickData { click_type: AutocompleteClickType; page: PageType; product?: string; position?: number; text: string; locale?: string; channel?: string; session?: string; anonymous?: string; } /** * DataLayer search query event. * * @export * @class DataLayerAutocompleteClick * @extends {Event} */ export class DataLayerAutocompleteClick extends Event { click_type: AutocompleteClickType; page: PageType; product?: string; position?: number; text: string; locale?: string; channel?: string; public type: EventType = EventType.AutocompleteClick; /** * Creates an instance of DataLayerAutocompleteClick. * * @param {ClickData} data * @memberof DataLayerAutocompleteClick */ constructor({ click_type, page, product, position, text, locale, channel, session, anonymous }: ClickData) { super(session, anonymous); this.click_type = click_type; this.page = page; this.product = product; this.position = position; this.text = text; this.locale = locale; this.channel = channel; } }