mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
[isexe] Add types
This commit is contained in:
parent
a1b863c972
commit
d819aa2aa8
30
types/isexe/index.d.ts
vendored
Normal file
30
types/isexe/index.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Type definitions for isexe 2.0
|
||||
// Project: https://github.com/isaacs/isexe#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = isExe;
|
||||
|
||||
declare function isExe(path: string, options?: isExe.Options): Promise<boolean>;
|
||||
declare function isExe(
|
||||
path: string,
|
||||
callback: (error: NodeJS.ErrnoException | undefined, isExe: boolean) => void
|
||||
): void;
|
||||
declare function isExe(
|
||||
path: string,
|
||||
options: isExe.Options,
|
||||
callback: (error: NodeJS.ErrnoException | undefined, isExe: boolean) => void
|
||||
): void;
|
||||
|
||||
declare namespace isExe {
|
||||
function sync(path: string, options?: Options): boolean;
|
||||
|
||||
interface Options {
|
||||
ignoreErrors?: boolean;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
pathExt?: string;
|
||||
}
|
||||
}
|
||||
18
types/isexe/isexe-tests.ts
Normal file
18
types/isexe/isexe-tests.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import isexe = require('isexe');
|
||||
|
||||
isexe('some-file-name'); // $ExpectType Promise<boolean>
|
||||
isexe('some-file-name', { ignoreErrors: true }); // $ExpectType Promise<boolean>
|
||||
isexe('some-file-name', { uid: 123 }); // $ExpectType Promise<boolean>
|
||||
isexe('some-file-name', { gid: 123 }); // $ExpectType Promise<boolean>
|
||||
isexe('some-file-name', { pathExt: 'exe;bat' }); // $ExpectType Promise<boolean>
|
||||
isexe('some-file-name', (err, isExe) => {
|
||||
err; // $ExpectType ErrnoException | undefined
|
||||
isExe; // $ExpectType boolean
|
||||
});
|
||||
isexe('some-file-name', { ignoreErrors: true }, (err, isExe) => {
|
||||
err; // $ExpectType ErrnoException | undefined
|
||||
isExe; // $ExpectType boolean
|
||||
});
|
||||
|
||||
isexe.sync('some-file-name'); // $ExpectType boolean
|
||||
isexe.sync('some-file-name', { ignoreErrors: true }); // $ExpectType boolean
|
||||
23
types/isexe/tsconfig.json
Normal file
23
types/isexe/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"isexe-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/isexe/tslint.json
Normal file
1
types/isexe/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user