-fix linting problems

This commit is contained in:
Ostad
2019-03-05 13:25:20 -05:00
parent a07c515fbd
commit 55151c0d42
3 changed files with 13 additions and 18 deletions
+8 -7
View File
@@ -2,13 +2,14 @@
// Project: https://github.com/guileen/node-sendmail
// Definitions by: My Self <https://github.com/me>
// 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;
+1 -1
View File
@@ -4,7 +4,7 @@ const emailSender = sendmail({
silent: false
});
const sendEmail = (options: sendmail.IMailInput): Promise<boolean> =>
const sendEmail = (options: sendmail.MailInput): Promise<boolean> =>
new Promise((resolve, reject) => {
emailSender(options, (err, reply) => {
// if error happened or returned code is now started with 2**
+4 -10
View File
@@ -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"]
}