mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 08:57:26 +08:00
Add typings for git-branch
This commit is contained in:
14
types/git-branch/git-branch-tests.ts
Normal file
14
types/git-branch/git-branch-tests.ts
Normal 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
types/git-branch/index.d.ts
vendored
Normal file
15
types/git-branch/index.d.ts
vendored
Normal 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
types/git-branch/tsconfig.json
Normal file
23
types/git-branch/tsconfig.json
Normal 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
types/git-branch/tslint.json
Normal file
1
types/git-branch/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user