Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion types/node/child_process.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ declare module 'child_process' {
function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;

interface CommonExecOptions extends ProcessEnvOptions {
interface CommonExecOptions extends CommonOptions {
input?: string | NodeJS.ArrayBufferView | undefined;
stdio?: StdioOptions | undefined;
killSignal?: NodeJS.Signals | number | undefined;
Expand Down
18 changes: 16 additions & 2 deletions types/node/test/child_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,22 @@ import { Writable, Readable, Pipe } from 'stream';
}

{
childProcess.execSync("echo test", { encoding: 'utf-8' });
childProcess.execSync("echo test", { encoding: 'buffer' });
childProcess.execSync("echo test", { encoding: 'utf-8' }); // $ExpectType string
childProcess.execSync("echo test", { encoding: 'buffer' }); // $ExpectType Buffer
childProcess.execSync("git status", { // $ExpectType string
cwd: 'test',
input: 'test',
stdio: 'pipe',
env: {},
shell: 'hurr',
uid: 1,
gid: 1,
timeout: 123,
killSignal: 1,
maxBuffer: 123,
encoding: "utf8",
windowsHide: true
});
}

{
Expand Down
2 changes: 1 addition & 1 deletion types/node/v15/child_process.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ declare module 'child_process' {
function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;

interface CommonExecOptions extends ProcessEnvOptions {
interface CommonExecOptions extends CommonOptions {
input?: string | NodeJS.ArrayBufferView;
stdio?: StdioOptions;
killSignal?: NodeJS.Signals | number;
Expand Down
18 changes: 16 additions & 2 deletions types/node/v15/test/child_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,22 @@ import { Writable, Readable, Pipe } from 'stream';
}

{
childProcess.execSync("echo test", { encoding: 'utf-8' });
childProcess.execSync("echo test", { encoding: 'buffer' });
childProcess.execSync("echo test", { encoding: 'utf-8' }); // $ExpectType string
childProcess.execSync("echo test", { encoding: 'buffer' }); // $ExpectType Buffer
childProcess.execSync("git status", { // $ExpectType string
cwd: 'test',
input: 'test',
stdio: 'pipe',
env: {},
shell: 'hurr',
uid: 1,
gid: 1,
timeout: 123,
killSignal: 1,
maxBuffer: 123,
encoding: "utf8",
windowsHide: true
});
}

{
Expand Down