Merge pull request #12178 from cyrilschumacher/master

Add definition for "nodemailer-stub-transport".
This commit is contained in:
Zhengbo Li
2016-10-24 11:42:32 -07:00
committed by GitHub
2 changed files with 48 additions and 0 deletions
@@ -0,0 +1,10 @@
/// <reference path="nodemailer-stub-transport.d.ts"/>
import nodemailer = require("nodemailer");
import stubTransport = require("nodemailer-stub-transport");
var transport = nodemailer.createTransport(stubTransport());
nodemailer.createTransport(stubTransport({ error: new Error('Invalid recipient') }));
transport = nodemailer.createTransport(stubTransport({ keepBcc: true }));
nodemailer.createTransport(stubTransport());
@@ -0,0 +1,38 @@
// Type definitions for nodemailer-stub-transport v1.1.0
// Project: https://github.com/andris9/nodemailer-stub-transport
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../nodemailer/nodemailer.d.ts"/>
declare module "nodemailer-stub-transport" {
import * as nodemailer from "nodemailer";
namespace StubTransportStatic {
/**
* Options.
* @interface
*/
export interface Options {
/**
* Specifies a custom error.
* @type {any}
*/
error?: any;
/**
* Value that indicates if the BCC addresses must be included in generated message.
* @type {boolean}
*/
keepBcc?: boolean;
}
}
/**
* Creates a stub transport.
* @param {Options} [options] Options.
* @return {Transport} The stub transport.
*/
function stubTransport(options?: StubTransportStatic.Options): nodemailer.Transport;
export = stubTransport;
}