Add types for the "npm-run"-module (#36042)

* Add types for the "npm-run"-module

* Fix the code according to tslint
This commit is contained in:
Manuel Thalmann 2019-06-14 07:00:03 +02:00 committed by Ron Buckton
parent f379e816be
commit 0973700702
4 changed files with 54 additions and 0 deletions

22
types/npm-run/index.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
// Type definitions for npm-run 5.0
// Project: https://github.com/timoxley/npm-run
// Definitions by: Manuel Thalmann <https://github.com/manuth>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
import { exec, execSync, spawnSync, spawn } from "child_process";
type ExecFunction = typeof exec;
interface Runner extends ExecFunction {
exec: ExecFunction;
sync: typeof execSync;
execSync: typeof execSync;
spawnSync: typeof spawnSync;
spawn: typeof spawn;
}
declare let npmRun: Runner;
export = npmRun;

View File

@ -0,0 +1,8 @@
import npmRun = require("npm-run");
npmRun("");
npmRun.exec("");
npmRun.execSync("");
npmRun.spawn("", []);
npmRun.spawnSync("", []);
npmRun.sync("");

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",
"npm-run-tests.ts"
]
}

View File

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