redux-form-numeric-field
Version:
a customized redux-form Field for entering numbers
91 lines (90 loc) • 5.38 kB
TypeScript
/// <reference types="react" />
import createNumericField from './createNumericField';
declare const NumericField: {
new <P extends import("redux-form").BaseFieldProps<{
input: {
onKeyDown?: import("react").KeyboardEventHandler<any> | undefined;
};
}> & {
normalizeOnBlur?: any;
normalizeNumber?: ((value?: string | number | null | undefined) => string | number | null | undefined) | undefined;
} = import("redux-form").BaseFieldProps<{
input: {
onKeyDown?: import("react").KeyboardEventHandler<any> | undefined;
};
}> & {
normalizeOnBlur?: any;
normalizeNumber?: ((value?: string | number | null | undefined) => string | number | null | undefined) | undefined;
}>(props: P | Readonly<P>): {
normalizeOnBlur: (value: any) => any;
validate: (value: any, allValues: any, props: any, name: string) => string | null | undefined;
KeyDownHandler: ({ input, onKeyDown, ...props }: import("redux-form").WrappedFieldProps & {
onKeyDown?: import("react").KeyboardEventHandler<any> | undefined;
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
render(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<P>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<P>;
state: Readonly<{}>;
refs: {
[key: string]: import("react").ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<{}>, nextContext: any): void;
};
new <P extends import("redux-form").BaseFieldProps<{
input: {
onKeyDown?: import("react").KeyboardEventHandler<any> | undefined;
};
}> & {
normalizeOnBlur?: any;
normalizeNumber?: ((value?: string | number | null | undefined) => string | number | null | undefined) | undefined;
} = import("redux-form").BaseFieldProps<{
input: {
onKeyDown?: import("react").KeyboardEventHandler<any> | undefined;
};
}> & {
normalizeOnBlur?: any;
normalizeNumber?: ((value?: string | number | null | undefined) => string | number | null | undefined) | undefined;
}>(props: P, context: any): {
normalizeOnBlur: (value: any) => any;
validate: (value: any, allValues: any, props: any, name: string) => string | null | undefined;
KeyDownHandler: ({ input, onKeyDown, ...props }: import("redux-form").WrappedFieldProps & {
onKeyDown?: import("react").KeyboardEventHandler<any> | undefined;
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
render(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<P>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<P>;
state: Readonly<{}>;
refs: {
[key: string]: import("react").ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<{}>, nextContext: any): void;
};
contextType?: import("react").Context<any> | undefined;
};
export { NumericField, createNumericField };