Page MenuHomePhabricator

TypeScript declaration files for jquery.i18n
Open, In Progress, LowPublic2 Estimated Story PointsFeature

Description

Feature summary (what you would like to be able to do and where):
Currently it seems like most of the code in the jquery.i18n library is being documented with JSDoc comments, meaning that generating .d.ts files (aka typescript declaration files) would not require too much work.

The generated .d.ts files could be published as part of the npm package for use by end users (such as myself).

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
Developing a Typescript-based userscript with the jquery.i18n library

Benefits (why should this be implemented?):
As a userscript developer working with the Mediawiki JS API, having typescript declaration files is extremely helpful to ensure the type-safety of my project and also to use autocomplete in my IDE.

Event Timeline

@Sportzpikachu Thanks for the PR. Please note that jquery.i18n has a successor banana.i18n which is a framework agnostic js library. That is the library we are actively going to maintain. If your usecase can use that library, it would be much better.

However, type definition for jquery.i18n may be useful for some projects. we will review it.

@Sportzpikachu Thanks for the PR. Please note that jquery.i18n has a successor banana.i18n which is a framework agnostic js library. That is the library we are actively going to maintain. If your usecase can use that library, it would be much better.

However, type definition for jquery.i18n may be useful for some projects. we will review it.

Hi @santhosh, my current usecase is for a userscript. In order to avoid loading external dependencies, we're fetching jquery.i18n from resourceloader. If banana.i18n is available on resourceloader, it would be very helpful for us.

Nikerabbit triaged this task as Medium priority.Nov 21 2023, 8:41 AM
Nikerabbit changed the task status from Open to In Progress.Nov 23 2023, 8:48 AM
Nikerabbit lowered the priority of this task from Medium to Low.Apr 3 2024, 8:44 AM