Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/react-currency-format

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-currency-format

TypeScript definitions for react-currency-format

  • 1.0.4
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

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

Credits

These definitions were written by Guilherme Samuel.

FAQs

Package last updated on 06 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc