mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
fixed statics
This commit is contained in:
Vendored
+12
-7
@@ -6,6 +6,11 @@
|
||||
|
||||
declare namespace IntlTelInput {
|
||||
interface Static {
|
||||
/**
|
||||
* Default options for all instances
|
||||
*/
|
||||
defaults: Options;
|
||||
|
||||
/**
|
||||
* Get all of the plugin's country data - either to re-use elsewhere
|
||||
* e.g. to populate a country dropdown.
|
||||
@@ -17,12 +22,6 @@ declare namespace IntlTelInput {
|
||||
* formatting/validation etc.
|
||||
*/
|
||||
loadUtils(path: string, utilsScriptDeferred?: boolean): void;
|
||||
|
||||
/**
|
||||
* initialise the plugin with optional options.
|
||||
* @param options options that can be provided during initialization.
|
||||
*/
|
||||
(node: Element, options?: Options): Plugin;
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
@@ -288,5 +287,11 @@ declare namespace intlTelInputUtils {
|
||||
}
|
||||
|
||||
interface Window {
|
||||
intlTelInput: IntlTelInput.Static;
|
||||
intlTelInputGlobals: IntlTelInput.Static;
|
||||
|
||||
/**
|
||||
* initialise the plugin with optional options.
|
||||
* @param options options that can be provided during initialization.
|
||||
*/
|
||||
intlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin;
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ window.intlTelInput(input).setNumber('+447733123456');
|
||||
|
||||
window.intlTelInput(input).setPlaceholderNumberType(intlTelInputUtils.numberType.FIXED_LINE);
|
||||
|
||||
const countryData = window.intlTelInput.getCountryData();
|
||||
const countryData = window.intlTelInputGlobals.getCountryData();
|
||||
const country = countryData[0];
|
||||
const dialCode = country.dialCode;
|
||||
const iso2 = country.iso2;
|
||||
const countryName = country.name;
|
||||
|
||||
window.intlTelInput.loadUtils('build/js/utils.js');
|
||||
window.intlTelInputGlobals.loadUtils('build/js/utils.js');
|
||||
|
||||
window.intlTelInput(input, {
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
|
||||
@@ -42,13 +42,13 @@ $('#phone').intlTelInput('setNumber', '+447733123456');
|
||||
|
||||
$('#phone').intlTelInput('setPlaceholderNumberType', intlTelInputUtils.numberType.FIXED_LINE);
|
||||
|
||||
const jqueryCountryData = $.fn.intlTelInput.getCountryData();
|
||||
const jqueryCountryData = window.intlTelInputGlobals.getCountryData();
|
||||
const jqueryCountry = countryData[0];
|
||||
const jqueryDialCode = country.dialCode;
|
||||
const jqueryIso2 = country.iso2;
|
||||
const jqueryName = country.name;
|
||||
|
||||
$.fn.intlTelInput.loadUtils('build/js/utils.js');
|
||||
window.intlTelInputGlobals.loadUtils('build/js/utils.js');
|
||||
|
||||
$('#phone').intlTelInput({
|
||||
utilsScript: '../../build/js/utils.js'
|
||||
|
||||
-12
@@ -4,18 +4,6 @@
|
||||
|
||||
declare namespace IntlTelInput {
|
||||
interface JQueryPlugin {
|
||||
/**
|
||||
* Get all of the plugin's country data - either to re-use elsewhere
|
||||
* e.g. to populate a country dropdown.
|
||||
*/
|
||||
getCountryData(): intlTelInputUtils.CountryData[];
|
||||
|
||||
/**
|
||||
* Load the utils.js script (included in the lib directory) to enable
|
||||
* formatting/validation etc.
|
||||
*/
|
||||
loadUtils(path: string, utilsScriptDeferred?: boolean): void;
|
||||
|
||||
/**
|
||||
* initialise the plugin with optional options.
|
||||
* @param options options that can be provided during initialization.
|
||||
|
||||
Reference in New Issue
Block a user