Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@types/react-currency-format
Advanced tools
Readme
npm install --save @types/react-currency-format
This package contains type definitions for react-currency-format (https://github.com/mohitgupta8888/react-currency-format#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-currency-format.
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;
These definitions were written by Guilherme Samuel.
FAQs
TypeScript definitions for react-currency-format
The npm package @types/react-currency-format receives a total of 8,014 weekly downloads. As such, @types/react-currency-format popularity was classified as popular.
We found that @types/react-currency-format demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.