babel-plugin-jsdoc-to-assert icon indicating copy to clipboard operation
babel-plugin-jsdoc-to-assert copied to clipboard

Feature request: Support for `typedef`

Open thejhh opened this issue 5 years ago • 0 comments

I guess that's not yet supported? I couldn't find a test for typedef definitions.

I use a lot of code like this to define backend's data transfer objects before I pass them to my client side model classes:

/**
 * @typedef {Object} MyDataDTO
 * @property {string} foo -
 * @property {string} bar -
 */

/**
 * @typedef {Object} MyResponseDTO
 * @property {MyDataDTO} payload -
 * @property {number} status -
 */

/** 
 */
class MyData {

    /** 
     * @param model {MyDataDTO}
     */
    constructor (model) {
        this._model = model;
    }

    // ...
}

thejhh avatar Apr 26 '19 18:04 thejhh