I got this piece of code:
import nodemailer from "nodemailer";
const transporter = nodemailer.createTransport({
host: "smtp...",
port: 587,
secure: false,
requireTLS: true,
auth: {...}
});
const result = await transporter.sendMail({
from: "XXX",
to: "YYY",
subject: "ZZZ",
text: "WWW"
});
Typescript is currently evaluation the result
as any
.
Is this correct?
I have also installed @types/nodemailer
. This is the type definition contained in it:
Even if I try to type it as SentMessageInfo
directly, I also get any
:
import { SentMessageInfo } from "nodemailer";
const result: SentMessageInfo = await transporter.sendMail({...});
Am I doing something wrong? Or there is really no type definition for that?
The type for transporter
seems to be correct (the type is Mail
).
The type is correct, SentMessageInfo
is simply an alias for any
:
export type SentMessageInfo = any;