import { PageType } from "../../../commons/types/page-type"; import { Event, EventType } from "../../../event/core/event"; /** * Front view data. * * @interface FrontViewData */ export interface FrontViewData { page: PageType; position: string; storeFront: string; products: string[]; locale?: string; channel?: string; } /** * DataLayer front view event. * * @export * @class DataLayerFrontViewEvent * @extends {Event} */ export class DataLayerFrontViewEvent extends Event { public page: PageType; public area: string; public storefront: string; public products: string[]; public locale?: string; public channel?: string; public type: EventType = EventType.FrontView; /** * Creates an instance of DataLayerFrontViewEvent. * * @param {FrontViewData} data * @memberof DataLayerFrontViewEvent */ constructor(data: FrontViewData) { super(); this.page = data.page; this.area = data.position; this.storefront = data.storeFront; this.products = data.products; this.locale = data.locale; this.channel = data.channel; } }