Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 47 additions & 9 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ type child_process$execSyncOpts = {
input?: string | Buffer;
stdio?: Array<any>;
env?: Object;
shell?: string,
uid?: number;
gid?: number;
timeout?: number;
Expand All @@ -165,6 +166,19 @@ type child_process$execFileOpts = {

type child_process$execFileCallback = (error: ?child_process$Error, stdout: Buffer, stderr: Buffer) => void;

type child_process$execFileSyncOpts = {
cwd?: string;
input?: string | Buffer;
stdio?: Array<any>;
env?: Object;
uid?: number;
gid?: number;
timeout?: number;
killSignal?: string;
maxBuffer?: number;
encoding?: string;
};

type child_process$forkOpts = {
cwd?: string;
env?: Object;
Expand All @@ -181,10 +195,12 @@ type child_process$Handle = any; // TODO
type child_process$spawnOpts = {
cwd?: string;
env?: Object;
argv0?: string;
stdio?: string | Array<any>;
detached?: boolean;
uid?: number;
gid?: number;
shell?: boolean | string;
};

type child_process$spawnRet = {
Expand All @@ -197,16 +213,38 @@ type child_process$spawnRet = {
error: Error;
};

type child_process$spawnSyncOpts = {
cwd?: string;
input?: string | Buffer;
stdio?: Array<any>;
env?: Object;
uid?: number;
gid?: number;
timeout?: number;
killSignal?: string;
maxBuffer?: number;
encoding?: string;
shell?: boolean | string;
};

type child_process$spawnSyncRet = child_process$spawnRet;

declare class child_process$ChildProcess extends events$EventEmitter {
connected: boolean;
stderr: stream$Readable;
stdin: stream$Writable;
stdio: Array<any>;
stdout: stream$Readable;
stderr: stream$Readable;
pid: number;
connected: boolean;

disconnect(): void;
kill(signal?: string): void;
send(message: Object, sendHandle?: child_process$Handle): boolean;
send(
message: Object,
sendHandleOrCallback?: child_process$Handle,
optionsOrCallback?: Object | () => void,
callback?: () => void
): boolean;
}

declare module "child_process" {
Expand Down Expand Up @@ -238,8 +276,8 @@ declare module "child_process" {

declare function execFileSync(
command: string,
argsOrOptions?: Array<string> | child_process$execFileOpts,
options?: child_process$execFileOpts
argsOrOptions?: Array<string> | child_process$execFileSyncOpts,
options?: child_process$execFileSyncOpts
): Buffer | string;

declare function fork(
Expand All @@ -256,13 +294,13 @@ declare module "child_process" {

declare function spawnSync(
command: string,
argsOrOptions?: Array<string> | child_process$spawnOpts,
options?: child_process$spawnOpts
): child_process$spawnRet;
argsOrOptions?: Array<string> | child_process$spawnSyncOpts,
options?: child_process$spawnSyncOpts
): child_process$spawnSyncRet;
}

type cluster$Worker = {
id: string;
id: number;
process: child_process$ChildProcess;
suicide: boolean;

Expand Down