mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
[git-branch] Improve types (#31676)
This commit is contained in:
committed by
Wesley Wigham
parent
44b33a09c5
commit
a3b7804c74
@@ -1,14 +1,18 @@
|
||||
import gitBranch = require('git-branch');
|
||||
|
||||
gitBranch()
|
||||
.then((name) => {});
|
||||
.then((name) => {
|
||||
name; // $ExpectType string
|
||||
});
|
||||
|
||||
gitBranch('cwd')
|
||||
.then((name) => {});
|
||||
.then((name) => {
|
||||
name; // $ExpectType string
|
||||
});
|
||||
|
||||
gitBranch.sync();
|
||||
gitBranch.sync('cwd');
|
||||
gitBranch.sync(); // $ExpectType string
|
||||
gitBranch.sync('cwd'); // $ExpectType string
|
||||
|
||||
gitBranch((err, name) => {});
|
||||
gitBranch((err, name) => {}); // $ExpectType void
|
||||
|
||||
gitBranch('cwd', (err, name) => {});
|
||||
gitBranch('cwd', (err, name) => {}); // $ExpectType void
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ 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 function GitBranch(callback: (err: null | string, name: string) => void): void;
|
||||
|
||||
declare namespace GitBranch {
|
||||
function sync(cwd?: string): string;
|
||||
|
||||
Reference in New Issue
Block a user