diff --git a/which/which-tests.ts b/which/which-tests.ts new file mode 100644 index 0000000000..45a376dcb3 --- /dev/null +++ b/which/which-tests.ts @@ -0,0 +1,10 @@ +/// + +import which = require("which"); + +which("cat", (err, path) => { + console.log(path); +}); + +var path = which.sync("cat"); +console.log(path); diff --git a/which/which.d.ts b/which/which.d.ts new file mode 100644 index 0000000000..d25ac4fd7f --- /dev/null +++ b/which/which.d.ts @@ -0,0 +1,13 @@ +// Type definitions for which 1.0.8 +// Project: https://github.com/isaacs/node-which +// Definitions by: 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; +}