• Version 5.4.14
  • Published
  • 6.14 kB
  • 1 dependency
  • MIT license


npm i @types/react-text-mask
yarn add @types/react-text-mask
pnpm add @types/react-text-mask


TypeScript definitions for react-text-mask



function conformToMask

conformToMask: (
text: string,
mask: Mask | ((value: string) => Mask),
config?: ConformToMaskConfig
) => ConformToMaskResult;


    class MaskedInput

    class MaskedInput extends React.Component<MaskedInputProps, any> {}

      property inputElement

      inputElement: HTMLElement;


        interface ConformToMaskResult

        interface ConformToMaskResult {}

          property conformedValue

          conformedValue: string;

            property meta

            meta: {
            someCharsRejected: boolean;

              interface MaskedInputProps

              interface MaskedInputProps extends React.InputHTMLAttributes<HTMLInputElement> {}

                property guide

                guide?: boolean;

                  property keepCharPositions

                  keepCharPositions?: boolean;

                    property mask

                    mask: Mask | ((value: string) => Mask);

                      property pipe

                      pipe?: (
                      conformedValue: string,
                      config: PipeConfig
                      ) => false | string | { value: string; indexesOfPipedChars: number[] };

                        property placeholderChar

                        placeholderChar?: string;

                          property render

                          render?: (
                          ref: (inputElement: HTMLElement) => void,
                          props: {
                          onChange: (event: React.ChangeEvent<HTMLElement>) => void;
                          onBlur: (event: React.FocusEvent<HTMLElement>) => void;
                          defaultValue: string | undefined;
                          ) => React.ReactNode;

                            property showMask

                            showMask?: boolean;

                              interface PipeConfig

                              interface PipeConfig {}

                                property currentCaretPosition

                                currentCaretPosition: number;

                                  property guide

                                  guide: boolean | undefined;

                                    property keepCharPositions

                                    keepCharPositions: boolean;

                                      property placeholder

                                      placeholder: string;

                                        property placeholderChar

                                        placeholderChar: string;

                                          property previousConformedValue

                                          previousConformedValue: string | undefined;

                                            property rawValue

                                            rawValue: string;

                                              Type Aliases

                                              type ConformToMaskConfig

                                              type ConformToMaskConfig = Partial<Omit<PipeConfig, 'rawValue'>>;

                                                type Mask

                                                type Mask = Array<string | RegExp> | false;

                                                  Package Files (1)

                                                  Dependencies (1)

                                                  Dev Dependencies (0)

                                                  No dev dependencies.

                                                  Peer Dependencies (0)

                                                  No peer dependencies.


                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/react-text-mask.

                                                  • Markdown
                                                  • HTML
                                                    <a href="https://www.jsdocs.io/package/@types/react-text-mask"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>