@types/which
Advanced tools
Comparing version 1.0.28 to 1.3.0
@@ -1,12 +0,66 @@ | ||
// Type definitions for which 1.0.8 | ||
// Type definitions for which 1.3.0 | ||
// Project: https://github.com/isaacs/node-which | ||
// Definitions by: vvakame <https://github.com/vvakame> | ||
// Definitions by: vvakame <https://github.com/vvakame>, cspotcoxe <https://github.com/cspotcode> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
declare function when(cmd: string, cb: (err: Error, path: string) => void): void; | ||
declare namespace when { | ||
/** Finds all instances of a specified executable in the PATH environment variable */ | ||
declare function which(cmd: string, options: which.AsyncOptions & which.OptionsAll, cb: (err: Error | null, paths: Array<string> | undefined) => void): void; | ||
/** Finds the first instance of a specified executable in the PATH environment variable */ | ||
declare function which(cmd: string, options: which.AsyncOptions & which.OptionsFirst, cb: (err: Error | null, path: string | undefined) => void): void; | ||
/** Finds the first instance of a specified executable in the PATH environment variable */ | ||
declare function which(cmd: string, options: which.AsyncOptions, cb: (err: Error | null, path: string | Array<string> | undefined) => void): void; | ||
/** Finds the first instance of a specified executable in the PATH environment variable */ | ||
declare function which(cmd: string, cb: (err: Error | null, path: string | undefined) => void): void; | ||
declare namespace which { | ||
/** Finds all instances of a specified executable in the PATH environment variable */ | ||
function sync(cmd: string, options: which.Options & which.OptionsAll & which.OptionsNoThrow): Array<string> | null; | ||
/** Finds the first instance of a specified executable in the PATH environment variable */ | ||
function sync(cmd: string, options: which.Options & which.OptionsFirst & which.OptionsNoThrow): string | null; | ||
/** Finds all instances of a specified executable in the PATH environment variable */ | ||
function sync(cmd: string, options: which.Options & which.OptionsAll & which.OptionsThrow): Array<string>; | ||
/** Finds the first instance of a specified executable in the PATH environment variable */ | ||
function sync(cmd: string, options: which.Options & which.OptionsFirst & which.OptionsThrow): string; | ||
/** Finds the first instance of a specified executable in the PATH environment variable */ | ||
function sync(cmd: string, options: which.Options): string | Array<string> | null; | ||
/** Finds the first instance of a specified executable in the PATH environment variable */ | ||
function sync(cmd: string): string; | ||
/** Options that ask for all matches. */ | ||
interface OptionsAll extends AsyncOptions { | ||
all: true; | ||
} | ||
/** Options that ask for the first match (the default behavior) */ | ||
interface OptionsFirst extends AsyncOptions { | ||
all?: false | undefined; | ||
} | ||
/** Options that ask to receive null instead of a thrown error */ | ||
interface OptionsNoThrow extends Options { | ||
nothrow: true; | ||
} | ||
/** Options that ask for a thrown error if executable is not found (the default behavior) */ | ||
interface OptionsThrow extends Options { | ||
nothrow?: false | undefined; | ||
} | ||
/** Options for which() async API */ | ||
interface AsyncOptions { | ||
/** If true, return all matches, instead of just the first one. Note that this means the function returns an array of strings instead of a single string. */ | ||
all?: boolean; | ||
/** Use instead of the PATH environment variable. */ | ||
path?: string; | ||
/** Use instead of the PATHEXT environment variable. */ | ||
pathExt?: string; | ||
} | ||
/** Options for which() sync and async APIs */ | ||
interface Options extends AsyncOptions { | ||
/** If true, returns null when not found */ | ||
nothrow?: boolean; | ||
} | ||
} | ||
export = when; | ||
export = which; |
{ | ||
"name": "@types/which", | ||
"version": "1.0.28", | ||
"description": "TypeScript definitions for which 1.0.8", | ||
"version": "1.3.0", | ||
"description": "TypeScript definitions for which", | ||
"license": "MIT", | ||
"author": "vvakame <https://github.com/vvakame>", | ||
"contributors": [ | ||
{ | ||
"name": "vvakame", | ||
"url": "https://github.com/vvakame", | ||
"githubUsername": "vvakame" | ||
}, | ||
{ | ||
"name": "cspotcoxe", | ||
"url": "https://github.com/cspotcode", | ||
"githubUsername": "cspotcode" | ||
} | ||
], | ||
"main": "", | ||
@@ -14,4 +25,4 @@ "repository": { | ||
"dependencies": {}, | ||
"typings": "index.d.ts", | ||
"typesPublisherContentHash": "8bc777a5654cf691ff14d89b10d3960d38420faed9ba9bffeadbc1d56aca5f72" | ||
"typesPublisherContentHash": "bbfd8d8a026f2198f41c9302fea8cf1aee9b320a1e078d9c52f0de4b30f452e0", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -5,15 +5,13 @@ # Installation | ||
# Summary | ||
This package contains type definitions for which 1.0.8 (https://github.com/isaacs/node-which). | ||
This package contains type definitions for which (https://github.com/isaacs/node-which). | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/which | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/which | ||
Additional Details | ||
* Last updated: Mon, 19 Sep 2016 17:28:59 GMT | ||
* File structure: ProperModule | ||
* Library Dependencies: none | ||
* Module Dependencies: none | ||
* Global values: when | ||
* Last updated: Thu, 28 Dec 2017 23:58:44 GMT | ||
* Dependencies: none | ||
* Global values: none | ||
# Credits | ||
These definitions were written by vvakame <https://github.com/vvakame>. | ||
These definitions were written by vvakame <https://github.com/vvakame>, cspotcoxe <https://github.com/cspotcode>. |
6038
57
17