Skip to content

A jsdoc plugin that will convert types like {typeof SomeClass} into {Class<SomeClass>}

Notifications You must be signed in to change notification settings

cancerberoSgx/jsdoc-typeof-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Dependencies Dependencies

What

A jsdoc plugin that will convert types like {typeof SomeClass} into {Class<SomeClass>}

Why

Because jsdoc3 doesn't support types that reference classes - just class instances. Also because we want to validate types using typescript jsdoc and google closure which supports the syntax {typeof SomeClass} for referencing static types. Jsdoc currently fails generating documentation if it founds such expressions. This plugin will translate such expressions to a syntax compatible to jsdoc that make some sense.

How to use

npm install jsdoc-typeof-plugin --save-dev

Enable this plugin in your jsdoc configuration file:

    "plugins": ["node_modules/jsdoc-typeof-plugin"],

And now you are ready to use {typeof SomeClass}, for example:

/**
 * @class
 */
class WithTypes {

    constructor() {
        /**
         * @property {typeof View} the view class used to render each item
         */
        this.ItemViewClass
    }
    /**
    * @return {typeof Something} a new Something subclass
    */
    static extends() {
        return null
    }
}

About

A jsdoc plugin that will convert types like {typeof SomeClass} into {Class<SomeClass>}

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published