import React, { type Dispatch, type SetStateAction, type PropsWithChildren } from 'react'; import type { Product, ProductPrice, ProductVariant, VariantCoupon, Options, FreeGift, BundleListItem, Bundle } from './types/product'; import type { CompareData, DiscountData } from './types.js'; type Country = { id?: number; name?: string; code?: string; }; export type UserProfile = { user_id: string; email: string; nick_name?: string; full_name?: string; first_name?: string; last_name?: string; dob?: string; gender?: string; phone_number?: string; phone_account?: string; country?: Country; is_subscribe?: boolean; avatar?: string; can_change_password?: boolean; invitation_code?: string; phone_carrier?: string; dob_programmed?: boolean; activated?: boolean; registed_at?: number; activated_at?: number; token?: string; }; export type SavingDetail = { coupon: number; bundle: number; member: number; freeGift: number; compare: number; exchangePurchase: number; }; type variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice; }; export type FunctionMemberPriceResult = { hasMemberPrice: boolean; originalPrice: number; withCouponMemberTotalSave: number; withoutCouponMaxMemberTotalSave?: number; labels: { key: string; value: string; desc: string; }[]; }; export type ModalData = { needClickAway?: boolean; className?: string; title?: string; content?: string; domContent?: React.ReactNode; }; export type JoinedRecommendBuyProducts = { bundle?: { value?: BundleListItem; canOperate?: boolean; }; gift?: { value?: ProductVariant; canOperate?: boolean; }; exchange?: { value?: ProductVariant; canOperate?: boolean; }; }; export type CreditsRedemption = { amount: number; availablePoints: number; usedPoints: number; skuDetails?: { sku: string; is_eligible: boolean; }[]; }; export interface ProductContextType { isLogin?: boolean; isMobile?: boolean; isDesktop?: boolean; product: Product; profile?: UserProfile; variant: ProductVariant; selectedVariants: Array; renderRating?: React.ReactNode; coupon?: VariantCoupon; savingDetail: SavingDetail; setSavingDetail: Dispatch>; finalPrice: number; comparePrice: number; totalSavings: number; selectedOptions: Options; setSelectedOptions: Dispatch>; freeGift?: FreeGift; checkedGift?: ProductVariant; setCheckedGift?: Dispatch>; exchangePurchase?: FreeGift; checkedExchangePurchase?: ProductVariant; setCheckedExchangePurchase?: Dispatch>; checkedBundle?: BundleListItem; setCheckedBundle: Dispatch>; joinedRecommendBuyProducts: JoinedRecommendBuyProducts; setJoinedRecommendBuyProducts?: Dispatch>; checkedCareBundle?: ProductVariant; setCheckedCareBundle?: Dispatch>; bundle?: Bundle; compareData?: CompareData['data']; onAddToCart?: () => void; onBuyNow?: () => void; creditsRedemption?: CreditsRedemption; memberFunctionResult?: FunctionMemberPriceResult; openModal: ({ title, content, domContent }: ModalData) => void; openSignInPopup?: () => void; openAuthCodePopup?: () => void; openSignUpPopup?: () => void; renderInstallments?: React.ReactNode; onUseCouponChange?: (couponSaving: number) => void; onUseMemberDiscountChange?: (memberSaving: number) => void; discount?: DiscountData; buyNowLoading?: boolean; addToCartLoading?: boolean; addOrder?: Array<'bundle' | 'gift' | 'exchange'>; setAddOrder?: Dispatch>>; } export declare const BizProductContext: React.Context; export declare const useBizProductContext: () => ProductContextType; declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemption, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderInstallments, onUseCouponChange, onUseMemberDiscountChange, discount, buyNowLoading, addToCartLoading, }: PropsWithChildren>) => import("react/jsx-runtime").JSX.Element; export default ProductProvider;