import { Dispatch, SetStateAction } from 'react';
import { CheckoutModel as NewCheckoutModel } from '../../api/checkout-types';
import { ReactNode } from 'react';
import { CheckoutRenderer } from './legacy-modular-checkout';
import { PromoCodeError } from './consts';
import { ShoppingCart } from '../../api/cart-types';
import { LegacyCheckoutModel } from '../../api/legacy-checkout-types';
import { useAvailablePsps } from './checkout-payment-method-selector/hooks/use-available-psps';
import { PaymentProviderId } from '../../api/market-types';
import { ExpressPaymentProvider } from './checkout-payment-method-selector/hooks/use-payment-express-provider';
import { Whatever } from '../../types/whatever';
import { BoltShopperAddress, BoltUser, PaymentMethod, Profile } from '../../api/shopper-account-api';
import { CountryCode } from '../../common/market-metadata';
export declare type ModularCheckoutProps = {
    isInDialog?: boolean;
    children: CheckoutRenderer | ReactNode;
};
export declare enum CheckoutUpdateStatus {
    PENDING = "PENDING",
    COMPLETE = "COMPLETE",
    FAILED = "FAILED"
}
export declare type CheckoutAddressForm<T> = {
    currentValue: T;
    isValid: boolean;
    onSubmit: (value?: T) => Promise<CheckoutUpdateStatus.FAILED | CheckoutUpdateStatus.COMPLETE | CheckoutUpdateStatus.PENDING>;
    reset: () => void;
    setCurrentValue: Dispatch<SetStateAction<T>>;
    setIsValid: Dispatch<SetStateAction<boolean>>;
    setSubmit: (submitFunction: () => void) => void;
    setSubmittedValue: Dispatch<SetStateAction<T>>;
    submit: () => void;
    submittedValue: T;
};
export declare type CheckoutUpdateRequest = {
    status: CheckoutUpdateStatus;
    setStatus: (status: CheckoutUpdateStatus) => void;
    error: AddressErrors;
    setError: (error: AddressErrors) => void;
};
export declare function isCheckoutDeliveryAddressData(value: CheckoutDeliveryAddressData | void): value is CheckoutDeliveryAddressData;
export declare type CheckoutAddresses = {
    forceUpdateForms: (value: CheckoutDeliveryAddressData | void) => Promise<boolean>;
    deliveryAddressForm: CheckoutAddressForm<CheckoutDeliveryAddressData>;
    billingAddressForm: CheckoutAddressForm<CheckoutBillingAddressData> & {
        exists: boolean;
        setExists: (value: boolean) => void;
    };
    deliveryAddressRequest: CheckoutUpdateRequest;
    billingAddressRequest: CheckoutUpdateRequest;
    isBillingAddressSameAsDelivery: boolean;
    setIsBillingAddressSameAsDelivery: (value: boolean) => void;
};
export declare type LegacyModularCheckoutContextData = {
    checkoutVersion: 'legacy';
    shoppingCart: ShoppingCart;
    shoppingCartPurchased: ShoppingCart;
    setShoppingCartPurchased: (cart: ShoppingCart) => void;
    lastRemovedItem: string;
    paymentData: LegacyCheckoutModel;
    promoCodesSupport: {
        onPromoCodeApplied: (promoCode: string) => Promise<boolean>;
        onPromoCodeCleared: () => void;
        promoCodeErrorCode: string;
    };
    addresses: Omit<CheckoutAddresses, 'forceUpdateForms'>;
    payment: {
        paymentForm: {
            submit: () => void;
            setSubmit: (confirmFunction: () => void) => void;
        };
    };
    onPaymentRequested: () => void;
    checkoutStatus: CheckoutStatus;
};
export declare type CheckoutPaymentModel = {
    paymentForm: {
        submit: () => void;
        onSubmit: (transactionId: string) => void;
        isSubmitted: boolean;
        setIsSubmitted: (value: boolean) => void;
    };
    paymentMethod: {
        availablePaymentMethods: ReturnType<typeof useAvailablePsps>;
        setAvailablePaymentMethods: (value: ReturnType<typeof useAvailablePsps>) => void;
        selectedPaymentMethod: PaymentProviderId | ExpressPaymentProvider;
        setPaymentMethod: (value: PaymentProviderId | ExpressPaymentProvider) => void;
    };
    paymentRequest: CheckoutUpdateRequest;
    shouldCreateBoltAccount: boolean;
    setCreateBoltAccount: (value: boolean) => void;
    boltUser: BoltUser;
    setBoltUser: (boltUser: {
        hasBoltAccount: boolean;
        addresses: BoltShopperAddress[];
        profile: Profile;
        paymentMethods: PaymentMethod[];
    }) => void;
};
export declare type NewModularCheckoutContextData = {
    checkoutVersion: 'current';
    checkout: NewCheckoutModel;
    addresses: CheckoutAddresses;
    checkoutStatus: CheckoutStatus;
    setCheckoutStatus: (newStatus: CheckoutStatus) => void;
    setCheckout: (val: NewCheckoutModel) => void;
    refreshCheckout: () => Promise<NewCheckoutModel>;
    confirmCheckout: () => Promise<Whatever>;
    isUserLogin: boolean;
    setIsUserLogin: (value: boolean) => void;
    isBoltEmail: boolean;
    setIsBoltEmail: (value: boolean) => void;
    isLoginSubmitted: boolean;
    setIsLoginSubmitted: (value: boolean) => void;
    isFormExtended: boolean;
    setIsFormExtended: (value: boolean) => void;
    isFormEditMode: boolean;
    setFormEditMode: (value: boolean) => void;
    fetchCheckout: (checkoutId: string) => Promise<NewCheckoutModel>;
    payment: CheckoutPaymentModel;
    order: LegacyCheckoutModel;
    promoCodesSupport: {
        onPromoCodeApplied: (promoCode: string) => Promise<void>;
        onPromoCodeCleared: (promoCodeId: string) => Promise<void>;
        promoCodeErrorCode: PromoCodeError | string | null;
    };
};
export declare type PaymentData = {
    transactionId: string;
    htmlSnippet: string;
    pspData: {
        clientSecret: string;
    };
};
export declare type ModularCheckoutContextData = NewModularCheckoutContextData | LegacyModularCheckoutContextData;
export declare type CheckoutDeliveryAddressData = {
    apartment?: string;
    city: string;
    country: CountryCode;
    email: string;
    firstName: string;
    lastName: string;
    phoneNumber: string;
    state?: string;
    street: string;
    zipCode: string;
};
export declare type CheckoutBillingAddressData = Omit<CheckoutDeliveryAddressData, 'email' | 'phoneNumber'>;
export declare enum CheckoutStatus {
    NEW = "NEW",
    PROCESSING = "PROCESSING",
    CONFIRMED = "CONFIRMED",
    PARTIALLY_CONFIRMED = "PARTIALLY_CONFIRMED",
    EMPTY = "EMPTY"
}
export declare enum AddressErrors {
    INVALID_ZIPCODE = "InvalidZipCode",
    STATE_ZIPCODE_ERROR = "StateNotMatchingZipCode",
    INVALID_ADDRESS_ERROR = "InvalidAddress"
}
export declare type SubmitBehavior = 'none' | 'collapse';
export declare type PaymentDependsOn = 'none' | 'validAddress' | 'validDeliveryAddress';
export declare type RefreshableCheckout = {
    checkout: NewCheckoutModel;
    refreshCheckout: () => Promise<NewCheckoutModel>;
};
//# sourceMappingURL=types.d.ts.map