How to specify resolution and rejection type of the promise in JSDoc?
Even if they don’t exist in Javascript, I found that JSdoc understands “generic types”. So you can define your custom types and then use /* @return Promise<MyType> */. The following result in a nice TokenConsume(token) → {Promise.<Token>} with a link to your custom Token type in the doc. /** * @typedef Token * @property {bool} … Read more