diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index 0d66457479..667a210087 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -100,7 +100,7 @@ declare namespace IntlTelInput { * Set the type of the placeholder number * @param type Placeholder number type to be set */ - setPlaceholderNumberType(type: intlTelInputUtils.numberType): void; + setPlaceholderNumberType(type: intlTelInputUtils.placeholderNumberType): void; } interface JQueryPlugin { @@ -186,7 +186,7 @@ declare namespace IntlTelInput { * Set the type of the placeholder number * @param type Placeholder number type to be set */ - (method: 'setPlaceholderNumberType', type: intlTelInputUtils.numberType): void; + (method: 'setPlaceholderNumberType', type: intlTelInputUtils.placeholderNumberType): void; } interface Options { @@ -302,7 +302,7 @@ declare namespace IntlTelInput { * e.g. "FIXED_LINE" to set the number type to use for the placeholder. * Default = MOBILE */ - placeholderNumberType?: intlTelInputUtils.numberType; + placeholderNumberType?: intlTelInputUtils.placeholderNumberType; /** * Specify the countries to appear at the top of the list. @@ -370,6 +370,20 @@ declare namespace intlTelInputUtils { TOO_LONG = 3, NOT_A_NUMBER = 4 } + + type placeholderNumberType = + | "FIXED_LINE_OR_MOBILE" + | "FIXED_LINE" + | "MOBILE" + | "PAGER" + | "PERSONAL_NUMBER" + | "PREMIUM_RATE" + | "SHARED_COST" + | "TOLL_FREE" + | "UAN" + | "UNKNOWN" + | "VOICEMAIL" + | "VOIP"; } interface Window { diff --git a/types/intl-tel-input/intl-tel-input-tests.ts b/types/intl-tel-input/intl-tel-input-tests.ts index 6dc551c626..ab6808bbed 100644 --- a/types/intl-tel-input/intl-tel-input-tests.ts +++ b/types/intl-tel-input/intl-tel-input-tests.ts @@ -12,7 +12,7 @@ window.intlTelInput(input, { }); window.intlTelInput(input, { - placeholderNumberType: intlTelInputUtils.numberType.MOBILE, + placeholderNumberType: "MOBILE", }); window.intlTelInput(input, { @@ -43,7 +43,7 @@ window.intlTelInput(input).setCountry('gb'); window.intlTelInput(input).setNumber('+447733123456'); -window.intlTelInput(input).setPlaceholderNumberType(intlTelInputUtils.numberType.FIXED_LINE); +window.intlTelInput(input).setPlaceholderNumberType("FIXED_LINE"); const countryData = window.intlTelInputGlobals.getCountryData(); const country = countryData[0]; @@ -100,7 +100,7 @@ $('#phone').intlTelInput({ }); $('#phone').intlTelInput({ - placeholderNumberType: intlTelInputUtils.numberType.MOBILE, + placeholderNumberType: "MOBILE", }); $('#phone').intlTelInput({ @@ -131,7 +131,7 @@ $('#phone').intlTelInput('setCountry', 'gb'); $('#phone').intlTelInput('setNumber', '+447733123456'); -$('#phone').intlTelInput('setPlaceholderNumberType', intlTelInputUtils.numberType.FIXED_LINE); +$('#phone').intlTelInput('setPlaceholderNumberType', "FIXED_LINE"); $('#phone').intlTelInput({ utilsScript: '../../build/js/utils.js'