# @types/react-currency-format

> TypeScript definitions for react-currency-format

Latest version **1.0.4** (published 2023-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-currency-format
pnpm add @types/react-currency-format
yarn add @types/react-currency-format
bun add @types/react-currency-format
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-12-06 |
| First published | 2021-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-currency-format
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-currency-format
- npm.io page: https://npm.io/package/@types/react-currency-format

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 1.0.4 (latest) — 2023-12-06
- 1.0.3 (ts4.5) — 2023-11-07
- 1.0.0 (ts3.6) — 2021-07-19
- 1.0.2 — 2023-10-18
- 1.0.1 — 2023-09-27

## README

# 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.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-currency-format/index.d.ts)
````ts
import { Component, ComponentType, HTMLAttributes, InputHTMLAttributes, JSX } from "react";

declare namespace CurrencyFormat {
    /**
     * Available input type attributes which the component supports.
     */
    type InputType = "text" | "tel";

    /**
     * A value object containing the formatted value, the original value and the float value.
     * @see {@link https://github.com/mohitgupta8888/react-currency-format#values-object}
     */
    interface Values {
        formattedValue: string;
        value: string;
        floatValue: number;
    }

    // The component accepts all the props which can be given to a input or span based on displayType selected.
    type DisplayTypeInput = InputHTMLAttributes<HTMLInputElement> & {
        displayType?: "input";
        customInput?: ComponentType<any>;
    };

    type DisplayTypeText = HTMLAttributes<HTMLSpanElement> & {
        displayType?: "text";
        customInput?: never;
    };

    /**
     * Props accepted by the component.
     * @see {@link https://github.com/mohitgupta8888/react-currency-format#props}
     */
    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);

    /**
     * Props accepted by the component and any other prop of the customInput.
     */
    type Props = StrictProps & {
        [key: string]: unknown;
    };
}

declare class CurrencyFormat extends Component<CurrencyFormat.Props> {}

export = CurrencyFormat;

````

### Additional Details
 * Last updated: Wed, 06 Dec 2023 06:08:17 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Guilherme Samuel](https://github.com/guilhermefront).

---
_Source: https://npm.io/package/@types/react-currency-format · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
