diff --git a/types/email-check/email-check-tests.ts b/types/email-check/email-check-tests.ts new file mode 100644 index 0000000000..22de351676 --- /dev/null +++ b/types/email-check/email-check-tests.ts @@ -0,0 +1,9 @@ +import emailCheck = require('email-check'); + +const checkWithoutOptions: Promise = emailCheck('recipient@email.com'); + +const options: emailCheck.EmailCheckOptions = { from: 'sender@email.com', host: 'email.com', timeout: 10000 }; +const checkWithOptions: Promise = emailCheck('recipient@email.com', options); + +const partialOptions: emailCheck.EmailCheckOptions = { from: 'sender@email.com' }; +const checkWithPartialOptions: Promise = emailCheck('recipient@email.com', partialOptions); diff --git a/types/email-check/index.d.ts b/types/email-check/index.d.ts new file mode 100644 index 0000000000..5c0b6bb84f --- /dev/null +++ b/types/email-check/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for email-check 1.1 +// Project: https://github.com/pensierinmusica/email-check +// Definitions by: Luke Jones +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace emailCheck { + interface EmailCheckOptions { + from?: string; + host?: string; + timeout?: number; + } +} + +declare function emailCheck(email: string, options?: emailCheck.EmailCheckOptions): Promise; + +export = emailCheck; diff --git a/types/email-check/tsconfig.json b/types/email-check/tsconfig.json new file mode 100644 index 0000000000..e61523b41c --- /dev/null +++ b/types/email-check/tsconfig.json @@ -0,0 +1,23 @@ +{ + "files": [ + "index.d.ts", + "email-check-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/email-check/tslint.json b/types/email-check/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/email-check/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}