diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 6ed7660196..8716cda0e6 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-input-mask 0.7 +// Type definitions for react-input-mask 1.2 // Project: https://github.com/sanniassin/react-input-mask // Definitions by: Alexandre Paré // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -36,6 +36,10 @@ declare namespace reactInputMask { * Show mask even in empty input without focus. */ alwaysShowMask?: boolean; + /** + * Use inputRef instead of ref if you need input node to manage focus, selection, etc. + */ + inputRef?: React.Ref; } class ReactInputMask extends React.Component { } diff --git a/types/react-input-mask/react-input-mask-tests.tsx b/types/react-input-mask/react-input-mask-tests.tsx index d116b2b27a..a34b15ac99 100644 --- a/types/react-input-mask/react-input-mask-tests.tsx +++ b/types/react-input-mask/react-input-mask-tests.tsx @@ -1,10 +1,13 @@ import ReactInputMask from 'react-input-mask'; import * as React from 'react'; +let ref: HTMLInputElement | null = null; +
+ ref = node} />
;