From da4ae937263db4f5f2e3b7b446f3262889c1f190 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Tue, 25 Dec 2018 23:56:53 +0100 Subject: [PATCH] [git-user-name] Add types --- types/git-user-name/git-user-name-tests.ts | 6 ++++++ types/git-user-name/index.d.ts | 16 +++++++++++++++ types/git-user-name/tsconfig.json | 23 ++++++++++++++++++++++ types/git-user-name/tslint.json | 1 + 4 files changed, 46 insertions(+) create mode 100644 types/git-user-name/git-user-name-tests.ts create mode 100644 types/git-user-name/index.d.ts create mode 100644 types/git-user-name/tsconfig.json create mode 100644 types/git-user-name/tslint.json diff --git a/types/git-user-name/git-user-name-tests.ts b/types/git-user-name/git-user-name-tests.ts new file mode 100644 index 0000000000..4d7e0adc54 --- /dev/null +++ b/types/git-user-name/git-user-name-tests.ts @@ -0,0 +1,6 @@ +import userName = require('git-user-name'); + +userName(); // $ExpectType string | null +userName({ cwd: 'foo' }); // $ExpectType string | null +userName({ path: 'foo' }); // $ExpectType string | null +userName({ gitconfig: 'foo' }); // $ExpectType string | null diff --git a/types/git-user-name/index.d.ts b/types/git-user-name/index.d.ts new file mode 100644 index 0000000000..b72e1645c3 --- /dev/null +++ b/types/git-user-name/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for git-user-name 2.0 +// Project: https://github.com/jonschlinkert/git-user-name +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = gitUserName; + +declare function gitUserName(options?: gitUserName.Options): string | null; + +declare namespace gitUserName { + interface Options { + cwd?: string; + path?: string; + gitconfig?: string; + } +} diff --git a/types/git-user-name/tsconfig.json b/types/git-user-name/tsconfig.json new file mode 100644 index 0000000000..ba7fc9dcd5 --- /dev/null +++ b/types/git-user-name/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", + "git-user-name-tests.ts" + ] +} diff --git a/types/git-user-name/tslint.json b/types/git-user-name/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-user-name/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }