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" }