Home

Awesome

jsdoc-tsd

Installation

You can install this module from npm:

$> npm install @otris/jsdoc-tsd

Usage

To use this module, simply specify this project as the template for your jsdoc output. To use this template from the command line, run

$> jsdoc -t node_modules/@otris/jsdoc-tsd -r .

You can also add this template to your JSON configuration file:

{
    "opts": {
        "template": "./node_modules/@otris/jsdoc-tsd"
    }
}

Output directory / file

To determine the output directory and / or the output file name you can pass the path or the file name to the cmd call as follow:

$> jsdoc -d <target-dir>/<filename>.d.ts

Important: If you want to change the file name of the result file your path has to end with the file ending d.ts

Options

[
    "global",
    "inner",
    "instance",
    "static"
]
/**
 * Determines if the tagged version is less or equal the latest version
 * @param {string} taggedVersion The value of the @since tag
 * @param {string} [latestVersion] The configured value, if passed
 * @returns {boolean} true, if the item should be emitted, otherwise false
 */
function versionComparator(taggedVersion, latestVersion) {

}

Alternatively you can pass a path to a javascript file which exports the comparator function like

module.exports = function(taggedVersion, latestVersion) {
    // do what you need to
}

Supported Tags

Supported typscript tags

Ignored Tags

Note

This jsdoc template was developed for my needs. There will be some updates in the future, but I don't know when.

Pull requests are welcome. But please test your changes.

This project is inspired by jsdoc2tsd