From d3d7c7b4ab34fd55c291ad9b8665d11f08f7f984 Mon Sep 17 00:00:00 2001 From: Vincent Bortone Date: Sun, 3 Feb 2013 10:42:12 -0500 Subject: [PATCH] Add transport class. --- nodemailer/nodemailer.d.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/nodemailer/nodemailer.d.ts b/nodemailer/nodemailer.d.ts index 4ab4a09af..6b4dc3420 100644 --- a/nodemailer/nodemailer.d.ts +++ b/nodemailer/nodemailer.d.ts @@ -4,10 +4,26 @@ // Definitions by: Vincent Bortone // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface Transport {} +class Transport { + static transports: { + SMTP: SMTPTransport, + SES: SESTransport, + SENDMAIL: SendmailTransport, + STUB: StubTransport + }; + + constructor(type: string, options?: Object); + options: Object; + transportType: strng; + sendMailWithTransport(emailMessage: MailComposer, callback?: (err: Error) => any): any; + useDKIM(dkim: DKIMOptions); + close(callback?: (err: Error) => any)); +} interface MailComposer {} +interface DKIMOptions{} + interface XOAuthGenerator {} interface NodemailerTransportOptions { @@ -17,12 +33,15 @@ interface NodemailerTransportOptions { interface NodeMailerMessageOptions {} +// Module level exports interface NodemailerStatic { X_MAILER_NAME: string; X_MAILER_HOMEPAGE: string; + createXOAuthGenerator(options: Object): XOAuthGenerator; createTransport(type: string, options: NodeMailerTransportOptions): Transport; sendMail(options: NodeMailerMessageOptions, callback?: (err: Error) => any): any; send_mail(options: NodeMailerMessageOptions, callback?: (err: Error) => any): any; + stripHTML(str: string): string; } interface Nodemailer {