-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript types definition support #433
Comments
Hi there! Thanks for putting this together. I don't understand your video example though. The second line doesn't make sense - it should start |
Indeed it doesn't look correct. I'll have a look later this week, thanks for your comment :) |
Fixed it - see merged PR. Note$.fn.intlTelInput static methods are not typed because of jquery typings. |
Thanks! So now I'm wondering - without static method support, what exactly does this do? Presumably it doesn't support the public methods e.g. |
Defines intlTelInput method in JQuery instanceWithout the definition file, intlTelInput method would not be available in JQuery instances. It would give following error : Defines different signatures of the public API (parameters types, return type)In that file, I defined the methods listed in the public API with correct param type and return type. Even if public methods are called with method name as a string, TypeScript allows you to have specialized overload signatures based on string constants. It allows you i.e. to specify correct return type depending on method name. That is what I did and what for example JQueryUI has also in its d.ts (see Defines the optionsWhen you will provide options object, it will have to be compliant (property name and correct type) with the Options interface defined in the d.ts file. For example, it will restrict you from doing this : Defines intlTelInputUtils global variable and enumsI also defined intlTelInputUtils global var so TypeScript compiler will know what type it is; same for enums. Otherwise it will complain with such errors. |
Very cool thank you! |
First, sorry for up this old issue. I have small question about this types definitions. After install I a new angular project, I trying import the lib, like this:
And this error show up:
I think this maybe happen because is never exported, in base a similar issue that I find: microsoft/TypeScript#11420 (comment) What I missing here? |
@romelgomez |
Dear I tried use this plugin on oracle apex but only value in item inserted how I can get the extension also . |
The newly added React component needs type definitions. |
Hello!
This issue just to let you know I added Typescript definition file for this plugin in DefinitelyTyped repo (see merged PR).
I just did a PR to intl-tel-input repo to add this information to README.md .
The text was updated successfully, but these errors were encountered: