RequireJS/NodeJS code navigation

Hello World!
I try to use RequireJS with NodeJS for keeping same code for server and client side. So, I use 3 files - file with realcode and define of RequireJs, wrapper for Node/CommonJs and module, that use code from RequireJS:

js/example.js

define("BL/example", [],   /**    * @class Example    * @return {Example} example    */   function BaseMaster() {     "use strict";     return {
      text: function () {
        console.log("hello world");
      }
    };
  });


node/example.js

(function () {   "use strict";   var example = {},     requirejs = require("requirejs");   requirejs.config({     nodeRequire: require,     paths: {       BL: "/path/to/BL"     }   });   module.exports = example;   requirejs(["BL/example"],     /**      *      * @param {Example} jsExample      */     function (jsExample) {
      var field;
      for (field in jsExample) {
        if (jsExample.hasOwnField(field)) {
          example[field] = jsExample[field];
        }
      }       baseMaster.initModule();     }); }());


And module, that use example

(function () {
  "use strict";
  /** @type Example */
  var example = require("example");
  example.test();
}());


This code works fine. But WebStorm doesn't find declaration of Example in last code. How do I make it found type Example? Thx.

Please sign in to leave a comment.