mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
[intl-tel-input] Add promise property.
This commit is contained in:
Vendored
+2
@@ -37,6 +37,8 @@ declare namespace IntlTelInput {
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
promise: Promise<void>;
|
||||
|
||||
/**
|
||||
* Remove the plugin from the input, and unbind any event listeners.
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,24 @@
|
||||
import intlTelInput = require('intl-tel-input');
|
||||
|
||||
// $ExpectType (node: Element, options?: Options) => Plugin
|
||||
intlTelInput;
|
||||
function test_import() {
|
||||
// $ExpectType (node: Element, options?: Options) => Plugin
|
||||
intlTelInput;
|
||||
}
|
||||
|
||||
// $ExpectError
|
||||
const options: IntlTelInput.Options = {
|
||||
allowDropdown: true
|
||||
};
|
||||
function test_IntlTelInput_not_visible() {
|
||||
// $ExpectError
|
||||
const options: IntlTelInput.Options = {
|
||||
allowDropdown: true
|
||||
};
|
||||
}
|
||||
|
||||
function test_intlTelInputUtils_global() {
|
||||
const input = document.querySelector('#phone');
|
||||
const iti = intlTelInput(input, {
|
||||
utilsScript: 'node_modules/intl-tel-input/build/js/utils.js'
|
||||
});
|
||||
|
||||
iti.promise.then(() => {
|
||||
console.log(intlTelInputUtils.numberFormat.E164);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user