Installation
npm install --save @types/react-text-mask
Summary
This package contains type definitions for react-text-mask (https://github.com/text-mask/text-mask/tree/master/react).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-text-mask.
import * as React from "react";
export type maskArray = Array<string | RegExp> | false;
export interface MaskedInputProps
extends React.InputHTMLAttributes<HTMLInputElement> {
mask: maskArray | ((value: string) => maskArray);
guide?: boolean | undefined;
placeholderChar?: string | undefined;
keepCharPositions?: boolean | undefined;
pipe?: ((
conformedValue: string,
config: any
) => false | string | { value: string; indexesOfPipedChars: number[] }) | undefined;
showMask?: boolean | undefined;
render?: ((ref: (inputElement: HTMLElement) => void, props: any) => any) | undefined;
}
export interface conformToMaskResult {
conformedValue: string;
meta: {
someCharsRejected: boolean;
};
}
export default class MaskedInput extends React.Component<
MaskedInputProps,
any
> {
inputElement: HTMLElement;
}
export function conformToMask(
text: string,
mask: maskArray | ((value: string) => maskArray),
config?: any
): conformToMaskResult;
Additional Details
- Last updated: Wed, 04 Aug 2021 09:31:28 GMT
- Dependencies: @types/react
- Global values: none
Credits
These definitions were written by Guilherme Hübner, Deividi Cavarzan, and Artem Lyubchuk.