import React from 'react'; import { InputProps } from '../types'; import { InputContainerProps } from '../base/InputContainer'; declare type ValidationResult = { isValid: true; } | { isValid: false; error: NUMBER_INPUT_ERRORS | string; value?: number; }; interface NumberInputConstraints { /** If input is less than min, onChange will not be called */ min?: number; /** If input is greated than max, onChange will not be called */ max?: number; /** Custom constraint */ custom?: (value: string | null, precision?: number) => ValidationResult; } /** * Number input field component. It follows the props from react-final-form */ export interface IInputNumber extends InputProps, Pick { /** Optional autocomplete */ autoComplete?: string; /** Optional passed in inline styles */ style?: object; /** className attached to text input */ className?: string; /** placeholder text */ placeholder?: string; /** Constraints for input validation */ constraints?: NumberInputConstraints; /** show value in percentage, 0.12 => 12% */ usePercentage?: boolean; /** * round precision, 0.12 with precision 1 => 0.1 * * precision with percentage will apply precision after percentage * e.g. * value = 0.12, usePercentarge = true, precision = 1 * will show 12.0% * */ precision?: number; defaultValue?: number; setExternalError?: (isError?: boolean) => void; limitRange?: boolean; } export declare const InputNumber: React.FC; declare enum NUMBER_INPUT_ERRORS { GREATED_THAN_MAX = "panda.input.number.error.max", INVALID_NUMBER = "panda.input.number.error.invalid", LESS_THAN_MIN = "panda.input.number.error.min" } export {};