Generation of TypeScript Declaration Files from JavaScript Code

08/18/2021
by   Fernando Cristiani, et al.
0

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 generates a declaration file based on this information. To evaluate the tool, 249 declaration files were generated directly from an NPM module and 111 of these were compared with the corresponding declaration file provided on DefinitelyTyped. All these files either exhibited no differences at all or differences that can be resolved by extending the developer-provided examples.

READ FULL TEXT

page 3

page 4

research
02/20/2018

Categorizing the Content of GitHub README Files

README files play an essential role in shaping a developer's first impre...
research
12/04/2022

Visualizing Contributor Code Competency for PyPI Libraries: Preliminary Results

Python is known to be used by beginners to professional programmers. Pyt...
research
05/16/2023

Newad: A register map automation tool for Verilog

Large scale scientific instrumentation-and-control FPGA gateware designs...
research
06/13/2019

FPScreen: A Rapid Similarity Search Tool for Massive Molecular Library Based on Molecular Fingerprint Comparison

We designed a fast similarity search engine for large molecular librarie...
research
04/29/2021

The Behavioral Diversity of Java JSON Libraries

JSON is a popular file and data format that is precisely specified by th...
research
11/23/2018

Smart Greybox Fuzzing

Coverage-based greybox fuzzing (CGF) is one of the most successful metho...
research
08/02/2021

DepRes: A Tool for Resolving Fully Qualified Names and Their Dependencies

Reusing code snippets shared by other programmers on Q A forums (e.g.,...

Please sign up or login with your details

Forgot password? Click here to reset