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

Is imported types supported?

Open voxpelli opened this issue 6 years ago • 4 comments

Is code like this supported?

/** @typedef {import('bunyan-adaptor').BunyanLite} BunyanLite */

Seems like it was complaining quite a bit when I tried.

voxpelli avatar Jun 06 '19 15:06 voxpelli

No I don't think this is supported.

englercj avatar Jun 06 '19 16:06 englercj

There seems to be a bit of chatter going on about type imports in JSDoc, but no solid canonical path at the moment unfortunately.

https://github.com/jsdoc/jsdoc/issues/1537 https://github.com/Microsoft/TypeScript/issues/22160

jeffersoneagley avatar Nov 20 '19 19:11 jeffersoneagley

It looks like this is the TS team's official solution to this problem, but the JSDoc folks show no signs of implementing it on their end. Does it make sense for tsd-jsdoc to support this or do you have to wait for official JSDoc support? Supporting doc-import would allow workaround for all sorts of other unsupported constructs, by moving the type definition out of JS completely. (See this example)

thw0rted avatar May 28 '20 11:05 thw0rted

This is another example of why I think we should do #102

englercj avatar Jun 13 '20 03:06 englercj