import React, { Component } from 'react'; import type { ImageURISource, StyleProp, TextStyle, ViewStyle } from 'react-native'; import type { CommerceTypes } from '../../../libs/fscommerce'; import type { SwatchProps, SwatchStyle } from './Swatch'; export interface SwatchItemType extends CommerceTypes.OptionValue { color?: string; image?: ImageURISource; } export interface SerializableSwatchesProps { items: SwatchItemType[]; title?: string; defaultValue?: string; style?: ViewStyle; label?: boolean; labelContainerStyle?: ViewStyle; labelTitleStyle?: TextStyle; labelValueStyle?: TextStyle; showingMoreStyle?: ViewStyle; showingLessStyle?: ViewStyle; separateMoreButton?: boolean; disabled?: boolean; maxSwatches?: number; moreLessStyle?: ViewStyle; } export interface SwatchesProps extends SwatchStyle, Omit { style?: StyleProp; renderSwatch?: (swatch: SwatchProps) => React.ReactNode; labelContainerStyle?: StyleProp; labelTitleStyle?: StyleProp; labelValueStyle?: StyleProp; showingMoreStyle?: StyleProp; showingLessStyle?: StyleProp; renderLabel?: (swatch: SelectedSwatchItem) => void; onChangeSwatch?: (swatch: string) => void; onColorPress?: (elem: CommerceTypes.OptionValue) => void; renderMoreLess?: (showMore: boolean) => React.ReactNode; moreLessStyle?: StyleProp; onClickPlus?: () => void; } export interface SelectedSwatchItem { value: string; name: string; } export interface SwatchesState { selected: { index: number | null; swatch: SelectedSwatchItem; }; shouldShowMoreLess: boolean; showMore: boolean; } export declare class Swatches extends Component { constructor(props: SwatchesProps); private getSelectedSwatch; private readonly onSelect; private readonly _renderSwatch; private readonly renderLabel; private readonly toggleMoreLess; private readonly renderMoreLess; componentDidUpdate(prevProps: SwatchesProps, prevState: SwatchesState): void; render(): JSX.Element; }