import { PureComponent } from 'react'; import type { StyleProp, ViewStyle } from 'react-native'; import type { CommerceDataSource, CommerceTypes } from '../../../libs/fscommerce'; import type { ButtonProps } from './Button'; import type { StepperProps } from './Stepper'; import type { SwatchesProps } from './Swatches'; export interface AddToCartProps { product: CommerceTypes.Product; commerceDataSource: CommerceDataSource; defaultVariantId?: string; onChangeOption?: (name: string, value: string, variant?: CommerceTypes.Variant) => void; onAddToCart?: (cart: Promise) => void; style?: StyleProp; swatchesStyle?: StyleProp; stepperStyle?: StyleProp; buttonStyle?: StyleProp; actionBarStyle?: StyleProp; buttonProps?: Partial; swatchesProps?: Partial; stepperProps?: Partial; renderStepper?: (onChange: (count: number) => void) => JSX.Element; renderButton?: (onPress: () => void) => JSX.Element; } export interface AddToCartOptionValue { name: string; value: string; } export interface AddToCartState { quantity: number; optionValues: AddToCartOptionValue[]; variantId?: string; } export declare class AddToCart extends PureComponent { static getDerivedStateFromProps(nextProps: AddToCartProps): Partial | null; constructor(props: AddToCartProps); private determineVariant; private readonly changeQty; private readonly addToCart; private readonly updateOption; private renderStepper; private renderButton; render(): JSX.Element; }