declare const CustomerCookieConsentValues: { /** Customer hasn't given their consent yet. */ readonly UNDEFINED: "UNDEFINED"; /** Collect all types of cookies. */ readonly ACCEPTED: "ACCEPTED"; /** Collect only essential cookies. */ readonly DECLINED: "DECLINED"; /** Collect essential and analytics cookies only. */ readonly ANALYTICS_ONLY: "ANALYTICS_ONLY"; /** Collect essential and personalization cookies. */ readonly PERSONALIZATION_ONLY: "PERSONALIZATION_ONLY"; }; type CustomerCookieConsentType = typeof CustomerCookieConsentValues[keyof typeof CustomerCookieConsentValues]; declare const JsApiPageValues: { readonly ACCOUNT_REGISTRATION: "ACCOUNT_REGISTRATION"; readonly ACCOUNT_RESET_PASSWORD: "ACCOUNT_RESET_PASSWORD"; readonly ACCOUNT_REVIEWS: "ACCOUNT_REVIEWS"; readonly ACCOUNT_ROOT: "ACCOUNT_ROOT"; readonly ACCOUNT_SUBSCRIPTION: "ACCOUNT_SUBSCRIPTION"; readonly CART: "CART"; readonly CATEGORY: "CATEGORY"; readonly CHECKOUT_ADDRESS: "CHECKOUT_ADDRESS"; readonly CHECKOUT_DELIVERY: "CHECKOUT_DELIVERY"; readonly CHECKOUT_ORDER_CONFIRMATION: "ORDER_CONFIRMATION"; readonly CHECKOUT_ORDER_FAILURE: "ORDER_FAILURE"; readonly CHECKOUT_PAYMENT: "CHECKOUT_PAYMENT_DETAILS"; readonly CHECKOUT_RESULT: "CHECKOUT_RESULT"; readonly CHECKOUT_TAX_INFORMATION: "CHECKOUT_TAX_INFORMATION"; readonly DOWNLOAD_ERROR: "DOWNLOAD_ERROR"; readonly FAVORITES: "FAVORITES"; readonly MISSING: "MISSING"; readonly PRODUCT: "PRODUCT"; readonly SEARCH: "SEARCH"; readonly SIGN_IN: "SIGN_IN"; readonly SUBSCRIBE: "SUBSCRIBE_PAGE"; readonly TERMS: "TERMS"; readonly UNSUBSCRIBE: "UNSUBSCRIBE_PAGE"; }; type JsApiPageType = typeof JsApiPageValues[keyof typeof JsApiPageValues]; declare const LegalPageTypeValues: { readonly ABOUT: "about"; readonly PRIVACY_POLICY: "privacy-policy"; readonly RETURNS: "returns"; readonly SHIPPING_PAYMENT: "shipping-payment"; readonly TERMS: "terms"; }; type LegalPageType = typeof LegalPageTypeValues[keyof typeof LegalPageTypeValues]; declare const VisitorLocationSourceValues: { readonly SHIPPING_ADDRESS: "SHIPPING_ADDRESS"; readonly BILLING_ADDRESS: "BILLING_ADDRESS"; readonly IP_ADDRESS: "IP_ADDRESS"; }; type VisitorLocationSourceType = typeof VisitorLocationSourceValues[keyof typeof VisitorLocationSourceValues]; /** Subscription product settings for cart operations. */ interface AddProductRecurringChargeSettings { /** Charge recurring interval. */ recurringInterval: 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; /** Charge recurring interval count. */ recurringIntervalCount: number; } /** Product data for adding to cart. */ interface AddProductData { /** Internal product ID. */ id: number; /** Quantity of the product that will be added to the cart. */ quantity?: number; /** Map of the selected product options (option name as a key and option value as a value). */ options?: Record; /** Selected price for the product with the parameter "nameYourPriceEnabled": true. */ selectedPrice?: string; /** Defines subscription product settings if needed. */ recurringChargeSettings?: AddProductRecurringChargeSettings; } /** Product parameter can be either product ID or product data object. */ type AddProductParameter = number | AddProductData; /** Details about a product added to the shopping cart. */ interface CartItem { /** Quantity of the specific product added to the shopping cart. */ quantity: number; /** Details about the product added to the shopping cart. */ product: CartProduct; /** Map of the selected product options (option name as key and option value as value). */ options: Record; } /** Shopping cart information. */ interface CartData { /** Cart ID. Matches with the cart ID in REST API /carts endpoint. */ cartId: string; /** Order ID, assigned to the cart. Remains the same when an order is placed and becomes * visible to the customer and store owner in notifications and Ecwid admin. */ id: string; /** Internal order ID for Ecwid services. Use id field instead. */ orderId: string; /** Details about products in the shopping cart. */ items: CartItem[]; /** Total quantity of products added to the shopping cart. */ productsQuantity: number; /** Cart subtotal – cost of all products added to the cart without any discounts, taxes, or shipping costs applied. */ subtotal?: number; /** Cart total – total cost of the cart with all available price modifiers applied. */ total?: number; /** Defines if the order uses gross/net prices. */ isPricesIncludeTax?: boolean; /** Total tax applied to the cart. May include taxes to both product and shipping costs. */ tax?: number; /** Name of the discount coupon applied to the cart. Does not contain the actual coupon code. */ couponName?: string; /** Name of the payment method selected by a customer at the storefront. */ paymentMethod?: string; /** Internal "module" for the payment method selected by a customer at the storefront. Only available for Ecwid-build payment methods. */ paymentModule?: string; /** Total weight of products added to the shopping cart. */ weight: number; /** Name of the selected shipping method. Available only when a customer goes to the checkout_payment_details page. */ shippingMethod?: string; /** Details about shipping address. Available only when a customer goes to the shipping_delivery page. */ shippingPerson?: BillingPerson; /** Details about customer's billing address. Has the same format with the shippingPerson. Becomes available only when a customer goes to the payment page. */ billingPerson?: BillingPerson; } /** Details about a product in the shopping cart. */ interface CartProduct { /** Internal product ID. */ id: number; /** Product SKU. */ sku: string; /** Product price before applied taxes, fees, or discounts. */ price: number; /** If true, product allows customer to set their own price for it. */ isCustomerSetPrice?: boolean; /** If isCustomerSetPrice is true, contains a custom price for the product that the customer entered before adding a product to the cart. */ selectedPrice?: number; /** Product name. */ name: string; /** Product weight. */ weight: number; /** Product description truncated to 120 characters. */ shortDescription: string; /** Link to the product page. */ url: string; /** If selected options match with one of product variations, this field contains the ID of product variation added to the cart. */ variation?: number; /** Details about product media (images and video). */ mediaItem?: CartMediaItem; /** Details about subscription customer has chosen for the product. Only available for subscription products. */ recurringChargeSettings?: RecurringChargeSettings; } /** Details about product media (images and video) in the cart. */ interface CartMediaItem { /** Media type. */ type: 'PICTURE' | 'VIDEO'; /** Defines if the image is main for the product. Products can have only one main image * and multiple secondary ones referred as the "gallery". Only for PICTURE type. */ isMain?: boolean; /** Internal image ID. Only for PICTURE type. */ id?: string; /** Details about image border. Only for PICTURE type. */ borderInfo?: CartImageBorderInfo; /** Image width in pixels. Only for PICTURE type. */ width?: number; /** Image height in pixels. Only for PICTURE type. */ height?: number; /** Link to the image resized to fit 160x160px container. Only for PICTURE type. */ image160pxUrl?: string; /** Link to the image resized to fit 400x400px container. Only for PICTURE type. */ image400pxUrl?: string; /** Link to the image resized to fit 800x800px container. Only for PICTURE type. */ image800pxUrl?: string; /** Details about embedded video. Only for VIDEO type. */ videoInfo?: CartVideoInfo; } /** Details about embedded video in cart items. */ interface CartVideoInfo { /** String with HTML code for video embedding. */ embedHtml: string; /** Link to the video. */ url: string; /** Width of the embedded video. */ width: number; /** Height of the embedded video. */ height: number; } /** Details about image border in cart items. */ interface CartImageBorderInfo { /** Border color in specific cart format. */ dominatingColor: CartDominatingColor; /** Defines if an image is homogeneous. */ homogeneity: boolean; } /** Border color information for cart images. */ interface CartDominatingColor { /** True if the image is considered dark. */ isDark: boolean; /** True if the image is considered transparent. */ isFullyTransparent: boolean; /** HEX code for the calculated "medium" color of all outside pixels of the image, for example #2e3236. */ rbgHexValue: string; } /** Details about subscription settings for cart products. */ interface RecurringChargeSettings { /** Index of the current recurring interval. */ recurringIntervalCount: number; /** How often subscription charges will happen. */ recurringSubscriptionInterval: 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; /** Additional fee to the first payment for the subscription. */ signUpFee: number; /** Total price of the first subscription payment. */ subscriptionPriceWithSignUpFee: number; } /** Order calculation result returned by Cart.calculateTotal method. */ interface Order { /** Contains full cart details after calculation matching the Cart.get() result. */ cart: CartData; /** Total discount from applied coupons. */ couponDiscount: number; /** Discount value from customer group discounts. */ customerGroupDiscount: number; /** Absolute discount from customer group discounts. */ customerGroupVolumeDiscount: number; /** Total discount value from all sources. */ discount: number; /** Total fees applied to order. */ handlingFee: number; /** Total fees applied to order before taxes. */ handlingFeeWithoutTax: number; /** Specifies if product prices include taxes defining tax calculation formulae. */ pricesIncludeTax: boolean; /** Total shipping cost. */ shipping: number; /** Total shipping cost before taxes applied. */ shippingWithoutTax: number; /** Order subtotal. Includes the shopping cart total with discounts and taxes but without shipping costs or handling fees. */ subtotal: number; /** Order subtotal before applied taxes. */ subtotalWithoutTax: number; /** Total sum of taxes applied to order. */ tax: number; /** Order total that includes all costs, fees, taxes, and discounts. */ total: number; /** Order total before taxes applied. */ totalWithoutTax: number; /** Total discount for order subtotal. */ volumeDiscount: number; } type CartGetCallback = (cart: CartData) => void; type CartAddProductCallback = (success: boolean, product: CartProduct, cart: CartData, error?: string) => void; type CartRemoveProductCallback = (success: boolean, itemsRemovedQuantity: number, product: CartProduct, cart: CartData, error?: string) => void; type CartClearCallback = (success: boolean, error?: string) => void; type CartCalculateTotalCallback = (order: Order) => void; type CartGoToCheckoutCallback = () => void; interface CartApi { get: (callback?: CartGetCallback) => Promise; addProduct: (product: AddProductParameter, callback?: CartAddProductCallback) => Promise; removeProduct: (index: number, callback?: CartRemoveProductCallback) => Promise; removeProducts: (indices: number[], callback?: CartRemoveProductCallback) => Promise; clear: (callback?: CartClearCallback) => Promise; calculateTotal: (callback?: CartCalculateTotalCallback) => Promise; gotoCheckout: (callback?: CartGoToCheckoutCallback) => Promise; canGotoCheckout: () => Promise; } type CustomerGetCallback = (customer: CustomerData | null) => void; type CustomerSignOutCallback = (success: boolean, error?: string) => void; interface CustomerApi { get: (callback?: CustomerGetCallback) => Promise; signOut: (callback?: CustomerSignOutCallback) => Promise; } interface BillingPerson { /** Full name of the customer. */ name: string; /** Customer's company name. */ companyName: string; /** Address line 1 and address line 2, separated by \n. */ street: string; /** City. */ city: string; /** Two-letter country code. */ countryCode: string; /** Country name. */ countryName: string; /** Postal/ZIP code. */ postalCode: string; /** State/province code, for example, NY. */ stateOrProvinceCode: string; /** Customer's phone number. */ phone: string; } interface ShippingAddress { /** Ordered ID of saved shipping address. * Starts with 0 and iterates by 1. */ id: number; /** Details of the saved shipping address. */ person: BillingPerson; } interface CustomerData { /** Customer's email. */ email: string; /** Customer's internal ID. */ id: number; /** Internal store ID. */ ownerId: number; /** Customer's registration date in a stringified UNIX timestamp format. * For example, "1718010611". */ registered: string; /** Customer's saved billing address. */ billingPerson: BillingPerson; /** Customer's saved shipping addresses. */ shippingAddresses: ShippingAddress[]; } interface JsApiAccountFavoritesPage extends BaseJsApiPage { type: typeof JsApiPageValues.FAVORITES; } interface JsApiAccountRegistrationPage extends BaseJsApiPage { type: typeof JsApiPageValues.ACCOUNT_REGISTRATION; } interface JsApiAccountResetPasswordPage extends BaseJsApiPage { type: typeof JsApiPageValues.ACCOUNT_RESET_PASSWORD; } interface JsApiAccountReviewsPage extends BaseJsApiPage { type: typeof JsApiPageValues.ACCOUNT_REVIEWS; published?: boolean; moderated?: boolean; } interface JsApiAccountRootPage extends BaseJsApiPage { type: typeof JsApiPageValues.ACCOUNT_ROOT; } interface JsApiAccountSubscriptionPage extends BaseJsApiPage { type: typeof JsApiPageValues.ACCOUNT_SUBSCRIPTION; subscriptionId?: number; } interface JsApiCartPage extends BaseJsApiPage { type: typeof JsApiPageValues.CART; } interface JsApiFilterParams { attributes: Record; categories: number[] | undefined; includeProductsFromSubcategories: boolean; inventory: string | undefined; keyword: string | undefined; onsale: string | undefined; options: Record; priceFrom: number | undefined; priceTo: number | undefined; sku: string | undefined; } interface JsApiCategoryPage extends BaseJsApiPage { type: typeof JsApiPageValues.CATEGORY; categoryId: number; filterParams: JsApiFilterParams; name?: string; offset: number; limit: number; sort: string; } interface JsApiCheckoutAddressPage extends BaseJsApiPage { type: typeof JsApiPageValues.CHECKOUT_ADDRESS; } interface JsApiCheckoutDeliveryPage extends BaseJsApiPage { type: typeof JsApiPageValues.CHECKOUT_DELIVERY; } interface JsApiCheckoutOrderConfirmationPage extends BaseJsApiPage { type: typeof JsApiPageValues.CHECKOUT_ORDER_CONFIRMATION; } interface JsApiCheckoutOrderFailurePage extends BaseJsApiPage { type: typeof JsApiPageValues.CHECKOUT_ORDER_FAILURE; } interface JsApiCheckoutPaymentPage extends BaseJsApiPage { type: typeof JsApiPageValues.CHECKOUT_PAYMENT; } interface JsApiCheckoutResultPage extends BaseJsApiPage { type: typeof JsApiPageValues.CHECKOUT_RESULT; } interface JsApiCheckoutTaxInformationPage extends BaseJsApiPage { type: typeof JsApiPageValues.CHECKOUT_TAX_INFORMATION; } interface JsApiDownloadErrorPage extends BaseJsApiPage { type: typeof JsApiPageValues.DOWNLOAD_ERROR; } interface JsApiMissingPage extends BaseJsApiPage { type: typeof JsApiPageValues.MISSING; } interface JsApiProductPage extends BaseJsApiPage { type: typeof JsApiPageValues.PRODUCT; categoryId: number; mainCategoryId: number; name: string; nameTranslated: Record; productId: number; } interface JsApiSearchPage extends BaseJsApiPage { type: typeof JsApiPageValues.SEARCH; filterParams: JsApiFilterParams; keywords: string | undefined; offset: number; limit: number; sort: string; } interface JsApiSignInPage extends BaseJsApiPage { type: typeof JsApiPageValues.SIGN_IN; } interface JsApiSubscribePage extends BaseJsApiPage { type: typeof JsApiPageValues.SUBSCRIBE; key?: string; } interface JsApiTermsPage extends BaseJsApiPage { type: typeof JsApiPageValues.TERMS; page?: LegalPageType; } interface JsApiUnsubscribePage extends BaseJsApiPage { type: typeof JsApiPageValues.UNSUBSCRIBE; key?: string; } interface BaseJsApiPage { type: JsApiPageType; hasPrevious: boolean; } type JsApiPage = JsApiAccountFavoritesPage | JsApiAccountRegistrationPage | JsApiAccountResetPasswordPage | JsApiAccountReviewsPage | JsApiAccountRootPage | JsApiAccountSubscriptionPage | JsApiCartPage | JsApiCategoryPage | JsApiCheckoutAddressPage | JsApiCheckoutDeliveryPage | JsApiCheckoutOrderConfirmationPage | JsApiCheckoutOrderFailurePage | JsApiCheckoutPaymentPage | JsApiCheckoutResultPage | JsApiCheckoutTaxInformationPage | JsApiDownloadErrorPage | JsApiMissingPage | JsApiProductPage | JsApiSearchPage | JsApiSignInPage | JsApiSubscribePage | JsApiTermsPage | JsApiUnsubscribePage; interface EcwidApiPromise { add(callback: (result: T) => void): void; } interface TrackingConsent { /** Customer's cookie consent. */ userResponse?: CustomerCookieConsentType; /** True if store requests customer consent, false otherwise. */ askConsent?: boolean; } interface VisitorLocation { /** Country code (null if not found) in ISO 639-1. */ countryCode: string | null; /** State code (null if not found) in ISO 639-1. */ stateCode: string | null; /** The source of the received country code and state code. */ source: VisitorLocationSourceType; } export { LegalPageTypeValues as L, CustomerCookieConsentValues as r, JsApiPageValues as w, VisitorLocationSourceValues as x }; export type { AddProductData as A, BaseJsApiPage as B, CartAddProductCallback as C, EcwidApiPromise as E, JsApiFilterParams as J, Order as O, RecurringChargeSettings as R, ShippingAddress as S, TrackingConsent as T, VisitorLocation as V, AddProductParameter as a, AddProductRecurringChargeSettings as b, BillingPerson as c, CartApi as d, CartCalculateTotalCallback as e, CartClearCallback as f, CartData as g, CartDominatingColor as h, CartGetCallback as i, CartGoToCheckoutCallback as j, CartImageBorderInfo as k, CartItem as l, CartMediaItem as m, CartProduct as n, CartRemoveProductCallback as o, CartVideoInfo as p, CustomerApi as q, CustomerData as s, CustomerGetCallback as t, CustomerSignOutCallback as u, JsApiPage as v, CustomerCookieConsentType as y };