mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
fixed type of placeholders: should be the keys of numberType
This commit is contained in:
Vendored
+17
-3
@@ -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 {
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user