UNPKG

@appmetrica/react-native-analytics

Version:
58 lines 2.13 kB
export type ECommerceScreen = { name: string; searchQuery?: string; payload?: Map<string, string> | Record<string, string>; categoriesPath?: Array<string>; }; export type ECommerceAmount = { amount: number | string; unit: string; }; export type ECommercePrice = { amount: ECommerceAmount; internalComponents?: Array<ECommerceAmount>; }; export type ECommerceProduct = { sku: string; name?: string; actualPrice?: ECommercePrice; originalPrice?: ECommercePrice; promocodes?: Array<string>; categoriesPath?: Array<string>; payload?: Map<string, string> | Record<string, string>; }; export type ECommerceReferrer = { type?: string; identifier?: string; screen?: ECommerceScreen; }; export type ECommerceCartItem = { product: ECommerceProduct; price: ECommercePrice; quantity: number | string; referrer?: ECommerceReferrer; }; export type ECommerceOrder = { orderId: string; products: Array<ECommerceCartItem>; payload?: Map<string, string> | Record<string, string>; }; export type ECommerceEventType = 'showSceenEvent' | 'showProductCardEvent' | 'showProductDetailsEvent' | 'addCartItemEvent' | 'removeCartItemEvent' | 'beginCheckoutEvent' | 'purchaseEvent'; export interface ECommerceEvent { ecommerceEvent: ECommerceEventType; ecommerceScreen?: ECommerceScreen; product?: ECommerceProduct; referrer?: ECommerceReferrer; cartItem?: ECommerceCartItem; order?: ECommerceOrder; } export declare class ECommerce { static showScreenEvent(screen: ECommerceScreen): ECommerceEvent; static showProductCardEvent(product: ECommerceProduct, screen: ECommerceScreen): ECommerceEvent; static showProductDetailsEvent(product: ECommerceProduct, referrer?: ECommerceReferrer): ECommerceEvent; static addCartItemEvent(item: ECommerceCartItem): ECommerceEvent; static removeCartItemEvent(item: ECommerceCartItem): ECommerceEvent; static beginCheckoutEvent(order: ECommerceOrder): ECommerceEvent; static purchaseEvent(order: ECommerceOrder): ECommerceEvent; } //# sourceMappingURL=ecommerce.d.ts.map