jsdoc-tsd icon indicating copy to clipboard operation
jsdoc-tsd copied to clipboard

How to document an external type?

Open MichalCz opened this issue 5 years ago • 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.

MichalCz avatar Aug 28 '19 15:08 MichalCz

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

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

wehrstedt avatar Aug 28 '19 17:08 wehrstedt

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. :)

MichalCz avatar Aug 28 '19 19:08 MichalCz