otris/jsdoc-tsd

How to document an external type?

MichalCz opened this issue · 2 comments

Hi,

How should we document external modules in the code?

A simple example would be this:

/**
 * @returns {Readable} 
 */
function() { return fs.createReadStream('some-file.txt') }

In this case we mean import {Readable} from "stream" which should appear in the definition file.

You should be able to simply provide the longname, there is nö validstion. Have you tried

/**
 * @returns {stream.Readable}
 */

I'll double-check tomorrow - but I remember it wasn't sufficient. Just as if it required that import in the begining. I'll get back to you tomorrow, but today I've had some wine already so my checks may be less than useful. :)