Skip to content

Commit

Permalink
Showing 3 changed files with 24 additions and 6 deletions.
16 changes: 12 additions & 4 deletions react/build/IntlTelInput.d.ts
Original file line number Diff line number Diff line change
@@ -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<ItiProps & React.RefAttributes<unknown>>;
type ItiRef = {
getInstance: () => Iti | null;
getInput: () => HTMLInputElement | null;
};
const IntlTelInput: React.ForwardRefExoticComponent<ItiProps & React.RefAttributes<ItiRef>>;
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<ItiProps & React.RefAttributes<unknown>>;
type ItiRef = {
getInstance: () => Iti | null;
getInput: () => HTMLInputElement | null;
};
const IntlTelInput: React.ForwardRefExoticComponent<ItiProps & React.RefAttributes<ItiRef>>;
export default IntlTelInput;
}
7 changes: 6 additions & 1 deletion react/src/intl-tel-input/react.tsx
Original file line number Diff line number Diff line change
@@ -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<ItiRef>) {
const inputRef = useRef<HTMLInputElement | null>(null);
const itiRef = useRef<Iti | null>(null);

7 changes: 6 additions & 1 deletion react/src/intl-tel-input/reactWithUtils.tsx
Original file line number Diff line number Diff line change
@@ -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<ItiRef>) {
const inputRef = useRef<HTMLInputElement | null>(null);
const itiRef = useRef<Iti | null>(null);

0 comments on commit d641bc2

Please sign in to comment.