mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Add react-text-mask definitions (#23871)
This commit is contained in:
committed by
Andy
parent
c37774d139
commit
35cb910717
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// Type definitions for react-text-mask 16.0
|
||||
// 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 | ((input: HTMLInputElement) => maskArray);
|
||||
|
||||
guide?: boolean;
|
||||
|
||||
placeholderChar?: string;
|
||||
|
||||
keepCharPositions?: boolean;
|
||||
|
||||
pipe?: (conformedValue: string, config: any) => false | string | { value: string, indexesOfPipedChars: number[] };
|
||||
|
||||
onReject?: (infos: { conformedValue: string, maskRejection: boolean, pipeRejection: boolean }) => void;
|
||||
|
||||
onAccept?: () => void;
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user