mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
Merge pull request #9792 from fdnhkj/intl-tel-input
Intl tel input - Removed wrong static functions typings
This commit is contained in:
@@ -28,7 +28,7 @@ let ntlNumber = $('#phone').intlTelInput('getNumber', intlTelInputUtils.numberFo
|
||||
let numberType = $('#phone').intlTelInput('getNumberType');
|
||||
if (numberType === intlTelInputUtils.numberType.MOBILE) {}
|
||||
|
||||
let countryData = $('#phone').intlTelInput('getSelectedCountryData');
|
||||
let selectedCountryData = $('#phone').intlTelInput('getSelectedCountryData');
|
||||
|
||||
let error = $('#phone').intlTelInput('getValidationError');
|
||||
if (error === intlTelInputUtils.validationError.TOO_SHORT) {}
|
||||
@@ -39,9 +39,9 @@ $('#phone').intlTelInput('setCountry', 'gb');
|
||||
|
||||
$('#phone').intlTelInput('setNumber', '+447733123456');
|
||||
|
||||
let countryData3 = $.intlTelInput.getCountryData();
|
||||
let countryData = $.fn.intlTelInput.getCountryData();
|
||||
|
||||
$.intlTelInput.loadUtils('build/js/utils.js');
|
||||
$.fn.intlTelInput.loadUtils('build/js/utils.js');
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
|
||||
Vendored
+5
-19
@@ -3,6 +3,11 @@
|
||||
// Definitions by: Fidan Hakaj <https://github.com/fdnhkj/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Static methods that are defined in JQueryStatic.fn are not typed
|
||||
// as jquery.d.ts has no interface for fn
|
||||
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jquery/jquery.d.ts#L958
|
||||
// fn: any; //TODO: Decide how we want to type this
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare namespace IntlTelInput {
|
||||
@@ -113,21 +118,6 @@ declare namespace IntlTelInput {
|
||||
iso2: string;
|
||||
dialCode: string;
|
||||
}
|
||||
|
||||
interface Static {
|
||||
/**
|
||||
* Get all of the plugin's country data.
|
||||
* Note that any modifications must be done before initialising the plugin.
|
||||
*/
|
||||
getCountryData: () => Array<CountryData>;
|
||||
/**
|
||||
* Note: this is only needed if you're lazy loading the plugin script itself (intlTelInput.js).
|
||||
* If not then just use the utilsScript option. Load the utils.js script
|
||||
* (included in the lib directory) to enable formatting/validation etc.
|
||||
* @param path path to the utils.js script.
|
||||
*/
|
||||
loadUtils: (path: string) => void;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace intlTelInputUtils {
|
||||
@@ -163,10 +153,6 @@ declare namespace intlTelInputUtils {
|
||||
}
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
intlTelInput: IntlTelInput.Static;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Remove the plugin from the input, and unbind any event listeners.
|
||||
|
||||
Reference in New Issue
Block a user