-
Notifications
You must be signed in to change notification settings - Fork 378
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
Overloaded jQuery getter/setters always use return type of getter #123
Comments
Also the methods |
Yes, this is a limitation of the default definition system -- it doesn't handle overloading. It's possible to write custom code to handle such functions, but that seems overkill for the jQuery module. Overloading simply on the number of arguments would not be too hard to implement, I guess, and would come in handy often. I'll leave this issue open. Not sure when I'll get to it. |
heya @marijnh, is this feature request still open? do you have any idea if there was any progress on this idea? |
I think more and more that tern should support multiple signature #713 It could support this issue like TypeScript Definition support it https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jquery/jquery.d.ts#L1406
|
Some of the jQuery methods like attr, css, and prop, function as both getters and setters, and return different types for the getter vs. the setter.
It would be nice if tern could figure out the return type based on the number of arguments passed to the function, so the hints would be based on the correct type.
Maybe some way to specify multiple signatures in the jquery.json file for these methods could work?
The text was updated successfully, but these errors were encountered: