tsd-jsdoc
tsd-jsdoc copied to clipboard
Is imported types supported?
Is code like this supported?
/** @typedef {import('bunyan-adaptor').BunyanLite} BunyanLite */
Seems like it was complaining quite a bit when I tried.
No I don't think this is supported.
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
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)
This is another example of why I think we should do #102