diff --git a/react/build/IntlTelInput.d.ts b/react/build/IntlTelInput.d.ts index b3af2b44c..771d5eb4b 100644 --- a/react/build/IntlTelInput.d.ts +++ b/react/build/IntlTelInput.d.ts @@ -976,7 +976,7 @@ declare module "intl-tel-input" { } declare module "intl-tel-input/react" { import intlTelInput from "intl-tel-input"; - import { SomeOptions } from "intl-tel-input"; + import { Iti, SomeOptions } from "intl-tel-input"; import React from "react"; export { intlTelInput }; type ItiProps = { @@ -989,7 +989,11 @@ declare module "intl-tel-input/react" { initOptions?: SomeOptions; inputProps?: object; }; - const IntlTelInput: React.ForwardRefExoticComponent>; + type ItiRef = { + getInstance: () => Iti | null; + getInput: () => HTMLInputElement | null; + }; + const IntlTelInput: React.ForwardRefExoticComponent>; export default IntlTelInput; } declare module "intl-tel-input/utils-compiled" { @@ -1002,7 +1006,7 @@ declare module "intl-tel-input/intlTelInputWithUtils" { } declare module "intl-tel-input/reactWithUtils" { import intlTelInput from "intl-tel-input/intlTelInputWithUtils"; - import { SomeOptions } from "intl-tel-input"; + import { Iti, SomeOptions } from "intl-tel-input"; import React from "react"; export { intlTelInput }; type ItiProps = { @@ -1015,6 +1019,10 @@ declare module "intl-tel-input/reactWithUtils" { initOptions?: SomeOptions; inputProps?: object; }; - const IntlTelInput: React.ForwardRefExoticComponent>; + type ItiRef = { + getInstance: () => Iti | null; + getInput: () => HTMLInputElement | null; + }; + const IntlTelInput: React.ForwardRefExoticComponent>; export default IntlTelInput; } diff --git a/react/src/intl-tel-input/react.tsx b/react/src/intl-tel-input/react.tsx index 23edc141f..65df93ccb 100644 --- a/react/src/intl-tel-input/react.tsx +++ b/react/src/intl-tel-input/react.tsx @@ -17,6 +17,11 @@ type ItiProps = { inputProps?: object; }; +type ItiRef = { + getInstance: () => Iti | null; + getInput: () => HTMLInputElement | null; +} + const IntlTelInput = forwardRef(function IntlTelInput({ initialValue = "", onChangeNumber = () => {}, @@ -26,7 +31,7 @@ const IntlTelInput = forwardRef(function IntlTelInput({ usePreciseValidation = false, initOptions = {}, inputProps = {}, -}: ItiProps, ref) { +}: ItiProps, ref: React.ForwardedRef) { const inputRef = useRef(null); const itiRef = useRef(null); diff --git a/react/src/intl-tel-input/reactWithUtils.tsx b/react/src/intl-tel-input/reactWithUtils.tsx index ad679607d..9b4fd2a39 100644 --- a/react/src/intl-tel-input/reactWithUtils.tsx +++ b/react/src/intl-tel-input/reactWithUtils.tsx @@ -18,6 +18,11 @@ type ItiProps = { inputProps?: object; }; +type ItiRef = { + getInstance: () => Iti | null; + getInput: () => HTMLInputElement | null; +} + const IntlTelInput = forwardRef(function IntlTelInput({ initialValue = "", onChangeNumber = () => {}, @@ -27,7 +32,7 @@ const IntlTelInput = forwardRef(function IntlTelInput({ usePreciseValidation = false, initOptions = {}, inputProps = {}, -}: ItiProps, ref) { +}: ItiProps, ref: React.ForwardedRef) { const inputRef = useRef(null); const itiRef = useRef(null);