From 9b0cdc63e624b9e15b38a3184506b207fee6948a Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 15:31:20 +0300 Subject: [PATCH 1/5] Add inputRef prop definition --- types/react-input-mask/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 6ed7660196..2bc3bda94f 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -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 { } From edf2bd560299c4033cf2e3ff19f75fd0e082655b Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 15:47:14 +0300 Subject: [PATCH 2/5] Add test for inputRef prop --- types/react-input-mask/react-input-mask-tests.tsx | 3 +++ 1 file changed, 3 insertions(+) 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} />
; From 38998ea10a52e176d72b5055cf81647c167b682d Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 15:53:35 +0300 Subject: [PATCH 3/5] Fix lint errors --- types/react-input-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 2bc3bda94f..de3853642f 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -39,7 +39,7 @@ declare namespace reactInputMask { /** * Use inputRef instead of ref if you need input node to manage focus, selection, etc. */ - inputRef?: React.Ref + inputRef?: React.Ref; } class ReactInputMask extends React.Component { } From 3f2825672b7f9ae401ad0a32577dafe007cf4c9b Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 16:07:06 +0300 Subject: [PATCH 4/5] Fix package version --- types/react-input-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index de3853642f..034c3b4f9d 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.2 // Project: https://github.com/sanniassin/react-input-mask // Definitions by: Alexandre Paré // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From bc1e2d97212935217194003ef5cc0c4ac8d5732e Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 16:50:17 +0300 Subject: [PATCH 5/5] Fix package version --- types/react-input-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 034c3b4f9d..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 1.2.2 +// 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