/// <reference types="react" />
import { SiteModel } from './components/_cms-components/site/site';
import { EVENT_ON_MODAL_CLOSE, EventBus } from './tipser-events';
import { TipserProductModel, TipserProductVariantModel } from './components/product/model';
import { Pushable } from './tipser-elements-provider';
import { CartApi } from './api/cart-api';
import { CheckoutApi } from './api/checkout-api';
import { LegacyCheckoutApi } from './api/legacy-checkout-api';
import { TokenApi } from './api/token-api';
import { ProfileApi } from './api/profile-api';
import { MarketApi } from './api/market-api';
import { CheckoutDeliveryAddressData } from './components/modular-checkout/types';
import { TipserEnv } from './common/enums/env';
import { TipserLang } from './common/enums/tipser-lang';
import { ProductApi } from './api/product-api';
import { EVENT_ON_ADD_TO_CART, EVENT_ON_QUANTITY_CHANGE, EVENT_ON_REMOVE_FROM_CART } from './components/cart-icon/cart-events';
import { EVENT_ON_ERROR } from './tipser-error';
import { CartItemModel } from './api/cart-types';
import { EVENT_ON_ANALYTICS } from './common/analytics/consts';
import { TrackingPayload, TrackingPayloadObject } from './common/analytics/tracking-payload';
import { BoltApi } from './api/bolt-api';
import { ExperimentsApi } from './api/experiments-api';
import { ShopperAccountApi } from './api/shopper-account-api';
import { GetTipserApiUrl } from './common/tipser-urls/tipser-urls';
import { CountryCode } from './common/market-metadata';
export declare type CustomLabelKey = 'buy' | 'add_to_cart' | 'choose_variant' | 'out_of_stock' | 'notify_me' | 'added_to_cart' | 'buy_now';
export declare type CustomUrlPlainPathOrFunction = string | ((productId: string) => string);
export interface CustomUrls {
    productBaseUrl?: CustomUrlPlainPathOrFunction;
    checkoutConfirmationUrl?: string;
    checkoutUrl?: string;
    cartUrl?: string;
}
export declare const isCustomUrlPlainPath: (customUrl: CustomUrlPlainPathOrFunction) => customUrl is string;
interface PrePopulatedAddress {
    delivery?: Partial<CheckoutDeliveryAddressData>;
    billing?: Partial<CheckoutDeliveryAddressData>;
}
declare type ModalUiSettings = {
    hideSimilarProducts?: boolean;
    hideCartIcon?: boolean;
    inheritStyles?: boolean;
};
export declare type LinkMetadata = {
    url: string;
    scanned: boolean;
    product?: TipserProductModel;
};
export declare type LinkReplacementConfig = {
    enabled: boolean;
    market: CountryCode;
    urls?: string[];
    withObserver?: boolean;
    onClick?: (target: LinkMetadata, resume: (confirm: boolean) => void) => void;
    customClass?: string;
};
/**
 * This configuration interface should reflect publicly documented configuration.
 * Non optional properties, are eventually set by default values
 */
declare type DefaultConfig = {
    cms: object;
    gaTrackingCode: string;
    contentfulApiKey: string;
    contentfulSpace: string;
    site: SiteModel;
    contentfulEnv: string;
    isGaEnabled: boolean;
    addToCartSettings: {
        directToCheckoutMode?: boolean;
    };
    customUrls: CustomUrls;
    addToCartPopup: {
        className?: string;
        duration?: number;
    };
    defaultAddedToCartPopup: boolean;
    useDefaultErrorHandler: boolean;
    eventHandlers: TipserConfigEventHandlers;
    customLabels: {
        [key in CustomLabelKey]?: string;
    };
    disableAnalytics: boolean;
    disableCartIconDropdown: boolean;
    modalUi: ModalUiSettings;
    env: TipserEnv;
    lang: TipserLang;
    primaryColor: string;
    history: Pushable;
    linkReplacement: LinkReplacementConfig;
};
export declare type TipserElementsConfig = {
    env?: TipserEnv;
    lang?: TipserLang;
    defaultAddedToCartPopup?: boolean;
    useDefaultErrorHandler?: boolean;
    /**
     * @deprecated The property should not be used. Use eventHandlers instead of it
     */
    eventsHandlers?: TipserConfigEventHandlers;
    eventHandlers?: TipserConfigEventHandlers;
    customLabels?: {
        [key in CustomLabelKey]?: string;
    };
    disableAnalytics?: boolean;
    addToCartSettings?: {
        directToCheckoutMode?: boolean;
    };
    checkoutLabels?: {
        backToCartButton?: string;
    };
    dialogChildren?: JSX.Element;
    customUrls?: CustomUrls;
    disableCartIconDropdown?: boolean;
    dataAvailability?: {
        styleWithProductsAvailable?: boolean;
    };
    prePopulatedAddress?: PrePopulatedAddress;
    posData?: string;
    primaryColor?: string;
    modalUi?: ModalUiSettings;
    addToCartPopup?: {
        className?: string;
        duration?: number;
    };
    sessionId?: string;
    linkReplacement?: LinkReplacementConfig;
};
/**
 * Defines everything that is inside of Tipser's React context:
 */
export declare type TipserContextData = DefaultConfig & TipserElementsConfig & {
    posId: string;
    api: TipserApi;
    tipserApiUrl: string;
    events: EventBus;
    ga?: string;
    history?: Pushable;
};
export declare type CartChangeEventHandlerPayload = {
    product: CartItemModel;
    cartSize?: number;
};
export declare type AddToCartEventHandlerPayload = CartChangeEventHandlerPayload & {
    selectedVariant: TipserProductVariantModel;
};
export interface TipserConfigEventHandlers {
    [EVENT_ON_ADD_TO_CART]?: (params: AddToCartEventHandlerPayload) => void;
    [EVENT_ON_REMOVE_FROM_CART]?: (params: CartChangeEventHandlerPayload) => void;
    [EVENT_ON_QUANTITY_CHANGE]?: (params: CartChangeEventHandlerPayload) => void;
    [EVENT_ON_MODAL_CLOSE]?: () => void;
    [EVENT_ON_ERROR]?: () => void;
    [EVENT_ON_ANALYTICS]?: (e: TrackingPayload<TrackingPayloadObject>) => void;
}
export declare type TipserApi = {
    bolt: BoltApi;
    cart: CartApi;
    checkout: CheckoutApi;
    legacyCheckout: LegacyCheckoutApi;
    market: MarketApi;
    product: ProductApi;
    profile: ProfileApi;
    shopperAccount: ShopperAccountApi;
    token: TokenApi;
    experiments: ExperimentsApi;
};
export declare function addDefaultContextData(params: {
    config: TipserElementsConfig;
    posId: string;
    history?: Pushable;
    events: EventBus;
    api: TipserApi;
    tipserApiUrl: GetTipserApiUrl;
}): TipserContextData;
export declare const validateCustomUrls: ({ checkoutUrl, cartUrl }: CustomUrls) => void;
export {};
//# sourceMappingURL=config.d.ts.map