Skip to content

helps in the creation of Typescript definition files for existing Javascript libraries

License

Notifications You must be signed in to change notification settings

mhelvens/js2tsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js2tsd

This project consists of a simple script that helps in the creation of Typescript definition files for existing Javascript libraries. Files that might then be submitted to DefinitelyTyped, for instance. It does this by importing the library itself, traversing its enumerable properties, and generating the skeleton for a corresponding .d.ts file.

The script will be improved over time, but the process will never be perfect, so you'll always need to do some manual work before the output becomes useful. You need to manually specify most types, as well as double-check the output for obvious mistakes. But the boring copy/pasting work will be taken care of.

No comprehensive documentation has been written yet, but it should be easy enough to get started. Have a look at example.js, which uses the Chroma.js library as an example.

Have fun!

About

helps in the creation of Typescript definition files for existing Javascript libraries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published