Inference and Evolution of TypeScript Declaration Files

Erik Krogh Kristensen and Anders Møller

TypeScript is a typed extension of JavaScript that has become widely used. More than 2000 JavaScript libraries now have publicly available TypeScript declaration files, which allows the libraries to be used when programming TypeScript applications. Such declaration files are written manually, however, and they are often lagging behind the continuous development of the libraries, thereby hindering their usability. The existing tool TSCheck is capable of detecting mismatches between the libraries and their declaration files, but it is less suitable when creating and evolving declaration files.

In this work we present the tools TSInfer and TSEvolve that are designed to assist the construction of new TypeScript declaration files and support the co-evolution of the declaration files as the underlying JavaScript libraries evolve. Our experimental results involving major libraries demonstrate that TSInfer and TSEvolve are superior to TSCheck regarding these tasks and that the tools are sufficiently fast and precise for practical use.

[ PDF | BibTeX | supplementary material ]