import type { EmptyObject } from '@xylabs/sdk-js' import { GoogleStandardEvent } from './StandardEvent.ts' export interface GoogleBaseProperties extends Record { lib: 'xyga' } export interface GoogleAnalyticsItem { affiliation?: string coupon?: string currency?: string discount?: number item_brand?: string item_category?: string item_id: string item_name: string item_variant?: string price?: number quantity?: number } export interface GoogleAdwordsItem { google_business_vertical: 'retail' id: string } export interface GoogleItem extends GoogleAdwordsItem, GoogleAnalyticsItem {} export interface GoogleValueProperties extends Record { currency?: string value?: number } export interface GoogleItemsProperties extends Record { items?: GoogleItem[] } export interface GoogleAddPaymentInfoProperties extends GoogleValueProperties, GoogleItemsProperties { coupon?: string payment_type?: string } export interface GoogleAddShippingInfoProperties extends GoogleValueProperties, GoogleItemsProperties { coupon?: string shipping_tier?: string } export interface GoogleCartProperties extends GoogleValueProperties, GoogleItemsProperties {} export type GoogleAddToCartProperties = GoogleCartProperties export type GoogleRemoveFromCartProperties = GoogleCartProperties export type GoogleViewCartProperties = GoogleCartProperties export type GoogleViewItemProperties = GoogleCartProperties export interface GoogleAddToWishlistProperties extends GoogleValueProperties, GoogleItemsProperties {} export interface GoogleEarnVirtualCurrencyProperties extends Record { value?: number virtual_currency_name?: string } export interface GoogleSpendVirtualCurrencyProperties extends GoogleEarnVirtualCurrencyProperties { item_name?: string } export interface GoogleBeginCheckoutProperties extends GoogleValueProperties, GoogleItemsProperties { coupon?: string } export interface GoogleJoinGroupProperties extends Record { group_id?: string } export interface GoogleSelectItemProperties extends GoogleItemsProperties { item_list_id?: string item_list_name?: string } export interface GoogleViewItemListProperties extends GoogleItemsProperties { item_list_id?: string item_list_name?: string } export interface GooglePromotionProperties { creative_name?: string creative_slot?: string location_id?: string promotion_id?: string promotion_name?: string } export interface GoogleSelectPromotionProperties extends GoogleItemsProperties, GooglePromotionProperties {} export interface GoogleViewPromotionProperties extends GoogleItemsProperties, GooglePromotionProperties {} export interface GooglePurchaseProperties extends GoogleValueProperties, GoogleItemsProperties { affiliation?: string coupon?: string shipping?: number tax?: number transaction_id?: string } export interface GoogleRefundProperties extends GoogleValueProperties, GoogleItemsProperties { affiliation?: string coupon?: string shipping?: number tax?: number transaction_id?: string } export class GoogleStandardEvents { addPaymentInfo() { return new GoogleStandardEvent('add_paymennt_info') } addShippingInfo() { return new GoogleStandardEvent('add_shipping_info') } addToCart() { return new GoogleStandardEvent('add_to_cart') } addToWishList() { return new GoogleStandardEvent('add_to_wishlist') } beginCheckout() { return new GoogleStandardEvent('begin_checkout') } earnVirtualCurrency() { return new GoogleStandardEvent('earn_virtual_currency') } generateLead() { return new GoogleStandardEvent('generate_lead') } joinGroup() { return new GoogleStandardEvent('join_group') } levelEnd() { return new GoogleStandardEvent('level_end') } levelStart() { return new GoogleStandardEvent('level_start') } levelUp() { return new GoogleStandardEvent('level_up') } login() { return new GoogleStandardEvent('login') } postScore() { return new GoogleStandardEvent('post_score') } purchase() { return new GoogleStandardEvent('purchase') } refund() { return new GoogleStandardEvent('refund') } removeFromCart() { return new GoogleStandardEvent('remove_from_cart') } search() { return new GoogleStandardEvent('search') } selectContent() { return new GoogleStandardEvent('select_content') } selectItem() { return new GoogleStandardEvent('select_item') } selectPromotion() { return new GoogleStandardEvent('select_promotion') } share() { return new GoogleStandardEvent('share') } signUp() { return new GoogleStandardEvent('sign_up') } spendVirtualCurrency() { return new GoogleStandardEvent('spend_virtual_currency') } tutorialBegin() { return new GoogleStandardEvent('tutorial_begin') } tutorialComplete() { return new GoogleStandardEvent('tutorial_complete') } unlockAchievement() { return new GoogleStandardEvent('unlock_achievement') } viewCart() { return new GoogleStandardEvent('view_cart') } viewItem() { return new GoogleStandardEvent('view_item') } viewItemList() { return new GoogleStandardEvent('view_item_list') } viewPromotion() { return new GoogleStandardEvent('view_promotion') } }