diff --git a/types/git-branch/git-branch-tests.ts b/types/git-branch/git-branch-tests.ts new file mode 100644 index 0000000000..4b02cb5da3 --- /dev/null +++ b/types/git-branch/git-branch-tests.ts @@ -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) => {}); diff --git a/types/git-branch/index.d.ts b/types/git-branch/index.d.ts new file mode 100644 index 0000000000..a1cecc9691 --- /dev/null +++ b/types/git-branch/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for git-branch 2.0 +// Project: https://github.com/jonschlinkert/git-branch +// Definitions by: Ryan Clark +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export = GitBranch; + +declare function GitBranch(cwd?: string): Promise; +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; +} diff --git a/types/git-branch/tsconfig.json b/types/git-branch/tsconfig.json new file mode 100644 index 0000000000..0ed27223a0 --- /dev/null +++ b/types/git-branch/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-branch-tests.ts" + ] +} diff --git a/types/git-branch/tslint.json b/types/git-branch/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-branch/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }