[git-add-remote] Add types

This commit is contained in:
Dimitri Benin 2018-12-25 15:50:14 +01:00
parent 682ebb5fcd
commit 079a53d99e
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import addRemotePrepare = require('git-add-remote');
const addRemote = addRemotePrepare('foo/bar');
addRemote('foo', 'https://foo.git', (err, stdout, stderr) => {
err; // $ExpectType ExecException | null
stdout; // $ExpectType string
stderr; // $ExpectType string
});
addRemote.sync('foo', 'https://foo.git');

24
types/git-add-remote/index.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
// Type definitions for git-add-remote 1.0
// Project: https://github.com/jonschlinkert/git-add-remote
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { ExecException } from 'child_process';
export = prepare;
declare function prepare(cwd?: string): prepare.AddRemote;
declare namespace prepare {
interface AddRemote {
(
name: string,
url: string,
callback: (error: ExecException | null, stdout: string, stderr: string) => void
): void;
sync(name: string, url: string): void;
}
}

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-add-remote-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }