mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Merge remote-tracking branch 'upstream/master' into types2.0
Add tsconfig files everywhere # Conflicts: # azure-mobile-services-client/AzureMobileServicesClient.d.ts # bookshelf/bookshelf.d.ts # hapi/hapi.d.ts # helmet/helmet.d.ts # mongodb/mongodb.d.ts # nock/nock.d.ts # react-bootstrap/react-bootstrap.d.ts # react-helmet/react-helmet.d.ts # restify/restify.d.ts # sequelize/sequelize.d.ts
This commit is contained in:
@@ -15,6 +15,7 @@ import * as querystring from "querystring";
|
||||
import * as path from "path";
|
||||
import * as readline from "readline";
|
||||
import * as childProcess from "child_process";
|
||||
import * as cluster from "cluster";
|
||||
import * as os from "os";
|
||||
import * as vm from "vm";
|
||||
// Specifically test buffer module regression.
|
||||
@@ -643,6 +644,18 @@ namespace readline_tests {
|
||||
childProcess.exec("echo test");
|
||||
childProcess.spawnSync("echo test");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/// cluster tests: https://nodejs.org/api/cluster.html ///
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
cluster.fork();
|
||||
Object.keys(cluster.workers).forEach(key => {
|
||||
const worker = cluster.workers[key];
|
||||
if (worker.isDead()) {
|
||||
console.log('worker %d is dead', worker.process.pid);
|
||||
}
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
/// os tests : https://nodejs.org/api/os.html
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
6
node/node.d.ts
vendored
6
node/node.d.ts
vendored
@@ -679,6 +679,8 @@ declare module "cluster" {
|
||||
kill(signal?: string): void;
|
||||
destroy(signal?: string): void;
|
||||
disconnect(): void;
|
||||
isConnected(): boolean;
|
||||
isDead(): boolean;
|
||||
}
|
||||
|
||||
export var settings: ClusterSettings;
|
||||
@@ -688,7 +690,9 @@ declare module "cluster" {
|
||||
export function fork(env?: any): Worker;
|
||||
export function disconnect(callback?: Function): void;
|
||||
export var worker: Worker;
|
||||
export var workers: Worker[];
|
||||
export var workers: {
|
||||
[index: string]: Worker
|
||||
};
|
||||
|
||||
// Event emitter
|
||||
export function addListener(event: string, listener: Function): void;
|
||||
|
||||
9
node/tsconfig.json
Normal file
9
node/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2015",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user