TL;DR
This paper introduces dts-generate, a tool that automatically creates TypeScript declaration files from JavaScript libraries by executing code examples and extracting runtime information, reducing manual effort and errors.
Contribution
The work presents a novel automated approach to generate accurate TypeScript declaration files from JavaScript code using runtime analysis of documentation examples.
Findings
Generated declaration files matched or could be improved by existing ones
The tool successfully automates declaration file creation for NPM packages
Most discrepancies are resolvable by extending code examples
Abstract
Developers are starting to write large and complex applications in TypeScript, a typed dialect of JavaScript. TypeScript applications integrate JavaScript libraries via typed descriptions of their APIs called declaration files. DefinitelyTyped is the standard public repository for these files. The repository is populated and maintained manually by volunteers, which is error-prone and time consuming. Discrepancies between a declaration file and the JavaScript implementation lead to incorrect feedback from the TypeScript IDE and, thus, to incorrect uses of the underlying JavaScript library. This work presents dts-generate, a tool that generates TypeScript declaration files for JavaScript libraries uploaded to the NPM registry. It extracts code examples from the documentation written by the developer, executes the library driven by the examples, gathers run-time information, and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
