title: JSDoc type for returned class instances
body: <p>I'm using Node.js with two modules and one script that depends on them:</p>
  
  <p><strong>lib/Bar.js</strong></p>
  
  <pre><code>module.exports = class Bar {
    // ..
  };
  </code></pre>
  
  <p><strong>lib/Foo.js</strong></p>
  
  <pre><code>const Bar = require('./Bar.js');
  
  module.exports = class Foo {
    /**
     * @return {Bar} A Bar instance
    */
    get someBar() {
      return new Bar();
    }
  };
  </code></pre>
  
  <p><strong>main.js</strong></p>
  
  <pre><code>const Foo = require('./lib/Foo.js');
  
  checkFoo(new Foo());
  
  /**
   * @param {Foo} foo A Foo instance
  */
  function checkFoo(foo) {
    foo. // I get suggestions for Foo properties
    foo.someBar. // I get suggestions for Bar properties
  
    checkBar(foo.someBar);
  }
  
  /**
   * @param {Bar} bar a Bar instance
  */
  function checkBar(bar) {
    bar. // I get no suggestions!
  }
  </code></pre>
  
  <p>My code editor Visual Studio Code uses IntelliSense to give the user suggestions about Foo and Bar properties, which works correctly inside the <code>checkFoo</code> method as the type of <code>foo</code> is declared as <code>Foo</code> object, and the type of <code>foo.someBar</code> is declared in the <code>Foo</code> class as a <code>Bar</code> object.</p>
  
  <p>But as soon as I pass this <code>Bar</code> instance to another method (<code>checkBar</code>), the type <code>Bar</code> isn't recognized (probably because I don't require the module). <strong>Is there a special syntax in JSDoc to specify a type as being declared in another module?</strong> Or is this just an issue with VSCode?</p>