【发布时间】:2020-05-30 04:05:51
【问题描述】:
我尝试将使用nodemailer 和nodemailer-html-to-text 插件的代码库转换为打字稿。
Nodemailer 有 @types 定义,但 nodemailer-html-to-text 没有。
如何为这个模块创建自己的类型定义?
我试图在我的项目中创建一个@types/nodemailer-html-to-text.d.ts 文件:
declare module 'nodemailer-html-to-text' {
}
从这里开始,我希望这个文件导出一个Mail.PluginFunction类型的htmlToText函数定义,但是我不知道该怎么做……
【问题讨论】:
标签: typescript npm nodemailer