mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add type definitions for email-check (#47097)
This commit is contained in:
parent
40c72bd5eb
commit
24f1e8d601
9
types/email-check/email-check-tests.ts
Normal file
9
types/email-check/email-check-tests.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import emailCheck = require('email-check');
|
||||
|
||||
const checkWithoutOptions: Promise<boolean> = emailCheck('recipient@email.com');
|
||||
|
||||
const options: emailCheck.EmailCheckOptions = { from: 'sender@email.com', host: 'email.com', timeout: 10000 };
|
||||
const checkWithOptions: Promise<boolean> = emailCheck('recipient@email.com', options);
|
||||
|
||||
const partialOptions: emailCheck.EmailCheckOptions = { from: 'sender@email.com' };
|
||||
const checkWithPartialOptions: Promise<boolean> = emailCheck('recipient@email.com', partialOptions);
|
||||
16
types/email-check/index.d.ts
vendored
Normal file
16
types/email-check/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Type definitions for email-check 1.1
|
||||
// Project: https://github.com/pensierinmusica/email-check
|
||||
// Definitions by: Luke Jones <https://github.com/luke-j>
|
||||
// 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<boolean>;
|
||||
|
||||
export = emailCheck;
|
||||
23
types/email-check/tsconfig.json
Normal file
23
types/email-check/tsconfig.json
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
3
types/email-check/tslint.json
Normal file
3
types/email-check/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user