Add definition for "nodemailer-stub-transport".

This commit is contained in:
Cyril Schumacher
2016-10-22 16:41:32 +02:00
parent 3cc599268d
commit 2837a29204
2 changed files with 46 additions and 0 deletions
@@ -0,0 +1,8 @@
/// <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 }));
@@ -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;
}