Merge pull request #26286 from rynclark/git-branch

Add typings for git-branch
This commit is contained in:
Armando Aguirre
2018-06-05 15:28:43 -07:00
committed by GitHub
4 changed files with 53 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import gitBranch = require('git-branch');
gitBranch()
.then((name) => {});
gitBranch('cwd')
.then((name) => {});
gitBranch.sync();
gitBranch.sync('cwd');
gitBranch((err, name) => {});
gitBranch('cwd', (err, name) => {});
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for git-branch 2.0
// Project: https://github.com/jonschlinkert/git-branch
// Definitions by: Ryan Clark <https://github.com/rynclark>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export = GitBranch;
declare function GitBranch(cwd?: string): Promise<string>;
declare function GitBranch(cwd?: string, callback?: (err: null | string, name: string) => void): void;
declare function GitBranch(callback?: (err: null | string, name: string) => void): void;
declare namespace GitBranch {
function sync(cwd?: string): string;
}
+23
View File
@@ -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-branch-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }