[英]How to use a type from another module as a JSDoc return/param type
我正在嘗試使用JSDoc來記錄我正在制作的機器人的一些功能:
const Discord = require("discord.js");
/**
* Returns and empty embed with the bot's default settings
* @param u - The user that executed the command
* @returns {Discord.RichEmbed}
*/
exports.getDefaultEmbed = function(u) {
let embed = new Discord.RichEmbed();
embed.setColor(0xFA632A);
if (u) embed.setFooter(u.tag, u.displayAvatarURL);
return embed;
};
正如你所看到的,這個函數返回從一個RichEmbed對象discord.js
模塊,但WebStorm似乎並不喜歡這樣。
那么,我如何使用JSDoc中另一個模塊的類型?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.