@types/react-input-mask

  • Version 3.0.6
  • Published
  • 7.33 kB
  • 1 dependency
  • MIT license

Install

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

Overview

TypeScript definitions for react-input-mask

Index

Classes

class ReactInputMask

class ReactInputMask extends React.Component<Props> {}

    Interfaces

    interface BeforeMaskedStateChangeStates

    interface BeforeMaskedStateChangeStates {}

      property currentState

      currentState: InputState;

        property nextState

        nextState: InputState;

          property previousState

          previousState: InputState;

            interface InputState

            interface InputState {}

              property selection

              selection: Selection | null;

                property value

                value: string;

                  interface Selection

                  interface Selection {}

                    property end

                    end: number;

                      property start

                      start: number;

                        Type Aliases

                        type Props

                        type Props = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children'> & {
                        /**
                        * Mask string. Format characters are:
                        * * `9`: `0-9`
                        * * `a`: `A-Z, a-z`
                        * * `\*`: `A-Z, a-z, 0-9`
                        *
                        * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings.
                        * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}`
                        */
                        mask: string | Array<string | RegExp>;
                        /**
                        * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input.
                        */
                        maskChar?: string | null | undefined;
                        maskPlaceholder?: string | null | undefined;
                        /**
                        * Show mask even in empty input without focus.
                        */
                        alwaysShowMask?: boolean | undefined;
                        /**
                        * Use inputRef instead of ref if you need input node to manage focus, selection, etc.
                        */
                        inputRef?: React.Ref<HTMLInputElement> | undefined;
                        /**
                        * In case you need to implement more complex masking behavior, you can provide
                        * beforeMaskedStateChange function to change masked value and cursor position
                        * before it will be applied to the input.
                        *
                        * * previousState: Input state before change. Only defined on change event.
                        * * currentState: Current raw input state. Not defined during component render.
                        * * nextState: Input state with applied mask. Contains value and selection fields.
                        */
                        beforeMaskedStateChange?(states: BeforeMaskedStateChangeStates): InputState;
                        children?: (inputProps: any) => React.ReactNode;
                        };

                          Package Files (1)

                          Dependencies (1)

                          Dev Dependencies (0)

                          No dev dependencies.

                          Peer Dependencies (0)

                          No peer dependencies.

                          Badge

                          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-input-mask.

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