mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
nodemailer: MimeNode.build returns Promise (#41068)
* nodemailer: MimeNode.build returns Promise * nodemailer: definition for v6.4
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Nodemailer 6.2
|
||||
// Type definitions for Nodemailer 6.4
|
||||
// Project: https://github.com/nodemailer/nodemailer, https://nodemailer.com
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Piotr Roszatycki <https://github.com/dex4er>
|
||||
|
||||
+2
-1
@@ -87,8 +87,9 @@ declare class MimeNode {
|
||||
*/
|
||||
setContent(content: string | Buffer | Readable): this;
|
||||
|
||||
/** Generate the message and return it with a callback */
|
||||
/** Generate the message and return it with a callback or promise */
|
||||
build(callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
build(): Promise<Buffer>;
|
||||
|
||||
getTransferEncoding(): string;
|
||||
|
||||
|
||||
@@ -1282,13 +1282,19 @@ function mailcomposer_createReadStream_test() {
|
||||
|
||||
// build
|
||||
|
||||
function mailcomposer_build_test() {
|
||||
function mailcomposer_build_callback_test() {
|
||||
const mail = new MailComposer({ from: '...' });
|
||||
mail.compile().build((err, message) => {
|
||||
process.stdout.write(message);
|
||||
});
|
||||
}
|
||||
|
||||
async function mailcomposer_build_promise_test() {
|
||||
const mail = new MailComposer({ from: '...' });
|
||||
const message = await mail.compile().build();
|
||||
process.stdout.write(message);
|
||||
}
|
||||
|
||||
// addressparser
|
||||
|
||||
function isAddress(addressOrGroup: addressparser.AddressOrGroup): addressOrGroup is addressparser.Address {
|
||||
|
||||
Reference in New Issue
Block a user