diff --git a/types/sendmail/index.d.ts b/types/sendmail/index.d.ts index 191c0514fb..a70fc9930f 100644 --- a/types/sendmail/index.d.ts +++ b/types/sendmail/index.d.ts @@ -2,13 +2,14 @@ // Project: https://github.com/guileen/node-sendmail // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /*~ If this module is a UMD module that exposes a global variable 'myLib' when *~ loaded outside a module loader environment, declare that global here. *~ Otherwise, delete this declaration. */ declare namespace sendMailConstructor { - export interface IOptions { + interface Options { logger?: { debug?: () => void; info?: () => void; @@ -33,7 +34,7 @@ declare namespace sendMailConstructor { smtpHost?: string | number; } - export interface IMailInput { + interface MailInput { from: string; to: string; cc?: string; @@ -45,26 +46,26 @@ declare namespace sendMailConstructor { charset?: string; encoding?: string; id?: string; - headers?: object; + headers?: any; content?: string; html?: string; - attachments?: { + attachments?: Array<{ type: string; filename: string; content: any; - }[]; + }>; } } type CallbackFn = (err: Error, domain: string) => void; type SendMailFn = ( - mail: sendMailConstructor.IMailInput, + mail: sendMailConstructor.MailInput, callback: CallbackFn ) => void; declare function sendMailConstructor( - options: sendMailConstructor.IOptions + options: sendMailConstructor.Options ): SendMailFn; export = sendMailConstructor; diff --git a/types/sendmail/sendmail-tests.ts b/types/sendmail/sendmail-tests.ts index f57c3b00d9..5b0f50979b 100644 --- a/types/sendmail/sendmail-tests.ts +++ b/types/sendmail/sendmail-tests.ts @@ -4,7 +4,7 @@ const emailSender = sendmail({ silent: false }); -const sendEmail = (options: sendmail.IMailInput): Promise => +const sendEmail = (options: sendmail.MailInput): Promise => new Promise((resolve, reject) => { emailSender(options, (err, reply) => { // if error happened or returned code is now started with 2** diff --git a/types/sendmail/tsconfig.json b/types/sendmail/tsconfig.json index c4cf4b7613..248bfdbfdf 100644 --- a/types/sendmail/tsconfig.json +++ b/types/sendmail/tsconfig.json @@ -1,22 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "sendmail-tests.ts" - ] + "files": ["index.d.ts", "sendmail-tests.ts"] }