jsdocts
Outputs typescript declaration files from javascript files documented with jsDoc
Overview
jsdocts uses the jsdoc-toolkit to create a typescript decleration files from the jsdoc comments in the associated javascript files.
jsdocts uses NOC to wrap the jsdoc-toolkit
Installation
npm install -g jsdocts
Usage
jsdocts -d:<decleration_output_path> <source_dir> <source_file> ...
Known Issues
- Optional parameters
- Method overloading
- Modules
Untested
- Passthrough of standard jsDoc-Toolkit options
Example
javascript file documentd with jsdocs
/** Creates a new Vector. @constructor @param @param @param*/ { thisx = x; thisy = y; thisz = z;} /** Multiples a vector by the given value and returns the new vector @method times @param @return */Vectorprototype { return k * thisx k * thisy k * thisz;}; /** Adds a vector to the vector instance, returning a new vector. @method plus @param @return */Vectorprototype { return thisx + vx thisy + vy thisz + vz;}; /** Performs the dot product @method dot @param @return */Vectorprototype { return thisx * vx + thisy * vy + thisz * vz;}; /** Gets the magnitude of the vector @method mag @return */Vectorprototype { return Math;}; /** Performs the cross product of 2 vectors @method cross @param @param @return */Vector { return v1y * v2z - v1z * v2y v1z * v2x - v1x * v2z v1x * v2y - v1y * v2x;};
exported declaration file