Skip to content

Commit 1d55982

Browse files
fix: update transport.ts to include Transport type and define MailMessage for improved type safety
1 parent 21317ff commit 1d55982

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/types/transport.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import NodemailerMail = require("nodemailer/lib/mailer");
22

3-
import { Transporter } from "nodemailer";
3+
import { Transport, Transporter } from "nodemailer";
44
import {
55
SendResponse,
66
SendError,
@@ -51,3 +51,5 @@ export interface MailtrapTransporter extends Transporter<MailtrapResponse> {
5151
mailOptions: MailtrapMailOptions | MailtrapMailOptionsSandbox
5252
): Promise<MailtrapResponse>;
5353
}
54+
55+
export type MailMessage<T> = Parameters<Transport<T>["send"]>[0];

0 commit comments

Comments
 (0)