diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index 45ffbcfb12..84f7bed50a 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -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; } diff --git a/types/intl-tel-input/intl-tel-input-tests.ts b/types/intl-tel-input/intl-tel-input-tests.ts index 58c5790342..9a8d68ee5d 100644 --- a/types/intl-tel-input/intl-tel-input-tests.ts +++ b/types/intl-tel-input/intl-tel-input-tests.ts @@ -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' diff --git a/types/intl-tel-input/jquery-wrapped-tests.ts b/types/intl-tel-input/jquery-wrapped-tests.ts index ad870e800b..cd8eae1704 100644 --- a/types/intl-tel-input/jquery-wrapped-tests.ts +++ b/types/intl-tel-input/jquery-wrapped-tests.ts @@ -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' diff --git a/types/intl-tel-input/jquery-wrapped.d.ts b/types/intl-tel-input/jquery-wrapped.d.ts index 6a69404221..a95cbf2ba8 100644 --- a/types/intl-tel-input/jquery-wrapped.d.ts +++ b/types/intl-tel-input/jquery-wrapped.d.ts @@ -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.