diff --git a/types/find-exec/find-exec-tests.ts b/types/find-exec/find-exec-tests.ts new file mode 100644 index 0000000000..bdce7566b4 --- /dev/null +++ b/types/find-exec/find-exec-tests.ts @@ -0,0 +1,5 @@ +import findExec = require('find-exec'); + +findExec(['mplayer', 'afplay', 'cvlc']); // $ExpectType string | null +// support var args as per implementation details +findExec('mplayer', 'afplay', 'cvlc'); // ExpectType string | null diff --git a/types/find-exec/index.d.ts b/types/find-exec/index.d.ts new file mode 100644 index 0000000000..36994faaca --- /dev/null +++ b/types/find-exec/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for find-exec 1.0 +// Project: https://github.com/shime/find-exec +// Definitions by: Piotr Błażejewicz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Takes a list of shell commands and returns the first available. + * Works synchronously to respect the order. + */ +declare function findExec(execs: string[]): string | null; +declare function findExec(...args: string[]): string | null; +export = findExec; diff --git a/types/find-exec/tsconfig.json b/types/find-exec/tsconfig.json new file mode 100644 index 0000000000..348dc55404 --- /dev/null +++ b/types/find-exec/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "find-exec-tests.ts" + ] +} diff --git a/types/find-exec/tslint.json b/types/find-exec/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/find-exec/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }