UNPKG

@chargebee/atomicpricing

Version:

JS wrapper for your Atomic Pricing hosted page

60 lines (59 loc) 1.84 kB
import { Address, Entity, Quantity, SubscriptionAttributes, Visitor } from '../../types'; export declare const EventKeys: { THEME_UPDATED: string; PAGE_LOAD: string; DIMENSION: string; SET_VISITOR: string; SET_QUANTITY: string; SET_BILLING_ADDRESS: string; SET_SHIPPING_ADDRESS: string; SET_BUSINESS_ENTITY: string; SET_PRICE_VARIANT: string; SET_SUBSCRIPTION_ATTRIBUTES: string; }; export type EventData = { source: 'pricify'; type: EventType; payload: EventPayload; }; export type EventType = (typeof EventKeys)[keyof typeof EventKeys]; export type EventPayload = PageLoadEvent | DimensionEvent | SetVisitorEvent | SetQuantityEvent | SetBillingAddressEvent | SetShippingAddressEvent | SetSubscriptionAttributesEvent | SetBusinessEntityEvent; export type EventOptions = { siteId: string; pricingPageId: string; }; export type BaseEvent = { siteId?: string; pricingPageId?: string; sessionId?: string; }; export type PageLoadEvent = { pricingPage?: any; } & BaseEvent; export type DimensionEvent = { window?: { height: number; width: number; }; scroll?: { height: number; width: number; }; } & BaseEvent; export type SetVisitorEvent = Visitor & BaseEvent; export type SetQuantityEvent = Quantity & BaseEvent; export type SetBillingAddressEvent = Address & BaseEvent; export type SetShippingAddressEvent = Address & BaseEvent; export type SetBusinessEntityEvent = Entity & BaseEvent; export type SetPriceVariantEvent = Entity & BaseEvent; export type SetSubscriptionAttributesEvent = SubscriptionAttributes & BaseEvent; export type HostedPricingPage = { id: string; type: string; state: string; url: string; embed: boolean; created_at: number; expires_at: number; object: string; };