feat(find-exec): new definition file (#43186)

- definition file for v1.0
- tests

https://github.com/shime/find-exec#find-exec

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz) 2020-03-20 19:01:29 +01:00 committed by GitHub
parent 2d3a320fd5
commit d3c19af135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 0 deletions

View File

@ -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

12
types/find-exec/index.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
// Type definitions for find-exec 1.0
// Project: https://github.com/shime/find-exec
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// 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;

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }