// Type definitions for react-numeric-input 2.2 // Project: https://github.com/vlad-ignatov/react-numeric-input#readme // Definitions by: Heather Booker // Aarni Koskela // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from 'react'; export = NumericInput; declare namespace NumericInput { type BoundsFunctionProp = number | ((component: NumericInput) => number | undefined); type Omit = Pick>; // via TS 2.8 manual interface NumericInputProps extends Omit< React.InputHTMLAttributes, 'min' | 'max' | 'step' | 'onChange' | 'defaultValue' | 'onInvalid' | 'style' > { addLabelText?: string; componentClass?: string; defaultValue?: number | string; format?: ((value: number | null) => string); max?: BoundsFunctionProp; min?: BoundsFunctionProp; mobile?: boolean | 'auto' | ((component: NumericInput) => boolean); noStyle?: boolean; noValidate?: boolean | string; onBlur?: React.FocusEventHandler; onChange?: ((value: number | null, stringValue: string, input: HTMLInputElement) => void); onFocus?: React.FocusEventHandler; onInput?: React.FormEventHandler; onInvalid?: ((error: string, value: number | null, stringValue: string) => void); onKeyDown?: React.KeyboardEventHandler; onSelect?: React.ReactEventHandler; onValid?: ((value: number | null, stringValue: string) => void); parse?: ((stringValue: string) => number | null); precision?: number | ((component: NumericInput) => number | null | undefined); snap?: boolean; step?: number | ((component: NumericInput, direction: string) => number | undefined); strict?: boolean; style?: {[key: string]: React.CSSProperties} | boolean; value?: number | string; } // Exposed here for the function prop handlers that get the NumericInput instance as a parameter. // Lifted directly from react-numeric-input@79874ccbe:/src/NumericInput.jsx#L63-L73 interface NumericInputState { btnDownActive?: boolean; btnDownHover?: boolean; btnUpActive?: boolean; btnUpHover?: boolean; selectionEnd?: number | null; selectionStart?: number | null; stringValue?: string; value?: number | null; } } declare class NumericInput extends React.Component { static DIRECTION_UP: string; static DIRECTION_DOWN: string; }