@types/react-text-mask

v5.4.8(not latest)
  • Types
  • ESM
  • CJS

TypeScript definitions for react-text-mask

License
MIT
Install Size
6.1 kB/-
Vulns
0
Published

Get started

$npm install @types/react-text-mask@5.4.8
$pnpm add @types/react-text-mask@5.4.8
$yarn add @types/react-text-mask@5.4.8
$bun add @types/react-text-mask@5.4.8
$deno add npm:@types/react-text-mask@5.4.8
$vlt install @types/react-text-mask@5.4.8
# Usually installed as a dev dependency
$npm install -D @types/react-text-mask@5.4.8
$pnpm add -D @types/react-text-mask@5.4.8
$yarn add -D @types/react-text-mask@5.4.8
$bun add -d @types/react-text-mask@5.4.8
$deno add -D npm:@types/react-text-mask@5.4.8
$vlt install -D @types/react-text-mask@5.4.8

Readme

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.

index.d.ts

// Type definitions for react-text-mask 5.4
// Project: https://github.com/text-mask/text-mask/tree/master/react
// Definitions by: Guilherme Hübner <https://github.com/guilhermehubner>
//                 Deividi Cavarzan <https://github.com/cavarzan>
//                 Artem Lyubchuk <https://github.com/needpower>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import * as React from "react";

export type maskArray = Array<string | RegExp> | boolean;

export interface MaskedInputProps
    extends React.InputHTMLAttributes<HTMLInputElement> {
    mask?: maskArray | ((value: string) => maskArray) | undefined;

    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, 07 Jul 2021 18:31:47 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Guilherme Hübner, Deividi Cavarzan, and Artem Lyubchuk.

Weekly DownloadsAcross all versions

Versions

5.4.14
latestts4.5ts4.6ts4.7ts4.8ts4.9ts5.0ts5.1ts5.2ts5.3ts5.4ts5.5ts5.6ts5.7ts5.8ts5.9ts6.0
5.4.11
ts3.9ts4.0ts4.1ts4.2ts4.3ts4.4
5.4.8
ts3.6ts3.7ts3.8
5.4.7
ts3.5
5.4.6
ts2.8ts2.9ts3.0ts3.1ts3.2ts3.3ts3.4
5.4.0
ts2.6ts2.7