假设我有3个简单文件:
app.js
const A = require('./a');
const B = require('./b');
let first = new A("hello");
let second = new B(first);
a.js
/**
* @constructor
* @param {*} val Value
*/
function a(val) {
this.val = val;
}
module.exports = a;
b.js
/**
* @constructor
* @param {a} a - a instance
*/
function b(a) {
this.a = a;
console.log(this.a.val); // no hint / autocomplete suggestions
}
module.exports = b;
是否有可能使Intellisense在文件“ b.js”中显示类“ a”的字段/方法,而无需在将其作为参数传递时导入/要求它?