Installation
npm install --save @types/react-currency-format
Summary
This package contains type definitions for react-currency-format (https://github.com/mohitgupta8888/react-currency-format#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-currency-format.
import { Component, ComponentType, HTMLAttributes, InputHTMLAttributes } from "react";
declare namespace CurrencyFormat {
type InputType = "text" | "tel";
interface Values {
formattedValue: string;
value: string;
floatValue: number;
}
type DisplayTypeInput = InputHTMLAttributes<HTMLInputElement> & {
displayType?: "input";
customInput?: ComponentType<any>;
};
type DisplayTypeText = HTMLAttributes<HTMLSpanElement> & {
displayType?: "text";
customInput?: never;
};
type StrictProps =
& Partial<{
thousandSeparator: string | boolean;
thousandSpacing: "2" | "2s" | "3" | "4";
decimalSeparator: string;
decimalScale: number;
fixedDecimalScale: boolean;
allowNegative: boolean;
prefix: string;
suffix: string;
value: number | string | null;
isNumericString: boolean;
type: InputType;
format: string | ((unformatedInput: string) => string);
removeFormatting: (formattedValue: string) => string;
mask: string | string[];
onValueChange: (values: Values) => void;
isAllowed: (values: Values) => boolean;
renderText: (formattedValue: string) => JSX.Element;
}>
& (DisplayTypeText | DisplayTypeInput);
type Props = StrictProps & {
[key: string]: unknown;
};
}
declare class CurrencyFormat extends Component<CurrencyFormat.Props> {}
export = CurrencyFormat;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/react
Credits
These definitions were written by Guilherme Samuel.