From 70bb5e397f4131f732632aa65bdab3567d7b9982 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Mon, 14 Jan 2019 00:46:35 +0100 Subject: [PATCH] [npm-email] Add types --- types/npm-email/index.d.ts | 14 ++++++++++++++ types/npm-email/npm-email-tests.ts | 3 +++ types/npm-email/tsconfig.json | 23 +++++++++++++++++++++++ types/npm-email/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/npm-email/index.d.ts create mode 100644 types/npm-email/npm-email-tests.ts create mode 100644 types/npm-email/tsconfig.json create mode 100644 types/npm-email/tslint.json diff --git a/types/npm-email/index.d.ts b/types/npm-email/index.d.ts new file mode 100644 index 0000000000..055a68f8af --- /dev/null +++ b/types/npm-email/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for npm-email 3.0 +// Project: https://github.com/sindresorhus/npm-email#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = npmEmail; + +/** + * Get the email of an npm user. + * + * @param username npm username to look up. + * @returns A promise for the user's email address. + */ +declare function npmEmail(username: string): Promise; diff --git a/types/npm-email/npm-email-tests.ts b/types/npm-email/npm-email-tests.ts new file mode 100644 index 0000000000..b0640c73e3 --- /dev/null +++ b/types/npm-email/npm-email-tests.ts @@ -0,0 +1,3 @@ +import npmEmail = require('npm-email'); + +npmEmail('sindresorhus'); // $ExpectType Promise diff --git a/types/npm-email/tsconfig.json b/types/npm-email/tsconfig.json new file mode 100644 index 0000000000..985ed0472a --- /dev/null +++ b/types/npm-email/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-email-tests.ts" + ] +} diff --git a/types/npm-email/tslint.json b/types/npm-email/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-email/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }