@types/react-text-mask
Advanced tools
Comparing version 5.4.9 to 5.4.10
@@ -6,30 +6,49 @@ // Type definitions for react-text-mask 5.4 | ||
// Artem Lyubchuk <https://github.com/needpower> | ||
// Pavel <https://github.com/p-piseckiy> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Minimum TypeScript Version: 3.9 | ||
import * as React from "react"; | ||
import * as React from 'react'; | ||
export type maskArray = Array<string | RegExp> | false; | ||
export type Mask = Array<string | RegExp> | false; | ||
export interface MaskedInputProps | ||
extends React.InputHTMLAttributes<HTMLInputElement> { | ||
mask: maskArray | ((value: string) => maskArray); | ||
export interface PipeConfig { | ||
placeholder: string; | ||
placeholderChar: string; | ||
currentCaretPosition: number; | ||
keepCharPositions: boolean; | ||
rawValue: string; | ||
guide: boolean | undefined; | ||
previousConformedValue: string | undefined; | ||
} | ||
guide?: boolean | undefined; | ||
export type ConformToMaskConfig = Partial<Omit<PipeConfig, 'rawValue'>>; | ||
placeholderChar?: string | undefined; | ||
export interface MaskedInputProps extends React.InputHTMLAttributes<HTMLInputElement> { | ||
mask: Mask | ((value: string) => Mask); | ||
keepCharPositions?: boolean | undefined; | ||
guide?: boolean; | ||
pipe?: (( | ||
placeholderChar?: string; | ||
keepCharPositions?: boolean; | ||
pipe?: ( | ||
conformedValue: string, | ||
config: any | ||
) => false | string | { value: string; indexesOfPipedChars: number[] }) | undefined; | ||
config: PipeConfig, | ||
) => false | string | { value: string; indexesOfPipedChars: number[] }; | ||
showMask?: boolean | undefined; | ||
showMask?: boolean; | ||
render?: ((ref: (inputElement: HTMLElement) => void, props: any) => any) | undefined; | ||
render?: ( | ||
ref: (inputElement: HTMLElement) => void, | ||
props: { | ||
onChange: (event: React.ChangeEvent<HTMLElement>) => void; | ||
onBlur: (event: React.FocusEvent<HTMLElement>) => void; | ||
defaultValue: string | undefined; | ||
}, | ||
) => React.ReactNode; | ||
} | ||
export interface conformToMaskResult { | ||
export interface ConformToMaskResult { | ||
conformedValue: string; | ||
@@ -41,7 +60,4 @@ meta: { | ||
export default class MaskedInput extends React.Component< | ||
MaskedInputProps, | ||
any | ||
> { | ||
inputElement: HTMLElement; | ||
export default class MaskedInput extends React.Component<MaskedInputProps, any> { | ||
inputElement: HTMLElement; | ||
} | ||
@@ -51,4 +67,4 @@ | ||
text: string, | ||
mask: maskArray | ((value: string) => maskArray), | ||
config?: any | ||
): conformToMaskResult; | ||
mask: Mask | ((value: string) => Mask), | ||
config?: ConformToMaskConfig, | ||
): ConformToMaskResult; |
{ | ||
"name": "@types/react-text-mask", | ||
"version": "5.4.9", | ||
"version": "5.4.10", | ||
"description": "TypeScript definitions for react-text-mask", | ||
@@ -22,2 +22,7 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-text-mask", | ||
"githubUsername": "needpower" | ||
}, | ||
{ | ||
"name": "Pavel", | ||
"url": "https://github.com/p-piseckiy", | ||
"githubUsername": "p-piseckiy" | ||
} | ||
@@ -36,4 +41,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "7b0fd24ba946df7547bb7f09387aad5a888c9cb65c6feaee95e1116346365647", | ||
"typesPublisherContentHash": "01ba8d2c3e12a3f48d08baf390b5138ad734339faf3fba2f644ddaaabe32fe53", | ||
"typeScriptVersion": "3.9" | ||
} |
@@ -16,30 +16,49 @@ # Installation | ||
// Artem Lyubchuk <https://github.com/needpower> | ||
// Pavel <https://github.com/p-piseckiy> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Minimum TypeScript Version: 3.9 | ||
import * as React from "react"; | ||
import * as React from 'react'; | ||
export type maskArray = Array<string | RegExp> | false; | ||
export type Mask = Array<string | RegExp> | false; | ||
export interface MaskedInputProps | ||
extends React.InputHTMLAttributes<HTMLInputElement> { | ||
mask: maskArray | ((value: string) => maskArray); | ||
export interface PipeConfig { | ||
placeholder: string; | ||
placeholderChar: string; | ||
currentCaretPosition: number; | ||
keepCharPositions: boolean; | ||
rawValue: string; | ||
guide: boolean | undefined; | ||
previousConformedValue: string | undefined; | ||
} | ||
guide?: boolean | undefined; | ||
export type ConformToMaskConfig = Partial<Omit<PipeConfig, 'rawValue'>>; | ||
placeholderChar?: string | undefined; | ||
export interface MaskedInputProps extends React.InputHTMLAttributes<HTMLInputElement> { | ||
mask: Mask | ((value: string) => Mask); | ||
keepCharPositions?: boolean | undefined; | ||
guide?: boolean; | ||
pipe?: (( | ||
placeholderChar?: string; | ||
keepCharPositions?: boolean; | ||
pipe?: ( | ||
conformedValue: string, | ||
config: any | ||
) => false | string | { value: string; indexesOfPipedChars: number[] }) | undefined; | ||
config: PipeConfig, | ||
) => false | string | { value: string; indexesOfPipedChars: number[] }; | ||
showMask?: boolean | undefined; | ||
showMask?: boolean; | ||
render?: ((ref: (inputElement: HTMLElement) => void, props: any) => any) | undefined; | ||
render?: ( | ||
ref: (inputElement: HTMLElement) => void, | ||
props: { | ||
onChange: (event: React.ChangeEvent<HTMLElement>) => void; | ||
onBlur: (event: React.FocusEvent<HTMLElement>) => void; | ||
defaultValue: string | undefined; | ||
}, | ||
) => React.ReactNode; | ||
} | ||
export interface conformToMaskResult { | ||
export interface ConformToMaskResult { | ||
conformedValue: string; | ||
@@ -51,7 +70,4 @@ meta: { | ||
export default class MaskedInput extends React.Component< | ||
MaskedInputProps, | ||
any | ||
> { | ||
inputElement: HTMLElement; | ||
export default class MaskedInput extends React.Component<MaskedInputProps, any> { | ||
inputElement: HTMLElement; | ||
} | ||
@@ -61,5 +77,5 @@ | ||
text: string, | ||
mask: maskArray | ((value: string) => maskArray), | ||
config?: any | ||
): conformToMaskResult; | ||
mask: Mask | ((value: string) => Mask), | ||
config?: ConformToMaskConfig, | ||
): ConformToMaskResult; | ||
@@ -69,3 +85,3 @@ ```` | ||
### Additional Details | ||
* Last updated: Wed, 04 Aug 2021 09:31:28 GMT | ||
* Last updated: Fri, 08 Oct 2021 00:31:19 GMT | ||
* Dependencies: [@types/react](https://npmjs.com/package/@types/react) | ||
@@ -75,2 +91,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by [Guilherme Hübner](https://github.com/guilhermehubner), [Deividi Cavarzan](https://github.com/cavarzan), and [Artem Lyubchuk](https://github.com/needpower). | ||
These definitions were written by [Guilherme Hübner](https://github.com/guilhermehubner), [Deividi Cavarzan](https://github.com/cavarzan), [Artem Lyubchuk](https://github.com/needpower), and [Pavel](https://github.com/p-piseckiy). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7301
53
88