import { OnsiteCoreWindow } from "@mailbiz/onsite-core"; //#region [Window] interface TrayWindow extends OnsiteCoreWindow { dataLayer?: DataLayerObject; tray?: TrayContextProps; globalCart?: TrayGlobalCart; } //#endregion interface TrayContextProps { store?: { observers?: { checkout$: TrayObserverEntity; }; }; } interface TrayObserverEntity { subscribe: (cb: Function) => { unsubscribe: Function; }; } type DataLayerObject = Array; interface DataLayerBaseEvent { event: string; } interface DataLayerProductEvent extends DataLayerBaseEvent { pageTitle: string; pageCategory: string; siteSearchFrom: string; idProduct: string; nameProduct: string; category: string; idCategory: string; priceSell: string; promotion: string; price: string; brand: string; reference: string; model: string; availability: string; availabilityDetails: string; urlImage: string; urlProduct: string; listSku: Array<{ idSku: string; nameSku: string; price: string; sellPrice: string; availability: string; reference: string; urlImage: string; priceSellDetails: Array<{ name: string; "installment.months": string; "installment.amount": string; }>; EAN: string; }>; characteristcs: Array<{ description: string; value: string; }>; priceSellDetails: Array<{ name: string; "installment.months": string; "installment.amount": string; }>; EAN: string; breadcrumbDetails: Array<{ id: string; name: string; level: number; }>; freeShipping: string; hot: string; additionalButton: string; release: string; rating: { count: string; average: string; }; breadcrumb: string; } interface DataLayerUpdateGTMEvent extends DataLayerBaseEvent, DataLayerBaseAccountEvent { visitorLoginState: string; visitorId: string; visitorSessionID: string; visitorType: string; visitorLifetimeValue: number; customerType: string; visitorDemographicInfo?: { zipCode: string; address: string; city: string; neighborhood: string; state: string; gender: string; age: string; additional: string; }; allow_mail: string; siteSearchFrom: string; } interface DataLayerAccount extends DataLayerBaseAccountEvent { pageCategory: string; pageTitle: string; allow_mail: number; customerType: string; customerProfileName: string; customerProfileId: string; visitorDemographicInfo: { address: string; age: any; city: string; gender: string; neighborhood: string; state: string; zipCode: string; }; visitorSessionId: string; } interface DataLayerBaseAccountEvent extends DataLayerBaseEvent { customerName: string; customerEmail: string; customerId: number; } interface TrayGlobalCart { isNewCustomer: boolean; statusCode: number; data: { features: string[]; cart: { orderId: any; lastOrderId: any; customerNote: string; storeNote: string; products: Array<{ id: string; quantity: string; price: string; variant_id: string; additional_information: string; name: string; date: string; bought_together_id: string; cart_id: string; text_variant: string; id_campaign: string; is_giveaways: string; PaymentMethodByProduct: Array; id_item: string; Category: { id: string; name: string; tree: Array<{ id: number; name: string; level: number; }>; }; url: { http: string; https: string; }; ncm: string; stock: string; ean: string; reference: string; original_name: string; available: string; brand: string; Variant: Array; price_itens_kit: string; can_be_wrapped: string; has_wrap_available: string; Tax: Array; sub_total: string; name_extras: Array; additional_information_extras: Array; sku_ga: string; virtual_product: boolean; images: { small: string; medium: string; large: string; }; has_variation: boolean; is_giveaway: boolean; }>; store: { id: string; name: string; url: string; cart_url: string; }; paymentMethods: Array; shippingMethods: Array; shippingChosen: { id: string; name: string; original_name: string; price: number; min_period: number; max_period: number; estimated_delivery_date: string; traced_estimated_delivery_date: string; show_details_in_cart: boolean; zip_code: string; tax_name: string; tax_value: number; total: number; city: string; state: string; country: any; identifier: any; information: any; short_information: any; home_delivery: number; checkout: string; hash: string; original_hash: string; advance_payment: string; integrator: string; use_information: boolean; id_quotation: string; fob_exibe_valor: boolean; fob: boolean; show_text_free_shipping: boolean; capital: string; pickup: string; pickupOptions: Array; location: { shippingId: any; identifier: string; code: string; name: string; cnpj: string; stateRegistration: number; address: Array; operation: Array; geographicLocation: Array; phone: string; values: Array; hash: string; cellphone: string; images: string; }; fobShowValue: boolean; }; customer: any; maxDaysToKeepWaitingPix: any; payment: Array; pointSale: string; cacheControl: string; hashVersionControl: any; processed: any; finalized: any; paymentErrorsMessages: Array; paymentResponseMessages: any; transactionId: any; isPaymentLocal: boolean; byQuestion: any; cardChosen: any; productsVersion: string; urlCallback: any; partner: { id: any; name: any; site: any; commission: any; }; onlyVirtualProducts: boolean; customerAttributes: Array; configurations: { easy: { default_maximum_age: number; }; isBirthDateRequired: string; birthDateRequiredOption: string; duplicateCpf: string; duplicateCnpj: string; minimumAgeText: string; multiAddressEnabled: string; receiverNameRequired: string; internationalShipping: string; contractTermEnabled: string; contractTermText: string; acceptsDuplicateCPF: boolean; campaign_exhibition_percent: string; acceptsDuplicateCNPJ: boolean; isPhoneVisible: string; personTypeEnabled: string; cpf: string; cnpj: string; gender: string; rg: string; currency: string; maximumAgeLimit: string; minimumAgeLimit: string; minimumAgeLimitPurchaseMessage: string; maximumAgeLimitPurchaseMessage: string; minimumAgeLimitRegistrationMessage: string; maximumAgeLimitRegistrationMessage: string; enableMinMaxAge: number; lang: string; onlyPaypal: string; phoneTypeRequired: string; requiredVariation: string; removeTax: string; newCart: string; saleWithoutStock: string; showStockInCart: string; showBrandInCart: string; shippingSelect: string; showZipCodeInCart: string; showProductReference: string; giveawayProductChooseObligatory: string; newCentral: string; freeShippingDeadlineInitial: string; freeShippingDeadlineFinal: string; }; wishList: any; countries: any; countriesFlags: any; couponCode: string; shoppingLimitation: any; fileUpload: any; giftWrap: any; giftCard: any; giveaways: Array; integrations: Array; sessionId: string; total: number; subTotal: number; shipping: any; reseller: boolean; urlBankSlip: any; available: number; previousProductsInfos: Array<{ product_id: string; variant_id: string; price: string; bought_together_id: string; id_item: string; isCampaignProduct: string; price_itens_kit: string; additional_info_kit: string; variants_kit: string; }>; hasGatewayProcessError: boolean; accessCode: any; terms: string; cartAdditionalValues: Array; checkout: { total: number; subtotal: number; shipping: number; message: any; taxes: number; additional: number; taxName: string; progressiveDiscount: number; shippingProgressiveDiscount: number; discount: string; couponDiscount: number; partialPaymentDiscount: number; giftWrap: number; giftCard: number; bankAccountList: any; paymentSelectToFinalize: any; paymentFormDiscount: number; paymentFormIncrease: number; paymentSplitInterest: number; cartAdditionalValuesTotal: number; }; paymentMethodChosen: any; }; }; } declare global { interface Window extends TrayWindow { } }