wikimedia / jquery.i18n

🌐 jQuery based internationalization library
GNU General Public License v2.0
703 stars 143 forks source link

Add a typescript declaration file #275

Open sportshead opened 1 year ago

sportshead commented 1 year ago

Bug: T348794

Did my best to infer the types based on the code, I think I got the types pretty accurate. One thing I'm not too sure about is MessageStore.load - I copied the overloads straight from I18N.load, since it seems like they both take the same input.

santhoshtr commented 11 months ago

Thanks for your contribution. Would it be possible to add tests for these typings as well? Banana.i18n is the successor of this library, and that library also has typings. You can refer the typing tests in the repo: https://github.com/wikimedia/banana-i18n/tree/master/types

Tests not only verify the work you did, but also act as example reference to use the type definition.