mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #31691 from BendingBender/list-git-remotes
[list-git-remotes] Add types
This commit is contained in:
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for list-git-remotes 1.0
|
||||
// Project: https://github.com/jonschlinkert/list-git-remotes
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { ExecException, ExecSyncOptions } from 'child_process';
|
||||
|
||||
export = listGitRemotes;
|
||||
|
||||
declare function listGitRemotes(callback: listGitRemotes.Callback): void;
|
||||
declare function listGitRemotes(cwd: string, callback: listGitRemotes.Callback): void;
|
||||
|
||||
declare namespace listGitRemotes {
|
||||
function sync(cwd?: string, options?: ExecSyncOptions): Remotes;
|
||||
function sync(options: ExecSyncOptions): Remotes;
|
||||
|
||||
type Callback = (err: ExecException | null, remotes: Remotes, stderr?: string) => void;
|
||||
|
||||
interface Remotes {
|
||||
[key: string]: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import remotes = require('list-git-remotes');
|
||||
|
||||
remotes((err, res, stderr) => {
|
||||
err; // $ExpectType ExecException | null
|
||||
res; // $ExpectType Remotes
|
||||
stderr; // $ExpectType string | undefined
|
||||
});
|
||||
remotes('some/project', (err, res, stderr) => {
|
||||
err; // $ExpectType ExecException | null
|
||||
res; // $ExpectType Remotes
|
||||
stderr; // $ExpectType string | undefined
|
||||
});
|
||||
|
||||
remotes.sync(); // $ExpectType Remotes
|
||||
remotes.sync('some/project'); // $ExpectType Remotes
|
||||
remotes.sync('some/project', { shell: 'foo' }); // $ExpectType Remotes
|
||||
remotes.sync({ cwd: 'some/project', shell: 'foo' }); // $ExpectType Remotes
|
||||
@@ -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",
|
||||
"list-git-remotes-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user