Files
DefinitelyTyped/types/react-text-mask/index.d.ts
Guilherme Hübner Franco 042216be69 [react-text-mask] Fix definition
2018-03-14 13:44:11 -03:00

35 lines
1.0 KiB
TypeScript

// Type definitions for react-text-mask 5.1
// Project: https://github.com/text-mask/text-mask
// Definitions by: Guilherme Hübner <https://github.com/guilhermehubner>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
import * as React from "react";
export type maskArray = Array<string | RegExp>;
export interface MaskedInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
mask?: maskArray | ((value: string) => maskArray);
guide?: boolean;
placeholderChar?: string;
keepCharPositions?: boolean;
pipe?: (conformedValue: string, config: any) => false | string | { value: string, indexesOfPipedChars: number[] };
showMask?: boolean;
}
export interface conformToMaskResult {
conformedValue: string;
meta: {
someCharsRejected: boolean
};
}
export default class MaskedInput extends React.Component<MaskedInputProps, any> {}
export function conformToMask(text: string, mask: maskArray, config: any): conformToMaskResult;