import { TouchableHighlightProps } from 'react-native'; import { InputProps } from '../input/PropsType'; import { Theme } from '../style'; import { StepperStyle } from './style'; type ValueProps = { allowEmpty: true; value?: ValueType | null; defaultValue?: ValueType | null; onChange?: (value: ValueType | null) => void; }; type ValuePropsWithNull = { allowEmpty?: false; value?: ValueType; defaultValue?: ValueType; onChange?: (value: ValueType) => void; }; export type BaseStepperProps = Omit & (ValuePropsWithNull | ValueProps) & { min?: ValueType; max?: ValueType; step?: ValueType; digits?: number; disabled?: boolean; minusButtonProps?: TouchableHighlightProps; plusButtonProps?: TouchableHighlightProps; parser?: (text: string) => ValueType; formatter?: (value?: ValueType) => string; styles?: Partial; themeStyles?: (theme: Theme) => Partial; }; type NumberStepperProps = BaseStepperProps & { stringMode?: false; }; type StringStepperProps = BaseStepperProps & { stringMode: true; }; export type StepperProps = NumberStepperProps | StringStepperProps; export {};