mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
Merge pull request #3447 from borisyankov/add-which
add which/which.d.ts
This commit is contained in:
10
which/which-tests.ts
Normal file
10
which/which-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference path="./which.d.ts" />
|
||||
|
||||
import which = require("which");
|
||||
|
||||
which("cat", (err, path) => {
|
||||
console.log(path);
|
||||
});
|
||||
|
||||
var path = which.sync("cat");
|
||||
console.log(path);
|
||||
13
which/which.d.ts
vendored
Normal file
13
which/which.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for which 1.0.8
|
||||
// Project: https://github.com/isaacs/node-which
|
||||
// Definitions by: vvakame <https://github.com/vvakame>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "which" {
|
||||
function when (cmd: string, cb: (err: Error, path: string) => void): void;
|
||||
module when {
|
||||
function sync(cmd: string): string;
|
||||
}
|
||||
|
||||
export = when;
|
||||
}
|
||||
Reference in New Issue
Block a user