[node] Fix typings for various child_process methods by thw0rted · Pull Request #28025 · DefinitelyTyped/DefinitelyTyped · GitHub
Skip to content

[node] Fix typings for various child_process methods#28025

Merged
3 commits merged into
DefinitelyTyped:masterfrom
thw0rted:node-child-process
Aug 10, 2018
Merged

[node] Fix typings for various child_process methods#28025
3 commits merged into
DefinitelyTyped:masterfrom
thw0rted:node-child-process

Conversation

@thw0rted

Copy link
Copy Markdown
Contributor

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: npm child_process docs
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

Required minimal changes outside of Node. Build appears to be broken but it's TS@next's fault as far as I can tell.

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels Aug 10, 2018
@typescript-bot

typescript-bot commented Aug 10, 2018

Copy link
Copy Markdown
Contributor

Comment thread types/node/index.d.ts Outdated
keepOpen?: boolean;
}

export type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | stream.Stream | number)>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null and undefined are also allowed as types in the array

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I overlooked those in the docs.

@typescript-bot

Copy link
Copy Markdown
Contributor

@thw0rted The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Comment thread types/node/index.d.ts
export function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;

export interface SpawnSyncOptions {
argv0?: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite sure that argv0 argument is also supported for sync even if it is missing in node docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem pretty unlikely that spawnsync wouldn't end up reusing most of the logic from spawn (or vice versa). I'll put the option back here and see about getting the Node docs fixed -- if it turns out you really can't, I'll open a separate PR to take it out, I guess.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That didn't take long: found it. Definitely uses the same logic for both functions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node PR is up.

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Aug 10, 2018
@typescript-bot

typescript-bot commented Aug 10, 2018

Copy link
Copy Markdown
Contributor

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants