/**
* @param data Information about the object.
* @param data.member Information about the object's members.
*/
function getData(data){
console.log(data.member);
}
function niceApiCall(parameters) {
const result = await ... // HTTP call to the API here
for (const e of result.entries) {
.. // decorate each entry in the result
}
return result;
}
WebStorm 将警告“ result. entry”是一个未解析的变量(字段)。
一般的解决方案是添加 @namespace声明:
function niceApiCall(parameters) {
/** @namespace result.entries **/
const result = await ... // HTTP call to the API here
for (const e of result.entries) {
.. // decorate each entry in the result
}
return result;
}