mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
Merge pull request #31684 from BendingBender/git-username
[git-username] Add types
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import username = require('git-username');
|
||||
|
||||
username('some/path'); // $ExpectType string | null
|
||||
username({ cwd: 'some/path' }); // $ExpectType string | null
|
||||
username({ strict: true }); // $ExpectType string
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for git-username 1.0
|
||||
// Project: https://github.com/jonschlinkert/git-username
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = gitUsername;
|
||||
|
||||
declare function gitUsername(options: gitUsername.StrictOptions): string;
|
||||
declare function gitUsername(options?: string | gitUsername.BaseOptions): string | null;
|
||||
|
||||
declare namespace gitUsername {
|
||||
interface BaseOptions {
|
||||
cwd?: string;
|
||||
strict?: boolean;
|
||||
}
|
||||
|
||||
interface StrictOptions extends BaseOptions {
|
||||
strict: true;
|
||||
}
|
||||
}
|
||||
@@ -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-username-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user