Skip to content
Myr

Split type files (#978)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 4b2e316 · Browse files · 132 files+8057 added−6028 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

132 files+8057 added−6028 removed

  • other:+8057 added−6028 removed

132 files+8057 added−6028 removed

added:test-d/arguments/encoding-option.test-d.ts+45 added
added:test-d/arguments/options.test-d.ts+192 added
1import * as process from 'node:process';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {execa, execaSync, type Options, type SyncOptions} from '../../index.js';45const fileUrl = new URL('file:///test');67expectAssignable<Options>({cleanup: false});8expectNotAssignable<SyncOptions>({cleanup: false});9expectAssignable<SyncOptions>({preferLocal: false});1011await execa('unicorns', {preferLocal: false});12execaSync('unicorns', {preferLocal: false});13expectError(await execa('unicorns', {preferLocal: 'false'}));14expectError(execaSync('unicorns', {preferLocal: 'false'}));1516await execa('unicorns', {localDir: '.'});17execaSync('unicorns', {localDir: '.'});18await execa('unicorns', {localDir: fileUrl});19execaSync('unicorns', {localDir: fileUrl});20expectError(await execa('unicorns', {localDir: false}));21expectError(execaSync('unicorns', {localDir: false}));2223await execa('unicorns', {node: true});24execaSync('unicorns', {node: true});25expectError(await execa('unicorns', {node: 'true'}));26expectError(execaSync('unicorns', {node: 'true'}));2728await execa('unicorns', {nodePath: './node'});29execaSync('unicorns', {nodePath: './node'});30await execa('unicorns', {nodePath: fileUrl});31execaSync('unicorns', {nodePath: fileUrl});32expectError(await execa('unicorns', {nodePath: false}));33expectError(execaSync('unicorns', {nodePath: false}));3435await execa('unicorns', {nodeOptions: ['--async-stack-traces'] as const});36execaSync('unicorns', {nodeOptions: ['--async-stack-traces'] as const});37expectError(await execa('unicorns', {nodeOptions: [false] as const}));38expectError(execaSync('unicorns', {nodeOptions: [false] as const}));3940await execa('unicorns', {input: ''});41execaSync('unicorns', {input: ''});42await execa('unicorns', {input: new Uint8Array()});43execaSync('unicorns', {input: new Uint8Array()});44await execa('unicorns', {input: process.stdin});45execaSync('unicorns', {input: process.stdin});46expectError(await execa('unicorns', {input: false}));47expectError(execaSync('unicorns', {input: false}));4849await execa('unicorns', {inputFile: ''});50execaSync('unicorns', {inputFile: ''});51await execa('unicorns', {inputFile: fileUrl});52execaSync('unicorns', {inputFile: fileUrl});53expectError(await execa('unicorns', {inputFile: false}));54expectError(execaSync('unicorns', {inputFile: false}));5556await execa('unicorns', {lines: false});57execaSync('unicorns', {lines: false});58expectError(await execa('unicorns', {lines: 'false'}));59expectError(execaSync('unicorns', {lines: 'false'}));6061await execa('unicorns', {reject: false});62execaSync('unicorns', {reject: false});63expectError(await execa('unicorns', {reject: 'false'}));64expectError(execaSync('unicorns', {reject: 'false'}));6566await execa('unicorns', {stripFinalNewline: false});67execaSync('unicorns', {stripFinalNewline: false});68expectError(await execa('unicorns', {stripFinalNewline: 'false'}));69expectError(execaSync('unicorns', {stripFinalNewline: 'false'}));7071await execa('unicorns', {extendEnv: false});72execaSync('unicorns', {extendEnv: false});73expectError(await execa('unicorns', {extendEnv: 'false'}));74expectError(execaSync('unicorns', {extendEnv: 'false'}));7576await execa('unicorns', {cwd: '.'});77execaSync('unicorns', {cwd: '.'});78await execa('unicorns', {cwd: fileUrl});79execaSync('unicorns', {cwd: fileUrl});80expectError(await execa('unicorns', {cwd: false}));81expectError(execaSync('unicorns', {cwd: false}));8283/* eslint-disable @typescript-eslint/naming-convention */84await execa('unicorns', {env: {PATH: ''}});85execaSync('unicorns', {env: {PATH: ''}});86/* eslint-enable @typescript-eslint/naming-convention */87expectError(await execa('unicorns', {env: false}));88expectError(execaSync('unicorns', {env: false}));8990await execa('unicorns', {argv0: ''});91execaSync('unicorns', {argv0: ''});92expectError(await execa('unicorns', {argv0: false}));93expectError(execaSync('unicorns', {argv0: false}));9495await execa('unicorns', {uid: 0});96execaSync('unicorns', {uid: 0});97expectError(await execa('unicorns', {uid: '0'}));98expectError(execaSync('unicorns', {uid: '0'}));99100await execa('unicorns', {gid: 0});101execaSync('unicorns', {gid: 0});102expectError(await execa('unicorns', {gid: '0'}));103expectError(execaSync('unicorns', {gid: '0'}));104105await execa('unicorns', {shell: true});106execaSync('unicorns', {shell: true});107await execa('unicorns', {shell: '/bin/sh'});108execaSync('unicorns', {shell: '/bin/sh'});109await execa('unicorns', {shell: fileUrl});110execaSync('unicorns', {shell: fileUrl});111expectError(await execa('unicorns', {shell: {}}));112expectError(execaSync('unicorns', {shell: {}}));113114await execa('unicorns', {timeout: 1000});115execaSync('unicorns', {timeout: 1000});116expectError(await execa('unicorns', {timeout: '1000'}));117expectError(execaSync('unicorns', {timeout: '1000'}));118119await execa('unicorns', {maxBuffer: 1000});120execaSync('unicorns', {maxBuffer: 1000});121expectError(await execa('unicorns', {maxBuffer: '1000'}));122expectError(execaSync('unicorns', {maxBuffer: '1000'}));123124await execa('unicorns', {killSignal: 'SIGTERM'});125execaSync('unicorns', {killSignal: 'SIGTERM'});126await execa('unicorns', {killSignal: 9});127execaSync('unicorns', {killSignal: 9});128expectError(await execa('unicorns', {killSignal: false}));129expectError(execaSync('unicorns', {killSignal: false}));130131await execa('unicorns', {forceKillAfterDelay: false});132expectError(execaSync('unicorns', {forceKillAfterDelay: false}));133await execa('unicorns', {forceKillAfterDelay: 42});134expectError(execaSync('unicorns', {forceKillAfterDelay: 42}));135expectError(await execa('unicorns', {forceKillAfterDelay: 'true'}));136expectError(execaSync('unicorns', {forceKillAfterDelay: 'true'}));137138await execa('unicorns', {windowsVerbatimArguments: true});139execaSync('unicorns', {windowsVerbatimArguments: true});140expectError(await execa('unicorns', {windowsVerbatimArguments: 'true'}));141expectError(execaSync('unicorns', {windowsVerbatimArguments: 'true'}));142143await execa('unicorns', {windowsHide: false});144execaSync('unicorns', {windowsHide: false});145expectError(await execa('unicorns', {windowsHide: 'false'}));146expectError(execaSync('unicorns', {windowsHide: 'false'}));147148await execa('unicorns', {verbose: 'none'});149execaSync('unicorns', {verbose: 'none'});150await execa('unicorns', {verbose: 'short'});151execaSync('unicorns', {verbose: 'short'});152await execa('unicorns', {verbose: 'full'});153execaSync('unicorns', {verbose: 'full'});154expectError(await execa('unicorns', {verbose: 'other'}));155expectError(execaSync('unicorns', {verbose: 'other'}));156157await execa('unicorns', {cleanup: false});158expectError(execaSync('unicorns', {cleanup: false}));159expectError(await execa('unicorns', {cleanup: 'false'}));160expectError(execaSync('unicorns', {cleanup: 'false'}));161162await execa('unicorns', {buffer: false});163execaSync('unicorns', {buffer: false});164expectError(await execa('unicorns', {buffer: 'false'}));165expectError(execaSync('unicorns', {buffer: 'false'}));166167await execa('unicorns', {all: true});168execaSync('unicorns', {all: true});169expectError(await execa('unicorns', {all: 'true'}));170expectError(execaSync('unicorns', {all: 'true'}));171172await execa('unicorns', {ipc: true});173expectError(execaSync('unicorns', {ipc: true}));174expectError(await execa('unicorns', {ipc: 'true'}));175expectError(execaSync('unicorns', {ipc: 'true'}));176177await execa('unicorns', {serialization: 'json'});178expectError(execaSync('unicorns', {serialization: 'json'}));179await execa('unicorns', {serialization: 'advanced'});180expectError(execaSync('unicorns', {serialization: 'advanced'}));181expectError(await execa('unicorns', {serialization: 'other'}));182expectError(execaSync('unicorns', {serialization: 'other'}));183184await execa('unicorns', {detached: true});185expectError(execaSync('unicorns', {detached: true}));186expectError(await execa('unicorns', {detached: 'true'}));187expectError(execaSync('unicorns', {detached: 'true'}));188189await execa('unicorns', {cancelSignal: new AbortController().signal});190expectError(execaSync('unicorns', {cancelSignal: new AbortController().signal}));191expectError(await execa('unicorns', {cancelSignal: false}));192expectError(execaSync('unicorns', {cancelSignal: false}));
added:test-d/arguments/specific.test-d.ts+147 added
1import {expectType, expectError} from 'tsd';2import {execa, execaSync} from '../../index.js';34await execa('unicorns', {maxBuffer: {}});5expectError(await execa('unicorns', {maxBuffer: []}));6await execa('unicorns', {maxBuffer: {stdout: 0}});7await execa('unicorns', {maxBuffer: {stderr: 0}});8await execa('unicorns', {maxBuffer: {stdout: 0, stderr: 0} as const});9await execa('unicorns', {maxBuffer: {all: 0}});10await execa('unicorns', {maxBuffer: {fd1: 0}});11await execa('unicorns', {maxBuffer: {fd2: 0}});12await execa('unicorns', {maxBuffer: {fd3: 0}});13expectError(await execa('unicorns', {maxBuffer: {stdout: '0'}}));1415execaSync('unicorns', {maxBuffer: {}});16expectError(execaSync('unicorns', {maxBuffer: []}));17execaSync('unicorns', {maxBuffer: {stdout: 0}});18execaSync('unicorns', {maxBuffer: {stderr: 0}});19execaSync('unicorns', {maxBuffer: {stdout: 0, stderr: 0} as const});20execaSync('unicorns', {maxBuffer: {all: 0}});21execaSync('unicorns', {maxBuffer: {fd1: 0}});22execaSync('unicorns', {maxBuffer: {fd2: 0}});23execaSync('unicorns', {maxBuffer: {fd3: 0}});24expectError(execaSync('unicorns', {maxBuffer: {stdout: '0'}}));2526await execa('unicorns', {verbose: {}});27expectError(await execa('unicorns', {verbose: []}));28await execa('unicorns', {verbose: {stdout: 'none'}});29await execa('unicorns', {verbose: {stderr: 'none'}});30await execa('unicorns', {verbose: {stdout: 'none', stderr: 'none'} as const});31await execa('unicorns', {verbose: {all: 'none'}});32await execa('unicorns', {verbose: {fd1: 'none'}});33await execa('unicorns', {verbose: {fd2: 'none'}});34await execa('unicorns', {verbose: {fd3: 'none'}});35expectError(await execa('unicorns', {verbose: {stdout: 'other'}}));3637execaSync('unicorns', {verbose: {}});38expectError(execaSync('unicorns', {verbose: []}));39execaSync('unicorns', {verbose: {stdout: 'none'}});40execaSync('unicorns', {verbose: {stderr: 'none'}});41execaSync('unicorns', {verbose: {stdout: 'none', stderr: 'none'} as const});42execaSync('unicorns', {verbose: {all: 'none'}});43execaSync('unicorns', {verbose: {fd1: 'none'}});44execaSync('unicorns', {verbose: {fd2: 'none'}});45execaSync('unicorns', {verbose: {fd3: 'none'}});46expectError(execaSync('unicorns', {verbose: {stdout: 'other'}}));4748await execa('unicorns', {stripFinalNewline: {}});49expectError(await execa('unicorns', {stripFinalNewline: []}));50await execa('unicorns', {stripFinalNewline: {stdout: true}});51await execa('unicorns', {stripFinalNewline: {stderr: true}});52await execa('unicorns', {stripFinalNewline: {stdout: true, stderr: true} as const});53await execa('unicorns', {stripFinalNewline: {all: true}});54await execa('unicorns', {stripFinalNewline: {fd1: true}});55await execa('unicorns', {stripFinalNewline: {fd2: true}});56await execa('unicorns', {stripFinalNewline: {fd3: true}});57expectError(await execa('unicorns', {stripFinalNewline: {stdout: 'true'}}));5859execaSync('unicorns', {stripFinalNewline: {}});60expectError(execaSync('unicorns', {stripFinalNewline: []}));61execaSync('unicorns', {stripFinalNewline: {stdout: true}});62execaSync('unicorns', {stripFinalNewline: {stderr: true}});63execaSync('unicorns', {stripFinalNewline: {stdout: true, stderr: true} as const});64execaSync('unicorns', {stripFinalNewline: {all: true}});65execaSync('unicorns', {stripFinalNewline: {fd1: true}});66execaSync('unicorns', {stripFinalNewline: {fd2: true}});67execaSync('unicorns', {stripFinalNewline: {fd3: true}});68expectError(execaSync('unicorns', {stripFinalNewline: {stdout: 'true'}}));6970await execa('unicorns', {lines: {}});71expectError(await execa('unicorns', {lines: []}));72await execa('unicorns', {lines: {stdout: true}});73await execa('unicorns', {lines: {stderr: true}});74await execa('unicorns', {lines: {stdout: true, stderr: true} as const});75await execa('unicorns', {lines: {all: true}});76await execa('unicorns', {lines: {fd1: true}});77await execa('unicorns', {lines: {fd2: true}});78await execa('unicorns', {lines: {fd3: true}});79expectError(await execa('unicorns', {lines: {stdout: 'true'}}));8081execaSync('unicorns', {lines: {}});82expectError(execaSync('unicorns', {lines: []}));83execaSync('unicorns', {lines: {stdout: true}});84execaSync('unicorns', {lines: {stderr: true}});85execaSync('unicorns', {lines: {stdout: true, stderr: true} as const});86execaSync('unicorns', {lines: {all: true}});87execaSync('unicorns', {lines: {fd1: true}});88execaSync('unicorns', {lines: {fd2: true}});89execaSync('unicorns', {lines: {fd3: true}});90expectError(execaSync('unicorns', {lines: {stdout: 'true'}}));9192await execa('unicorns', {buffer: {}});93expectError(await execa('unicorns', {buffer: []}));94await execa('unicorns', {buffer: {stdout: true}});95await execa('unicorns', {buffer: {stderr: true}});96await execa('unicorns', {buffer: {stdout: true, stderr: true} as const});97await execa('unicorns', {buffer: {all: true}});98await execa('unicorns', {buffer: {fd1: true}});99await execa('unicorns', {buffer: {fd2: true}});100await execa('unicorns', {buffer: {fd3: true}});101expectError(await execa('unicorns', {buffer: {stdout: 'true'}}));102103execaSync('unicorns', {buffer: {}});104expectError(execaSync('unicorns', {buffer: []}));105execaSync('unicorns', {buffer: {stdout: true}});106execaSync('unicorns', {buffer: {stderr: true}});107execaSync('unicorns', {buffer: {stdout: true, stderr: true} as const});108execaSync('unicorns', {buffer: {all: true}});109execaSync('unicorns', {buffer: {fd1: true}});110execaSync('unicorns', {buffer: {fd2: true}});111execaSync('unicorns', {buffer: {fd3: true}});112expectError(execaSync('unicorns', {buffer: {stdout: 'true'}}));113114expectError(await execa('unicorns', {preferLocal: {}}));115expectError(await execa('unicorns', {preferLocal: []}));116expectError(await execa('unicorns', {preferLocal: {stdout: 0}}));117expectError(await execa('unicorns', {preferLocal: {stderr: 0}}));118expectError(await execa('unicorns', {preferLocal: {stdout: 0, stderr: 0} as const}));119expectError(await execa('unicorns', {preferLocal: {all: 0}}));120expectError(await execa('unicorns', {preferLocal: {fd1: 0}}));121expectError(await execa('unicorns', {preferLocal: {fd2: 0}}));122expectError(await execa('unicorns', {preferLocal: {fd3: 0}}));123expectError(await execa('unicorns', {preferLocal: {stdout: '0'}}));124125expectError(execaSync('unicorns', {preferLocal: {}}));126expectError(execaSync('unicorns', {preferLocal: []}));127expectError(execaSync('unicorns', {preferLocal: {stdout: 0}}));128expectError(execaSync('unicorns', {preferLocal: {stderr: 0}}));129expectError(execaSync('unicorns', {preferLocal: {stdout: 0, stderr: 0} as const}));130expectError(execaSync('unicorns', {preferLocal: {all: 0}}));131expectError(execaSync('unicorns', {preferLocal: {fd1: 0}}));132expectError(execaSync('unicorns', {preferLocal: {fd2: 0}}));133expectError(execaSync('unicorns', {preferLocal: {fd3: 0}}));134expectError(execaSync('unicorns', {preferLocal: {stdout: '0'}}));135136expectType<string[]>(execaSync('unicorns', {lines: {stdout: true, fd1: false}}).stdout);137expectType<string[]>(execaSync('unicorns', {lines: {stdout: true, all: false}}).stdout);138expectType<string[]>(execaSync('unicorns', {lines: {fd1: true, all: false}}).stdout);139expectType<string[]>(execaSync('unicorns', {lines: {stderr: true, fd2: false}}).stderr);140expectType<string[]>(execaSync('unicorns', {lines: {stderr: true, all: false}}).stderr);141expectType<string[]>(execaSync('unicorns', {lines: {fd2: true, all: false}}).stderr);142expectType<string[]>(execaSync('unicorns', {lines: {fd1: false, stdout: true}}).stdout);143expectType<string[]>(execaSync('unicorns', {lines: {all: false, stdout: true}}).stdout);144expectType<string[]>(execaSync('unicorns', {lines: {all: false, fd1: true}}).stdout);145expectType<string[]>(execaSync('unicorns', {lines: {fd2: false, stderr: true}}).stderr);146expectType<string[]>(execaSync('unicorns', {lines: {all: false, stderr: true}}).stderr);147expectType<string[]>(execaSync('unicorns', {lines: {all: false, fd2: true}}).stderr);
added:test-d/convert/duplex.test-d.ts+29 added
added:test-d/convert/iterable.test-d.ts+84 added
1import {expectType, expectError} from 'tsd';2import {execa} from '../../index.js';34const execaPromise = execa('unicorns');5const execaBufferPromise = execa('unicorns', {encoding: 'buffer', all: true});6const execaHexPromise = execa('unicorns', {encoding: 'hex', all: true});78const asyncIteration = async () => {9 for await (const line of execaPromise) {10 expectType<string>(line);11 }1213 for await (const line of execaPromise.iterable()) {14 expectType<string>(line);15 }1617 for await (const line of execaPromise.iterable({binary: false})) {18 expectType<string>(line);19 }2021 for await (const line of execaPromise.iterable({binary: true})) {22 expectType<Uint8Array>(line);23 }2425 for await (const line of execaPromise.iterable({} as {binary: boolean})) {26 expectType<string | Uint8Array>(line);27 }2829 for await (const line of execaBufferPromise) {30 expectType<Uint8Array>(line);31 }3233 for await (const line of execaBufferPromise.iterable()) {34 expectType<Uint8Array>(line);35 }3637 for await (const line of execaBufferPromise.iterable({binary: false})) {38 expectType<Uint8Array>(line);39 }4041 for await (const line of execaBufferPromise.iterable({binary: true})) {42 expectType<Uint8Array>(line);43 }4445 for await (const line of execaBufferPromise.iterable({} as {binary: boolean})) {46 expectType<Uint8Array>(line);47 }48};4950await asyncIteration();5152expectType<AsyncIterableIterator<string>>(execaPromise.iterable());53expectType<AsyncIterableIterator<string>>(execaPromise.iterable({binary: false}));54expectType<AsyncIterableIterator<Uint8Array>>(execaPromise.iterable({binary: true}));55expectType<AsyncIterableIterator<string | Uint8Array>>(execaPromise.iterable({} as {binary: boolean}));5657expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable());58expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable({binary: false}));59expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable({binary: true}));60expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable({} as {binary: boolean}));6162expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable());63expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable({binary: false}));64expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable({binary: true}));65expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable({} as {binary: boolean}));6667execaPromise.iterable({});68execaPromise.iterable({from: 'stdout'});69execaPromise.iterable({from: 'stderr'});70execaPromise.iterable({from: 'all'});71execaPromise.iterable({from: 'fd3'});72expectError(execaPromise.iterable({from: 'stdin'}));73expectError(execaPromise.iterable({from: 'fd'}));74expectError(execaPromise.iterable({from: 'fdNotANumber'}));75expectError(execaPromise.iterable({to: 'stdin'}));7677execaPromise.iterable({binary: false});78expectError(execaPromise.iterable({binary: 'false'}));7980execaPromise.iterable({preserveNewlines: false});81expectError(execaPromise.iterable({preserveNewlines: 'false'}));8283expectError(execaPromise.iterable('stdout'));84expectError(execaPromise.iterable({other: 'stdout'}));
added:test-d/convert/readable.test-d.ts+25 added
added:test-d/convert/writable.test-d.ts+21 added
added:test-d/methods/command.test-d.ts+94 added
1import {expectType, expectError, expectAssignable} from 'tsd';2import {execaCommand, execaCommandSync, type ExecaResult, type ExecaSubprocess, type ExecaSyncResult} from '../../index.js';34const fileUrl = new URL('file:///test');5const stringArray = ['foo', 'bar'] as const;67expectError(execaCommand());8expectError(execaCommand(true));9expectError(execaCommand(['unicorns', 'arg']));10expectAssignable<ExecaSubprocess>(execaCommand('unicorns'));11expectError(execaCommand(fileUrl));1213expectError(execaCommand('unicorns', []));14expectError(execaCommand('unicorns', ['foo']));15expectError(execaCommand('unicorns', 'foo'));16expectError(execaCommand('unicorns', [true]));1718expectAssignable<ExecaSubprocess>(execaCommand('unicorns', {}));19expectError(execaCommand('unicorns', [], {}));20expectError(execaCommand('unicorns', [], []));21expectError(execaCommand('unicorns', {other: true}));2223expectAssignable<ExecaSubprocess>(execaCommand`unicorns`);24expectType<ExecaResult<{}>>(await execaCommand('unicorns'));25expectType<ExecaResult<{}>>(await execaCommand`unicorns`);2627expectAssignable<typeof execaCommand>(execaCommand({}));28expectAssignable<ExecaSubprocess>(execaCommand({})('unicorns'));29expectAssignable<ExecaSubprocess>(execaCommand({})`unicorns`);3031expectAssignable<{stdout: string}>(await execaCommand('unicorns'));32expectAssignable<{stdout: Uint8Array}>(await execaCommand('unicorns', {encoding: 'buffer'}));33expectAssignable<{stdout: string}>(await execaCommand({})('unicorns'));34expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})('unicorns'));35expectAssignable<{stdout: Uint8Array}>(await execaCommand({})({encoding: 'buffer'})('unicorns'));36expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})({})('unicorns'));37expectAssignable<{stdout: string}>(await execaCommand({})`unicorns`);38expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})`unicorns`);39expectAssignable<{stdout: Uint8Array}>(await execaCommand({})({encoding: 'buffer'})`unicorns`);40expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})({})`unicorns`);4142expectType<ExecaResult<{}>>(await execaCommand`${'unicorns'}`);43expectType<ExecaResult<{}>>(await execaCommand`unicorns ${'foo'}`);44expectError(await execaCommand`unicorns ${'foo'} ${'bar'}`);45expectError(await execaCommand`unicorns ${1}`);46expectError(await execaCommand`unicorns ${stringArray}`);47expectError(await execaCommand`unicorns ${[1, 2]}`);48expectType<ExecaResult<{}>>(await execaCommand`unicorns ${false.toString()}`);49expectError(await execaCommand`unicorns ${false}`);5051expectError(await execaCommand`unicorns ${await execaCommand`echo foo`}`);52expectError(await execaCommand`unicorns ${execaCommand`echo foo`}`);53expectError(await execaCommand`unicorns ${[await execaCommand`echo foo`, 'bar']}`);54expectError(await execaCommand`unicorns ${[execaCommand`echo foo`, 'bar']}`);5556expectError(execaCommandSync());57expectError(execaCommandSync(true));58expectError(execaCommandSync(['unicorns', 'arg']));59expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns'));60expectError(execaCommandSync(fileUrl));61expectError(execaCommandSync('unicorns', []));62expectError(execaCommandSync('unicorns', ['foo']));63expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns', {}));64expectError(execaCommandSync('unicorns', [], {}));65expectError(execaCommandSync('unicorns', 'foo'));66expectError(execaCommandSync('unicorns', [true]));67expectError(execaCommandSync('unicorns', [], []));68expectError(execaCommandSync('unicorns', {other: true}));69expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns`);70expectAssignable<typeof execaCommandSync>(execaCommandSync({}));71expectType<ExecaSyncResult<{}>>(execaCommandSync({})('unicorns'));72expectType<ExecaSyncResult<{}>>(execaCommandSync({})`unicorns`);73expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns'));74expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns`);75expectAssignable<{stdout: string}>(execaCommandSync('unicorns'));76expectAssignable<{stdout: Uint8Array}>(execaCommandSync('unicorns', {encoding: 'buffer'}));77expectAssignable<{stdout: string}>(execaCommandSync({})('unicorns'));78expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})('unicorns'));79expectAssignable<{stdout: Uint8Array}>(execaCommandSync({})({encoding: 'buffer'})('unicorns'));80expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})({})('unicorns'));81expectAssignable<{stdout: string}>(execaCommandSync({})`unicorns`);82expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})`unicorns`);83expectAssignable<{stdout: Uint8Array}>(execaCommandSync({})({encoding: 'buffer'})`unicorns`);84expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})({})`unicorns`);85expectType<ExecaSyncResult<{}>>(execaCommandSync`${'unicorns'}`);86expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns ${'foo'}`);87expectError(execaCommandSync`unicorns ${'foo'} ${'bar'}`);88expectError(execaCommandSync`unicorns ${1}`);89expectError(execaCommandSync`unicorns ${stringArray}`);90expectError(execaCommandSync`unicorns ${[1, 2]}`);91expectError(execaCommandSync`unicorns ${execaCommandSync`echo foo`}`);92expectError(execaCommandSync`unicorns ${[execaCommandSync`echo foo`, 'bar']}`);93expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns ${false.toString()}`);94expectError(execaCommandSync`unicorns ${false}`);
added:test-d/methods/main-async.test-d.ts+56 added
added:test-d/methods/main-sync.test-d.ts+54 added
added:test-d/methods/node.test-d.ts+63 added
added:test-d/methods/script-s.test-d.ts+64 added
added:test-d/methods/script-sync.test-d.ts+64 added
1import {expectType, expectError, expectAssignable} from 'tsd';2import {$, type ExecaSyncResult} from '../../index.js';34const fileUrl = new URL('file:///test');5const stringArray = ['foo', 'bar'] as const;67expectError($.sync());8expectError($.sync(true));9expectError($.sync(['unicorns', 'arg']));10expectType<ExecaSyncResult<{}>>($.sync('unicorns'));11expectType<ExecaSyncResult<{}>>($.sync(fileUrl));1213expectType<ExecaSyncResult<{}>>($.sync('unicorns', []));14expectType<ExecaSyncResult<{}>>($.sync('unicorns', ['foo']));15expectError($.sync('unicorns', 'foo'));16expectError($.sync('unicorns', [true]));1718expectType<ExecaSyncResult<{}>>($.sync('unicorns', {}));19expectType<ExecaSyncResult<{}>>($.sync('unicorns', [], {}));20expectError($.sync('unicorns', [], []));21expectError($.sync('unicorns', {other: true}));2223expectType<ExecaSyncResult<{}>>($.sync`unicorns`);24expectType<ExecaSyncResult<{}>>($.sync('unicorns'));25expectType<ExecaSyncResult<{}>>($.sync`unicorns`);2627expectAssignable<typeof $.sync>($.sync({}));28expectType<ExecaSyncResult<{}>>($.sync({})('unicorns'));29expectType<ExecaSyncResult<{}>>($({}).sync('unicorns'));30expectType<ExecaSyncResult<{}>>($.sync({})`unicorns`);31expectType<ExecaSyncResult<{}>>($({}).sync`unicorns`);3233expectAssignable<{stdout: string}>($.sync('unicorns'));34expectAssignable<{stdout: Uint8Array}>($.sync('unicorns', {encoding: 'buffer'}));35expectAssignable<{stdout: string}>($.sync('unicorns', ['foo']));36expectAssignable<{stdout: Uint8Array}>($.sync('unicorns', ['foo'], {encoding: 'buffer'}));37expectAssignable<{stdout: string}>($.sync({})('unicorns'));38expectAssignable<{stdout: string}>($({}).sync('unicorns'));39expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})('unicorns'));40expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync('unicorns'));41expectAssignable<{stdout: Uint8Array}>($.sync({})({encoding: 'buffer'})('unicorns'));42expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).sync('unicorns'));43expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})({})('unicorns'));44expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync({})('unicorns'));45expectAssignable<{stdout: string}>($.sync({})`unicorns`);46expectAssignable<{stdout: string}>($({}).sync`unicorns`);47expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})`unicorns`);48expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync`unicorns`);49expectAssignable<{stdout: Uint8Array}>($.sync({})({encoding: 'buffer'})`unicorns`);50expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).sync`unicorns`);51expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})({})`unicorns`);52expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync({})`unicorns`);5354expectType<ExecaSyncResult<{}>>($.sync`${'unicorns'}`);55expectType<ExecaSyncResult<{}>>($.sync`unicorns ${'foo'}`);56expectType<ExecaSyncResult<{}>>($.sync`unicorns ${'foo'} ${'bar'}`);57expectType<ExecaSyncResult<{}>>($.sync`unicorns ${1}`);58expectType<ExecaSyncResult<{}>>($.sync`unicorns ${stringArray}`);59expectType<ExecaSyncResult<{}>>($.sync`unicorns ${[1, 2]}`);60expectType<ExecaSyncResult<{}>>($.sync`unicorns ${false.toString()}`);61expectError($.sync`unicorns ${false}`);6263expectType<ExecaSyncResult<{}>>($.sync`unicorns ${$.sync`echo foo`}`);64expectType<ExecaSyncResult<{}>>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);
added:test-d/methods/script.test-d.ts+56 added
1import {expectType, expectError, expectAssignable} from 'tsd';2import {$, type ExecaResult, type ExecaSubprocess} from '../../index.js';34const fileUrl = new URL('file:///test');5const stringArray = ['foo', 'bar'] as const;67expectError($());8expectError($(true));9expectError($(['unicorns', 'arg']));10expectAssignable<ExecaSubprocess>($('unicorns'));11expectAssignable<ExecaSubprocess>($(fileUrl));1213expectAssignable<ExecaSubprocess>($('unicorns', []));14expectAssignable<ExecaSubprocess>($('unicorns', ['foo']));15expectError($('unicorns', 'foo'));16expectError($('unicorns', [true]));1718expectAssignable<ExecaSubprocess>($('unicorns', {}));19expectAssignable<ExecaSubprocess>($('unicorns', [], {}));20expectError($('unicorns', [], []));21expectError($('unicorns', {other: true}));2223expectAssignable<ExecaSubprocess>($`unicorns`);24expectType<ExecaResult<{}>>(await $('unicorns'));25expectType<ExecaResult<{}>>(await $`unicorns`);2627expectAssignable<typeof $>($({}));28expectAssignable<ExecaSubprocess>($({})('unicorns'));29expectAssignable<ExecaSubprocess>($({})`unicorns`);3031expectAssignable<{stdout: string}>(await $('unicorns'));32expectAssignable<{stdout: Uint8Array}>(await $('unicorns', {encoding: 'buffer'}));33expectAssignable<{stdout: string}>(await $('unicorns', ['foo']));34expectAssignable<{stdout: Uint8Array}>(await $('unicorns', ['foo'], {encoding: 'buffer'}));35expectAssignable<{stdout: string}>(await $({})('unicorns'));36expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})('unicorns'));37expectAssignable<{stdout: Uint8Array}>(await $({})({encoding: 'buffer'})('unicorns'));38expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})({})('unicorns'));39expectAssignable<{stdout: string}>(await $({})`unicorns`);40expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})`unicorns`);41expectAssignable<{stdout: Uint8Array}>(await $({})({encoding: 'buffer'})`unicorns`);42expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})({})`unicorns`);4344expectType<ExecaResult<{}>>(await $`${'unicorns'}`);45expectType<ExecaResult<{}>>(await $`unicorns ${'foo'}`);46expectType<ExecaResult<{}>>(await $`unicorns ${'foo'} ${'bar'}`);47expectType<ExecaResult<{}>>(await $`unicorns ${1}`);48expectType<ExecaResult<{}>>(await $`unicorns ${stringArray}`);49expectType<ExecaResult<{}>>(await $`unicorns ${[1, 2]}`);50expectType<ExecaResult<{}>>(await $`unicorns ${false.toString()}`);51expectError(await $`unicorns ${false}`);5253expectType<ExecaResult<{}>>(await $`unicorns ${await $`echo foo`}`);54expectError(await $`unicorns ${$`echo foo`}`);55expectType<ExecaResult<{}>>(await $`unicorns ${[await $`echo foo`, 'bar']}`);56expectError(await $`unicorns ${[$`echo foo`, 'bar']}`);
added:test-d/return/ignore-option.test-d.ts+143 added
1import {type Readable, type Writable} from 'node:stream';2import {expectType, expectError} from 'tsd';3import {execa, execaSync, type ExecaError, type ExecaSyncError} from '../../index.js';45const ignoreAnyPromise = execa('unicorns', {stdin: 'ignore', stdout: 'ignore', stderr: 'ignore', all: true});6expectType<null>(ignoreAnyPromise.stdin);7expectType<null>(ignoreAnyPromise.stdio[0]);8expectType<null>(ignoreAnyPromise.stdout);9expectType<null>(ignoreAnyPromise.stdio[1]);10expectType<null>(ignoreAnyPromise.stderr);11expectType<null>(ignoreAnyPromise.stdio[2]);12expectType<undefined>(ignoreAnyPromise.all);13expectError(ignoreAnyPromise.stdio[3].destroy());1415const ignoreAnyResult = await ignoreAnyPromise;16expectType<undefined>(ignoreAnyResult.stdout);17expectType<undefined>(ignoreAnyResult.stdio[1]);18expectType<undefined>(ignoreAnyResult.stderr);19expectType<undefined>(ignoreAnyResult.stdio[2]);20expectType<undefined>(ignoreAnyResult.all);2122const ignoreAllPromise = execa('unicorns', {stdio: 'ignore', all: true});23expectType<null>(ignoreAllPromise.stdin);24expectType<null>(ignoreAllPromise.stdio[0]);25expectType<null>(ignoreAllPromise.stdout);26expectType<null>(ignoreAllPromise.stdio[1]);27expectType<null>(ignoreAllPromise.stderr);28expectType<null>(ignoreAllPromise.stdio[2]);29expectType<undefined>(ignoreAllPromise.all);30expectError(ignoreAllPromise.stdio[3].destroy());3132const ignoreAllResult = await ignoreAllPromise;33expectType<undefined>(ignoreAllResult.stdout);34expectType<undefined>(ignoreAllResult.stdio[1]);35expectType<undefined>(ignoreAllResult.stderr);36expectType<undefined>(ignoreAllResult.stdio[2]);37expectType<undefined>(ignoreAllResult.all);3839const ignoreStdioArrayPromise = execa('unicorns', {stdio: ['ignore', 'ignore', 'pipe', 'pipe'], all: true});40expectType<null>(ignoreStdioArrayPromise.stdin);41expectType<null>(ignoreStdioArrayPromise.stdio[0]);42expectType<null>(ignoreStdioArrayPromise.stdout);43expectType<null>(ignoreStdioArrayPromise.stdio[1]);44expectType<Readable>(ignoreStdioArrayPromise.stderr);45expectType<Readable>(ignoreStdioArrayPromise.stdio[2]);46expectType<Readable>(ignoreStdioArrayPromise.all);47expectType<Readable>(ignoreStdioArrayPromise.stdio[3]);48const ignoreStdioArrayResult = await ignoreStdioArrayPromise;49expectType<undefined>(ignoreStdioArrayResult.stdout);50expectType<undefined>(ignoreStdioArrayResult.stdio[1]);51expectType<string>(ignoreStdioArrayResult.stderr);52expectType<string>(ignoreStdioArrayResult.stdio[2]);53expectType<string>(ignoreStdioArrayResult.all);5455const ignoreStdioArrayReadPromise = execa('unicorns', {stdio: ['ignore', 'ignore', 'pipe', new Uint8Array()], all: true});56expectType<Writable>(ignoreStdioArrayReadPromise.stdio[3]);5758const ignoreStdinPromise = execa('unicorns', {stdin: 'ignore'});59expectType<null>(ignoreStdinPromise.stdin);6061const ignoreStdoutPromise = execa('unicorns', {stdout: 'ignore', all: true});62expectType<Writable>(ignoreStdoutPromise.stdin);63expectType<Writable>(ignoreStdoutPromise.stdio[0]);64expectType<null>(ignoreStdoutPromise.stdout);65expectType<null>(ignoreStdoutPromise.stdio[1]);66expectType<Readable>(ignoreStdoutPromise.stderr);67expectType<Readable>(ignoreStdoutPromise.stdio[2]);68expectType<Readable>(ignoreStdoutPromise.all);69expectError(ignoreStdoutPromise.stdio[3].destroy());7071const ignoreStdoutResult = await ignoreStdoutPromise;72expectType<undefined>(ignoreStdoutResult.stdout);73expectType<string>(ignoreStdoutResult.stderr);74expectType<string>(ignoreStdoutResult.all);7576const ignoreStderrPromise = execa('unicorns', {stderr: 'ignore', all: true});77expectType<Writable>(ignoreStderrPromise.stdin);78expectType<Writable>(ignoreStderrPromise.stdio[0]);79expectType<Readable>(ignoreStderrPromise.stdout);80expectType<Readable>(ignoreStderrPromise.stdio[1]);81expectType<null>(ignoreStderrPromise.stderr);82expectType<null>(ignoreStderrPromise.stdio[2]);83expectType<Readable>(ignoreStderrPromise.all);84expectError(ignoreStderrPromise.stdio[3].destroy());8586const ignoreStderrResult = await ignoreStderrPromise;87expectType<string>(ignoreStderrResult.stdout);88expectType<undefined>(ignoreStderrResult.stderr);89expectType<string>(ignoreStderrResult.all);9091const ignoreStdioPromise = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore'], all: true});92expectType<Writable>(ignoreStdioPromise.stdin);93expectType<Writable>(ignoreStdioPromise.stdio[0]);94expectType<Readable>(ignoreStdioPromise.stdout);95expectType<Readable>(ignoreStdioPromise.stdio[1]);96expectType<Readable>(ignoreStdioPromise.stderr);97expectType<Readable>(ignoreStdioPromise.stdio[2]);98expectType<Readable>(ignoreStdioPromise.all);99expectType<null>(ignoreStdioPromise.stdio[3]);100101const ignoreStdioResult = await ignoreStdioPromise;102expectType<string>(ignoreStdioResult.stdout);103expectType<string>(ignoreStdioResult.stderr);104expectType<string>(ignoreStdioResult.all);105106const ignoreStdoutResultSync = execaSync('unicorns', {stdout: 'ignore', all: true});107expectType<undefined>(ignoreStdoutResultSync.stdout);108expectType<undefined>(ignoreStdoutResultSync.stdio[1]);109expectType<string>(ignoreStdoutResultSync.stderr);110expectType<string>(ignoreStdoutResultSync.stdio[2]);111expectType<string>(ignoreStdoutResultSync.all);112113const ignoreStderrResultSync = execaSync('unicorns', {stderr: 'ignore', all: true});114expectType<string>(ignoreStderrResultSync.stdout);115expectType<undefined>(ignoreStderrResultSync.stderr);116expectType<string>(ignoreStderrResultSync.all);117118const ignoreFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});119expectType<undefined>(ignoreFd3Result.stdio[3]);120121const ignoreStdoutError = new Error('.') as ExecaError<{stdout: 'ignore'; all: true}>;122expectType<undefined>(ignoreStdoutError.stdout);123expectType<undefined>(ignoreStdoutError.stdio[1]);124expectType<string>(ignoreStdoutError.stderr);125expectType<string>(ignoreStdoutError.stdio[2]);126expectType<string>(ignoreStdoutError.all);127128const ignoreStderrError = new Error('.') as ExecaError<{stderr: 'ignore'; all: true}>;129expectType<string>(ignoreStderrError.stdout);130expectType<undefined>(ignoreStderrError.stderr);131expectType<string>(ignoreStderrError.all);132133const ignoreStdoutErrorSync = new Error('.') as ExecaSyncError<{stdout: 'ignore'; all: true}>;134expectType<undefined>(ignoreStdoutErrorSync.stdout);135expectType<undefined>(ignoreStdoutErrorSync.stdio[1]);136expectType<string>(ignoreStdoutErrorSync.stderr);137expectType<string>(ignoreStdoutErrorSync.stdio[2]);138expectType<string>(ignoreStdoutErrorSync.all);139140const ignoreStderrErrorSync = new Error('.') as ExecaSyncError<{stderr: 'ignore'; all: true}>;141expectType<string>(ignoreStderrErrorSync.stdout);142expectType<undefined>(ignoreStderrErrorSync.stderr);143expectType<string>(ignoreStderrErrorSync.all);
added:test-d/return/ignore-other.test-d.ts+153 added
1import * as process from 'node:process';2import {expectType} from 'tsd';3import {execa, execaSync, type ExecaError, type ExecaSyncError} from '../../index.js';45const inheritStdoutResult = await execa('unicorns', {stdout: 'inherit', all: true});6expectType<undefined>(inheritStdoutResult.stdout);7expectType<string>(inheritStdoutResult.stderr);8expectType<string>(inheritStdoutResult.all);910const inheritStderrResult = await execa('unicorns', {stderr: 'inherit', all: true});11expectType<string>(inheritStderrResult.stdout);12expectType<undefined>(inheritStderrResult.stderr);13expectType<string>(inheritStderrResult.all);1415const inheritArrayStdoutResult = await execa('unicorns', {stdout: ['inherit'] as ['inherit'], all: true});16expectType<undefined>(inheritArrayStdoutResult.stdout);17expectType<string>(inheritArrayStdoutResult.stderr);18expectType<string>(inheritArrayStdoutResult.all);1920const inheritArrayStderrResult = await execa('unicorns', {stderr: ['inherit'] as ['inherit'], all: true});21expectType<string>(inheritArrayStderrResult.stdout);22expectType<undefined>(inheritArrayStderrResult.stderr);23expectType<string>(inheritArrayStderrResult.all);2425const inheritStdoutResultSync = execaSync('unicorns', {stdout: 'inherit', all: true});26expectType<undefined>(inheritStdoutResultSync.stdout);27expectType<string>(inheritStdoutResultSync.stderr);28expectType<string>(inheritStdoutResultSync.all);2930const inheritStderrResultSync = execaSync('unicorns', {stderr: 'inherit', all: true});31expectType<string>(inheritStderrResultSync.stdout);32expectType<undefined>(inheritStderrResultSync.stderr);33expectType<string>(inheritStderrResultSync.all);3435const inheritStdoutError = new Error('.') as ExecaError<{stdout: 'inherit'; all: true}>;36expectType<undefined>(inheritStdoutError.stdout);37expectType<string>(inheritStdoutError.stderr);38expectType<string>(inheritStdoutError.all);3940const inheritStderrError = new Error('.') as ExecaError<{stderr: 'inherit'; all: true}>;41expectType<string>(inheritStderrError.stdout);42expectType<undefined>(inheritStderrError.stderr);43expectType<string>(inheritStderrError.all);4445const inheritStdoutErrorSync = new Error('.') as ExecaSyncError<{stdout: 'inherit'; all: true}>;46expectType<undefined>(inheritStdoutErrorSync.stdout);47expectType<string>(inheritStdoutErrorSync.stderr);48expectType<string>(inheritStdoutErrorSync.all);4950const inheritStderrErrorSync = new Error('.') as ExecaSyncError<{stderr: 'inherit'; all: true}>;51expectType<string>(inheritStderrErrorSync.stdout);52expectType<undefined>(inheritStderrErrorSync.stderr);53expectType<string>(inheritStderrErrorSync.all);5455const ipcStdoutResult = await execa('unicorns', {stdout: 'ipc', all: true});56expectType<undefined>(ipcStdoutResult.stdout);57expectType<string>(ipcStdoutResult.stderr);58expectType<string>(ipcStdoutResult.all);5960const ipcStderrResult = await execa('unicorns', {stderr: 'ipc', all: true});61expectType<string>(ipcStderrResult.stdout);62expectType<undefined>(ipcStderrResult.stderr);63expectType<string>(ipcStderrResult.all);6465const ipcStdoutError = new Error('.') as ExecaError<{stdout: 'ipc'; all: true}>;66expectType<undefined>(ipcStdoutError.stdout);67expectType<string>(ipcStdoutError.stderr);68expectType<string>(ipcStdoutError.all);6970const ipcStderrError = new Error('.') as ExecaError<{stderr: 'ipc'; all: true}>;71expectType<string>(ipcStderrError.stdout);72expectType<undefined>(ipcStderrError.stderr);73expectType<string>(ipcStderrError.all);7475const streamStdoutResult = await execa('unicorns', {stdout: process.stdout, all: true});76expectType<undefined>(streamStdoutResult.stdout);77expectType<string>(streamStdoutResult.stderr);78expectType<string>(streamStdoutResult.all);7980const streamArrayStdoutResult = await execa('unicorns', {stdout: [process.stdout] as [typeof process.stdout], all: true});81expectType<undefined>(streamArrayStdoutResult.stdout);82expectType<string>(streamArrayStdoutResult.stderr);83expectType<string>(streamArrayStdoutResult.all);8485const streamStderrResult = await execa('unicorns', {stderr: process.stdout, all: true});86expectType<string>(streamStderrResult.stdout);87expectType<undefined>(streamStderrResult.stderr);88expectType<string>(streamStderrResult.all);8990const streamArrayStderrResult = await execa('unicorns', {stderr: [process.stdout] as [typeof process.stdout], all: true});91expectType<string>(streamArrayStderrResult.stdout);92expectType<undefined>(streamArrayStderrResult.stderr);93expectType<string>(streamArrayStderrResult.all);9495const streamStdoutError = new Error('.') as ExecaError<{stdout: typeof process.stdout; all: true}>;96expectType<undefined>(streamStdoutError.stdout);97expectType<string>(streamStdoutError.stderr);98expectType<string>(streamStdoutError.all);99100const streamStderrError = new Error('.') as ExecaError<{stderr: typeof process.stdout; all: true}>;101expectType<string>(streamStderrError.stdout);102expectType<undefined>(streamStderrError.stderr);103expectType<string>(streamStderrError.all);104105const numberStdoutResult = await execa('unicorns', {stdout: 1, all: true});106expectType<undefined>(numberStdoutResult.stdout);107expectType<string>(numberStdoutResult.stderr);108expectType<string>(numberStdoutResult.all);109110const numberStderrResult = await execa('unicorns', {stderr: 1, all: true});111expectType<string>(numberStderrResult.stdout);112expectType<undefined>(numberStderrResult.stderr);113expectType<string>(numberStderrResult.all);114115const numberArrayStdoutResult = await execa('unicorns', {stdout: [1] as [1], all: true});116expectType<undefined>(numberArrayStdoutResult.stdout);117expectType<string>(numberArrayStdoutResult.stderr);118expectType<string>(numberArrayStdoutResult.all);119120const numberArrayStderrResult = await execa('unicorns', {stderr: [1] as [1], all: true});121expectType<string>(numberArrayStderrResult.stdout);122expectType<undefined>(numberArrayStderrResult.stderr);123expectType<string>(numberArrayStderrResult.all);124125const numberStdoutResultSync = execaSync('unicorns', {stdout: 1, all: true});126expectType<undefined>(numberStdoutResultSync.stdout);127expectType<string>(numberStdoutResultSync.stderr);128expectType<string>(numberStdoutResultSync.all);129130const numberStderrResultSync = execaSync('unicorns', {stderr: 1, all: true});131expectType<string>(numberStderrResultSync.stdout);132expectType<undefined>(numberStderrResultSync.stderr);133expectType<string>(numberStderrResultSync.all);134135const numberStdoutError = new Error('.') as ExecaError<{stdout: 1; all: true}>;136expectType<undefined>(numberStdoutError.stdout);137expectType<string>(numberStdoutError.stderr);138expectType<string>(numberStdoutError.all);139140const numberStderrError = new Error('.') as ExecaError<{stderr: 1; all: true}>;141expectType<string>(numberStderrError.stdout);142expectType<undefined>(numberStderrError.stderr);143expectType<string>(numberStderrError.all);144145const numberStdoutErrorSync = new Error('.') as ExecaSyncError<{stdout: 1; all: true}>;146expectType<undefined>(numberStdoutErrorSync.stdout);147expectType<string>(numberStdoutErrorSync.stderr);148expectType<string>(numberStdoutErrorSync.all);149150const numberStderrErrorSync = new Error('.') as ExecaSyncError<{stderr: 1; all: true}>;151expectType<string>(numberStderrErrorSync.stdout);152expectType<undefined>(numberStderrErrorSync.stderr);153expectType<string>(numberStderrErrorSync.all);
added:test-d/return/lines-main.test-d.ts+68 added
1import {expectType} from 'tsd';2import {execa, execaSync, type ExecaError, type ExecaSyncError} from '../../index.js';34const linesResult = await execa('unicorns', {lines: true, all: true});5expectType<string[]>(linesResult.stdout);6expectType<string[]>(linesResult.stdio[1]);7expectType<string[]>(linesResult.stderr);8expectType<string[]>(linesResult.stdio[2]);9expectType<string[]>(linesResult.all);1011const linesBufferResult = await execa('unicorns', {lines: true, encoding: 'buffer', all: true});12expectType<Uint8Array>(linesBufferResult.stdout);13expectType<Uint8Array>(linesBufferResult.stdio[1]);14expectType<Uint8Array>(linesBufferResult.stderr);15expectType<Uint8Array>(linesBufferResult.stdio[2]);16expectType<Uint8Array>(linesBufferResult.all);1718const linesHexResult = await execa('unicorns', {lines: true, encoding: 'hex', all: true});19expectType<string>(linesHexResult.stdout);20expectType<string>(linesHexResult.stdio[1]);21expectType<string>(linesHexResult.stderr);22expectType<string>(linesHexResult.stdio[2]);23expectType<string>(linesHexResult.all);2425const linesFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], lines: true});26expectType<string[]>(linesFd3Result.stdio[3]);2728const linesBufferFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], lines: true, encoding: 'buffer'});29expectType<Uint8Array>(linesBufferFd3Result.stdio[3]);3031const execaLinesError = new Error('.') as ExecaError<{lines: true; all: true}>;32expectType<string[]>(execaLinesError.stdout);33expectType<string[]>(execaLinesError.stdio[1]);34expectType<string[]>(execaLinesError.stderr);35expectType<string[]>(execaLinesError.stdio[2]);36expectType<string[]>(execaLinesError.all);3738const execaLinesBufferError = new Error('.') as ExecaError<{lines: true; encoding: 'buffer'; all: true}>;39expectType<Uint8Array>(execaLinesBufferError.stdout);40expectType<Uint8Array>(execaLinesBufferError.stdio[1]);41expectType<Uint8Array>(execaLinesBufferError.stderr);42expectType<Uint8Array>(execaLinesBufferError.stdio[2]);43expectType<Uint8Array>(execaLinesBufferError.all);4445const linesResultSync = execaSync('unicorns', {lines: true, all: true});46expectType<string[]>(linesResultSync.stdout);47expectType<string[]>(linesResultSync.stderr);48expectType<string[]>(linesResultSync.all);4950const linesBufferResultSync = execaSync('unicorns', {lines: true, encoding: 'buffer', all: true});51expectType<Uint8Array>(linesBufferResultSync.stdout);52expectType<Uint8Array>(linesBufferResultSync.stderr);53expectType<Uint8Array>(linesBufferResultSync.all);5455const linesHexResultSync = execaSync('unicorns', {lines: true, encoding: 'hex', all: true});56expectType<string>(linesHexResultSync.stdout);57expectType<string>(linesHexResultSync.stderr);58expectType<string>(linesHexResultSync.all);5960const execaLinesErrorSync = new Error('.') as ExecaSyncError<{lines: true; all: true}>;61expectType<string[]>(execaLinesErrorSync.stdout);62expectType<string[]>(execaLinesErrorSync.stderr);63expectType<string[]>(execaLinesErrorSync.all);6465const execaLinesBufferErrorSync = new Error('.') as ExecaSyncError<{lines: true; encoding: 'buffer'; all: true}>;66expectType<Uint8Array>(execaLinesBufferErrorSync.stdout);67expectType<Uint8Array>(execaLinesBufferErrorSync.stderr);68expectType<Uint8Array>(execaLinesBufferErrorSync.all);
added:test-d/return/lines-specific.test-d.ts+90 added
1import {expectType} from 'tsd';2import {execa, execaSync} from '../../index.js';34const linesStdoutResult = await execa('unicorns', {all: true, lines: {stdout: true}});5expectType<string[]>(linesStdoutResult.stdout);6expectType<string[]>(linesStdoutResult.stdio[1]);7expectType<string>(linesStdoutResult.stderr);8expectType<string>(linesStdoutResult.stdio[2]);9expectType<string[]>(linesStdoutResult.all);1011const linesStderrResult = await execa('unicorns', {all: true, lines: {stderr: true}});12expectType<string>(linesStderrResult.stdout);13expectType<string>(linesStderrResult.stdio[1]);14expectType<string[]>(linesStderrResult.stderr);15expectType<string[]>(linesStderrResult.stdio[2]);16expectType<string[]>(linesStderrResult.all);1718const linesFd1Result = await execa('unicorns', {all: true, lines: {fd1: true}});19expectType<string[]>(linesFd1Result.stdout);20expectType<string[]>(linesFd1Result.stdio[1]);21expectType<string>(linesFd1Result.stderr);22expectType<string>(linesFd1Result.stdio[2]);23expectType<string[]>(linesFd1Result.all);2425const linesFd2Result = await execa('unicorns', {all: true, lines: {fd2: true}});26expectType<string>(linesFd2Result.stdout);27expectType<string>(linesFd2Result.stdio[1]);28expectType<string[]>(linesFd2Result.stderr);29expectType<string[]>(linesFd2Result.stdio[2]);30expectType<string[]>(linesFd2Result.all);3132const linesAllResult = await execa('unicorns', {all: true, lines: {all: true}});33expectType<string[]>(linesAllResult.stdout);34expectType<string[]>(linesAllResult.stdio[1]);35expectType<string[]>(linesAllResult.stderr);36expectType<string[]>(linesAllResult.stdio[2]);37expectType<string[]>(linesAllResult.all);3839const linesFd3Result = await execa('unicorns', {all: true, lines: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});40expectType<string>(linesFd3Result.stdout);41expectType<string>(linesFd3Result.stdio[1]);42expectType<string>(linesFd3Result.stderr);43expectType<string>(linesFd3Result.stdio[2]);44expectType<string>(linesFd3Result.all);45expectType<string[]>(linesFd3Result.stdio[3]);46expectType<string>(linesFd3Result.stdio[4]);4748const linesStdoutResultSync = execaSync('unicorns', {all: true, lines: {stdout: true}});49expectType<string[]>(linesStdoutResultSync.stdout);50expectType<string[]>(linesStdoutResultSync.stdio[1]);51expectType<string>(linesStdoutResultSync.stderr);52expectType<string>(linesStdoutResultSync.stdio[2]);53expectType<string[]>(linesStdoutResultSync.all);5455const linesStderrResultSync = execaSync('unicorns', {all: true, lines: {stderr: true}});56expectType<string>(linesStderrResultSync.stdout);57expectType<string>(linesStderrResultSync.stdio[1]);58expectType<string[]>(linesStderrResultSync.stderr);59expectType<string[]>(linesStderrResultSync.stdio[2]);60expectType<string[]>(linesStderrResultSync.all);6162const linesFd1ResultSync = execaSync('unicorns', {all: true, lines: {fd1: true}});63expectType<string[]>(linesFd1ResultSync.stdout);64expectType<string[]>(linesFd1ResultSync.stdio[1]);65expectType<string>(linesFd1ResultSync.stderr);66expectType<string>(linesFd1ResultSync.stdio[2]);67expectType<string[]>(linesFd1ResultSync.all);6869const linesFd2ResultSync = execaSync('unicorns', {all: true, lines: {fd2: true}});70expectType<string>(linesFd2ResultSync.stdout);71expectType<string>(linesFd2ResultSync.stdio[1]);72expectType<string[]>(linesFd2ResultSync.stderr);73expectType<string[]>(linesFd2ResultSync.stdio[2]);74expectType<string[]>(linesFd2ResultSync.all);7576const linesAllResultSync = execaSync('unicorns', {all: true, lines: {all: true}});77expectType<string[]>(linesAllResultSync.stdout);78expectType<string[]>(linesAllResultSync.stdio[1]);79expectType<string[]>(linesAllResultSync.stderr);80expectType<string[]>(linesAllResultSync.stdio[2]);81expectType<string[]>(linesAllResultSync.all);8283const linesFd3ResultSync = execaSync('unicorns', {all: true, lines: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});84expectType<string>(linesFd3ResultSync.stdout);85expectType<string>(linesFd3ResultSync.stdio[1]);86expectType<string>(linesFd3ResultSync.stderr);87expectType<string>(linesFd3ResultSync.stdio[2]);88expectType<string>(linesFd3ResultSync.all);89expectType<string[]>(linesFd3ResultSync.stdio[3]);90expectType<string>(linesFd3ResultSync.stdio[4]);
added:test-d/return/no-buffer-main.test-d.ts+40 added
1import type {Readable, Writable} from 'node:stream';2import {expectType, expectError} from 'tsd';3import {execa, execaSync, type ExecaError, type ExecaSyncError} from '../../index.js';45const noBufferPromise = execa('unicorns', {buffer: false, all: true});6expectType<Writable>(noBufferPromise.stdin);7expectType<Writable>(noBufferPromise.stdio[0]);8expectType<Readable>(noBufferPromise.stdout);9expectType<Readable>(noBufferPromise.stdio[1]);10expectType<Readable>(noBufferPromise.stderr);11expectType<Readable>(noBufferPromise.stdio[2]);12expectType<Readable>(noBufferPromise.all);13expectError(noBufferPromise.stdio[3].destroy());1415const noBufferResult = await noBufferPromise;16expectType<undefined>(noBufferResult.stdout);17expectType<undefined>(noBufferResult.stdio[1]);18expectType<undefined>(noBufferResult.stderr);19expectType<undefined>(noBufferResult.stdio[2]);20expectType<undefined>(noBufferResult.all);2122const noBufferResultSync = execaSync('unicorns', {buffer: false, all: true});23expectType<undefined>(noBufferResultSync.stdout);24expectType<undefined>(noBufferResultSync.stderr);25expectType<undefined>(noBufferResultSync.all);2627const noBuffer3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], buffer: false});28expectType<undefined>(noBuffer3Result.stdio[3]);2930const noBufferError = new Error('.') as ExecaError<{buffer: false; all: true}>;31expectType<undefined>(noBufferError.stdout);32expectType<undefined>(noBufferError.stdio[1]);33expectType<undefined>(noBufferError.stderr);34expectType<undefined>(noBufferError.stdio[2]);35expectType<undefined>(noBufferError.all);3637const noBufferErrorSync = new Error('.') as ExecaSyncError<{buffer: false; all: true}>;38expectType<undefined>(noBufferErrorSync.stdout);39expectType<undefined>(noBufferErrorSync.stderr);40expectType<undefined>(noBufferErrorSync.all);
added:test-d/return/no-buffer-specific.test-d.ts+90 added
1import {expectType} from 'tsd';2import {execa, execaSync} from '../../index.js';34const noBufferStdoutResult = await execa('unicorns', {all: true, buffer: {stdout: false}});5expectType<undefined>(noBufferStdoutResult.stdout);6expectType<undefined>(noBufferStdoutResult.stdio[1]);7expectType<string>(noBufferStdoutResult.stderr);8expectType<string>(noBufferStdoutResult.stdio[2]);9expectType<string>(noBufferStdoutResult.all);1011const noBufferStderrResult = await execa('unicorns', {all: true, buffer: {stderr: false}});12expectType<string>(noBufferStderrResult.stdout);13expectType<string>(noBufferStderrResult.stdio[1]);14expectType<undefined>(noBufferStderrResult.stderr);15expectType<undefined>(noBufferStderrResult.stdio[2]);16expectType<string>(noBufferStderrResult.all);1718const noBufferFd1Result = await execa('unicorns', {all: true, buffer: {fd1: false}});19expectType<undefined>(noBufferFd1Result.stdout);20expectType<undefined>(noBufferFd1Result.stdio[1]);21expectType<string>(noBufferFd1Result.stderr);22expectType<string>(noBufferFd1Result.stdio[2]);23expectType<string>(noBufferFd1Result.all);2425const noBufferFd2Result = await execa('unicorns', {all: true, buffer: {fd2: false}});26expectType<string>(noBufferFd2Result.stdout);27expectType<string>(noBufferFd2Result.stdio[1]);28expectType<undefined>(noBufferFd2Result.stderr);29expectType<undefined>(noBufferFd2Result.stdio[2]);30expectType<string>(noBufferFd2Result.all);3132const noBufferAllResult = await execa('unicorns', {all: true, buffer: {all: false}});33expectType<undefined>(noBufferAllResult.stdout);34expectType<undefined>(noBufferAllResult.stdio[1]);35expectType<undefined>(noBufferAllResult.stderr);36expectType<undefined>(noBufferAllResult.stdio[2]);37expectType<undefined>(noBufferAllResult.all);3839const noBufferFd3Result = await execa('unicorns', {all: true, buffer: {fd3: false}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});40expectType<string>(noBufferFd3Result.stdout);41expectType<string>(noBufferFd3Result.stdio[1]);42expectType<string>(noBufferFd3Result.stderr);43expectType<string>(noBufferFd3Result.stdio[2]);44expectType<string>(noBufferFd3Result.all);45expectType<undefined>(noBufferFd3Result.stdio[3]);46expectType<string>(noBufferFd3Result.stdio[4]);4748const noBufferStdoutResultSync = execaSync('unicorns', {all: true, buffer: {stdout: false}});49expectType<undefined>(noBufferStdoutResultSync.stdout);50expectType<undefined>(noBufferStdoutResultSync.stdio[1]);51expectType<string>(noBufferStdoutResultSync.stderr);52expectType<string>(noBufferStdoutResultSync.stdio[2]);53expectType<string>(noBufferStdoutResultSync.all);5455const noBufferStderrResultSync = execaSync('unicorns', {all: true, buffer: {stderr: false}});56expectType<string>(noBufferStderrResultSync.stdout);57expectType<string>(noBufferStderrResultSync.stdio[1]);58expectType<undefined>(noBufferStderrResultSync.stderr);59expectType<undefined>(noBufferStderrResultSync.stdio[2]);60expectType<string>(noBufferStderrResultSync.all);6162const noBufferFd1ResultSync = execaSync('unicorns', {all: true, buffer: {fd1: false}});63expectType<undefined>(noBufferFd1ResultSync.stdout);64expectType<undefined>(noBufferFd1ResultSync.stdio[1]);65expectType<string>(noBufferFd1ResultSync.stderr);66expectType<string>(noBufferFd1ResultSync.stdio[2]);67expectType<string>(noBufferFd1ResultSync.all);6869const noBufferFd2ResultSync = execaSync('unicorns', {all: true, buffer: {fd2: false}});70expectType<string>(noBufferFd2ResultSync.stdout);71expectType<string>(noBufferFd2ResultSync.stdio[1]);72expectType<undefined>(noBufferFd2ResultSync.stderr);73expectType<undefined>(noBufferFd2ResultSync.stdio[2]);74expectType<string>(noBufferFd2ResultSync.all);7576const noBufferAllResultSync = execaSync('unicorns', {all: true, buffer: {all: false}});77expectType<undefined>(noBufferAllResultSync.stdout);78expectType<undefined>(noBufferAllResultSync.stdio[1]);79expectType<undefined>(noBufferAllResultSync.stderr);80expectType<undefined>(noBufferAllResultSync.stdio[2]);81expectType<undefined>(noBufferAllResultSync.all);8283const noBufferFd3ResultSync = execaSync('unicorns', {all: true, buffer: {fd3: false}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});84expectType<string>(noBufferFd3ResultSync.stdout);85expectType<string>(noBufferFd3ResultSync.stdio[1]);86expectType<string>(noBufferFd3ResultSync.stderr);87expectType<string>(noBufferFd3ResultSync.stdio[2]);88expectType<string>(noBufferFd3ResultSync.all);89expectType<undefined>(noBufferFd3ResultSync.stdio[3]);90expectType<string>(noBufferFd3ResultSync.stdio[4]);
added:test-d/return/result-all.test-d.ts+26 added
1import {expectType} from 'tsd';2import {execa, execaSync, type ExecaError, type ExecaSyncError} from '../../index.js';34const allResult = await execa('unicorns', {all: true});5expectType<string>(allResult.all);67const noAllResult = await execa('unicorns');8expectType<undefined>(noAllResult.all);910const allResultSync = execaSync('unicorns', {all: true});11expectType<string>(allResultSync.all);1213const noAllResultSync = execaSync('unicorns');14expectType<undefined>(noAllResultSync.all);1516const allError = new Error('.') as ExecaError<{all: true}>;17expectType<string>(allError.all);1819const noAllError = new Error('.') as ExecaError<{}>;20expectType<undefined>(noAllError.all);2122const allErrorSync = new Error('.') as ExecaError<{all: true}>;23expectType<string>(allErrorSync.all);2425const noAllErrorSync = new Error('.') as ExecaSyncError<{}>;26expectType<undefined>(noAllErrorSync.all);
added:test-d/return/result-main.test-d.ts+95 added
1import {expectType, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 ExecaError,6 ExecaSyncError,7 type ExecaResult,8 type ExecaSyncResult,9} from '../../index.js';1011type AnyChunk = string | Uint8Array | string[] | unknown[] | undefined;12expectType<AnyChunk>({} as ExecaResult['stdout']);13expectType<AnyChunk>({} as ExecaResult['stderr']);14expectType<AnyChunk>({} as ExecaResult['all']);15expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as ExecaResult['stdio']);16expectType<AnyChunk>({} as ExecaSyncResult['stdout']);17expectType<AnyChunk>({} as ExecaSyncResult['stderr']);18expectType<AnyChunk>({} as ExecaSyncResult['all']);19expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as ExecaSyncResult['stdio']);2021const unicornsResult = await execa('unicorns', {all: true});22expectAssignable<ExecaResult>(unicornsResult);23expectType<string>(unicornsResult.command);24expectType<string>(unicornsResult.escapedCommand);25expectType<number | undefined>(unicornsResult.exitCode);26expectType<boolean>(unicornsResult.failed);27expectType<boolean>(unicornsResult.timedOut);28expectType<boolean>(unicornsResult.isCanceled);29expectType<boolean>(unicornsResult.isTerminated);30expectType<boolean>(unicornsResult.isMaxBuffer);31expectType<string | undefined>(unicornsResult.signal);32expectType<string | undefined>(unicornsResult.signalDescription);33expectType<string>(unicornsResult.cwd);34expectType<number>(unicornsResult.durationMs);35expectType<ExecaResult[]>(unicornsResult.pipedFrom);3637const unicornsResultSync = execaSync('unicorns', {all: true});38expectAssignable<ExecaSyncResult>(unicornsResultSync);39expectType<string>(unicornsResultSync.command);40expectType<string>(unicornsResultSync.escapedCommand);41expectType<number | undefined>(unicornsResultSync.exitCode);42expectType<boolean>(unicornsResultSync.failed);43expectType<boolean>(unicornsResultSync.timedOut);44expectType<boolean>(unicornsResultSync.isCanceled);45expectType<boolean>(unicornsResultSync.isTerminated);46expectType<boolean>(unicornsResultSync.isMaxBuffer);47expectType<string | undefined>(unicornsResultSync.signal);48expectType<string | undefined>(unicornsResultSync.signalDescription);49expectType<string>(unicornsResultSync.cwd);50expectType<number>(unicornsResultSync.durationMs);51expectType<[]>(unicornsResultSync.pipedFrom);5253const error = new Error('.');54if (error instanceof ExecaError) {55 expectAssignable<ExecaError>(error);56 expectType<'ExecaError'>(error.name);57 expectType<string>(error.message);58 expectType<number | undefined>(error.exitCode);59 expectType<boolean>(error.failed);60 expectType<boolean>(error.timedOut);61 expectType<boolean>(error.isCanceled);62 expectType<boolean>(error.isTerminated);63 expectType<boolean>(error.isMaxBuffer);64 expectType<string | undefined>(error.signal);65 expectType<string | undefined>(error.signalDescription);66 expectType<string>(error.cwd);67 expectType<number>(error.durationMs);68 expectType<string>(error.shortMessage);69 expectType<string>(error.originalMessage);70 expectType<string | undefined>(error.code);71 expectType<unknown>(error.cause);72 expectType<ExecaResult[]>(error.pipedFrom);73}7475const errorSync = new Error('.');76if (errorSync instanceof ExecaSyncError) {77 expectAssignable<ExecaSyncError>(errorSync);78 expectType<'ExecaSyncError'>(errorSync.name);79 expectType<string>(errorSync.message);80 expectType<number | undefined>(errorSync.exitCode);81 expectType<boolean>(errorSync.failed);82 expectType<boolean>(errorSync.timedOut);83 expectType<boolean>(errorSync.isCanceled);84 expectType<boolean>(errorSync.isTerminated);85 expectType<boolean>(errorSync.isMaxBuffer);86 expectType<string | undefined>(errorSync.signal);87 expectType<string | undefined>(errorSync.signalDescription);88 expectType<string>(errorSync.cwd);89 expectType<number>(errorSync.durationMs);90 expectType<string>(errorSync.shortMessage);91 expectType<string>(errorSync.originalMessage);92 expectType<string | undefined>(errorSync.code);93 expectType<unknown>(errorSync.cause);94 expectType<[]>(errorSync.pipedFrom);95}
added:test-d/return/result-reject.test-d.ts+32 added
1import {expectType, expectError} from 'tsd';2import {execa, execaSync} from '../../index.js';34const rejectsResult = await execa('unicorns');5expectError(rejectsResult.stack?.toString());6expectError(rejectsResult.message?.toString());7expectError(rejectsResult.shortMessage?.toString());8expectError(rejectsResult.originalMessage?.toString());9expectError(rejectsResult.code?.toString());10expectError(rejectsResult.cause?.valueOf());1112const noRejectsResult = await execa('unicorns', {reject: false});13expectType<string | undefined>(noRejectsResult.stack);14expectType<string | undefined>(noRejectsResult.message);15expectType<string | undefined>(noRejectsResult.shortMessage);16expectType<string | undefined>(noRejectsResult.originalMessage);17expectType<string | undefined>(noRejectsResult.code);18expectType<unknown>(noRejectsResult.cause);1920const rejectsSyncResult = execaSync('unicorns');21expectError(rejectsSyncResult.stack?.toString());22expectError(rejectsSyncResult.message?.toString());23expectError(rejectsSyncResult.shortMessage?.toString());24expectError(rejectsSyncResult.originalMessage?.toString());25expectError(rejectsSyncResult.code?.toString());26expectError(rejectsSyncResult.cause?.valueOf());2728const noRejectsSyncResult = execaSync('unicorns', {reject: false});29expectType<string | undefined>(noRejectsSyncResult.stack);30expectType<string | undefined>(noRejectsSyncResult.message);31expectType<string | undefined>(noRejectsSyncResult.shortMessage);32expectType<string | undefined>(noRejectsSyncResult.originalMessage);
added:test-d/return/result-stdio.test-d.ts+119 added
1import {Readable, Writable} from 'node:stream';2import {expectType} from 'tsd';3import {execa, execaSync, type ExecaError, type ExecaSyncError} from '../../index.js';45const unicornsResult = await execa('unicorns', {all: true});6expectType<undefined>(unicornsResult.stdio[0]);7expectType<string>(unicornsResult.stdout);8expectType<string>(unicornsResult.stdio[1]);9expectType<string>(unicornsResult.stderr);10expectType<string>(unicornsResult.stdio[2]);11expectType<string>(unicornsResult.all);12expectType<string | undefined>(unicornsResult.stdio[3 as number]);1314const bufferResult = await execa('unicorns', {encoding: 'buffer', all: true});15expectType<Uint8Array>(bufferResult.stdout);16expectType<Uint8Array>(bufferResult.stdio[1]);17expectType<Uint8Array>(bufferResult.stderr);18expectType<Uint8Array>(bufferResult.stdio[2]);19expectType<Uint8Array>(bufferResult.all);2021const hexResult = await execa('unicorns', {encoding: 'hex', all: true});22expectType<string>(hexResult.stdout);23expectType<string>(hexResult.stdio[1]);24expectType<string>(hexResult.stderr);25expectType<string>(hexResult.stdio[2]);26expectType<string>(hexResult.all);2728const unicornsResultSync = execaSync('unicorns', {all: true});29expectType<undefined>(unicornsResultSync.stdio[0]);30expectType<string>(unicornsResultSync.stdout);31expectType<string>(unicornsResultSync.stdio[1]);32expectType<string>(unicornsResultSync.stderr);33expectType<string>(unicornsResultSync.stdio[2]);34expectType<string>(unicornsResultSync.all);3536const bufferResultSync = execaSync('unicorns', {encoding: 'buffer', all: true});37expectType<undefined>(bufferResultSync.stdio[0]);38expectType<Uint8Array>(bufferResultSync.stdout);39expectType<Uint8Array>(bufferResultSync.stdio[1]);40expectType<Uint8Array>(bufferResultSync.stderr);41expectType<Uint8Array>(bufferResultSync.stdio[2]);42expectType<Uint8Array>(bufferResultSync.all);4344const execaStringError = new Error('.') as ExecaError<{all: true}>;45expectType<undefined>(execaStringError.stdio[0]);46expectType<string>(execaStringError.stdout);47expectType<string>(execaStringError.stdio[1]);48expectType<string>(execaStringError.stderr);49expectType<string>(execaStringError.stdio[2]);50expectType<string>(execaStringError.all);5152const execaBufferError = new Error('.') as ExecaError<{encoding: 'buffer'; all: true}>;53expectType<undefined>(execaBufferError.stdio[0]);54expectType<Uint8Array>(execaBufferError.stdout);55expectType<Uint8Array>(execaBufferError.stdio[1]);56expectType<Uint8Array>(execaBufferError.stderr);57expectType<Uint8Array>(execaBufferError.stdio[2]);58expectType<Uint8Array>(execaBufferError.all);5960const execaStringErrorSync = new Error('.') as ExecaSyncError<{all: true}>;61expectType<undefined>(execaStringErrorSync.stdio[0]);62expectType<string>(execaStringErrorSync.stdout);63expectType<string>(execaStringErrorSync.stdio[1]);64expectType<string>(execaStringErrorSync.stderr);65expectType<string>(execaStringErrorSync.stdio[2]);66expectType<string>(execaStringErrorSync.all);6768const execaBufferErrorSync = new Error('.') as ExecaSyncError<{encoding: 'buffer'; all: true}>;69expectType<undefined>(execaBufferErrorSync.stdio[0]);70expectType<Uint8Array>(execaBufferErrorSync.stdout);71expectType<Uint8Array>(execaBufferErrorSync.stdio[1]);72expectType<Uint8Array>(execaBufferErrorSync.stderr);73expectType<Uint8Array>(execaBufferErrorSync.stdio[2]);74expectType<Uint8Array>(execaBufferErrorSync.all);7576const multipleStdoutResult = await execa('unicorns', {stdout: ['inherit', 'pipe'] as ['inherit', 'pipe'], all: true});77expectType<string>(multipleStdoutResult.stdout);78expectType<string>(multipleStdoutResult.stdio[1]);79expectType<string>(multipleStdoutResult.stderr);80expectType<string>(multipleStdoutResult.stdio[2]);81expectType<string>(multipleStdoutResult.all);8283const undefinedStdoutResult = await execa('unicorns', {stdout: undefined, all: true});84expectType<string>(undefinedStdoutResult.stdout);85expectType<string>(undefinedStdoutResult.stderr);86expectType<string>(undefinedStdoutResult.all);8788const undefinedArrayStdoutResult = await execa('unicorns', {stdout: [undefined] as const, all: true});89expectType<string>(undefinedArrayStdoutResult.stdout);90expectType<string>(undefinedArrayStdoutResult.stderr);91expectType<string>(undefinedArrayStdoutResult.all);9293const undefinedStderrResult = await execa('unicorns', {stderr: undefined, all: true});94expectType<string>(undefinedStderrResult.stdout);95expectType<string>(undefinedStderrResult.stderr);96expectType<string>(undefinedStderrResult.all);9798const undefinedArrayStderrResult = await execa('unicorns', {stderr: [undefined] as const, all: true});99expectType<string>(undefinedArrayStderrResult.stdout);100expectType<string>(undefinedArrayStderrResult.stderr);101expectType<string>(undefinedArrayStderrResult.all);102103const fd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']});104expectType<string>(fd3Result.stdio[3]);105106const inputFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe', new Readable()]]});107expectType<undefined>(inputFd3Result.stdio[3]);108109const outputFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe', new Writable()]]});110expectType<string>(outputFd3Result.stdio[3]);111112const bufferFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], encoding: 'buffer'});113expectType<Uint8Array>(bufferFd3Result.stdio[3]);114115const undefinedFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', undefined]});116expectType<undefined>(undefinedFd3Result.stdio[3]);117118const undefinedArrayFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [undefined] as const]});119expectType<undefined>(undefinedArrayFd3Result.stdio[3]);
added:test-d/stdio/option/array-binary.test-d.ts+36 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const binaryArray = [new Uint8Array(), new Uint8Array()] as const;1415await execa('unicorns', {stdin: [binaryArray]});16execaSync('unicorns', {stdin: [binaryArray]});1718expectError(await execa('unicorns', {stdout: [binaryArray]}));19expectError(execaSync('unicorns', {stdout: [binaryArray]}));2021expectError(await execa('unicorns', {stderr: [binaryArray]}));22expectError(execaSync('unicorns', {stderr: [binaryArray]}));2324await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryArray]]});25expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryArray]]}));26await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[binaryArray]]]});27expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[binaryArray]]]}));2829expectAssignable<StdinOption>([binaryArray]);30expectAssignable<StdinOptionSync>([binaryArray]);3132expectNotAssignable<StdoutStderrOption>([binaryArray]);33expectNotAssignable<StdoutStderrOptionSync>([binaryArray]);3435expectAssignable<StdioOption>([binaryArray]);36expectAssignable<StdioOptionSync>([binaryArray]);
added:test-d/stdio/option/array-object.test-d.ts+36 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const objectArray = [{}, {}] as const;1415await execa('unicorns', {stdin: [objectArray]});16execaSync('unicorns', {stdin: [objectArray]});1718expectError(await execa('unicorns', {stdout: [objectArray]}));19expectError(execaSync('unicorns', {stdout: [objectArray]}));2021expectError(await execa('unicorns', {stderr: [objectArray]}));22expectError(execaSync('unicorns', {stderr: [objectArray]}));2324await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectArray]]});25expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectArray]]}));26await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[objectArray]]]});27expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[objectArray]]]}));2829expectAssignable<StdinOption>([objectArray]);30expectAssignable<StdinOptionSync>([objectArray]);3132expectNotAssignable<StdoutStderrOption>([objectArray]);33expectNotAssignable<StdoutStderrOptionSync>([objectArray]);3435expectAssignable<StdioOption>([objectArray]);36expectAssignable<StdioOptionSync>([objectArray]);
added:test-d/stdio/option/array-string.test-d.ts+36 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const stringArray = ['foo', 'bar'] as const;1415await execa('unicorns', {stdin: [stringArray]});16execaSync('unicorns', {stdin: [stringArray]});1718expectError(await execa('unicorns', {stdout: [stringArray]}));19expectError(execaSync('unicorns', {stdout: [stringArray]}));2021expectError(await execa('unicorns', {stderr: [stringArray]}));22expectError(execaSync('unicorns', {stderr: [stringArray]}));2324await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringArray]]});25expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringArray]]}));26await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[stringArray]]]});27expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[stringArray]]]}));2829expectAssignable<StdinOption>([stringArray]);30expectAssignable<StdinOptionSync>([stringArray]);3132expectNotAssignable<StdoutStderrOption>([stringArray]);33expectNotAssignable<StdoutStderrOptionSync>([stringArray]);3435expectAssignable<StdioOption>([stringArray]);36expectAssignable<StdioOptionSync>([stringArray]);
added:test-d/stdio/option/duplex-invalid.test-d.ts+55 added
1import {Duplex} from 'node:stream';2import {expectError, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314const duplexWithInvalidObjectMode = {15 transform: new Duplex(),16 objectMode: 'true',17} as const;1819expectError(await execa('unicorns', {stdin: duplexWithInvalidObjectMode}));20expectError(execaSync('unicorns', {stdin: duplexWithInvalidObjectMode}));21expectError(await execa('unicorns', {stdin: [duplexWithInvalidObjectMode]}));22expectError(execaSync('unicorns', {stdin: [duplexWithInvalidObjectMode]}));2324expectError(await execa('unicorns', {stdout: duplexWithInvalidObjectMode}));25expectError(execaSync('unicorns', {stdout: duplexWithInvalidObjectMode}));26expectError(await execa('unicorns', {stdout: [duplexWithInvalidObjectMode]}));27expectError(execaSync('unicorns', {stdout: [duplexWithInvalidObjectMode]}));2829expectError(await execa('unicorns', {stderr: duplexWithInvalidObjectMode}));30expectError(execaSync('unicorns', {stderr: duplexWithInvalidObjectMode}));31expectError(await execa('unicorns', {stderr: [duplexWithInvalidObjectMode]}));32expectError(execaSync('unicorns', {stderr: [duplexWithInvalidObjectMode]}));3334expectError(await execa('unicorns', {stdio: duplexWithInvalidObjectMode}));35expectError(execaSync('unicorns', {stdio: duplexWithInvalidObjectMode}));3637expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexWithInvalidObjectMode]}));38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexWithInvalidObjectMode]}));39expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexWithInvalidObjectMode]]}));40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexWithInvalidObjectMode]]}));4142expectNotAssignable<StdinOption>(duplexWithInvalidObjectMode);43expectNotAssignable<StdinOptionSync>(duplexWithInvalidObjectMode);44expectNotAssignable<StdinOption>([duplexWithInvalidObjectMode]);45expectNotAssignable<StdinOptionSync>([duplexWithInvalidObjectMode]);4647expectNotAssignable<StdoutStderrOption>(duplexWithInvalidObjectMode);48expectNotAssignable<StdoutStderrOptionSync>(duplexWithInvalidObjectMode);49expectNotAssignable<StdoutStderrOption>([duplexWithInvalidObjectMode]);50expectNotAssignable<StdoutStderrOptionSync>([duplexWithInvalidObjectMode]);5152expectNotAssignable<StdioOption>(duplexWithInvalidObjectMode);53expectNotAssignable<StdioOptionSync>(duplexWithInvalidObjectMode);54expectNotAssignable<StdioOption>([duplexWithInvalidObjectMode]);55expectNotAssignable<StdioOptionSync>([duplexWithInvalidObjectMode]);
added:test-d/stdio/option/duplex-object.test-d.ts+55 added
1import {Duplex} from 'node:stream';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314const duplexObjectProperty = {15 transform: new Duplex(),16 objectMode: true as const,17} as const;1819await execa('unicorns', {stdin: duplexObjectProperty});20expectError(execaSync('unicorns', {stdin: duplexObjectProperty}));21await execa('unicorns', {stdin: [duplexObjectProperty]});22expectError(execaSync('unicorns', {stdin: [duplexObjectProperty]}));2324await execa('unicorns', {stdout: duplexObjectProperty});25expectError(execaSync('unicorns', {stdout: duplexObjectProperty}));26await execa('unicorns', {stdout: [duplexObjectProperty]});27expectError(execaSync('unicorns', {stdout: [duplexObjectProperty]}));2829await execa('unicorns', {stderr: duplexObjectProperty});30expectError(execaSync('unicorns', {stderr: duplexObjectProperty}));31await execa('unicorns', {stderr: [duplexObjectProperty]});32expectError(execaSync('unicorns', {stderr: [duplexObjectProperty]}));3334expectError(await execa('unicorns', {stdio: duplexObjectProperty}));35expectError(execaSync('unicorns', {stdio: duplexObjectProperty}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexObjectProperty]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexObjectProperty]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexObjectProperty]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexObjectProperty]]}));4142expectAssignable<StdinOption>(duplexObjectProperty);43expectNotAssignable<StdinOptionSync>(duplexObjectProperty);44expectAssignable<StdinOption>([duplexObjectProperty]);45expectNotAssignable<StdinOptionSync>([duplexObjectProperty]);4647expectAssignable<StdoutStderrOption>(duplexObjectProperty);48expectNotAssignable<StdoutStderrOptionSync>(duplexObjectProperty);49expectAssignable<StdoutStderrOption>([duplexObjectProperty]);50expectNotAssignable<StdoutStderrOptionSync>([duplexObjectProperty]);5152expectAssignable<StdioOption>(duplexObjectProperty);53expectNotAssignable<StdioOptionSync>(duplexObjectProperty);54expectAssignable<StdioOption>([duplexObjectProperty]);55expectNotAssignable<StdioOptionSync>([duplexObjectProperty]);
added:test-d/stdio/option/duplex-transform.test-d.ts+52 added
1import {Transform} from 'node:stream';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314const duplexTransform = {transform: new Transform()} as const;1516await execa('unicorns', {stdin: duplexTransform});17expectError(execaSync('unicorns', {stdin: duplexTransform}));18await execa('unicorns', {stdin: [duplexTransform]});19expectError(execaSync('unicorns', {stdin: [duplexTransform]}));2021await execa('unicorns', {stdout: duplexTransform});22expectError(execaSync('unicorns', {stdout: duplexTransform}));23await execa('unicorns', {stdout: [duplexTransform]});24expectError(execaSync('unicorns', {stdout: [duplexTransform]}));2526await execa('unicorns', {stderr: duplexTransform});27expectError(execaSync('unicorns', {stderr: duplexTransform}));28await execa('unicorns', {stderr: [duplexTransform]});29expectError(execaSync('unicorns', {stderr: [duplexTransform]}));3031expectError(await execa('unicorns', {stdio: duplexTransform}));32expectError(execaSync('unicorns', {stdio: duplexTransform}));3334await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexTransform]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexTransform]}));36await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexTransform]]});37expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexTransform]]}));3839expectAssignable<StdinOption>(duplexTransform);40expectNotAssignable<StdinOptionSync>(duplexTransform);41expectAssignable<StdinOption>([duplexTransform]);42expectNotAssignable<StdinOptionSync>([duplexTransform]);4344expectAssignable<StdoutStderrOption>(duplexTransform);45expectNotAssignable<StdoutStderrOptionSync>(duplexTransform);46expectAssignable<StdoutStderrOption>([duplexTransform]);47expectNotAssignable<StdoutStderrOptionSync>([duplexTransform]);4849expectAssignable<StdioOption>(duplexTransform);50expectNotAssignable<StdioOptionSync>(duplexTransform);51expectAssignable<StdioOption>([duplexTransform]);52expectNotAssignable<StdioOptionSync>([duplexTransform]);
added:test-d/stdio/option/duplex.test-d.ts+52 added
1import {Duplex} from 'node:stream';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314const duplex = {transform: new Duplex()} as const;1516await execa('unicorns', {stdin: duplex});17expectError(execaSync('unicorns', {stdin: duplex}));18await execa('unicorns', {stdin: [duplex]});19expectError(execaSync('unicorns', {stdin: [duplex]}));2021await execa('unicorns', {stdout: duplex});22expectError(execaSync('unicorns', {stdout: duplex}));23await execa('unicorns', {stdout: [duplex]});24expectError(execaSync('unicorns', {stdout: [duplex]}));2526await execa('unicorns', {stderr: duplex});27expectError(execaSync('unicorns', {stderr: duplex}));28await execa('unicorns', {stderr: [duplex]});29expectError(execaSync('unicorns', {stderr: [duplex]}));3031expectError(await execa('unicorns', {stdio: duplex}));32expectError(execaSync('unicorns', {stdio: duplex}));3334await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplex]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplex]}));36await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplex]]});37expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplex]]}));3839expectAssignable<StdinOption>(duplex);40expectNotAssignable<StdinOptionSync>(duplex);41expectAssignable<StdinOption>([duplex]);42expectNotAssignable<StdinOptionSync>([duplex]);4344expectAssignable<StdoutStderrOption>(duplex);45expectNotAssignable<StdoutStderrOptionSync>(duplex);46expectAssignable<StdoutStderrOption>([duplex]);47expectNotAssignable<StdoutStderrOptionSync>([duplex]);4849expectAssignable<StdioOption>(duplex);50expectNotAssignable<StdioOptionSync>(duplex);51expectAssignable<StdioOption>([duplex]);52expectNotAssignable<StdioOptionSync>([duplex]);
added:test-d/stdio/option/fd-integer-0.test-d.ts+54 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: 0});14execaSync('unicorns', {stdin: 0});15await execa('unicorns', {stdin: [0]});16execaSync('unicorns', {stdin: [0]});1718expectError(await execa('unicorns', {stdout: 0}));19expectError(execaSync('unicorns', {stdout: 0}));20expectError(await execa('unicorns', {stdout: [0]}));21expectError(execaSync('unicorns', {stdout: [0]}));2223expectError(await execa('unicorns', {stderr: 0}));24expectError(execaSync('unicorns', {stderr: 0}));25expectError(await execa('unicorns', {stderr: [0]}));26expectError(execaSync('unicorns', {stderr: [0]}));2728expectError(await execa('unicorns', {stdio: 0}));29expectError(execaSync('unicorns', {stdio: 0}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 0]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 0]});33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [0]]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [0]]});3536expectAssignable<StdinOption>(0);37expectAssignable<StdinOptionSync>(0);38expectAssignable<StdinOption>([0]);39expectAssignable<StdinOptionSync>([0]);4041expectNotAssignable<StdoutStderrOption>(0);42expectNotAssignable<StdoutStderrOptionSync>(0);43expectNotAssignable<StdoutStderrOption>([0]);44expectNotAssignable<StdoutStderrOptionSync>([0]);4546expectAssignable<StdioOption>(0);47expectAssignable<StdioOptionSync>(0);48expectAssignable<StdioOption>([0]);49expectAssignable<StdioOptionSync>([0]);5051expectNotAssignable<StdioOption>(0.5);52expectNotAssignable<StdioOption>(-1);53expectNotAssignable<StdioOption>(Number.POSITIVE_INFINITY);54expectNotAssignable<StdioOption>(Number.NaN);
added:test-d/stdio/option/fd-integer-1.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213expectError(await execa('unicorns', {stdin: 1}));14expectError(execaSync('unicorns', {stdin: 1}));15expectError(await execa('unicorns', {stdin: [1]}));16expectError(execaSync('unicorns', {stdin: [1]}));1718await execa('unicorns', {stdout: 1});19execaSync('unicorns', {stdout: 1});20await execa('unicorns', {stdout: [1]});21execaSync('unicorns', {stdout: [1]});2223await execa('unicorns', {stderr: 1});24execaSync('unicorns', {stderr: 1});25await execa('unicorns', {stderr: [1]});26execaSync('unicorns', {stderr: [1]});2728expectError(await execa('unicorns', {stdio: 1}));29expectError(execaSync('unicorns', {stdio: 1}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 1]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 1]});33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [1]]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [1]]});3536expectNotAssignable<StdinOption>(1);37expectNotAssignable<StdinOptionSync>(1);38expectNotAssignable<StdinOption>([1]);39expectNotAssignable<StdinOptionSync>([1]);4041expectAssignable<StdoutStderrOption>(1);42expectAssignable<StdoutStderrOptionSync>(1);43expectAssignable<StdoutStderrOption>([1]);44expectAssignable<StdoutStderrOptionSync>([1]);4546expectAssignable<StdioOption>(1);47expectAssignable<StdioOptionSync>(1);48expectAssignable<StdioOption>([1]);49expectAssignable<StdioOptionSync>([1]);
added:test-d/stdio/option/fd-integer-2.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213expectError(await execa('unicorns', {stdin: 2}));14expectError(execaSync('unicorns', {stdin: 2}));15expectError(await execa('unicorns', {stdin: [2]}));16expectError(execaSync('unicorns', {stdin: [2]}));1718await execa('unicorns', {stdout: 2});19execaSync('unicorns', {stdout: 2});20await execa('unicorns', {stdout: [2]});21execaSync('unicorns', {stdout: [2]});2223await execa('unicorns', {stderr: 2});24execaSync('unicorns', {stderr: 2});25await execa('unicorns', {stderr: [2]});26execaSync('unicorns', {stderr: [2]});2728expectError(await execa('unicorns', {stdio: 2}));29expectError(execaSync('unicorns', {stdio: 2}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 2]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 2]});33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [2]]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [2]]});3536expectNotAssignable<StdinOption>(2);37expectNotAssignable<StdinOptionSync>(2);38expectNotAssignable<StdinOption>([2]);39expectNotAssignable<StdinOptionSync>([2]);4041expectAssignable<StdoutStderrOption>(2);42expectAssignable<StdoutStderrOptionSync>(2);43expectAssignable<StdoutStderrOption>([2]);44expectAssignable<StdoutStderrOptionSync>([2]);4546expectAssignable<StdioOption>(2);47expectAssignable<StdioOptionSync>(2);48expectAssignable<StdioOption>([2]);49expectAssignable<StdioOptionSync>([2]);
added:test-d/stdio/option/fd-integer-3.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: 3});14execaSync('unicorns', {stdin: 3});15expectError(await execa('unicorns', {stdin: [3]}));16execaSync('unicorns', {stdin: [3]});1718await execa('unicorns', {stdout: 3});19execaSync('unicorns', {stdout: 3});20expectError(await execa('unicorns', {stdout: [3]}));21execaSync('unicorns', {stdout: [3]});2223await execa('unicorns', {stderr: 3});24execaSync('unicorns', {stderr: 3});25expectError(await execa('unicorns', {stderr: [3]}));26execaSync('unicorns', {stderr: [3]});2728expectError(await execa('unicorns', {stdio: 3}));29expectError(execaSync('unicorns', {stdio: 3}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 3]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 3]});33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [3]]}));34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [3]]});3536expectAssignable<StdinOption>(3);37expectAssignable<StdinOptionSync>(3);38expectNotAssignable<StdinOption>([3]);39expectAssignable<StdinOptionSync>([3]);4041expectAssignable<StdoutStderrOption>(3);42expectAssignable<StdoutStderrOptionSync>(3);43expectNotAssignable<StdoutStderrOption>([3]);44expectAssignable<StdoutStderrOptionSync>([3]);4546expectAssignable<StdioOption>(3);47expectAssignable<StdioOptionSync>(3);48expectNotAssignable<StdioOption>([3]);49expectAssignable<StdioOptionSync>([3]);
added:test-d/stdio/option/file-object-invalid.test-d.ts+51 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const invalidFileObject = {file: new URL('file:///test')} as const;1415expectError(await execa('unicorns', {stdin: invalidFileObject}));16expectError(execaSync('unicorns', {stdin: invalidFileObject}));17expectError(await execa('unicorns', {stdin: [invalidFileObject]}));18expectError(execaSync('unicorns', {stdin: [invalidFileObject]}));1920expectError(await execa('unicorns', {stdout: invalidFileObject}));21expectError(execaSync('unicorns', {stdout: invalidFileObject}));22expectError(await execa('unicorns', {stdout: [invalidFileObject]}));23expectError(execaSync('unicorns', {stdout: [invalidFileObject]}));2425expectError(await execa('unicorns', {stderr: invalidFileObject}));26expectError(execaSync('unicorns', {stderr: invalidFileObject}));27expectError(await execa('unicorns', {stderr: [invalidFileObject]}));28expectError(execaSync('unicorns', {stderr: [invalidFileObject]}));2930expectError(await execa('unicorns', {stdio: invalidFileObject}));31expectError(execaSync('unicorns', {stdio: invalidFileObject}));3233expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidFileObject]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidFileObject]}));35expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidFileObject]]}));36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidFileObject]]}));3738expectNotAssignable<StdinOption>(invalidFileObject);39expectNotAssignable<StdinOptionSync>(invalidFileObject);40expectNotAssignable<StdinOption>([invalidFileObject]);41expectNotAssignable<StdinOptionSync>([invalidFileObject]);4243expectNotAssignable<StdoutStderrOption>(invalidFileObject);44expectNotAssignable<StdoutStderrOptionSync>(invalidFileObject);45expectNotAssignable<StdoutStderrOption>([invalidFileObject]);46expectNotAssignable<StdoutStderrOptionSync>([invalidFileObject]);4748expectNotAssignable<StdioOption>(invalidFileObject);49expectNotAssignable<StdioOptionSync>(invalidFileObject);50expectNotAssignable<StdioOption>([invalidFileObject]);51expectNotAssignable<StdioOptionSync>([invalidFileObject]);
added:test-d/stdio/option/file-object.test-d.ts+51 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const fileObject = {file: './test'} as const;1415await execa('unicorns', {stdin: fileObject});16execaSync('unicorns', {stdin: fileObject});17await execa('unicorns', {stdin: [fileObject]});18execaSync('unicorns', {stdin: [fileObject]});1920await execa('unicorns', {stdout: fileObject});21execaSync('unicorns', {stdout: fileObject});22await execa('unicorns', {stdout: [fileObject]});23execaSync('unicorns', {stdout: [fileObject]});2425await execa('unicorns', {stderr: fileObject});26execaSync('unicorns', {stderr: fileObject});27await execa('unicorns', {stderr: [fileObject]});28execaSync('unicorns', {stderr: [fileObject]});2930expectError(await execa('unicorns', {stdio: fileObject}));31expectError(execaSync('unicorns', {stdio: fileObject}));3233await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileObject]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileObject]});35await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileObject]]});36execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileObject]]});3738expectAssignable<StdinOption>(fileObject);39expectAssignable<StdinOptionSync>(fileObject);40expectAssignable<StdinOption>([fileObject]);41expectAssignable<StdinOptionSync>([fileObject]);4243expectAssignable<StdoutStderrOption>(fileObject);44expectAssignable<StdoutStderrOptionSync>(fileObject);45expectAssignable<StdoutStderrOption>([fileObject]);46expectAssignable<StdoutStderrOptionSync>([fileObject]);4748expectAssignable<StdioOption>(fileObject);49expectAssignable<StdioOptionSync>(fileObject);50expectAssignable<StdioOption>([fileObject]);51expectAssignable<StdioOptionSync>([fileObject]);
added:test-d/stdio/option/file-url.test-d.ts+51 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const fileUrl = new URL('file:///test');1415await execa('unicorns', {stdin: fileUrl});16execaSync('unicorns', {stdin: fileUrl});17await execa('unicorns', {stdin: [fileUrl]});18execaSync('unicorns', {stdin: [fileUrl]});1920await execa('unicorns', {stdout: fileUrl});21execaSync('unicorns', {stdout: fileUrl});22await execa('unicorns', {stdout: [fileUrl]});23execaSync('unicorns', {stdout: [fileUrl]});2425await execa('unicorns', {stderr: fileUrl});26execaSync('unicorns', {stderr: fileUrl});27await execa('unicorns', {stderr: [fileUrl]});28execaSync('unicorns', {stderr: [fileUrl]});2930expectError(await execa('unicorns', {stdio: fileUrl}));31expectError(execaSync('unicorns', {stdio: fileUrl}));3233await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileUrl]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileUrl]});35await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileUrl]]});36execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileUrl]]});3738expectAssignable<StdinOption>(fileUrl);39expectAssignable<StdinOptionSync>(fileUrl);40expectAssignable<StdinOption>([fileUrl]);41expectAssignable<StdinOptionSync>([fileUrl]);4243expectAssignable<StdoutStderrOption>(fileUrl);44expectAssignable<StdoutStderrOptionSync>(fileUrl);45expectAssignable<StdoutStderrOption>([fileUrl]);46expectAssignable<StdoutStderrOptionSync>([fileUrl]);4748expectAssignable<StdioOption>(fileUrl);49expectAssignable<StdioOptionSync>(fileUrl);50expectAssignable<StdioOption>([fileUrl]);51expectAssignable<StdioOptionSync>([fileUrl]);
added:test-d/stdio/option/final-async-full.test-d.ts+58 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const asyncFinalFull = {14 async * transform(line: unknown) {15 yield '';16 },17 async * final() {18 yield '';19 },20} as const;2122await execa('unicorns', {stdin: asyncFinalFull});23expectError(execaSync('unicorns', {stdin: asyncFinalFull}));24await execa('unicorns', {stdin: [asyncFinalFull]});25expectError(execaSync('unicorns', {stdin: [asyncFinalFull]}));2627await execa('unicorns', {stdout: asyncFinalFull});28expectError(execaSync('unicorns', {stdout: asyncFinalFull}));29await execa('unicorns', {stdout: [asyncFinalFull]});30expectError(execaSync('unicorns', {stdout: [asyncFinalFull]}));3132await execa('unicorns', {stderr: asyncFinalFull});33expectError(execaSync('unicorns', {stderr: asyncFinalFull}));34await execa('unicorns', {stderr: [asyncFinalFull]});35expectError(execaSync('unicorns', {stderr: [asyncFinalFull]}));3637expectError(await execa('unicorns', {stdio: asyncFinalFull}));38expectError(execaSync('unicorns', {stdio: asyncFinalFull}));3940await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncFinalFull]});41expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncFinalFull]}));42await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncFinalFull]]});43expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncFinalFull]]}));4445expectAssignable<StdinOption>(asyncFinalFull);46expectNotAssignable<StdinOptionSync>(asyncFinalFull);47expectAssignable<StdinOption>([asyncFinalFull]);48expectNotAssignable<StdinOptionSync>([asyncFinalFull]);4950expectAssignable<StdoutStderrOption>(asyncFinalFull);51expectNotAssignable<StdoutStderrOptionSync>(asyncFinalFull);52expectAssignable<StdoutStderrOption>([asyncFinalFull]);53expectNotAssignable<StdoutStderrOptionSync>([asyncFinalFull]);5455expectAssignable<StdioOption>(asyncFinalFull);56expectNotAssignable<StdioOptionSync>(asyncFinalFull);57expectAssignable<StdioOption>([asyncFinalFull]);58expectNotAssignable<StdioOptionSync>([asyncFinalFull]);
added:test-d/stdio/option/final-invalid-full.test-d.ts+59 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const invalidReturnFinalFull = {14 * transform(line: string) {15 yield line;16 },17 * final() {18 yield {} as unknown;19 return false;20 },21} as const;2223expectError(await execa('unicorns', {stdin: invalidReturnFinalFull}));24expectError(execaSync('unicorns', {stdin: invalidReturnFinalFull}));25expectError(await execa('unicorns', {stdin: [invalidReturnFinalFull]}));26expectError(execaSync('unicorns', {stdin: [invalidReturnFinalFull]}));2728expectError(await execa('unicorns', {stdout: invalidReturnFinalFull}));29expectError(execaSync('unicorns', {stdout: invalidReturnFinalFull}));30expectError(await execa('unicorns', {stdout: [invalidReturnFinalFull]}));31expectError(execaSync('unicorns', {stdout: [invalidReturnFinalFull]}));3233expectError(await execa('unicorns', {stderr: invalidReturnFinalFull}));34expectError(execaSync('unicorns', {stderr: invalidReturnFinalFull}));35expectError(await execa('unicorns', {stderr: [invalidReturnFinalFull]}));36expectError(execaSync('unicorns', {stderr: [invalidReturnFinalFull]}));3738expectError(await execa('unicorns', {stdio: invalidReturnFinalFull}));39expectError(execaSync('unicorns', {stdio: invalidReturnFinalFull}));4041expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnFinalFull]}));42expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnFinalFull]}));43expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnFinalFull]]}));44expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnFinalFull]]}));4546expectNotAssignable<StdinOption>(invalidReturnFinalFull);47expectNotAssignable<StdinOptionSync>(invalidReturnFinalFull);48expectNotAssignable<StdinOption>([invalidReturnFinalFull]);49expectNotAssignable<StdinOptionSync>([invalidReturnFinalFull]);5051expectNotAssignable<StdoutStderrOption>(invalidReturnFinalFull);52expectNotAssignable<StdoutStderrOptionSync>(invalidReturnFinalFull);53expectNotAssignable<StdoutStderrOption>([invalidReturnFinalFull]);54expectNotAssignable<StdoutStderrOptionSync>([invalidReturnFinalFull]);5556expectNotAssignable<StdioOption>(invalidReturnFinalFull);57expectNotAssignable<StdioOptionSync>(invalidReturnFinalFull);58expectNotAssignable<StdioOption>([invalidReturnFinalFull]);59expectNotAssignable<StdioOptionSync>([invalidReturnFinalFull]);
added:test-d/stdio/option/final-object-full.test-d.ts+59 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const objectFinalFull = {14 * transform(line: unknown) {15 yield JSON.parse(line as string) as object;16 },17 * final() {18 yield {};19 },20 objectMode: true,21} as const;2223await execa('unicorns', {stdin: objectFinalFull});24execaSync('unicorns', {stdin: objectFinalFull});25await execa('unicorns', {stdin: [objectFinalFull]});26execaSync('unicorns', {stdin: [objectFinalFull]});2728await execa('unicorns', {stdout: objectFinalFull});29execaSync('unicorns', {stdout: objectFinalFull});30await execa('unicorns', {stdout: [objectFinalFull]});31execaSync('unicorns', {stdout: [objectFinalFull]});3233await execa('unicorns', {stderr: objectFinalFull});34execaSync('unicorns', {stderr: objectFinalFull});35await execa('unicorns', {stderr: [objectFinalFull]});36execaSync('unicorns', {stderr: [objectFinalFull]});3738expectError(await execa('unicorns', {stdio: objectFinalFull}));39expectError(execaSync('unicorns', {stdio: objectFinalFull}));4041await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectFinalFull]});42execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectFinalFull]});43await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectFinalFull]]});44execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectFinalFull]]});4546expectAssignable<StdinOption>(objectFinalFull);47expectAssignable<StdinOptionSync>(objectFinalFull);48expectAssignable<StdinOption>([objectFinalFull]);49expectAssignable<StdinOptionSync>([objectFinalFull]);5051expectAssignable<StdoutStderrOption>(objectFinalFull);52expectAssignable<StdoutStderrOptionSync>(objectFinalFull);53expectAssignable<StdoutStderrOption>([objectFinalFull]);54expectAssignable<StdoutStderrOptionSync>([objectFinalFull]);5556expectAssignable<StdioOption>(objectFinalFull);57expectAssignable<StdioOptionSync>(objectFinalFull);58expectAssignable<StdioOption>([objectFinalFull]);59expectAssignable<StdioOptionSync>([objectFinalFull]);
added:test-d/stdio/option/final-unknown-full.test-d.ts+59 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const unknownFinalFull = {14 * transform(line: unknown) {15 yield line;16 },17 * final() {18 yield {} as unknown;19 },20 objectMode: true,21} as const;2223await execa('unicorns', {stdin: unknownFinalFull});24execaSync('unicorns', {stdin: unknownFinalFull});25await execa('unicorns', {stdin: [unknownFinalFull]});26execaSync('unicorns', {stdin: [unknownFinalFull]});2728await execa('unicorns', {stdout: unknownFinalFull});29execaSync('unicorns', {stdout: unknownFinalFull});30await execa('unicorns', {stdout: [unknownFinalFull]});31execaSync('unicorns', {stdout: [unknownFinalFull]});3233await execa('unicorns', {stderr: unknownFinalFull});34execaSync('unicorns', {stderr: unknownFinalFull});35await execa('unicorns', {stderr: [unknownFinalFull]});36execaSync('unicorns', {stderr: [unknownFinalFull]});3738expectError(await execa('unicorns', {stdio: unknownFinalFull}));39expectError(execaSync('unicorns', {stdio: unknownFinalFull}));4041await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownFinalFull]});42execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownFinalFull]});43await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownFinalFull]]});44execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownFinalFull]]});4546expectAssignable<StdinOption>(unknownFinalFull);47expectAssignable<StdinOptionSync>(unknownFinalFull);48expectAssignable<StdinOption>([unknownFinalFull]);49expectAssignable<StdinOptionSync>([unknownFinalFull]);5051expectAssignable<StdoutStderrOption>(unknownFinalFull);52expectAssignable<StdoutStderrOptionSync>(unknownFinalFull);53expectAssignable<StdoutStderrOption>([unknownFinalFull]);54expectAssignable<StdoutStderrOptionSync>([unknownFinalFull]);5556expectAssignable<StdioOption>(unknownFinalFull);57expectAssignable<StdioOptionSync>(unknownFinalFull);58expectAssignable<StdioOption>([unknownFinalFull]);59expectAssignable<StdioOptionSync>([unknownFinalFull]);
added:test-d/stdio/option/generator-async-full.test-d.ts+55 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const asyncGeneratorFull = {14 async * transform(line: unknown) {15 yield '';16 },17} as const;1819await execa('unicorns', {stdin: asyncGeneratorFull});20expectError(execaSync('unicorns', {stdin: asyncGeneratorFull}));21await execa('unicorns', {stdin: [asyncGeneratorFull]});22expectError(execaSync('unicorns', {stdin: [asyncGeneratorFull]}));2324await execa('unicorns', {stdout: asyncGeneratorFull});25expectError(execaSync('unicorns', {stdout: asyncGeneratorFull}));26await execa('unicorns', {stdout: [asyncGeneratorFull]});27expectError(execaSync('unicorns', {stdout: [asyncGeneratorFull]}));2829await execa('unicorns', {stderr: asyncGeneratorFull});30expectError(execaSync('unicorns', {stderr: asyncGeneratorFull}));31await execa('unicorns', {stderr: [asyncGeneratorFull]});32expectError(execaSync('unicorns', {stderr: [asyncGeneratorFull]}));3334expectError(await execa('unicorns', {stdio: asyncGeneratorFull}));35expectError(execaSync('unicorns', {stdio: asyncGeneratorFull}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGeneratorFull]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGeneratorFull]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGeneratorFull]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGeneratorFull]]}));4142expectAssignable<StdinOption>(asyncGeneratorFull);43expectNotAssignable<StdinOptionSync>(asyncGeneratorFull);44expectAssignable<StdinOption>([asyncGeneratorFull]);45expectNotAssignable<StdinOptionSync>([asyncGeneratorFull]);4647expectAssignable<StdoutStderrOption>(asyncGeneratorFull);48expectNotAssignable<StdoutStderrOptionSync>(asyncGeneratorFull);49expectAssignable<StdoutStderrOption>([asyncGeneratorFull]);50expectNotAssignable<StdoutStderrOptionSync>([asyncGeneratorFull]);5152expectAssignable<StdioOption>(asyncGeneratorFull);53expectNotAssignable<StdioOptionSync>(asyncGeneratorFull);54expectAssignable<StdioOption>([asyncGeneratorFull]);55expectNotAssignable<StdioOptionSync>([asyncGeneratorFull]);
added:test-d/stdio/option/generator-async.test-d.ts+53 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const asyncGenerator = async function * (line: unknown) {14 yield '';15};1617await execa('unicorns', {stdin: asyncGenerator});18expectError(execaSync('unicorns', {stdin: asyncGenerator}));19await execa('unicorns', {stdin: [asyncGenerator]});20expectError(execaSync('unicorns', {stdin: [asyncGenerator]}));2122await execa('unicorns', {stdout: asyncGenerator});23expectError(execaSync('unicorns', {stdout: asyncGenerator}));24await execa('unicorns', {stdout: [asyncGenerator]});25expectError(execaSync('unicorns', {stdout: [asyncGenerator]}));2627await execa('unicorns', {stderr: asyncGenerator});28expectError(execaSync('unicorns', {stderr: asyncGenerator}));29await execa('unicorns', {stderr: [asyncGenerator]});30expectError(execaSync('unicorns', {stderr: [asyncGenerator]}));3132expectError(await execa('unicorns', {stdio: asyncGenerator}));33expectError(execaSync('unicorns', {stdio: asyncGenerator}));3435await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGenerator]});36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGenerator]}));37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGenerator]]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGenerator]]}));3940expectAssignable<StdinOption>(asyncGenerator);41expectNotAssignable<StdinOptionSync>(asyncGenerator);42expectAssignable<StdinOption>([asyncGenerator]);43expectNotAssignable<StdinOptionSync>([asyncGenerator]);4445expectAssignable<StdoutStderrOption>(asyncGenerator);46expectNotAssignable<StdoutStderrOptionSync>(asyncGenerator);47expectAssignable<StdoutStderrOption>([asyncGenerator]);48expectNotAssignable<StdoutStderrOptionSync>([asyncGenerator]);4950expectAssignable<StdioOption>(asyncGenerator);51expectNotAssignable<StdioOptionSync>(asyncGenerator);52expectAssignable<StdioOption>([asyncGenerator]);53expectNotAssignable<StdioOptionSync>([asyncGenerator]);
added:test-d/stdio/option/generator-binary-invalid.test-d.ts+56 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const transformWithInvalidBinary = {14 * transform(line: unknown) {15 yield line;16 },17 binary: 'true',18} as const;1920expectError(await execa('unicorns', {stdin: transformWithInvalidBinary}));21expectError(execaSync('unicorns', {stdin: transformWithInvalidBinary}));22expectError(await execa('unicorns', {stdin: [transformWithInvalidBinary]}));23expectError(execaSync('unicorns', {stdin: [transformWithInvalidBinary]}));2425expectError(await execa('unicorns', {stdout: transformWithInvalidBinary}));26expectError(execaSync('unicorns', {stdout: transformWithInvalidBinary}));27expectError(await execa('unicorns', {stdout: [transformWithInvalidBinary]}));28expectError(execaSync('unicorns', {stdout: [transformWithInvalidBinary]}));2930expectError(await execa('unicorns', {stderr: transformWithInvalidBinary}));31expectError(execaSync('unicorns', {stderr: transformWithInvalidBinary}));32expectError(await execa('unicorns', {stderr: [transformWithInvalidBinary]}));33expectError(execaSync('unicorns', {stderr: [transformWithInvalidBinary]}));3435expectError(await execa('unicorns', {stdio: transformWithInvalidBinary}));36expectError(execaSync('unicorns', {stdio: transformWithInvalidBinary}));3738expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidBinary]}));39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidBinary]}));40expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidBinary]]}));41expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidBinary]]}));4243expectNotAssignable<StdinOption>(transformWithInvalidBinary);44expectNotAssignable<StdinOptionSync>(transformWithInvalidBinary);45expectNotAssignable<StdinOption>([transformWithInvalidBinary]);46expectNotAssignable<StdinOptionSync>([transformWithInvalidBinary]);4748expectNotAssignable<StdoutStderrOption>(transformWithInvalidBinary);49expectNotAssignable<StdoutStderrOptionSync>(transformWithInvalidBinary);50expectNotAssignable<StdoutStderrOption>([transformWithInvalidBinary]);51expectNotAssignable<StdoutStderrOptionSync>([transformWithInvalidBinary]);5253expectNotAssignable<StdioOption>(transformWithInvalidBinary);54expectNotAssignable<StdioOptionSync>(transformWithInvalidBinary);55expectNotAssignable<StdioOption>([transformWithInvalidBinary]);56expectNotAssignable<StdioOptionSync>([transformWithInvalidBinary]);
added:test-d/stdio/option/generator-binary.test-d.ts+56 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const transformWithBinary = {14 * transform(line: unknown) {15 yield line;16 },17 binary: true,18} as const;1920await execa('unicorns', {stdin: transformWithBinary});21execaSync('unicorns', {stdin: transformWithBinary});22await execa('unicorns', {stdin: [transformWithBinary]});23execaSync('unicorns', {stdin: [transformWithBinary]});2425await execa('unicorns', {stdout: transformWithBinary});26execaSync('unicorns', {stdout: transformWithBinary});27await execa('unicorns', {stdout: [transformWithBinary]});28execaSync('unicorns', {stdout: [transformWithBinary]});2930await execa('unicorns', {stderr: transformWithBinary});31execaSync('unicorns', {stderr: transformWithBinary});32await execa('unicorns', {stderr: [transformWithBinary]});33execaSync('unicorns', {stderr: [transformWithBinary]});3435expectError(await execa('unicorns', {stdio: transformWithBinary}));36expectError(execaSync('unicorns', {stdio: transformWithBinary}));3738await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithBinary]});39execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithBinary]});40await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithBinary]]});41execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithBinary]]});4243expectAssignable<StdinOption>(transformWithBinary);44expectAssignable<StdinOptionSync>(transformWithBinary);45expectAssignable<StdinOption>([transformWithBinary]);46expectAssignable<StdinOptionSync>([transformWithBinary]);4748expectAssignable<StdoutStderrOption>(transformWithBinary);49expectAssignable<StdoutStderrOptionSync>(transformWithBinary);50expectAssignable<StdoutStderrOption>([transformWithBinary]);51expectAssignable<StdoutStderrOptionSync>([transformWithBinary]);5253expectAssignable<StdioOption>(transformWithBinary);54expectAssignable<StdioOptionSync>(transformWithBinary);55expectAssignable<StdioOption>([transformWithBinary]);56expectAssignable<StdioOptionSync>([transformWithBinary]);
added:test-d/stdio/option/generator-boolean-full.test-d.ts+55 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const booleanGeneratorFull = {14 * transform(line: boolean) {15 yield line;16 },17} as const;1819expectError(await execa('unicorns', {stdin: booleanGeneratorFull}));20expectError(execaSync('unicorns', {stdin: booleanGeneratorFull}));21expectError(await execa('unicorns', {stdin: [booleanGeneratorFull]}));22expectError(execaSync('unicorns', {stdin: [booleanGeneratorFull]}));2324expectError(await execa('unicorns', {stdout: booleanGeneratorFull}));25expectError(execaSync('unicorns', {stdout: booleanGeneratorFull}));26expectError(await execa('unicorns', {stdout: [booleanGeneratorFull]}));27expectError(execaSync('unicorns', {stdout: [booleanGeneratorFull]}));2829expectError(await execa('unicorns', {stderr: booleanGeneratorFull}));30expectError(execaSync('unicorns', {stderr: booleanGeneratorFull}));31expectError(await execa('unicorns', {stderr: [booleanGeneratorFull]}));32expectError(execaSync('unicorns', {stderr: [booleanGeneratorFull]}));3334expectError(await execa('unicorns', {stdio: booleanGeneratorFull}));35expectError(execaSync('unicorns', {stdio: booleanGeneratorFull}));3637expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGeneratorFull]}));38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGeneratorFull]}));39expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGeneratorFull]]}));40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGeneratorFull]]}));4142expectNotAssignable<StdinOption>(booleanGeneratorFull);43expectNotAssignable<StdinOptionSync>(booleanGeneratorFull);44expectNotAssignable<StdinOption>([booleanGeneratorFull]);45expectNotAssignable<StdinOptionSync>([booleanGeneratorFull]);4647expectNotAssignable<StdoutStderrOption>(booleanGeneratorFull);48expectNotAssignable<StdoutStderrOptionSync>(booleanGeneratorFull);49expectNotAssignable<StdoutStderrOption>([booleanGeneratorFull]);50expectNotAssignable<StdoutStderrOptionSync>([booleanGeneratorFull]);5152expectNotAssignable<StdioOption>(booleanGeneratorFull);53expectNotAssignable<StdioOptionSync>(booleanGeneratorFull);54expectNotAssignable<StdioOption>([booleanGeneratorFull]);55expectNotAssignable<StdioOptionSync>([booleanGeneratorFull]);
added:test-d/stdio/option/generator-boolean.test-d.ts+53 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const booleanGenerator = function * (line: boolean) {14 yield line;15};1617expectError(await execa('unicorns', {stdin: booleanGenerator}));18expectError(execaSync('unicorns', {stdin: booleanGenerator}));19expectError(await execa('unicorns', {stdin: [booleanGenerator]}));20expectError(execaSync('unicorns', {stdin: [booleanGenerator]}));2122expectError(await execa('unicorns', {stdout: booleanGenerator}));23expectError(execaSync('unicorns', {stdout: booleanGenerator}));24expectError(await execa('unicorns', {stdout: [booleanGenerator]}));25expectError(execaSync('unicorns', {stdout: [booleanGenerator]}));2627expectError(await execa('unicorns', {stderr: booleanGenerator}));28expectError(execaSync('unicorns', {stderr: booleanGenerator}));29expectError(await execa('unicorns', {stderr: [booleanGenerator]}));30expectError(execaSync('unicorns', {stderr: [booleanGenerator]}));3132expectError(await execa('unicorns', {stdio: booleanGenerator}));33expectError(execaSync('unicorns', {stdio: booleanGenerator}));3435expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGenerator]}));36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGenerator]}));37expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGenerator]]}));38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGenerator]]}));3940expectNotAssignable<StdinOption>(booleanGenerator);41expectNotAssignable<StdinOptionSync>(booleanGenerator);42expectNotAssignable<StdinOption>([booleanGenerator]);43expectNotAssignable<StdinOptionSync>([booleanGenerator]);4445expectNotAssignable<StdoutStderrOption>(booleanGenerator);46expectNotAssignable<StdoutStderrOptionSync>(booleanGenerator);47expectNotAssignable<StdoutStderrOption>([booleanGenerator]);48expectNotAssignable<StdoutStderrOptionSync>([booleanGenerator]);4950expectNotAssignable<StdioOption>(booleanGenerator);51expectNotAssignable<StdioOptionSync>(booleanGenerator);52expectNotAssignable<StdioOption>([booleanGenerator]);53expectNotAssignable<StdioOptionSync>([booleanGenerator]);
added:test-d/stdio/option/generator-empty.test-d.ts+49 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213expectError(await execa('unicorns', {stdin: {}}));14expectError(execaSync('unicorns', {stdin: {}}));15expectError(await execa('unicorns', {stdin: [{}]}));16expectError(execaSync('unicorns', {stdin: [{}]}));1718expectError(await execa('unicorns', {stdout: {}}));19expectError(execaSync('unicorns', {stdout: {}}));20expectError(await execa('unicorns', {stdout: [{}]}));21expectError(execaSync('unicorns', {stdout: [{}]}));2223expectError(await execa('unicorns', {stderr: {}}));24expectError(execaSync('unicorns', {stderr: {}}));25expectError(await execa('unicorns', {stderr: [{}]}));26expectError(execaSync('unicorns', {stderr: [{}]}));2728expectError(await execa('unicorns', {stdio: {}}));29expectError(execaSync('unicorns', {stdio: {}}));3031expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {}]}));32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {}]}));33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [{}]]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [{}]]}));3536expectNotAssignable<StdinOption>({});37expectNotAssignable<StdinOptionSync>({});38expectNotAssignable<StdinOption>([{}]);39expectNotAssignable<StdinOptionSync>([{}]);4041expectNotAssignable<StdoutStderrOption>({});42expectNotAssignable<StdoutStderrOptionSync>({});43expectNotAssignable<StdoutStderrOption>([{}]);44expectNotAssignable<StdoutStderrOptionSync>([{}]);4546expectNotAssignable<StdioOption>({});47expectNotAssignable<StdioOptionSync>({});48expectNotAssignable<StdioOption>([{}]);49expectNotAssignable<StdioOptionSync>([{}]);
added:test-d/stdio/option/generator-invalid-full.test-d.ts+56 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const invalidReturnGeneratorFull = {14 * transform(line: unknown) {15 yield line;16 return false;17 },18} as const;1920expectError(await execa('unicorns', {stdin: invalidReturnGeneratorFull}));21expectError(execaSync('unicorns', {stdin: invalidReturnGeneratorFull}));22expectError(await execa('unicorns', {stdin: [invalidReturnGeneratorFull]}));23expectError(execaSync('unicorns', {stdin: [invalidReturnGeneratorFull]}));2425expectError(await execa('unicorns', {stdout: invalidReturnGeneratorFull}));26expectError(execaSync('unicorns', {stdout: invalidReturnGeneratorFull}));27expectError(await execa('unicorns', {stdout: [invalidReturnGeneratorFull]}));28expectError(execaSync('unicorns', {stdout: [invalidReturnGeneratorFull]}));2930expectError(await execa('unicorns', {stderr: invalidReturnGeneratorFull}));31expectError(execaSync('unicorns', {stderr: invalidReturnGeneratorFull}));32expectError(await execa('unicorns', {stderr: [invalidReturnGeneratorFull]}));33expectError(execaSync('unicorns', {stderr: [invalidReturnGeneratorFull]}));3435expectError(await execa('unicorns', {stdio: invalidReturnGeneratorFull}));36expectError(execaSync('unicorns', {stdio: invalidReturnGeneratorFull}));3738expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGeneratorFull]}));39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGeneratorFull]}));40expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGeneratorFull]]}));41expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGeneratorFull]]}));4243expectNotAssignable<StdinOption>(invalidReturnGeneratorFull);44expectNotAssignable<StdinOptionSync>(invalidReturnGeneratorFull);45expectNotAssignable<StdinOption>([invalidReturnGeneratorFull]);46expectNotAssignable<StdinOptionSync>([invalidReturnGeneratorFull]);4748expectNotAssignable<StdoutStderrOption>(invalidReturnGeneratorFull);49expectNotAssignable<StdoutStderrOptionSync>(invalidReturnGeneratorFull);50expectNotAssignable<StdoutStderrOption>([invalidReturnGeneratorFull]);51expectNotAssignable<StdoutStderrOptionSync>([invalidReturnGeneratorFull]);5253expectNotAssignable<StdioOption>(invalidReturnGeneratorFull);54expectNotAssignable<StdioOptionSync>(invalidReturnGeneratorFull);55expectNotAssignable<StdioOption>([invalidReturnGeneratorFull]);56expectNotAssignable<StdioOptionSync>([invalidReturnGeneratorFull]);
added:test-d/stdio/option/generator-invalid.test-d.ts+54 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const invalidReturnGenerator = function * (line: unknown) {14 yield line;15 return false;16};1718expectError(await execa('unicorns', {stdin: invalidReturnGenerator}));19expectError(execaSync('unicorns', {stdin: invalidReturnGenerator}));20expectError(await execa('unicorns', {stdin: [invalidReturnGenerator]}));21expectError(execaSync('unicorns', {stdin: [invalidReturnGenerator]}));2223expectError(await execa('unicorns', {stdout: invalidReturnGenerator}));24expectError(execaSync('unicorns', {stdout: invalidReturnGenerator}));25expectError(await execa('unicorns', {stdout: [invalidReturnGenerator]}));26expectError(execaSync('unicorns', {stdout: [invalidReturnGenerator]}));2728expectError(await execa('unicorns', {stderr: invalidReturnGenerator}));29expectError(execaSync('unicorns', {stderr: invalidReturnGenerator}));30expectError(await execa('unicorns', {stderr: [invalidReturnGenerator]}));31expectError(execaSync('unicorns', {stderr: [invalidReturnGenerator]}));3233expectError(await execa('unicorns', {stdio: invalidReturnGenerator}));34expectError(execaSync('unicorns', {stdio: invalidReturnGenerator}));3536expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGenerator]}));37expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGenerator]}));38expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGenerator]]}));39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGenerator]]}));4041expectNotAssignable<StdinOption>(invalidReturnGenerator);42expectNotAssignable<StdinOptionSync>(invalidReturnGenerator);43expectNotAssignable<StdinOption>([invalidReturnGenerator]);44expectNotAssignable<StdinOptionSync>([invalidReturnGenerator]);4546expectNotAssignable<StdoutStderrOption>(invalidReturnGenerator);47expectNotAssignable<StdoutStderrOptionSync>(invalidReturnGenerator);48expectNotAssignable<StdoutStderrOption>([invalidReturnGenerator]);49expectNotAssignable<StdoutStderrOptionSync>([invalidReturnGenerator]);5051expectNotAssignable<StdioOption>(invalidReturnGenerator);52expectNotAssignable<StdioOptionSync>(invalidReturnGenerator);53expectNotAssignable<StdioOption>([invalidReturnGenerator]);54expectNotAssignable<StdioOptionSync>([invalidReturnGenerator]);
added:test-d/stdio/option/generator-object-full.test-d.ts+56 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const objectGeneratorFull = {14 * transform(line: unknown) {15 yield JSON.parse(line as string) as object;16 },17 objectMode: true,18} as const;1920await execa('unicorns', {stdin: objectGeneratorFull});21execaSync('unicorns', {stdin: objectGeneratorFull});22await execa('unicorns', {stdin: [objectGeneratorFull]});23execaSync('unicorns', {stdin: [objectGeneratorFull]});2425await execa('unicorns', {stdout: objectGeneratorFull});26execaSync('unicorns', {stdout: objectGeneratorFull});27await execa('unicorns', {stdout: [objectGeneratorFull]});28execaSync('unicorns', {stdout: [objectGeneratorFull]});2930await execa('unicorns', {stderr: objectGeneratorFull});31execaSync('unicorns', {stderr: objectGeneratorFull});32await execa('unicorns', {stderr: [objectGeneratorFull]});33execaSync('unicorns', {stderr: [objectGeneratorFull]});3435expectError(await execa('unicorns', {stdio: objectGeneratorFull}));36expectError(execaSync('unicorns', {stdio: objectGeneratorFull}));3738await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGeneratorFull]});39execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGeneratorFull]});40await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGeneratorFull]]});41execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGeneratorFull]]});4243expectAssignable<StdinOption>(objectGeneratorFull);44expectAssignable<StdinOptionSync>(objectGeneratorFull);45expectAssignable<StdinOption>([objectGeneratorFull]);46expectAssignable<StdinOptionSync>([objectGeneratorFull]);4748expectAssignable<StdoutStderrOption>(objectGeneratorFull);49expectAssignable<StdoutStderrOptionSync>(objectGeneratorFull);50expectAssignable<StdoutStderrOption>([objectGeneratorFull]);51expectAssignable<StdoutStderrOptionSync>([objectGeneratorFull]);5253expectAssignable<StdioOption>(objectGeneratorFull);54expectAssignable<StdioOptionSync>(objectGeneratorFull);55expectAssignable<StdioOption>([objectGeneratorFull]);56expectAssignable<StdioOptionSync>([objectGeneratorFull]);
added:test-d/stdio/option/generator-object-mode-invalid.test-d.ts+56 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const transformWithInvalidObjectMode = {14 * transform(line: unknown) {15 yield line;16 },17 objectMode: 'true',18} as const;1920expectError(await execa('unicorns', {stdin: transformWithInvalidObjectMode}));21expectError(execaSync('unicorns', {stdin: transformWithInvalidObjectMode}));22expectError(await execa('unicorns', {stdin: [transformWithInvalidObjectMode]}));23expectError(execaSync('unicorns', {stdin: [transformWithInvalidObjectMode]}));2425expectError(await execa('unicorns', {stdout: transformWithInvalidObjectMode}));26expectError(execaSync('unicorns', {stdout: transformWithInvalidObjectMode}));27expectError(await execa('unicorns', {stdout: [transformWithInvalidObjectMode]}));28expectError(execaSync('unicorns', {stdout: [transformWithInvalidObjectMode]}));2930expectError(await execa('unicorns', {stderr: transformWithInvalidObjectMode}));31expectError(execaSync('unicorns', {stderr: transformWithInvalidObjectMode}));32expectError(await execa('unicorns', {stderr: [transformWithInvalidObjectMode]}));33expectError(execaSync('unicorns', {stderr: [transformWithInvalidObjectMode]}));3435expectError(await execa('unicorns', {stdio: transformWithInvalidObjectMode}));36expectError(execaSync('unicorns', {stdio: transformWithInvalidObjectMode}));3738expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidObjectMode]}));39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidObjectMode]}));40expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidObjectMode]]}));41expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidObjectMode]]}));4243expectNotAssignable<StdinOption>(transformWithInvalidObjectMode);44expectNotAssignable<StdinOptionSync>(transformWithInvalidObjectMode);45expectNotAssignable<StdinOption>([transformWithInvalidObjectMode]);46expectNotAssignable<StdinOptionSync>([transformWithInvalidObjectMode]);4748expectNotAssignable<StdoutStderrOption>(transformWithInvalidObjectMode);49expectNotAssignable<StdoutStderrOptionSync>(transformWithInvalidObjectMode);50expectNotAssignable<StdoutStderrOption>([transformWithInvalidObjectMode]);51expectNotAssignable<StdoutStderrOptionSync>([transformWithInvalidObjectMode]);5253expectNotAssignable<StdioOption>(transformWithInvalidObjectMode);54expectNotAssignable<StdioOptionSync>(transformWithInvalidObjectMode);55expectNotAssignable<StdioOption>([transformWithInvalidObjectMode]);56expectNotAssignable<StdioOptionSync>([transformWithInvalidObjectMode]);
added:test-d/stdio/option/generator-object-mode.test-d.ts+56 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const transformWithObjectMode = {14 * transform(line: unknown) {15 yield line;16 },17 objectMode: true,18} as const;1920await execa('unicorns', {stdin: transformWithObjectMode});21execaSync('unicorns', {stdin: transformWithObjectMode});22await execa('unicorns', {stdin: [transformWithObjectMode]});23execaSync('unicorns', {stdin: [transformWithObjectMode]});2425await execa('unicorns', {stdout: transformWithObjectMode});26execaSync('unicorns', {stdout: transformWithObjectMode});27await execa('unicorns', {stdout: [transformWithObjectMode]});28execaSync('unicorns', {stdout: [transformWithObjectMode]});2930await execa('unicorns', {stderr: transformWithObjectMode});31execaSync('unicorns', {stderr: transformWithObjectMode});32await execa('unicorns', {stderr: [transformWithObjectMode]});33execaSync('unicorns', {stderr: [transformWithObjectMode]});3435expectError(await execa('unicorns', {stdio: transformWithObjectMode}));36expectError(execaSync('unicorns', {stdio: transformWithObjectMode}));3738await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithObjectMode]});39execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithObjectMode]});40await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithObjectMode]]});41execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithObjectMode]]});4243expectAssignable<StdinOption>(transformWithObjectMode);44expectAssignable<StdinOptionSync>(transformWithObjectMode);45expectAssignable<StdinOption>([transformWithObjectMode]);46expectAssignable<StdinOptionSync>([transformWithObjectMode]);4748expectAssignable<StdoutStderrOption>(transformWithObjectMode);49expectAssignable<StdoutStderrOptionSync>(transformWithObjectMode);50expectAssignable<StdoutStderrOption>([transformWithObjectMode]);51expectAssignable<StdoutStderrOptionSync>([transformWithObjectMode]);5253expectAssignable<StdioOption>(transformWithObjectMode);54expectAssignable<StdioOptionSync>(transformWithObjectMode);55expectAssignable<StdioOption>([transformWithObjectMode]);56expectAssignable<StdioOptionSync>([transformWithObjectMode]);
added:test-d/stdio/option/generator-object.test-d.ts+53 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const objectGenerator = function * (line: unknown) {14 yield JSON.parse(line as string) as object;15};1617await execa('unicorns', {stdin: objectGenerator});18execaSync('unicorns', {stdin: objectGenerator});19await execa('unicorns', {stdin: [objectGenerator]});20execaSync('unicorns', {stdin: [objectGenerator]});2122await execa('unicorns', {stdout: objectGenerator});23execaSync('unicorns', {stdout: objectGenerator});24await execa('unicorns', {stdout: [objectGenerator]});25execaSync('unicorns', {stdout: [objectGenerator]});2627await execa('unicorns', {stderr: objectGenerator});28execaSync('unicorns', {stderr: objectGenerator});29await execa('unicorns', {stderr: [objectGenerator]});30execaSync('unicorns', {stderr: [objectGenerator]});3132expectError(await execa('unicorns', {stdio: objectGenerator}));33expectError(execaSync('unicorns', {stdio: objectGenerator}));3435await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGenerator]});36execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGenerator]});37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGenerator]]});38execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGenerator]]});3940expectAssignable<StdinOption>(objectGenerator);41expectAssignable<StdinOptionSync>(objectGenerator);42expectAssignable<StdinOption>([objectGenerator]);43expectAssignable<StdinOptionSync>([objectGenerator]);4445expectAssignable<StdoutStderrOption>(objectGenerator);46expectAssignable<StdoutStderrOptionSync>(objectGenerator);47expectAssignable<StdoutStderrOption>([objectGenerator]);48expectAssignable<StdoutStderrOptionSync>([objectGenerator]);4950expectAssignable<StdioOption>(objectGenerator);51expectAssignable<StdioOptionSync>(objectGenerator);52expectAssignable<StdioOption>([objectGenerator]);53expectAssignable<StdioOptionSync>([objectGenerator]);
added:test-d/stdio/option/generator-only-binary.test-d.ts+51 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const binaryOnly = {binary: true} as const;1415expectError(await execa('unicorns', {stdin: binaryOnly}));16expectError(execaSync('unicorns', {stdin: binaryOnly}));17expectError(await execa('unicorns', {stdin: [binaryOnly]}));18expectError(execaSync('unicorns', {stdin: [binaryOnly]}));1920expectError(await execa('unicorns', {stdout: binaryOnly}));21expectError(execaSync('unicorns', {stdout: binaryOnly}));22expectError(await execa('unicorns', {stdout: [binaryOnly]}));23expectError(execaSync('unicorns', {stdout: [binaryOnly]}));2425expectError(await execa('unicorns', {stderr: binaryOnly}));26expectError(execaSync('unicorns', {stderr: binaryOnly}));27expectError(await execa('unicorns', {stderr: [binaryOnly]}));28expectError(execaSync('unicorns', {stderr: [binaryOnly]}));2930expectError(await execa('unicorns', {stdio: binaryOnly}));31expectError(execaSync('unicorns', {stdio: binaryOnly}));3233expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryOnly]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryOnly]}));35expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryOnly]]}));36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryOnly]]}));3738expectNotAssignable<StdinOption>(binaryOnly);39expectNotAssignable<StdinOptionSync>(binaryOnly);40expectNotAssignable<StdinOption>([binaryOnly]);41expectNotAssignable<StdinOptionSync>([binaryOnly]);4243expectNotAssignable<StdoutStderrOption>(binaryOnly);44expectNotAssignable<StdoutStderrOptionSync>(binaryOnly);45expectNotAssignable<StdoutStderrOption>([binaryOnly]);46expectNotAssignable<StdoutStderrOptionSync>([binaryOnly]);4748expectNotAssignable<StdioOption>(binaryOnly);49expectNotAssignable<StdioOptionSync>(binaryOnly);50expectNotAssignable<StdioOption>([binaryOnly]);51expectNotAssignable<StdioOptionSync>([binaryOnly]);
added:test-d/stdio/option/generator-only-final.test-d.ts+55 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const finalOnly = {14 * final() {15 yield {} as unknown;16 },17} as const;1819expectError(await execa('unicorns', {stdin: finalOnly}));20expectError(execaSync('unicorns', {stdin: finalOnly}));21expectError(await execa('unicorns', {stdin: [finalOnly]}));22expectError(execaSync('unicorns', {stdin: [finalOnly]}));2324expectError(await execa('unicorns', {stdout: finalOnly}));25expectError(execaSync('unicorns', {stdout: finalOnly}));26expectError(await execa('unicorns', {stdout: [finalOnly]}));27expectError(execaSync('unicorns', {stdout: [finalOnly]}));2829expectError(await execa('unicorns', {stderr: finalOnly}));30expectError(execaSync('unicorns', {stderr: finalOnly}));31expectError(await execa('unicorns', {stderr: [finalOnly]}));32expectError(execaSync('unicorns', {stderr: [finalOnly]}));3334expectError(await execa('unicorns', {stdio: finalOnly}));35expectError(execaSync('unicorns', {stdio: finalOnly}));3637expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', finalOnly]}));38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', finalOnly]}));39expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [finalOnly]]}));40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [finalOnly]]}));4142expectNotAssignable<StdinOption>(finalOnly);43expectNotAssignable<StdinOptionSync>(finalOnly);44expectNotAssignable<StdinOption>([finalOnly]);45expectNotAssignable<StdinOptionSync>([finalOnly]);4647expectNotAssignable<StdoutStderrOption>(finalOnly);48expectNotAssignable<StdoutStderrOptionSync>(finalOnly);49expectNotAssignable<StdoutStderrOption>([finalOnly]);50expectNotAssignable<StdoutStderrOptionSync>([finalOnly]);5152expectNotAssignable<StdioOption>(finalOnly);53expectNotAssignable<StdioOptionSync>(finalOnly);54expectNotAssignable<StdioOption>([finalOnly]);55expectNotAssignable<StdioOptionSync>([finalOnly]);
added:test-d/stdio/option/generator-only-object-mode.test-d.ts+51 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const objectModeOnly = {objectMode: true} as const;1415expectError(await execa('unicorns', {stdin: objectModeOnly}));16expectError(execaSync('unicorns', {stdin: objectModeOnly}));17expectError(await execa('unicorns', {stdin: [objectModeOnly]}));18expectError(execaSync('unicorns', {stdin: [objectModeOnly]}));1920expectError(await execa('unicorns', {stdout: objectModeOnly}));21expectError(execaSync('unicorns', {stdout: objectModeOnly}));22expectError(await execa('unicorns', {stdout: [objectModeOnly]}));23expectError(execaSync('unicorns', {stdout: [objectModeOnly]}));2425expectError(await execa('unicorns', {stderr: objectModeOnly}));26expectError(execaSync('unicorns', {stderr: objectModeOnly}));27expectError(await execa('unicorns', {stderr: [objectModeOnly]}));28expectError(execaSync('unicorns', {stderr: [objectModeOnly]}));2930expectError(await execa('unicorns', {stdio: objectModeOnly}));31expectError(execaSync('unicorns', {stdio: objectModeOnly}));3233expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectModeOnly]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectModeOnly]}));35expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectModeOnly]]}));36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectModeOnly]]}));3738expectNotAssignable<StdinOption>(objectModeOnly);39expectNotAssignable<StdinOptionSync>(objectModeOnly);40expectNotAssignable<StdinOption>([objectModeOnly]);41expectNotAssignable<StdinOptionSync>([objectModeOnly]);4243expectNotAssignable<StdoutStderrOption>(objectModeOnly);44expectNotAssignable<StdoutStderrOptionSync>(objectModeOnly);45expectNotAssignable<StdoutStderrOption>([objectModeOnly]);46expectNotAssignable<StdoutStderrOptionSync>([objectModeOnly]);4748expectNotAssignable<StdioOption>(objectModeOnly);49expectNotAssignable<StdioOptionSync>(objectModeOnly);50expectNotAssignable<StdioOption>([objectModeOnly]);51expectNotAssignable<StdioOptionSync>([objectModeOnly]);
added:test-d/stdio/option/generator-only-preserve.test-d.ts+51 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const preserveNewlinesOnly = {preserveNewlines: true} as const;1415expectError(await execa('unicorns', {stdin: preserveNewlinesOnly}));16expectError(execaSync('unicorns', {stdin: preserveNewlinesOnly}));17expectError(await execa('unicorns', {stdin: [preserveNewlinesOnly]}));18expectError(execaSync('unicorns', {stdin: [preserveNewlinesOnly]}));1920expectError(await execa('unicorns', {stdout: preserveNewlinesOnly}));21expectError(execaSync('unicorns', {stdout: preserveNewlinesOnly}));22expectError(await execa('unicorns', {stdout: [preserveNewlinesOnly]}));23expectError(execaSync('unicorns', {stdout: [preserveNewlinesOnly]}));2425expectError(await execa('unicorns', {stderr: preserveNewlinesOnly}));26expectError(execaSync('unicorns', {stderr: preserveNewlinesOnly}));27expectError(await execa('unicorns', {stderr: [preserveNewlinesOnly]}));28expectError(execaSync('unicorns', {stderr: [preserveNewlinesOnly]}));2930expectError(await execa('unicorns', {stdio: preserveNewlinesOnly}));31expectError(execaSync('unicorns', {stdio: preserveNewlinesOnly}));3233expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', preserveNewlinesOnly]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', preserveNewlinesOnly]}));35expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [preserveNewlinesOnly]]}));36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [preserveNewlinesOnly]]}));3738expectNotAssignable<StdinOption>(preserveNewlinesOnly);39expectNotAssignable<StdinOptionSync>(preserveNewlinesOnly);40expectNotAssignable<StdinOption>([preserveNewlinesOnly]);41expectNotAssignable<StdinOptionSync>([preserveNewlinesOnly]);4243expectNotAssignable<StdoutStderrOption>(preserveNewlinesOnly);44expectNotAssignable<StdoutStderrOptionSync>(preserveNewlinesOnly);45expectNotAssignable<StdoutStderrOption>([preserveNewlinesOnly]);46expectNotAssignable<StdoutStderrOptionSync>([preserveNewlinesOnly]);4748expectNotAssignable<StdioOption>(preserveNewlinesOnly);49expectNotAssignable<StdioOptionSync>(preserveNewlinesOnly);50expectNotAssignable<StdioOption>([preserveNewlinesOnly]);51expectNotAssignable<StdioOptionSync>([preserveNewlinesOnly]);
added:test-d/stdio/option/generator-preserve-invalid.test-d.ts+56 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const transformWithInvalidPreserveNewlines = {14 * transform(line: unknown) {15 yield line;16 },17 preserveNewlines: 'true',18} as const;1920expectError(await execa('unicorns', {stdin: transformWithInvalidPreserveNewlines}));21expectError(execaSync('unicorns', {stdin: transformWithInvalidPreserveNewlines}));22expectError(await execa('unicorns', {stdin: [transformWithInvalidPreserveNewlines]}));23expectError(execaSync('unicorns', {stdin: [transformWithInvalidPreserveNewlines]}));2425expectError(await execa('unicorns', {stdout: transformWithInvalidPreserveNewlines}));26expectError(execaSync('unicorns', {stdout: transformWithInvalidPreserveNewlines}));27expectError(await execa('unicorns', {stdout: [transformWithInvalidPreserveNewlines]}));28expectError(execaSync('unicorns', {stdout: [transformWithInvalidPreserveNewlines]}));2930expectError(await execa('unicorns', {stderr: transformWithInvalidPreserveNewlines}));31expectError(execaSync('unicorns', {stderr: transformWithInvalidPreserveNewlines}));32expectError(await execa('unicorns', {stderr: [transformWithInvalidPreserveNewlines]}));33expectError(execaSync('unicorns', {stderr: [transformWithInvalidPreserveNewlines]}));3435expectError(await execa('unicorns', {stdio: transformWithInvalidPreserveNewlines}));36expectError(execaSync('unicorns', {stdio: transformWithInvalidPreserveNewlines}));3738expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidPreserveNewlines]}));39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidPreserveNewlines]}));40expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidPreserveNewlines]]}));41expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidPreserveNewlines]]}));4243expectNotAssignable<StdinOption>(transformWithInvalidPreserveNewlines);44expectNotAssignable<StdinOptionSync>(transformWithInvalidPreserveNewlines);45expectNotAssignable<StdinOption>([transformWithInvalidPreserveNewlines]);46expectNotAssignable<StdinOptionSync>([transformWithInvalidPreserveNewlines]);4748expectNotAssignable<StdoutStderrOption>(transformWithInvalidPreserveNewlines);49expectNotAssignable<StdoutStderrOptionSync>(transformWithInvalidPreserveNewlines);50expectNotAssignable<StdoutStderrOption>([transformWithInvalidPreserveNewlines]);51expectNotAssignable<StdoutStderrOptionSync>([transformWithInvalidPreserveNewlines]);5253expectNotAssignable<StdioOption>(transformWithInvalidPreserveNewlines);54expectNotAssignable<StdioOptionSync>(transformWithInvalidPreserveNewlines);55expectNotAssignable<StdioOption>([transformWithInvalidPreserveNewlines]);56expectNotAssignable<StdioOptionSync>([transformWithInvalidPreserveNewlines]);
added:test-d/stdio/option/generator-preserve.test-d.ts+56 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const transformWithPreserveNewlines = {14 * transform(line: unknown) {15 yield line;16 },17 preserveNewlines: true,18} as const;1920await execa('unicorns', {stdin: transformWithPreserveNewlines});21execaSync('unicorns', {stdin: transformWithPreserveNewlines});22await execa('unicorns', {stdin: [transformWithPreserveNewlines]});23execaSync('unicorns', {stdin: [transformWithPreserveNewlines]});2425await execa('unicorns', {stdout: transformWithPreserveNewlines});26execaSync('unicorns', {stdout: transformWithPreserveNewlines});27await execa('unicorns', {stdout: [transformWithPreserveNewlines]});28execaSync('unicorns', {stdout: [transformWithPreserveNewlines]});2930await execa('unicorns', {stderr: transformWithPreserveNewlines});31execaSync('unicorns', {stderr: transformWithPreserveNewlines});32await execa('unicorns', {stderr: [transformWithPreserveNewlines]});33execaSync('unicorns', {stderr: [transformWithPreserveNewlines]});3435expectError(await execa('unicorns', {stdio: transformWithPreserveNewlines}));36expectError(execaSync('unicorns', {stdio: transformWithPreserveNewlines}));3738await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithPreserveNewlines]});39execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithPreserveNewlines]});40await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithPreserveNewlines]]});41execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithPreserveNewlines]]});4243expectAssignable<StdinOption>(transformWithPreserveNewlines);44expectAssignable<StdinOptionSync>(transformWithPreserveNewlines);45expectAssignable<StdinOption>([transformWithPreserveNewlines]);46expectAssignable<StdinOptionSync>([transformWithPreserveNewlines]);4748expectAssignable<StdoutStderrOption>(transformWithPreserveNewlines);49expectAssignable<StdoutStderrOptionSync>(transformWithPreserveNewlines);50expectAssignable<StdoutStderrOption>([transformWithPreserveNewlines]);51expectAssignable<StdoutStderrOptionSync>([transformWithPreserveNewlines]);5253expectAssignable<StdioOption>(transformWithPreserveNewlines);54expectAssignable<StdioOptionSync>(transformWithPreserveNewlines);55expectAssignable<StdioOption>([transformWithPreserveNewlines]);56expectAssignable<StdioOptionSync>([transformWithPreserveNewlines]);
added:test-d/stdio/option/generator-string-full.test-d.ts+55 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const stringGeneratorFull = {14 * transform(line: string) {15 yield line;16 },17} as const;1819expectError(await execa('unicorns', {stdin: stringGeneratorFull}));20expectError(execaSync('unicorns', {stdin: stringGeneratorFull}));21expectError(await execa('unicorns', {stdin: [stringGeneratorFull]}));22expectError(execaSync('unicorns', {stdin: [stringGeneratorFull]}));2324expectError(await execa('unicorns', {stdout: stringGeneratorFull}));25expectError(execaSync('unicorns', {stdout: stringGeneratorFull}));26expectError(await execa('unicorns', {stdout: [stringGeneratorFull]}));27expectError(execaSync('unicorns', {stdout: [stringGeneratorFull]}));2829expectError(await execa('unicorns', {stderr: stringGeneratorFull}));30expectError(execaSync('unicorns', {stderr: stringGeneratorFull}));31expectError(await execa('unicorns', {stderr: [stringGeneratorFull]}));32expectError(execaSync('unicorns', {stderr: [stringGeneratorFull]}));3334expectError(await execa('unicorns', {stdio: stringGeneratorFull}));35expectError(execaSync('unicorns', {stdio: stringGeneratorFull}));3637expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGeneratorFull]}));38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGeneratorFull]}));39expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGeneratorFull]]}));40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGeneratorFull]]}));4142expectNotAssignable<StdinOption>(stringGeneratorFull);43expectNotAssignable<StdinOptionSync>(stringGeneratorFull);44expectNotAssignable<StdinOption>([stringGeneratorFull]);45expectNotAssignable<StdinOptionSync>([stringGeneratorFull]);4647expectNotAssignable<StdoutStderrOption>(stringGeneratorFull);48expectNotAssignable<StdoutStderrOptionSync>(stringGeneratorFull);49expectNotAssignable<StdoutStderrOption>([stringGeneratorFull]);50expectNotAssignable<StdoutStderrOptionSync>([stringGeneratorFull]);5152expectNotAssignable<StdioOption>(stringGeneratorFull);53expectNotAssignable<StdioOptionSync>(stringGeneratorFull);54expectNotAssignable<StdioOption>([stringGeneratorFull]);55expectNotAssignable<StdioOptionSync>([stringGeneratorFull]);
added:test-d/stdio/option/generator-string.test-d.ts+53 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const stringGenerator = function * (line: string) {14 yield line;15};1617expectError(await execa('unicorns', {stdin: stringGenerator}));18expectError(execaSync('unicorns', {stdin: stringGenerator}));19expectError(await execa('unicorns', {stdin: [stringGenerator]}));20expectError(execaSync('unicorns', {stdin: [stringGenerator]}));2122expectError(await execa('unicorns', {stdout: stringGenerator}));23expectError(execaSync('unicorns', {stdout: stringGenerator}));24expectError(await execa('unicorns', {stdout: [stringGenerator]}));25expectError(execaSync('unicorns', {stdout: [stringGenerator]}));2627expectError(await execa('unicorns', {stderr: stringGenerator}));28expectError(execaSync('unicorns', {stderr: stringGenerator}));29expectError(await execa('unicorns', {stderr: [stringGenerator]}));30expectError(execaSync('unicorns', {stderr: [stringGenerator]}));3132expectError(await execa('unicorns', {stdio: stringGenerator}));33expectError(execaSync('unicorns', {stdio: stringGenerator}));3435expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGenerator]}));36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGenerator]}));37expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGenerator]]}));38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGenerator]]}));3940expectNotAssignable<StdinOption>(stringGenerator);41expectNotAssignable<StdinOptionSync>(stringGenerator);42expectNotAssignable<StdinOption>([stringGenerator]);43expectNotAssignable<StdinOptionSync>([stringGenerator]);4445expectNotAssignable<StdoutStderrOption>(stringGenerator);46expectNotAssignable<StdoutStderrOptionSync>(stringGenerator);47expectNotAssignable<StdoutStderrOption>([stringGenerator]);48expectNotAssignable<StdoutStderrOptionSync>([stringGenerator]);4950expectNotAssignable<StdioOption>(stringGenerator);51expectNotAssignable<StdioOptionSync>(stringGenerator);52expectNotAssignable<StdioOption>([stringGenerator]);53expectNotAssignable<StdioOptionSync>([stringGenerator]);
added:test-d/stdio/option/generator-unknown-full.test-d.ts+56 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const unknownGeneratorFull = {14 * transform(line: unknown) {15 yield line;16 },17 objectMode: true,18} as const;1920await execa('unicorns', {stdin: unknownGeneratorFull});21execaSync('unicorns', {stdin: unknownGeneratorFull});22await execa('unicorns', {stdin: [unknownGeneratorFull]});23execaSync('unicorns', {stdin: [unknownGeneratorFull]});2425await execa('unicorns', {stdout: unknownGeneratorFull});26execaSync('unicorns', {stdout: unknownGeneratorFull});27await execa('unicorns', {stdout: [unknownGeneratorFull]});28execaSync('unicorns', {stdout: [unknownGeneratorFull]});2930await execa('unicorns', {stderr: unknownGeneratorFull});31execaSync('unicorns', {stderr: unknownGeneratorFull});32await execa('unicorns', {stderr: [unknownGeneratorFull]});33execaSync('unicorns', {stderr: [unknownGeneratorFull]});3435expectError(await execa('unicorns', {stdio: unknownGeneratorFull}));36expectError(execaSync('unicorns', {stdio: unknownGeneratorFull}));3738await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGeneratorFull]});39execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGeneratorFull]});40await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGeneratorFull]]});41execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGeneratorFull]]});4243expectAssignable<StdinOption>(unknownGeneratorFull);44expectAssignable<StdinOptionSync>(unknownGeneratorFull);45expectAssignable<StdinOption>([unknownGeneratorFull]);46expectAssignable<StdinOptionSync>([unknownGeneratorFull]);4748expectAssignable<StdoutStderrOption>(unknownGeneratorFull);49expectAssignable<StdoutStderrOptionSync>(unknownGeneratorFull);50expectAssignable<StdoutStderrOption>([unknownGeneratorFull]);51expectAssignable<StdoutStderrOptionSync>([unknownGeneratorFull]);5253expectAssignable<StdioOption>(unknownGeneratorFull);54expectAssignable<StdioOptionSync>(unknownGeneratorFull);55expectAssignable<StdioOption>([unknownGeneratorFull]);56expectAssignable<StdioOptionSync>([unknownGeneratorFull]);
added:test-d/stdio/option/generator-unknown.test-d.ts+53 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const unknownGenerator = function * (line: unknown) {14 yield line;15};1617await execa('unicorns', {stdin: unknownGenerator});18execaSync('unicorns', {stdin: unknownGenerator});19await execa('unicorns', {stdin: [unknownGenerator]});20execaSync('unicorns', {stdin: [unknownGenerator]});2122await execa('unicorns', {stdout: unknownGenerator});23execaSync('unicorns', {stdout: unknownGenerator});24await execa('unicorns', {stdout: [unknownGenerator]});25execaSync('unicorns', {stdout: [unknownGenerator]});2627await execa('unicorns', {stderr: unknownGenerator});28execaSync('unicorns', {stderr: unknownGenerator});29await execa('unicorns', {stderr: [unknownGenerator]});30execaSync('unicorns', {stderr: [unknownGenerator]});3132expectError(await execa('unicorns', {stdio: unknownGenerator}));33expectError(execaSync('unicorns', {stdio: unknownGenerator}));3435await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGenerator]});36execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGenerator]});37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGenerator]]});38execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGenerator]]});3940expectAssignable<StdinOption>(unknownGenerator);41expectAssignable<StdinOptionSync>(unknownGenerator);42expectAssignable<StdinOption>([unknownGenerator]);43expectAssignable<StdinOptionSync>([unknownGenerator]);4445expectAssignable<StdoutStderrOption>(unknownGenerator);46expectAssignable<StdoutStderrOptionSync>(unknownGenerator);47expectAssignable<StdoutStderrOption>([unknownGenerator]);48expectAssignable<StdoutStderrOptionSync>([unknownGenerator]);4950expectAssignable<StdioOption>(unknownGenerator);51expectAssignable<StdioOptionSync>(unknownGenerator);52expectAssignable<StdioOption>([unknownGenerator]);53expectAssignable<StdioOptionSync>([unknownGenerator]);
added:test-d/stdio/option/ignore.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: 'ignore'});14execaSync('unicorns', {stdin: 'ignore'});15expectError(await execa('unicorns', {stdin: ['ignore']}));16expectError(execaSync('unicorns', {stdin: ['ignore']}));1718await execa('unicorns', {stdout: 'ignore'});19execaSync('unicorns', {stdout: 'ignore'});20expectError(await execa('unicorns', {stdout: ['ignore']}));21expectError(execaSync('unicorns', {stdout: ['ignore']}));2223await execa('unicorns', {stderr: 'ignore'});24execaSync('unicorns', {stderr: 'ignore'});25expectError(await execa('unicorns', {stderr: ['ignore']}));26expectError(execaSync('unicorns', {stderr: ['ignore']}));2728await execa('unicorns', {stdio: 'ignore'});29execaSync('unicorns', {stdio: 'ignore'});3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ignore']]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ignore']]}));3536expectAssignable<StdinOption>('ignore');37expectAssignable<StdinOptionSync>('ignore');38expectNotAssignable<StdinOption>(['ignore']);39expectNotAssignable<StdinOptionSync>(['ignore']);4041expectAssignable<StdoutStderrOption>('ignore');42expectAssignable<StdoutStderrOptionSync>('ignore');43expectNotAssignable<StdoutStderrOption>(['ignore']);44expectNotAssignable<StdoutStderrOptionSync>(['ignore']);4546expectAssignable<StdioOption>('ignore');47expectAssignable<StdioOptionSync>('ignore');48expectNotAssignable<StdioOption>(['ignore']);49expectNotAssignable<StdioOptionSync>(['ignore']);
added:test-d/stdio/option/inherit.test-d.ts+49 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: 'inherit'});14execaSync('unicorns', {stdin: 'inherit'});15await execa('unicorns', {stdin: ['inherit']});16execaSync('unicorns', {stdin: ['inherit']});1718await execa('unicorns', {stdout: 'inherit'});19execaSync('unicorns', {stdout: 'inherit'});20await execa('unicorns', {stdout: ['inherit']});21execaSync('unicorns', {stdout: ['inherit']});2223await execa('unicorns', {stderr: 'inherit'});24execaSync('unicorns', {stderr: 'inherit'});25await execa('unicorns', {stderr: ['inherit']});26execaSync('unicorns', {stderr: ['inherit']});2728await execa('unicorns', {stdio: 'inherit'});29execaSync('unicorns', {stdio: 'inherit'});3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'inherit']});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'inherit']});33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['inherit']]}));34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['inherit']]});3536expectAssignable<StdinOption>('inherit');37expectAssignable<StdinOptionSync>('inherit');38expectAssignable<StdinOption>(['inherit']);39expectAssignable<StdinOptionSync>(['inherit']);4041expectAssignable<StdoutStderrOption>('inherit');42expectAssignable<StdoutStderrOptionSync>('inherit');43expectAssignable<StdoutStderrOption>(['inherit']);44expectAssignable<StdoutStderrOptionSync>(['inherit']);4546expectAssignable<StdioOption>('inherit');47expectAssignable<StdioOptionSync>('inherit');48expectAssignable<StdioOption>(['inherit']);49expectAssignable<StdioOptionSync>(['inherit']);
added:test-d/stdio/option/ipc.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: 'ipc'});14expectError(execaSync('unicorns', {stdin: 'ipc'}));15expectError(await execa('unicorns', {stdin: ['ipc']}));16expectError(execaSync('unicorns', {stdin: ['ipc']}));1718await execa('unicorns', {stdout: 'ipc'});19expectError(execaSync('unicorns', {stdout: 'ipc'}));20expectError(await execa('unicorns', {stdout: ['ipc']}));21expectError(execaSync('unicorns', {stdout: ['ipc']}));2223await execa('unicorns', {stderr: 'ipc'});24expectError(execaSync('unicorns', {stderr: 'ipc'}));25expectError(await execa('unicorns', {stderr: ['ipc']}));26expectError(execaSync('unicorns', {stderr: ['ipc']}));2728expectError(await execa('unicorns', {stdio: 'ipc'}));29expectError(execaSync('unicorns', {stdio: 'ipc'}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']});32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']}));33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ipc']]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ipc']]}));3536expectAssignable<StdinOption>('ipc');37expectNotAssignable<StdinOptionSync>('ipc');38expectNotAssignable<StdinOption>(['ipc']);39expectNotAssignable<StdinOptionSync>(['ipc']);4041expectAssignable<StdoutStderrOption>('ipc');42expectNotAssignable<StdoutStderrOptionSync>('ipc');43expectNotAssignable<StdoutStderrOption>(['ipc']);44expectNotAssignable<StdoutStderrOptionSync>(['ipc']);4546expectAssignable<StdioOption>('ipc');47expectNotAssignable<StdioOptionSync>('ipc');48expectNotAssignable<StdioOption>(['ipc']);49expectNotAssignable<StdioOptionSync>(['ipc']);
added:test-d/stdio/option/iterable-async-binary.test-d.ts+55 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const asyncBinaryIterableFunction = async function * () {14 yield new Uint8Array(0);15};1617const asyncBinaryIterable = asyncBinaryIterableFunction();1819await execa('unicorns', {stdin: asyncBinaryIterable});20expectError(execaSync('unicorns', {stdin: asyncBinaryIterable}));21await execa('unicorns', {stdin: [asyncBinaryIterable]});22expectError(execaSync('unicorns', {stdin: [asyncBinaryIterable]}));2324expectError(await execa('unicorns', {stdout: asyncBinaryIterable}));25expectError(execaSync('unicorns', {stdout: asyncBinaryIterable}));26expectError(await execa('unicorns', {stdout: [asyncBinaryIterable]}));27expectError(execaSync('unicorns', {stdout: [asyncBinaryIterable]}));2829expectError(await execa('unicorns', {stderr: asyncBinaryIterable}));30expectError(execaSync('unicorns', {stderr: asyncBinaryIterable}));31expectError(await execa('unicorns', {stderr: [asyncBinaryIterable]}));32expectError(execaSync('unicorns', {stderr: [asyncBinaryIterable]}));3334expectError(await execa('unicorns', {stdio: asyncBinaryIterable}));35expectError(execaSync('unicorns', {stdio: asyncBinaryIterable}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncBinaryIterable]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncBinaryIterable]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncBinaryIterable]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncBinaryIterable]]}));4142expectAssignable<StdinOption>(asyncBinaryIterable);43expectNotAssignable<StdinOptionSync>(asyncBinaryIterable);44expectAssignable<StdinOption>([asyncBinaryIterable]);45expectNotAssignable<StdinOptionSync>([asyncBinaryIterable]);4647expectNotAssignable<StdoutStderrOption>(asyncBinaryIterable);48expectNotAssignable<StdoutStderrOptionSync>(asyncBinaryIterable);49expectNotAssignable<StdoutStderrOption>([asyncBinaryIterable]);50expectNotAssignable<StdoutStderrOptionSync>([asyncBinaryIterable]);5152expectAssignable<StdioOption>(asyncBinaryIterable);53expectNotAssignable<StdioOptionSync>(asyncBinaryIterable);54expectAssignable<StdioOption>([asyncBinaryIterable]);55expectNotAssignable<StdioOptionSync>([asyncBinaryIterable]);
added:test-d/stdio/option/iterable-async-object.test-d.ts+55 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const asyncObjectIterableFunction = async function * () {14 yield {};15};1617const asyncObjectIterable = asyncObjectIterableFunction();1819await execa('unicorns', {stdin: asyncObjectIterable});20expectError(execaSync('unicorns', {stdin: asyncObjectIterable}));21await execa('unicorns', {stdin: [asyncObjectIterable]});22expectError(execaSync('unicorns', {stdin: [asyncObjectIterable]}));2324expectError(await execa('unicorns', {stdout: asyncObjectIterable}));25expectError(execaSync('unicorns', {stdout: asyncObjectIterable}));26expectError(await execa('unicorns', {stdout: [asyncObjectIterable]}));27expectError(execaSync('unicorns', {stdout: [asyncObjectIterable]}));2829expectError(await execa('unicorns', {stderr: asyncObjectIterable}));30expectError(execaSync('unicorns', {stderr: asyncObjectIterable}));31expectError(await execa('unicorns', {stderr: [asyncObjectIterable]}));32expectError(execaSync('unicorns', {stderr: [asyncObjectIterable]}));3334expectError(await execa('unicorns', {stdio: asyncObjectIterable}));35expectError(execaSync('unicorns', {stdio: asyncObjectIterable}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncObjectIterable]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncObjectIterable]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncObjectIterable]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncObjectIterable]]}));4142expectAssignable<StdinOption>(asyncObjectIterable);43expectNotAssignable<StdinOptionSync>(asyncObjectIterable);44expectAssignable<StdinOption>([asyncObjectIterable]);45expectNotAssignable<StdinOptionSync>([asyncObjectIterable]);4647expectNotAssignable<StdoutStderrOption>(asyncObjectIterable);48expectNotAssignable<StdoutStderrOptionSync>(asyncObjectIterable);49expectNotAssignable<StdoutStderrOption>([asyncObjectIterable]);50expectNotAssignable<StdoutStderrOptionSync>([asyncObjectIterable]);5152expectAssignable<StdioOption>(asyncObjectIterable);53expectNotAssignable<StdioOptionSync>(asyncObjectIterable);54expectAssignable<StdioOption>([asyncObjectIterable]);55expectNotAssignable<StdioOptionSync>([asyncObjectIterable]);
added:test-d/stdio/option/iterable-async-string.test-d.ts+55 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const asyncStringIterableFunction = async function * () {14 yield '';15};1617const asyncStringIterable = asyncStringIterableFunction();1819await execa('unicorns', {stdin: asyncStringIterable});20expectError(execaSync('unicorns', {stdin: asyncStringIterable}));21await execa('unicorns', {stdin: [asyncStringIterable]});22expectError(execaSync('unicorns', {stdin: [asyncStringIterable]}));2324expectError(await execa('unicorns', {stdout: asyncStringIterable}));25expectError(execaSync('unicorns', {stdout: asyncStringIterable}));26expectError(await execa('unicorns', {stdout: [asyncStringIterable]}));27expectError(execaSync('unicorns', {stdout: [asyncStringIterable]}));2829expectError(await execa('unicorns', {stderr: asyncStringIterable}));30expectError(execaSync('unicorns', {stderr: asyncStringIterable}));31expectError(await execa('unicorns', {stderr: [asyncStringIterable]}));32expectError(execaSync('unicorns', {stderr: [asyncStringIterable]}));3334expectError(await execa('unicorns', {stdio: asyncStringIterable}));35expectError(execaSync('unicorns', {stdio: asyncStringIterable}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncStringIterable]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncStringIterable]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncStringIterable]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncStringIterable]]}));4142expectAssignable<StdinOption>(asyncStringIterable);43expectNotAssignable<StdinOptionSync>(asyncStringIterable);44expectAssignable<StdinOption>([asyncStringIterable]);45expectNotAssignable<StdinOptionSync>([asyncStringIterable]);4647expectNotAssignable<StdoutStderrOption>(asyncStringIterable);48expectNotAssignable<StdoutStderrOptionSync>(asyncStringIterable);49expectNotAssignable<StdoutStderrOption>([asyncStringIterable]);50expectNotAssignable<StdoutStderrOptionSync>([asyncStringIterable]);5152expectAssignable<StdioOption>(asyncStringIterable);53expectNotAssignable<StdioOptionSync>(asyncStringIterable);54expectAssignable<StdioOption>([asyncStringIterable]);55expectNotAssignable<StdioOptionSync>([asyncStringIterable]);
added:test-d/stdio/option/iterable-binary.test-d.ts+55 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const binaryIterableFunction = function * () {14 yield new Uint8Array(0);15};1617const binaryIterable = binaryIterableFunction();1819await execa('unicorns', {stdin: binaryIterable});20execaSync('unicorns', {stdin: binaryIterable});21await execa('unicorns', {stdin: [binaryIterable]});22execaSync('unicorns', {stdin: [binaryIterable]});2324expectError(await execa('unicorns', {stdout: binaryIterable}));25expectError(execaSync('unicorns', {stdout: binaryIterable}));26expectError(await execa('unicorns', {stdout: [binaryIterable]}));27expectError(execaSync('unicorns', {stdout: [binaryIterable]}));2829expectError(await execa('unicorns', {stderr: binaryIterable}));30expectError(execaSync('unicorns', {stderr: binaryIterable}));31expectError(await execa('unicorns', {stderr: [binaryIterable]}));32expectError(execaSync('unicorns', {stderr: [binaryIterable]}));3334expectError(await execa('unicorns', {stdio: binaryIterable}));35expectError(execaSync('unicorns', {stdio: binaryIterable}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryIterable]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryIterable]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryIterable]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryIterable]]}));4142expectAssignable<StdinOption>(binaryIterable);43expectAssignable<StdinOptionSync>(binaryIterable);44expectAssignable<StdinOption>([binaryIterable]);45expectAssignable<StdinOptionSync>([binaryIterable]);4647expectNotAssignable<StdoutStderrOption>(binaryIterable);48expectNotAssignable<StdoutStderrOptionSync>(binaryIterable);49expectNotAssignable<StdoutStderrOption>([binaryIterable]);50expectNotAssignable<StdoutStderrOptionSync>([binaryIterable]);5152expectAssignable<StdioOption>(binaryIterable);53expectAssignable<StdioOptionSync>(binaryIterable);54expectAssignable<StdioOption>([binaryIterable]);55expectAssignable<StdioOptionSync>([binaryIterable]);
added:test-d/stdio/option/iterable-object.test-d.ts+55 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const objectIterableFunction = function * () {14 yield {};15};1617const objectIterable = objectIterableFunction();1819await execa('unicorns', {stdin: objectIterable});20execaSync('unicorns', {stdin: objectIterable});21await execa('unicorns', {stdin: [objectIterable]});22execaSync('unicorns', {stdin: [objectIterable]});2324expectError(await execa('unicorns', {stdout: objectIterable}));25expectError(execaSync('unicorns', {stdout: objectIterable}));26expectError(await execa('unicorns', {stdout: [objectIterable]}));27expectError(execaSync('unicorns', {stdout: [objectIterable]}));2829expectError(await execa('unicorns', {stderr: objectIterable}));30expectError(execaSync('unicorns', {stderr: objectIterable}));31expectError(await execa('unicorns', {stderr: [objectIterable]}));32expectError(execaSync('unicorns', {stderr: [objectIterable]}));3334expectError(await execa('unicorns', {stdio: objectIterable}));35expectError(execaSync('unicorns', {stdio: objectIterable}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectIterable]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectIterable]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectIterable]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectIterable]]}));4142expectAssignable<StdinOption>(objectIterable);43expectAssignable<StdinOptionSync>(objectIterable);44expectAssignable<StdinOption>([objectIterable]);45expectAssignable<StdinOptionSync>([objectIterable]);4647expectNotAssignable<StdoutStderrOption>(objectIterable);48expectNotAssignable<StdoutStderrOptionSync>(objectIterable);49expectNotAssignable<StdoutStderrOption>([objectIterable]);50expectNotAssignable<StdoutStderrOptionSync>([objectIterable]);5152expectAssignable<StdioOption>(objectIterable);53expectAssignable<StdioOptionSync>(objectIterable);54expectAssignable<StdioOption>([objectIterable]);55expectAssignable<StdioOptionSync>([objectIterable]);
added:test-d/stdio/option/iterable-string.test-d.ts+55 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const stringIterableFunction = function * () {14 yield '';15};1617const stringIterable = stringIterableFunction();1819await execa('unicorns', {stdin: stringIterable});20execaSync('unicorns', {stdin: stringIterable});21await execa('unicorns', {stdin: [stringIterable]});22execaSync('unicorns', {stdin: [stringIterable]});2324expectError(await execa('unicorns', {stdout: stringIterable}));25expectError(execaSync('unicorns', {stdout: stringIterable}));26expectError(await execa('unicorns', {stdout: [stringIterable]}));27expectError(execaSync('unicorns', {stdout: [stringIterable]}));2829expectError(await execa('unicorns', {stderr: stringIterable}));30expectError(execaSync('unicorns', {stderr: stringIterable}));31expectError(await execa('unicorns', {stderr: [stringIterable]}));32expectError(execaSync('unicorns', {stderr: [stringIterable]}));3334expectError(await execa('unicorns', {stdio: stringIterable}));35expectError(execaSync('unicorns', {stdio: stringIterable}));3637await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringIterable]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringIterable]}));39await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringIterable]]});40expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringIterable]]}));4142expectAssignable<StdinOption>(stringIterable);43expectAssignable<StdinOptionSync>(stringIterable);44expectAssignable<StdinOption>([stringIterable]);45expectAssignable<StdinOptionSync>([stringIterable]);4647expectNotAssignable<StdoutStderrOption>(stringIterable);48expectNotAssignable<StdoutStderrOptionSync>(stringIterable);49expectNotAssignable<StdoutStderrOption>([stringIterable]);50expectNotAssignable<StdoutStderrOptionSync>([stringIterable]);5152expectAssignable<StdioOption>(stringIterable);53expectAssignable<StdioOptionSync>(stringIterable);54expectAssignable<StdioOption>([stringIterable]);55expectAssignable<StdioOptionSync>([stringIterable]);
added:test-d/stdio/option/null.test-d.ts+49 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213expectError(await execa('unicorns', {stdin: null}));14expectError(execaSync('unicorns', {stdin: null}));15expectError(await execa('unicorns', {stdin: [null]}));16expectError(execaSync('unicorns', {stdin: [null]}));1718expectError(await execa('unicorns', {stdout: null}));19expectError(execaSync('unicorns', {stdout: null}));20expectError(await execa('unicorns', {stdout: [null]}));21expectError(execaSync('unicorns', {stdout: [null]}));2223expectError(await execa('unicorns', {stderr: null}));24expectError(execaSync('unicorns', {stderr: null}));25expectError(await execa('unicorns', {stderr: [null]}));26expectError(execaSync('unicorns', {stderr: [null]}));2728expectError(await execa('unicorns', {stdio: null}));29expectError(execaSync('unicorns', {stdio: null}));3031expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', null]}));32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', null]}));33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [null]]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [null]]}));3536expectNotAssignable<StdinOption>(null);37expectNotAssignable<StdinOptionSync>(null);38expectNotAssignable<StdinOption>([null]);39expectNotAssignable<StdinOptionSync>([null]);4041expectNotAssignable<StdoutStderrOption>(null);42expectNotAssignable<StdoutStderrOptionSync>(null);43expectNotAssignable<StdoutStderrOption>([null]);44expectNotAssignable<StdoutStderrOptionSync>([null]);4546expectNotAssignable<StdioOption>(null);47expectNotAssignable<StdioOptionSync>(null);48expectNotAssignable<StdioOption>([null]);49expectNotAssignable<StdioOptionSync>([null]);
added:test-d/stdio/option/overlapped.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: 'overlapped'});14expectError(execaSync('unicorns', {stdin: 'overlapped'}));15await execa('unicorns', {stdin: ['overlapped']});16expectError(execaSync('unicorns', {stdin: ['overlapped']}));1718await execa('unicorns', {stdout: 'overlapped'});19expectError(execaSync('unicorns', {stdout: 'overlapped'}));20await execa('unicorns', {stdout: ['overlapped']});21expectError(execaSync('unicorns', {stdout: ['overlapped']}));2223await execa('unicorns', {stderr: 'overlapped'});24expectError(execaSync('unicorns', {stderr: 'overlapped'}));25await execa('unicorns', {stderr: ['overlapped']});26expectError(execaSync('unicorns', {stderr: ['overlapped']}));2728await execa('unicorns', {stdio: 'overlapped'});29expectError(execaSync('unicorns', {stdio: 'overlapped'}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'overlapped']});32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'overlapped']}));33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['overlapped']]});34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['overlapped']]}));3536expectAssignable<StdinOption>('overlapped');37expectNotAssignable<StdinOptionSync>('overlapped');38expectAssignable<StdinOption>(['overlapped']);39expectNotAssignable<StdinOptionSync>(['overlapped']);4041expectAssignable<StdoutStderrOption>('overlapped');42expectNotAssignable<StdoutStderrOptionSync>('overlapped');43expectAssignable<StdoutStderrOption>(['overlapped']);44expectNotAssignable<StdoutStderrOptionSync>(['overlapped']);4546expectAssignable<StdioOption>('overlapped');47expectNotAssignable<StdioOptionSync>('overlapped');48expectAssignable<StdioOption>(['overlapped']);49expectNotAssignable<StdioOptionSync>(['overlapped']);
added:test-d/stdio/option/pipe-inherit.test-d.ts+34 added
1import {expectError, expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const pipeInherit = ['pipe', 'inherit'] as const;1415await execa('unicorns', {stdin: pipeInherit});16execaSync('unicorns', {stdin: pipeInherit});1718await execa('unicorns', {stdout: pipeInherit});19execaSync('unicorns', {stdout: pipeInherit});2021await execa('unicorns', {stderr: pipeInherit});22execaSync('unicorns', {stderr: pipeInherit});2324expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeInherit]}));25execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeInherit]});2627expectAssignable<StdinOption>(pipeInherit);28expectAssignable<StdinOptionSync>(pipeInherit);2930expectAssignable<StdoutStderrOption>(pipeInherit);31expectAssignable<StdoutStderrOptionSync>(pipeInherit);3233expectAssignable<StdioOption>(pipeInherit);34expectAssignable<StdioOptionSync>(pipeInherit);
added:test-d/stdio/option/pipe-undefined.test-d.ts+34 added
1import {expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const pipeUndefined = ['pipe', undefined] as const;1415await execa('unicorns', {stdin: pipeUndefined});16execaSync('unicorns', {stdin: pipeUndefined});1718await execa('unicorns', {stdout: pipeUndefined});19execaSync('unicorns', {stdout: pipeUndefined});2021await execa('unicorns', {stderr: pipeUndefined});22execaSync('unicorns', {stderr: pipeUndefined});2324await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeUndefined]});25execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeUndefined]});2627expectAssignable<StdinOption>(pipeUndefined);28expectAssignable<StdinOptionSync>(pipeUndefined);2930expectAssignable<StdoutStderrOption>(pipeUndefined);31expectAssignable<StdoutStderrOptionSync>(pipeUndefined);3233expectAssignable<StdioOption>(pipeUndefined);34expectAssignable<StdioOptionSync>(pipeUndefined);
added:test-d/stdio/option/pipe.test-d.ts+49 added
1import {expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: 'pipe'});14execaSync('unicorns', {stdin: 'pipe'});15await execa('unicorns', {stdin: ['pipe']});16execaSync('unicorns', {stdin: ['pipe']});1718await execa('unicorns', {stdout: 'pipe'});19execaSync('unicorns', {stdout: 'pipe'});20await execa('unicorns', {stdout: ['pipe']});21execaSync('unicorns', {stdout: ['pipe']});2223await execa('unicorns', {stderr: 'pipe'});24execaSync('unicorns', {stderr: 'pipe'});25await execa('unicorns', {stderr: ['pipe']});26execaSync('unicorns', {stderr: ['pipe']});2728await execa('unicorns', {stdio: 'pipe'});29execaSync('unicorns', {stdio: 'pipe'});3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']});33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe']]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe']]});3536expectAssignable<StdinOption>('pipe');37expectAssignable<StdinOptionSync>('pipe');38expectAssignable<StdinOption>(['pipe']);39expectAssignable<StdinOptionSync>(['pipe']);4041expectAssignable<StdoutStderrOption>('pipe');42expectAssignable<StdoutStderrOptionSync>('pipe');43expectAssignable<StdoutStderrOption>(['pipe']);44expectAssignable<StdoutStderrOptionSync>(['pipe']);4546expectAssignable<StdioOption>('pipe');47expectAssignable<StdioOptionSync>('pipe');48expectAssignable<StdioOption>(['pipe']);49expectAssignable<StdioOptionSync>(['pipe']);
added:test-d/stdio/option/process-stderr.test-d.ts+50 added
1import * as process from 'node:process';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314expectError(await execa('unicorns', {stdin: process.stderr}));15expectError(execaSync('unicorns', {stdin: process.stderr}));16expectError(await execa('unicorns', {stdin: [process.stderr]}));17expectError(execaSync('unicorns', {stdin: [process.stderr]}));1819await execa('unicorns', {stdout: process.stderr});20execaSync('unicorns', {stdout: process.stderr});21await execa('unicorns', {stdout: [process.stderr]});22expectError(execaSync('unicorns', {stdout: [process.stderr]}));2324await execa('unicorns', {stderr: process.stderr});25execaSync('unicorns', {stderr: process.stderr});26await execa('unicorns', {stderr: [process.stderr]});27expectError(execaSync('unicorns', {stderr: [process.stderr]}));2829expectError(await execa('unicorns', {stdio: process.stderr}));30expectError(execaSync('unicorns', {stdio: process.stderr}));3132await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stderr]});33execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stderr]});34await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stderr]]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stderr]]}));3637expectNotAssignable<StdinOption>(process.stderr);38expectNotAssignable<StdinOptionSync>(process.stderr);39expectNotAssignable<StdinOption>([process.stderr]);40expectNotAssignable<StdinOptionSync>([process.stderr]);4142expectAssignable<StdoutStderrOption>(process.stderr);43expectAssignable<StdoutStderrOptionSync>(process.stderr);44expectAssignable<StdoutStderrOption>([process.stderr]);45expectNotAssignable<StdoutStderrOptionSync>([process.stderr]);4647expectAssignable<StdioOption>(process.stderr);48expectAssignable<StdioOptionSync>(process.stderr);49expectAssignable<StdioOption>([process.stderr]);50expectNotAssignable<StdioOptionSync>([process.stderr]);
added:test-d/stdio/option/process-stdin.test-d.ts+50 added
1import * as process from 'node:process';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314await execa('unicorns', {stdin: process.stdin});15execaSync('unicorns', {stdin: process.stdin});16await execa('unicorns', {stdin: [process.stdin]});17expectError(execaSync('unicorns', {stdin: [process.stdin]}));1819expectError(await execa('unicorns', {stdout: process.stdin}));20expectError(execaSync('unicorns', {stdout: process.stdin}));21expectError(await execa('unicorns', {stdout: [process.stdin]}));22expectError(execaSync('unicorns', {stdout: [process.stdin]}));2324expectError(await execa('unicorns', {stderr: process.stdin}));25expectError(execaSync('unicorns', {stderr: process.stdin}));26expectError(await execa('unicorns', {stderr: [process.stdin]}));27expectError(execaSync('unicorns', {stderr: [process.stdin]}));2829expectError(await execa('unicorns', {stdio: process.stdin}));30expectError(execaSync('unicorns', {stdio: process.stdin}));3132await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stdin]});33execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stdin]});34await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stdin]]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stdin]]}));3637expectAssignable<StdinOption>(process.stdin);38expectAssignable<StdinOptionSync>(process.stdin);39expectAssignable<StdinOption>([process.stdin]);40expectNotAssignable<StdinOptionSync>([process.stdin]);4142expectNotAssignable<StdoutStderrOption>(process.stdin);43expectNotAssignable<StdoutStderrOptionSync>(process.stdin);44expectNotAssignable<StdoutStderrOption>([process.stdin]);45expectNotAssignable<StdoutStderrOptionSync>([process.stdin]);4647expectAssignable<StdioOption>(process.stdin);48expectAssignable<StdioOptionSync>(process.stdin);49expectAssignable<StdioOption>([process.stdin]);50expectNotAssignable<StdioOptionSync>([process.stdin]);
added:test-d/stdio/option/process-stdout.test-d.ts+50 added
1import * as process from 'node:process';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314expectError(await execa('unicorns', {stdin: process.stdout}));15expectError(execaSync('unicorns', {stdin: process.stdout}));16expectError(await execa('unicorns', {stdin: [process.stdout]}));17expectError(execaSync('unicorns', {stdin: [process.stdout]}));1819await execa('unicorns', {stdout: process.stdout});20execaSync('unicorns', {stdout: process.stdout});21await execa('unicorns', {stdout: [process.stdout]});22expectError(execaSync('unicorns', {stdout: [process.stdout]}));2324await execa('unicorns', {stderr: process.stdout});25execaSync('unicorns', {stderr: process.stdout});26await execa('unicorns', {stderr: [process.stdout]});27expectError(execaSync('unicorns', {stderr: [process.stdout]}));2829expectError(await execa('unicorns', {stdio: process.stdout}));30expectError(execaSync('unicorns', {stdio: process.stdout}));3132await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stdout]});33execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stdout]});34await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stdout]]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stdout]]}));3637expectNotAssignable<StdinOption>(process.stdout);38expectNotAssignable<StdinOptionSync>(process.stdout);39expectNotAssignable<StdinOption>([process.stdout]);40expectNotAssignable<StdinOptionSync>([process.stdout]);4142expectAssignable<StdoutStderrOption>(process.stdout);43expectAssignable<StdoutStderrOptionSync>(process.stdout);44expectAssignable<StdoutStderrOption>([process.stdout]);45expectNotAssignable<StdoutStderrOptionSync>([process.stdout]);4647expectAssignable<StdioOption>(process.stdout);48expectAssignable<StdioOptionSync>(process.stdout);49expectAssignable<StdioOption>([process.stdout]);50expectNotAssignable<StdioOptionSync>([process.stdout]);
added:test-d/stdio/option/readable-stream.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: new ReadableStream()});14expectError(execaSync('unicorns', {stdin: new ReadableStream()}));15await execa('unicorns', {stdin: [new ReadableStream()]});16expectError(execaSync('unicorns', {stdin: [new ReadableStream()]}));1718expectError(await execa('unicorns', {stdout: new ReadableStream()}));19expectError(execaSync('unicorns', {stdout: new ReadableStream()}));20expectError(await execa('unicorns', {stdout: [new ReadableStream()]}));21expectError(execaSync('unicorns', {stdout: [new ReadableStream()]}));2223expectError(await execa('unicorns', {stderr: new ReadableStream()}));24expectError(execaSync('unicorns', {stderr: new ReadableStream()}));25expectError(await execa('unicorns', {stderr: [new ReadableStream()]}));26expectError(execaSync('unicorns', {stderr: [new ReadableStream()]}));2728expectError(await execa('unicorns', {stdio: new ReadableStream()}));29expectError(execaSync('unicorns', {stdio: new ReadableStream()}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new ReadableStream()]});32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new ReadableStream()]}));33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new ReadableStream()]]});34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new ReadableStream()]]}));3536expectAssignable<StdinOption>(new ReadableStream());37expectNotAssignable<StdinOptionSync>(new ReadableStream());38expectAssignable<StdinOption>([new ReadableStream()]);39expectNotAssignable<StdinOptionSync>([new ReadableStream()]);4041expectNotAssignable<StdoutStderrOption>(new ReadableStream());42expectNotAssignable<StdoutStderrOptionSync>(new ReadableStream());43expectNotAssignable<StdoutStderrOption>([new ReadableStream()]);44expectNotAssignable<StdoutStderrOptionSync>([new ReadableStream()]);4546expectAssignable<StdioOption>(new ReadableStream());47expectNotAssignable<StdioOptionSync>(new ReadableStream());48expectAssignable<StdioOption>([new ReadableStream()]);49expectNotAssignable<StdioOptionSync>([new ReadableStream()]);
added:test-d/stdio/option/readable.test-d.ts+50 added
1import {Readable} from 'node:stream';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314await execa('unicorns', {stdin: new Readable()});15execaSync('unicorns', {stdin: new Readable()});16await execa('unicorns', {stdin: [new Readable()]});17expectError(execaSync('unicorns', {stdin: [new Readable()]}));1819expectError(await execa('unicorns', {stdout: new Readable()}));20expectError(execaSync('unicorns', {stdout: new Readable()}));21expectError(await execa('unicorns', {stdout: [new Readable()]}));22expectError(execaSync('unicorns', {stdout: [new Readable()]}));2324expectError(await execa('unicorns', {stderr: new Readable()}));25expectError(execaSync('unicorns', {stderr: new Readable()}));26expectError(await execa('unicorns', {stderr: [new Readable()]}));27expectError(execaSync('unicorns', {stderr: [new Readable()]}));2829expectError(await execa('unicorns', {stdio: new Readable()}));30expectError(execaSync('unicorns', {stdio: new Readable()}));3132await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Readable()]});33execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Readable()]});34await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Readable()]]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Readable()]]}));3637expectAssignable<StdinOption>(new Readable());38expectAssignable<StdinOptionSync>(new Readable());39expectAssignable<StdinOption>([new Readable()]);40expectNotAssignable<StdinOptionSync>([new Readable()]);4142expectNotAssignable<StdoutStderrOption>(new Readable());43expectNotAssignable<StdoutStderrOptionSync>(new Readable());44expectNotAssignable<StdoutStderrOption>([new Readable()]);45expectNotAssignable<StdoutStderrOptionSync>([new Readable()]);4647expectAssignable<StdioOption>(new Readable());48expectAssignable<StdioOptionSync>(new Readable());49expectAssignable<StdioOption>([new Readable()]);50expectNotAssignable<StdioOptionSync>([new Readable()]);
added:test-d/stdio/option/uint-array.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: new Uint8Array()});14execaSync('unicorns', {stdin: new Uint8Array()});15await execa('unicorns', {stdin: [new Uint8Array()]});16execaSync('unicorns', {stdin: [new Uint8Array()]});1718expectError(await execa('unicorns', {stdout: new Uint8Array()}));19expectError(execaSync('unicorns', {stdout: new Uint8Array()}));20expectError(await execa('unicorns', {stdout: [new Uint8Array()]}));21expectError(execaSync('unicorns', {stdout: [new Uint8Array()]}));2223expectError(await execa('unicorns', {stderr: new Uint8Array()}));24expectError(execaSync('unicorns', {stderr: new Uint8Array()}));25expectError(await execa('unicorns', {stderr: [new Uint8Array()]}));26expectError(execaSync('unicorns', {stderr: [new Uint8Array()]}));2728expectError(await execa('unicorns', {stdio: new Uint8Array()}));29expectError(execaSync('unicorns', {stdio: new Uint8Array()}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Uint8Array()]});32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Uint8Array()]}));33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Uint8Array()]]});34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Uint8Array()]]}));3536expectAssignable<StdinOption>(new Uint8Array());37expectAssignable<StdinOptionSync>(new Uint8Array());38expectAssignable<StdinOption>([new Uint8Array()]);39expectAssignable<StdinOptionSync>([new Uint8Array()]);4041expectNotAssignable<StdoutStderrOption>(new Uint8Array());42expectNotAssignable<StdoutStderrOptionSync>(new Uint8Array());43expectNotAssignable<StdoutStderrOption>([new Uint8Array()]);44expectNotAssignable<StdoutStderrOptionSync>([new Uint8Array()]);4546expectAssignable<StdioOption>(new Uint8Array());47expectAssignable<StdioOptionSync>(new Uint8Array());48expectAssignable<StdioOption>([new Uint8Array()]);49expectAssignable<StdioOptionSync>([new Uint8Array()]);
added:test-d/stdio/option/undefined.test-d.ts+49 added
1import {expectAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213await execa('unicorns', {stdin: undefined});14execaSync('unicorns', {stdin: undefined});15await execa('unicorns', {stdin: [undefined]});16execaSync('unicorns', {stdin: [undefined]});1718await execa('unicorns', {stdout: undefined});19execaSync('unicorns', {stdout: undefined});20await execa('unicorns', {stdout: [undefined]});21execaSync('unicorns', {stdout: [undefined]});2223await execa('unicorns', {stderr: undefined});24execaSync('unicorns', {stderr: undefined});25await execa('unicorns', {stderr: [undefined]});26execaSync('unicorns', {stderr: [undefined]});2728await execa('unicorns', {stdio: undefined});29execaSync('unicorns', {stdio: undefined});3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', undefined]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', undefined]});33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [undefined]]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [undefined]]});3536expectAssignable<StdinOption>(undefined);37expectAssignable<StdinOptionSync>(undefined);38expectAssignable<StdinOption>([undefined]);39expectAssignable<StdinOptionSync>([undefined]);4041expectAssignable<StdoutStderrOption>(undefined);42expectAssignable<StdoutStderrOptionSync>(undefined);43expectAssignable<StdoutStderrOption>([undefined]);44expectAssignable<StdoutStderrOptionSync>([undefined]);4546expectAssignable<StdioOption>(undefined);47expectAssignable<StdioOptionSync>(undefined);48expectAssignable<StdioOption>([undefined]);49expectAssignable<StdioOptionSync>([undefined]);
added:test-d/stdio/option/unknown.test-d.ts+50 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213expectError(await execa('unicorns', {stdin: 'unknown'}));14expectError(execaSync('unicorns', {stdin: 'unknown'}));15expectError(await execa('unicorns', {stdin: ['unknown']}));16expectError(execaSync('unicorns', {stdin: ['unknown']}));1718expectError(await execa('unicorns', {stdout: 'unknown'}));19expectError(execaSync('unicorns', {stdout: 'unknown'}));20expectError(await execa('unicorns', {stdout: ['unknown']}));21expectError(execaSync('unicorns', {stdout: ['unknown']}));2223expectError(await execa('unicorns', {stderr: 'unknown'}));24expectError(execaSync('unicorns', {stderr: 'unknown'}));25expectError(await execa('unicorns', {stderr: ['unknown']}));26expectError(execaSync('unicorns', {stderr: ['unknown']}));2728expectError(await execa('unicorns', {stdio: 'unknown'}));29expectError(execaSync('unicorns', {stdio: 'unknown'}));3031expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'unknown']}));32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'unknown']}));33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['unknown']]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['unknown']]}));3536expectNotAssignable<StdinOption>('unknown');37expectNotAssignable<StdinOptionSync>('unknown');38expectNotAssignable<StdinOption>(['unknown']);39expectNotAssignable<StdinOptionSync>(['unknown']);4041expectNotAssignable<StdoutStderrOption>('unknown');42expectNotAssignable<StdoutStderrOptionSync>('unknown');43expectNotAssignable<StdoutStderrOption>(['unknown']);44expectNotAssignable<StdoutStderrOptionSync>(['unknown']);4546expectNotAssignable<StdioOption>('unknown');47expectNotAssignable<StdioOptionSync>('unknown');48expectNotAssignable<StdioOption>(['unknown']);49expectNotAssignable<StdioOptionSync>(['unknown']);50
added:test-d/stdio/option/web-transform-instance.test-d.ts+51 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const webTransformInstance = new TransformStream();1415await execa('unicorns', {stdin: webTransformInstance});16expectError(execaSync('unicorns', {stdin: webTransformInstance}));17await execa('unicorns', {stdin: [webTransformInstance]});18expectError(execaSync('unicorns', {stdin: [webTransformInstance]}));1920await execa('unicorns', {stdout: webTransformInstance});21expectError(execaSync('unicorns', {stdout: webTransformInstance}));22await execa('unicorns', {stdout: [webTransformInstance]});23expectError(execaSync('unicorns', {stdout: [webTransformInstance]}));2425await execa('unicorns', {stderr: webTransformInstance});26expectError(execaSync('unicorns', {stderr: webTransformInstance}));27await execa('unicorns', {stderr: [webTransformInstance]});28expectError(execaSync('unicorns', {stderr: [webTransformInstance]}));2930expectError(await execa('unicorns', {stdio: webTransformInstance}));31expectError(execaSync('unicorns', {stdio: webTransformInstance}));3233await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformInstance]});34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformInstance]}));35await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformInstance]]});36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformInstance]]}));3738expectAssignable<StdinOption>(webTransformInstance);39expectNotAssignable<StdinOptionSync>(webTransformInstance);40expectAssignable<StdinOption>([webTransformInstance]);41expectNotAssignable<StdinOptionSync>([webTransformInstance]);4243expectAssignable<StdoutStderrOption>(webTransformInstance);44expectNotAssignable<StdoutStderrOptionSync>(webTransformInstance);45expectAssignable<StdoutStderrOption>([webTransformInstance]);46expectNotAssignable<StdoutStderrOptionSync>([webTransformInstance]);4748expectAssignable<StdioOption>(webTransformInstance);49expectNotAssignable<StdioOptionSync>(webTransformInstance);50expectAssignable<StdioOption>([webTransformInstance]);51expectNotAssignable<StdioOptionSync>([webTransformInstance]);
added:test-d/stdio/option/web-transform-invalid.test-d.ts+54 added
1import {expectError, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const webTransformWithInvalidObjectMode = {14 transform: new TransformStream(),15 objectMode: 'true',16} as const;1718expectError(await execa('unicorns', {stdin: webTransformWithInvalidObjectMode}));19expectError(execaSync('unicorns', {stdin: webTransformWithInvalidObjectMode}));20expectError(await execa('unicorns', {stdin: [webTransformWithInvalidObjectMode]}));21expectError(execaSync('unicorns', {stdin: [webTransformWithInvalidObjectMode]}));2223expectError(await execa('unicorns', {stdout: webTransformWithInvalidObjectMode}));24expectError(execaSync('unicorns', {stdout: webTransformWithInvalidObjectMode}));25expectError(await execa('unicorns', {stdout: [webTransformWithInvalidObjectMode]}));26expectError(execaSync('unicorns', {stdout: [webTransformWithInvalidObjectMode]}));2728expectError(await execa('unicorns', {stderr: webTransformWithInvalidObjectMode}));29expectError(execaSync('unicorns', {stderr: webTransformWithInvalidObjectMode}));30expectError(await execa('unicorns', {stderr: [webTransformWithInvalidObjectMode]}));31expectError(execaSync('unicorns', {stderr: [webTransformWithInvalidObjectMode]}));3233expectError(await execa('unicorns', {stdio: webTransformWithInvalidObjectMode}));34expectError(execaSync('unicorns', {stdio: webTransformWithInvalidObjectMode}));3536expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformWithInvalidObjectMode]}));37expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformWithInvalidObjectMode]}));38expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformWithInvalidObjectMode]]}));39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformWithInvalidObjectMode]]}));4041expectNotAssignable<StdinOption>(webTransformWithInvalidObjectMode);42expectNotAssignable<StdinOptionSync>(webTransformWithInvalidObjectMode);43expectNotAssignable<StdinOption>([webTransformWithInvalidObjectMode]);44expectNotAssignable<StdinOptionSync>([webTransformWithInvalidObjectMode]);4546expectNotAssignable<StdoutStderrOption>(webTransformWithInvalidObjectMode);47expectNotAssignable<StdoutStderrOptionSync>(webTransformWithInvalidObjectMode);48expectNotAssignable<StdoutStderrOption>([webTransformWithInvalidObjectMode]);49expectNotAssignable<StdoutStderrOptionSync>([webTransformWithInvalidObjectMode]);5051expectNotAssignable<StdioOption>(webTransformWithInvalidObjectMode);52expectNotAssignable<StdioOptionSync>(webTransformWithInvalidObjectMode);53expectNotAssignable<StdioOption>([webTransformWithInvalidObjectMode]);54expectNotAssignable<StdioOptionSync>([webTransformWithInvalidObjectMode]);
added:test-d/stdio/option/web-transform-object.test-d.ts+54 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const webTransformObject = {14 transform: new TransformStream(),15 objectMode: true as const,16} as const;1718await execa('unicorns', {stdin: webTransformObject});19expectError(execaSync('unicorns', {stdin: webTransformObject}));20await execa('unicorns', {stdin: [webTransformObject]});21expectError(execaSync('unicorns', {stdin: [webTransformObject]}));2223await execa('unicorns', {stdout: webTransformObject});24expectError(execaSync('unicorns', {stdout: webTransformObject}));25await execa('unicorns', {stdout: [webTransformObject]});26expectError(execaSync('unicorns', {stdout: [webTransformObject]}));2728await execa('unicorns', {stderr: webTransformObject});29expectError(execaSync('unicorns', {stderr: webTransformObject}));30await execa('unicorns', {stderr: [webTransformObject]});31expectError(execaSync('unicorns', {stderr: [webTransformObject]}));3233expectError(await execa('unicorns', {stdio: webTransformObject}));34expectError(execaSync('unicorns', {stdio: webTransformObject}));3536await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformObject]});37expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformObject]}));38await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformObject]]});39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformObject]]}));4041expectAssignable<StdinOption>(webTransformObject);42expectNotAssignable<StdinOptionSync>(webTransformObject);43expectAssignable<StdinOption>([webTransformObject]);44expectNotAssignable<StdinOptionSync>([webTransformObject]);4546expectAssignable<StdoutStderrOption>(webTransformObject);47expectNotAssignable<StdoutStderrOptionSync>(webTransformObject);48expectAssignable<StdoutStderrOption>([webTransformObject]);49expectNotAssignable<StdoutStderrOptionSync>([webTransformObject]);5051expectAssignable<StdioOption>(webTransformObject);52expectNotAssignable<StdioOptionSync>(webTransformObject);53expectAssignable<StdioOption>([webTransformObject]);54expectNotAssignable<StdioOptionSync>([webTransformObject]);
added:test-d/stdio/option/web-transform.test-d.ts+51 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213const webTransform = {transform: new TransformStream()} as const;1415await execa('unicorns', {stdin: webTransform});16expectError(execaSync('unicorns', {stdin: webTransform}));17await execa('unicorns', {stdin: [webTransform]});18expectError(execaSync('unicorns', {stdin: [webTransform]}));1920await execa('unicorns', {stdout: webTransform});21expectError(execaSync('unicorns', {stdout: webTransform}));22await execa('unicorns', {stdout: [webTransform]});23expectError(execaSync('unicorns', {stdout: [webTransform]}));2425await execa('unicorns', {stderr: webTransform});26expectError(execaSync('unicorns', {stderr: webTransform}));27await execa('unicorns', {stderr: [webTransform]});28expectError(execaSync('unicorns', {stderr: [webTransform]}));2930expectError(await execa('unicorns', {stdio: webTransform}));31expectError(execaSync('unicorns', {stdio: webTransform}));3233await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransform]});34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransform]}));35await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransform]]});36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransform]]}));3738expectAssignable<StdinOption>(webTransform);39expectNotAssignable<StdinOptionSync>(webTransform);40expectAssignable<StdinOption>([webTransform]);41expectNotAssignable<StdinOptionSync>([webTransform]);4243expectAssignable<StdoutStderrOption>(webTransform);44expectNotAssignable<StdoutStderrOptionSync>(webTransform);45expectAssignable<StdoutStderrOption>([webTransform]);46expectNotAssignable<StdoutStderrOptionSync>([webTransform]);4748expectAssignable<StdioOption>(webTransform);49expectNotAssignable<StdioOptionSync>(webTransform);50expectAssignable<StdioOption>([webTransform]);51expectNotAssignable<StdioOptionSync>([webTransform]);
added:test-d/stdio/option/writable-stream.test-d.ts+49 added
1import {expectError, expectAssignable, expectNotAssignable} from 'tsd';2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinOptionSync,7 type StdoutStderrOption,8 type StdoutStderrOptionSync,9 type StdioOption,10 type StdioOptionSync,11} from '../../../index.js';1213expectError(await execa('unicorns', {stdin: new WritableStream()}));14expectError(execaSync('unicorns', {stdin: new WritableStream()}));15expectError(await execa('unicorns', {stdin: [new WritableStream()]}));16expectError(execaSync('unicorns', {stdin: [new WritableStream()]}));1718await execa('unicorns', {stdout: new WritableStream()});19expectError(execaSync('unicorns', {stdout: new WritableStream()}));20await execa('unicorns', {stdout: [new WritableStream()]});21expectError(execaSync('unicorns', {stdout: [new WritableStream()]}));2223await execa('unicorns', {stderr: new WritableStream()});24expectError(execaSync('unicorns', {stderr: new WritableStream()}));25await execa('unicorns', {stderr: [new WritableStream()]});26expectError(execaSync('unicorns', {stderr: [new WritableStream()]}));2728expectError(await execa('unicorns', {stdio: new WritableStream()}));29expectError(execaSync('unicorns', {stdio: new WritableStream()}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new WritableStream()]});32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new WritableStream()]}));33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new WritableStream()]]});34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new WritableStream()]]}));3536expectNotAssignable<StdinOption>(new WritableStream());37expectNotAssignable<StdinOptionSync>(new WritableStream());38expectNotAssignable<StdinOption>([new WritableStream()]);39expectNotAssignable<StdinOptionSync>([new WritableStream()]);4041expectAssignable<StdoutStderrOption>(new WritableStream());42expectNotAssignable<StdoutStderrOptionSync>(new WritableStream());43expectAssignable<StdoutStderrOption>([new WritableStream()]);44expectNotAssignable<StdoutStderrOptionSync>([new WritableStream()]);4546expectAssignable<StdioOption>(new WritableStream());47expectNotAssignable<StdioOptionSync>(new WritableStream());48expectAssignable<StdioOption>([new WritableStream()]);49expectNotAssignable<StdioOptionSync>([new WritableStream()]);
added:test-d/stdio/option/writable.test-d.ts+50 added
1import {Writable} from 'node:stream';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinOptionSync,8 type StdoutStderrOption,9 type StdoutStderrOptionSync,10 type StdioOption,11 type StdioOptionSync,12} from '../../../index.js';1314expectError(await execa('unicorns', {stdin: new Writable()}));15expectError(execaSync('unicorns', {stdin: new Writable()}));16expectError(await execa('unicorns', {stdin: [new Writable()]}));17expectError(execaSync('unicorns', {stdin: [new Writable()]}));1819await execa('unicorns', {stdout: new Writable()});20execaSync('unicorns', {stdout: new Writable()});21await execa('unicorns', {stdout: [new Writable()]});22expectError(execaSync('unicorns', {stdout: [new Writable()]}));2324await execa('unicorns', {stderr: new Writable()});25execaSync('unicorns', {stderr: new Writable()});26await execa('unicorns', {stderr: [new Writable()]});27expectError(execaSync('unicorns', {stderr: [new Writable()]}));2829expectError(await execa('unicorns', {stdio: new Writable()}));30expectError(execaSync('unicorns', {stdio: new Writable()}));3132await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Writable()]});33execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Writable()]});34await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Writable()]]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Writable()]]}));3637expectNotAssignable<StdinOption>(new Writable());38expectNotAssignable<StdinOptionSync>(new Writable());39expectNotAssignable<StdinOption>([new Writable()]);40expectNotAssignable<StdinOptionSync>([new Writable()]);4142expectAssignable<StdoutStderrOption>(new Writable());43expectAssignable<StdoutStderrOptionSync>(new Writable());44expectAssignable<StdoutStderrOption>([new Writable()]);45expectNotAssignable<StdoutStderrOptionSync>([new Writable()]);4647expectAssignable<StdioOption>(new Writable());48expectAssignable<StdioOptionSync>(new Writable());49expectAssignable<StdioOption>([new Writable()]);50expectNotAssignable<StdioOptionSync>([new Writable()]);
added:test-d/stdio/array.test-d.ts+14 added
1import {expectError} from 'tsd';2import {execa, execaSync} from '../../index.js';34expectError(await execa('unicorns', {stdio: []}));5expectError(execaSync('unicorns', {stdio: []}));6expectError(await execa('unicorns', {stdio: ['pipe']}));7expectError(execaSync('unicorns', {stdio: ['pipe']}));8expectError(await execa('unicorns', {stdio: ['pipe', 'pipe']}));9expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe']}));1011await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'pipe']});12execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'pipe']});13expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'unknown']}));14expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'unknown']}));
added:test-d/stdio/direction.test-d.ts+34 added
1import {Readable, Writable} from 'node:stream';2import {expectError, expectAssignable, expectNotAssignable} from 'tsd';3import {execa, execaSync, type StdioOption, type StdioOptionSync} from '../../index.js';45await execa('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});6execaSync('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});7await execa('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]});8expectError(execaSync('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]}));9await execa('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});10execaSync('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});11await execa('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]});12expectError(execaSync('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]}));13await execa('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});14execaSync('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});15await execa('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]});16expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]}));1718expectError(await execa('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));19expectError(execaSync('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));20expectError(await execa('unicorns', {stdio: [[new Writable()], ['pipe'], ['pipe']]}));21expectError(execaSync('unicorns', {stdio: [[new Writable()], ['pipe'], ['pipe']]}));22expectError(await execa('unicorns', {stdio: ['pipe', new Readable(), 'pipe']}));23expectError(execaSync('unicorns', {stdio: ['pipe', new Readable(), 'pipe']}));24expectError(await execa('unicorns', {stdio: [['pipe'], [new Readable()], ['pipe']]}));25expectError(execaSync('unicorns', {stdio: [['pipe'], [new Readable()], ['pipe']]}));26expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', new Readable()]}));27expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', new Readable()]}));28expectError(await execa('unicorns', {stdio: [['pipe'], ['pipe'], [new Readable()]]}));29expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Readable()]]}));3031expectAssignable<StdioOption>([new Uint8Array(), new Uint8Array()]);32expectAssignable<StdioOptionSync>([new Uint8Array(), new Uint8Array()]);33expectNotAssignable<StdioOption>([new Writable(), new Uint8Array()]);34expectNotAssignable<StdioOptionSync>([new Writable(), new Uint8Array()]);
added:test-d/subprocess/all.test-d.ts+9 added
1import type {Readable} from 'node:stream';2import {expectType} from 'tsd';3import {execa} from '../../index.js';45const allPromise = execa('unicorns', {all: true});6expectType<Readable>(allPromise.all);78const noAllPromise = execa('unicorns');9expectType<undefined>(noAllPromise.all);
added:test-d/subprocess/stdio.test-d.ts+41 added
1import type {Readable, Writable} from 'node:stream';2import {expectType, expectError} from 'tsd';3import {execa, type ExecaSubprocess} from '../../index.js';45expectType<Writable | null>({} as ExecaSubprocess['stdin']);6expectType<Readable | null>({} as ExecaSubprocess['stdout']);7expectType<Readable | null>({} as ExecaSubprocess['stderr']);8expectType<Readable | undefined>({} as ExecaSubprocess['all']);910const execaBufferPromise = execa('unicorns', {encoding: 'buffer', all: true});11expectType<Writable>(execaBufferPromise.stdin);12expectType<Writable>(execaBufferPromise.stdio[0]);13expectType<Readable>(execaBufferPromise.stdout);14expectType<Readable>(execaBufferPromise.stdio[1]);15expectType<Readable>(execaBufferPromise.stderr);16expectType<Readable>(execaBufferPromise.stdio[2]);17expectType<Readable>(execaBufferPromise.all);18expectError(execaBufferPromise.stdio[3].destroy());1920const execaHexPromise = execa('unicorns', {encoding: 'hex', all: true});21expectType<Writable>(execaHexPromise.stdin);22expectType<Writable>(execaHexPromise.stdio[0]);23expectType<Readable>(execaHexPromise.stdout);24expectType<Readable>(execaHexPromise.stdio[1]);25expectType<Readable>(execaHexPromise.stderr);26expectType<Readable>(execaHexPromise.stdio[2]);27expectType<Readable>(execaHexPromise.all);28expectError(execaHexPromise.stdio[3].destroy());2930const multipleStdinPromise = execa('unicorns', {stdin: ['inherit', 'pipe']});31expectType<Writable>(multipleStdinPromise.stdin);3233const multipleStdoutPromise = execa('unicorns', {stdout: ['inherit', 'pipe'] as ['inherit', 'pipe'], all: true});34expectType<Writable>(multipleStdoutPromise.stdin);35expectType<Writable>(multipleStdoutPromise.stdio[0]);36expectType<Readable>(multipleStdoutPromise.stdout);37expectType<Readable>(multipleStdoutPromise.stdio[1]);38expectType<Readable>(multipleStdoutPromise.stderr);39expectType<Readable>(multipleStdoutPromise.stdio[2]);40expectType<Readable>(multipleStdoutPromise.all);41expectError(multipleStdoutPromise.stdio[3].destroy());
added:test-d/subprocess/subprocess.test-d.ts+30 added
1import {expectType, expectError} from 'tsd';2import {execa} from '../../index.js';34const execaPromise = execa('unicorns');56expectType<number | undefined>(execaPromise.pid);78expectType<boolean>(execa('unicorns').kill());9execa('unicorns').kill('SIGKILL');10execa('unicorns').kill(undefined);11execa('unicorns').kill(new Error('test'));12execa('unicorns').kill('SIGKILL', new Error('test'));13execa('unicorns').kill(undefined, new Error('test'));14expectError(execa('unicorns').kill(null));15expectError(execa('unicorns').kill(0n));16expectError(execa('unicorns').kill([new Error('test')]));17expectError(execa('unicorns').kill({message: 'test'}));18expectError(execa('unicorns').kill(undefined, {}));19expectError(execa('unicorns').kill('SIGKILL', {}));20expectError(execa('unicorns').kill(null, new Error('test')));2122expectType<boolean>(execa('unicorns', {ipc: true}).send({}));23execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']}).send({});24execa('unicorns', {stdio: ['pipe', 'pipe', 'ipc', 'pipe']}).send({});25execa('unicorns', {ipc: true}).send('message');26execa('unicorns', {ipc: true}).send({}, undefined, {keepOpen: true});27expectError(execa('unicorns', {ipc: true}).send({}, true));28expectType<undefined>(execa('unicorns', {}).send);29expectType<undefined>(execa('unicorns', {ipc: false}).send);30expectType<undefined>(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']}).send);
added:test-d/transform/object-mode.test-d.ts+223 added
1import {Duplex} from 'node:stream';2import {expectType} from 'tsd';3import {execa, type ExecaError} from '../../index.js';45const duplexStream = new Duplex();6const duplex = {transform: duplexStream} as const;7const duplexObject = {transform: duplexStream as Duplex & {readonly readableObjectMode: true}} as const;8const duplexNotObject = {transform: duplexStream as Duplex & {readonly readableObjectMode: false}} as const;9const duplexObjectProperty = {transform: duplexStream, objectMode: true as const} as const;10const duplexNotObjectProperty = {transform: duplexStream, objectMode: false as const} as const;1112const webTransformInstance = new TransformStream();13const webTransform = {transform: webTransformInstance} as const;14const webTransformObject = {transform: webTransformInstance, objectMode: true as const} as const;15const webTransformNotObject = {transform: webTransformInstance, objectMode: false as const} as const;1617const objectGenerator = function * (line: unknown) {18 yield JSON.parse(line as string) as object;19};2021const objectFinal = function * () {22 yield {};23};2425const objectTransformLinesStdoutResult = await execa('unicorns', {lines: true, stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}});26expectType<unknown[]>(objectTransformLinesStdoutResult.stdout);27expectType<[undefined, unknown[], string[]]>(objectTransformLinesStdoutResult.stdio);2829const objectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransformObject});30expectType<unknown[]>(objectWebTransformStdoutResult.stdout);31expectType<[undefined, unknown[], string]>(objectWebTransformStdoutResult.stdio);3233const objectDuplexStdoutResult = await execa('unicorns', {stdout: duplexObject});34expectType<unknown[]>(objectDuplexStdoutResult.stdout);35expectType<[undefined, unknown[], string]>(objectDuplexStdoutResult.stdio);3637const objectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: duplexObjectProperty});38expectType<unknown[]>(objectDuplexPropertyStdoutResult.stdout);39expectType<[undefined, unknown[], string]>(objectDuplexPropertyStdoutResult.stdio);4041const objectTransformStdoutResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}});42expectType<unknown[]>(objectTransformStdoutResult.stdout);43expectType<[undefined, unknown[], string]>(objectTransformStdoutResult.stdio);4445const objectWebTransformStderrResult = await execa('unicorns', {stderr: webTransformObject});46expectType<unknown[]>(objectWebTransformStderrResult.stderr);47expectType<[undefined, string, unknown[]]>(objectWebTransformStderrResult.stdio);4849const objectDuplexStderrResult = await execa('unicorns', {stderr: duplexObject});50expectType<unknown[]>(objectDuplexStderrResult.stderr);51expectType<[undefined, string, unknown[]]>(objectDuplexStderrResult.stdio);5253const objectDuplexPropertyStderrResult = await execa('unicorns', {stderr: duplexObjectProperty});54expectType<unknown[]>(objectDuplexPropertyStderrResult.stderr);55expectType<[undefined, string, unknown[]]>(objectDuplexPropertyStderrResult.stdio);5657const objectTransformStderrResult = await execa('unicorns', {stderr: {transform: objectGenerator, final: objectFinal, objectMode: true}});58expectType<unknown[]>(objectTransformStderrResult.stderr);59expectType<[undefined, string, unknown[]]>(objectTransformStderrResult.stdio);6061const objectWebTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', webTransformObject]});62expectType<unknown[]>(objectWebTransformStdioResult.stderr);63expectType<[undefined, string, unknown[]]>(objectWebTransformStdioResult.stdio);6465const objectDuplexStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexObject]});66expectType<unknown[]>(objectDuplexStdioResult.stderr);67expectType<[undefined, string, unknown[]]>(objectDuplexStdioResult.stdio);6869const objectDuplexPropertyStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexObjectProperty]});70expectType<unknown[]>(objectDuplexPropertyStdioResult.stderr);71expectType<[undefined, string, unknown[]]>(objectDuplexPropertyStdioResult.stdio);7273const objectTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', {transform: objectGenerator, final: objectFinal, objectMode: true}]});74expectType<unknown[]>(objectTransformStdioResult.stderr);75expectType<[undefined, string, unknown[]]>(objectTransformStdioResult.stdio);7677const singleObjectWebTransformStdoutResult = await execa('unicorns', {stdout: [webTransformObject]});78expectType<unknown[]>(singleObjectWebTransformStdoutResult.stdout);79expectType<[undefined, unknown[], string]>(singleObjectWebTransformStdoutResult.stdio);8081const singleObjectDuplexStdoutResult = await execa('unicorns', {stdout: [duplexObject]});82expectType<unknown[]>(singleObjectDuplexStdoutResult.stdout);83expectType<[undefined, unknown[], string]>(singleObjectDuplexStdoutResult.stdio);8485const singleObjectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: [duplexObjectProperty]});86expectType<unknown[]>(singleObjectDuplexPropertyStdoutResult.stdout);87expectType<[undefined, unknown[], string]>(singleObjectDuplexPropertyStdoutResult.stdio);8889const singleObjectTransformStdoutResult = await execa('unicorns', {stdout: [{transform: objectGenerator, final: objectFinal, objectMode: true}]});90expectType<unknown[]>(singleObjectTransformStdoutResult.stdout);91expectType<[undefined, unknown[], string]>(singleObjectTransformStdoutResult.stdio);9293const manyObjectWebTransformStdoutResult = await execa('unicorns', {stdout: [webTransformObject, webTransformObject]});94expectType<unknown[]>(manyObjectWebTransformStdoutResult.stdout);95expectType<[undefined, unknown[], string]>(manyObjectWebTransformStdoutResult.stdio);9697const manyObjectDuplexStdoutResult = await execa('unicorns', {stdout: [duplexObject, duplexObject]});98expectType<unknown[]>(manyObjectDuplexStdoutResult.stdout);99expectType<[undefined, unknown[], string]>(manyObjectDuplexStdoutResult.stdio);100101const manyObjectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: [duplexObjectProperty, duplexObjectProperty]});102expectType<unknown[]>(manyObjectDuplexPropertyStdoutResult.stdout);103expectType<[undefined, unknown[], string]>(manyObjectDuplexPropertyStdoutResult.stdio);104105const manyObjectTransformStdoutResult = await execa('unicorns', {stdout: [{transform: objectGenerator, final: objectFinal, objectMode: true}, {transform: objectGenerator, final: objectFinal, objectMode: true}]});106expectType<unknown[]>(manyObjectTransformStdoutResult.stdout);107expectType<[undefined, unknown[], string]>(manyObjectTransformStdoutResult.stdio);108109const falseObjectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransformNotObject});110expectType<string>(falseObjectWebTransformStdoutResult.stdout);111expectType<[undefined, string, string]>(falseObjectWebTransformStdoutResult.stdio);112113const falseObjectDuplexStdoutResult = await execa('unicorns', {stdout: duplexNotObject});114expectType<string>(falseObjectDuplexStdoutResult.stdout);115expectType<[undefined, string, string]>(falseObjectDuplexStdoutResult.stdio);116117const falseObjectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: duplexNotObjectProperty});118expectType<string>(falseObjectDuplexPropertyStdoutResult.stdout);119expectType<[undefined, string, string]>(falseObjectDuplexPropertyStdoutResult.stdio);120121const falseObjectTransformStdoutResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: false}});122expectType<string>(falseObjectTransformStdoutResult.stdout);123expectType<[undefined, string, string]>(falseObjectTransformStdoutResult.stdio);124125const falseObjectWebTransformStderrResult = await execa('unicorns', {stderr: webTransformNotObject});126expectType<string>(falseObjectWebTransformStderrResult.stderr);127expectType<[undefined, string, string]>(falseObjectWebTransformStderrResult.stdio);128129const falseObjectDuplexStderrResult = await execa('unicorns', {stderr: duplexNotObject});130expectType<string>(falseObjectDuplexStderrResult.stderr);131expectType<[undefined, string, string]>(falseObjectDuplexStderrResult.stdio);132133const falseObjectDuplexPropertyStderrResult = await execa('unicorns', {stderr: duplexNotObjectProperty});134expectType<string>(falseObjectDuplexPropertyStderrResult.stderr);135expectType<[undefined, string, string]>(falseObjectDuplexPropertyStderrResult.stdio);136137const falseObjectTransformStderrResult = await execa('unicorns', {stderr: {transform: objectGenerator, final: objectFinal, objectMode: false}});138expectType<string>(falseObjectTransformStderrResult.stderr);139expectType<[undefined, string, string]>(falseObjectTransformStderrResult.stdio);140141const falseObjectWebTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', webTransformNotObject]});142expectType<string>(falseObjectWebTransformStdioResult.stderr);143expectType<[undefined, string, string]>(falseObjectWebTransformStdioResult.stdio);144145const falseObjectDuplexStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexNotObject]});146expectType<string>(falseObjectDuplexStdioResult.stderr);147expectType<[undefined, string, string]>(falseObjectDuplexStdioResult.stdio);148149const falseObjectDuplexPropertyStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexNotObjectProperty]});150expectType<string>(falseObjectDuplexPropertyStdioResult.stderr);151expectType<[undefined, string, string]>(falseObjectDuplexPropertyStdioResult.stdio);152153const falseObjectTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', {transform: objectGenerator, final: objectFinal, objectMode: false}]});154expectType<string>(falseObjectTransformStdioResult.stderr);155expectType<[undefined, string, string]>(falseObjectTransformStdioResult.stdio);156157const topObjectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransformInstance});158expectType<string>(topObjectWebTransformStdoutResult.stdout);159expectType<[undefined, string, string]>(topObjectWebTransformStdoutResult.stdio);160161const undefinedObjectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransform});162expectType<string>(undefinedObjectWebTransformStdoutResult.stdout);163expectType<[undefined, string, string]>(undefinedObjectWebTransformStdoutResult.stdio);164165const undefinedObjectDuplexStdoutResult = await execa('unicorns', {stdout: duplex});166expectType<string | unknown[]>(undefinedObjectDuplexStdoutResult.stdout);167expectType<[undefined, string | unknown[], string]>(undefinedObjectDuplexStdoutResult.stdio);168169const undefinedObjectTransformStdoutResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal}});170expectType<string>(undefinedObjectTransformStdoutResult.stdout);171expectType<[undefined, string, string]>(undefinedObjectTransformStdoutResult.stdio);172173const noObjectTransformStdoutResult = await execa('unicorns', {stdout: objectGenerator, final: objectFinal});174expectType<string>(noObjectTransformStdoutResult.stdout);175expectType<[undefined, string, string]>(noObjectTransformStdoutResult.stdio);176177const trueTrueObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: true}, all: true});178expectType<unknown[]>(trueTrueObjectTransformResult.stdout);179expectType<unknown[]>(trueTrueObjectTransformResult.stderr);180expectType<unknown[]>(trueTrueObjectTransformResult.all);181expectType<[undefined, unknown[], unknown[]]>(trueTrueObjectTransformResult.stdio);182183const trueFalseObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: false}, all: true});184expectType<unknown[]>(trueFalseObjectTransformResult.stdout);185expectType<string>(trueFalseObjectTransformResult.stderr);186expectType<unknown[]>(trueFalseObjectTransformResult.all);187expectType<[undefined, unknown[], string]>(trueFalseObjectTransformResult.stdio);188189const falseTrueObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: false}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: true}, all: true});190expectType<string>(falseTrueObjectTransformResult.stdout);191expectType<unknown[]>(falseTrueObjectTransformResult.stderr);192expectType<unknown[]>(falseTrueObjectTransformResult.all);193expectType<[undefined, string, unknown[]]>(falseTrueObjectTransformResult.stdio);194195const falseFalseObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: false}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: false}, all: true});196expectType<string>(falseFalseObjectTransformResult.stdout);197expectType<string>(falseFalseObjectTransformResult.stderr);198expectType<string>(falseFalseObjectTransformResult.all);199expectType<[undefined, string, string]>(falseFalseObjectTransformResult.stdio);200201const objectTransformStdoutError = new Error('.') as ExecaError<{stdout: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: true}}>;202expectType<unknown[]>(objectTransformStdoutError.stdout);203expectType<[undefined, unknown[], string]>(objectTransformStdoutError.stdio);204205const objectTransformStderrError = new Error('.') as ExecaError<{stderr: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: true}}>;206expectType<unknown[]>(objectTransformStderrError.stderr);207expectType<[undefined, string, unknown[]]>(objectTransformStderrError.stdio);208209const objectTransformStdioError = new Error('.') as ExecaError<{stdio: ['pipe', 'pipe', {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: true}]}>;210expectType<unknown[]>(objectTransformStdioError.stderr);211expectType<[undefined, string, unknown[]]>(objectTransformStdioError.stdio);212213const falseObjectTransformStdoutError = new Error('.') as ExecaError<{stdout: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: false}}>;214expectType<string>(falseObjectTransformStdoutError.stdout);215expectType<[undefined, string, string]>(falseObjectTransformStdoutError.stdio);216217const falseObjectTransformStderrError = new Error('.') as ExecaError<{stderr: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: false}}>;218expectType<string>(falseObjectTransformStderrError.stderr);219expectType<[undefined, string, string]>(falseObjectTransformStderrError.stdio);220221const falseObjectTransformStdioError = new Error('.') as ExecaError<{stdio: ['pipe', 'pipe', {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: false}]}>;222expectType<string>(falseObjectTransformStdioError.stderr);223expectType<[undefined, string, string]>(falseObjectTransformStdioError.stdio);
added:test-d/pipe.test-d.ts+249 added
1import {createWriteStream} from 'node:fs';2import {expectType, expectNotType, expectError} from 'tsd';3import {execa, execaSync, $, type ExecaResult} from '../index.js';45const fileUrl = new URL('file:///test');6const stringArray = ['foo', 'bar'] as const;7const pipeOptions = {from: 'stderr', to: 'fd3', all: true} as const;89const execaPromise = execa('unicorns', {all: true});10const execaBufferPromise = execa('unicorns', {encoding: 'buffer', all: true});11const scriptPromise = $`unicorns`;1213const bufferResult = await execaBufferPromise;14type BufferExecaReturnValue = typeof bufferResult;15type EmptyExecaReturnValue = ExecaResult<{}>;16type ShortcutExecaReturnValue = ExecaResult<typeof pipeOptions>;1718expectNotType<BufferExecaReturnValue>(await execaPromise.pipe(execaPromise));19expectNotType<BufferExecaReturnValue>(await scriptPromise.pipe(execaPromise));20expectType<BufferExecaReturnValue>(await execaPromise.pipe(execaBufferPromise));21expectType<BufferExecaReturnValue>(await scriptPromise.pipe(execaBufferPromise));22expectType<BufferExecaReturnValue>(await execaPromise.pipe(execaBufferPromise, pipeOptions));23expectType<BufferExecaReturnValue>(await scriptPromise.pipe(execaBufferPromise, pipeOptions));2425expectType<EmptyExecaReturnValue>(await execaPromise.pipe`stdin`);26expectType<EmptyExecaReturnValue>(await scriptPromise.pipe`stdin`);27expectType<ShortcutExecaReturnValue>(await execaPromise.pipe(pipeOptions)`stdin`);28expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe(pipeOptions)`stdin`);2930expectType<EmptyExecaReturnValue>(await execaPromise.pipe('stdin'));31expectType<EmptyExecaReturnValue>(await scriptPromise.pipe('stdin'));32expectType<ShortcutExecaReturnValue>(await execaPromise.pipe('stdin', pipeOptions));33expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe('stdin', pipeOptions));3435expectType<BufferExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe(execaBufferPromise));36expectType<BufferExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe(execaBufferPromise));37expectType<BufferExecaReturnValue>(await execaPromise.pipe(execaPromise, pipeOptions).pipe(execaBufferPromise));38expectType<BufferExecaReturnValue>(await scriptPromise.pipe(execaPromise, pipeOptions).pipe(execaBufferPromise));39expectType<BufferExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe(execaBufferPromise, pipeOptions));40expectType<BufferExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe(execaBufferPromise, pipeOptions));4142expectType<EmptyExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe`stdin`);43expectType<EmptyExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe`stdin`);44expectType<EmptyExecaReturnValue>(await execaPromise.pipe(execaPromise, pipeOptions).pipe`stdin`);45expectType<EmptyExecaReturnValue>(await scriptPromise.pipe(execaPromise, pipeOptions).pipe`stdin`);46expectType<ShortcutExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe(pipeOptions)`stdin`);47expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe(pipeOptions)`stdin`);4849expectType<EmptyExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe('stdin'));50expectType<EmptyExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe('stdin'));51expectType<EmptyExecaReturnValue>(await execaPromise.pipe(execaPromise, pipeOptions).pipe('stdin'));52expectType<EmptyExecaReturnValue>(await scriptPromise.pipe(execaPromise, pipeOptions).pipe('stdin'));53expectType<ShortcutExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe('stdin', pipeOptions));54expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe('stdin', pipeOptions));5556expectType<BufferExecaReturnValue>(await execaPromise.pipe`stdin`.pipe(execaBufferPromise));57expectType<BufferExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe(execaBufferPromise));58expectType<BufferExecaReturnValue>(await execaPromise.pipe(pipeOptions)`stdin`.pipe(execaBufferPromise));59expectType<BufferExecaReturnValue>(await scriptPromise.pipe(pipeOptions)`stdin`.pipe(execaBufferPromise));60expectType<BufferExecaReturnValue>(await execaPromise.pipe`stdin`.pipe(execaBufferPromise, pipeOptions));61expectType<BufferExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe(execaBufferPromise, pipeOptions));6263expectType<EmptyExecaReturnValue>(await execaPromise.pipe`stdin`.pipe`stdin`);64expectType<EmptyExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe`stdin`);65expectType<EmptyExecaReturnValue>(await execaPromise.pipe(pipeOptions)`stdin`.pipe`stdin`);66expectType<EmptyExecaReturnValue>(await scriptPromise.pipe(pipeOptions)`stdin`.pipe`stdin`);67expectType<ShortcutExecaReturnValue>(await execaPromise.pipe`stdin`.pipe(pipeOptions)`stdin`);68expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe(pipeOptions)`stdin`);6970expectType<EmptyExecaReturnValue>(await execaPromise.pipe`stdin`.pipe('stdin'));71expectType<EmptyExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe('stdin'));72expectType<EmptyExecaReturnValue>(await execaPromise.pipe(pipeOptions)`stdin`.pipe('stdin'));73expectType<EmptyExecaReturnValue>(await scriptPromise.pipe(pipeOptions)`stdin`.pipe('stdin'));74expectType<ShortcutExecaReturnValue>(await execaPromise.pipe`stdin`.pipe('stdin', pipeOptions));75expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe('stdin', pipeOptions));7677expectType<BufferExecaReturnValue>(await execaPromise.pipe('pipe').pipe(execaBufferPromise));78expectType<BufferExecaReturnValue>(await scriptPromise.pipe('pipe').pipe(execaBufferPromise));79expectType<BufferExecaReturnValue>(await execaPromise.pipe('pipe', pipeOptions).pipe(execaBufferPromise));80expectType<BufferExecaReturnValue>(await scriptPromise.pipe('pipe', pipeOptions).pipe(execaBufferPromise));81expectType<BufferExecaReturnValue>(await execaPromise.pipe('pipe').pipe(execaBufferPromise, pipeOptions));82expectType<BufferExecaReturnValue>(await scriptPromise.pipe('pipe').pipe(execaBufferPromise, pipeOptions));8384expectType<EmptyExecaReturnValue>(await execaPromise.pipe('pipe').pipe`stdin`);85expectType<EmptyExecaReturnValue>(await scriptPromise.pipe('pipe').pipe`stdin`);86expectType<EmptyExecaReturnValue>(await execaPromise.pipe('pipe', pipeOptions).pipe`stdin`);87expectType<EmptyExecaReturnValue>(await scriptPromise.pipe('pipe', pipeOptions).pipe`stdin`);88expectType<ShortcutExecaReturnValue>(await execaPromise.pipe('pipe').pipe(pipeOptions)`stdin`);89expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe('pipe').pipe(pipeOptions)`stdin`);9091expectType<EmptyExecaReturnValue>(await execaPromise.pipe('pipe').pipe('stdin'));92expectType<EmptyExecaReturnValue>(await scriptPromise.pipe('pipe').pipe('stdin'));93expectType<EmptyExecaReturnValue>(await execaPromise.pipe('pipe', pipeOptions).pipe('stdin'));94expectType<EmptyExecaReturnValue>(await scriptPromise.pipe('pipe', pipeOptions).pipe('stdin'));95expectType<ShortcutExecaReturnValue>(await execaPromise.pipe('pipe').pipe('stdin', pipeOptions));96expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe('pipe').pipe('stdin', pipeOptions));9798await execaPromise.pipe(execaBufferPromise, {});99await scriptPromise.pipe(execaBufferPromise, {});100await execaPromise.pipe({})`stdin`;101await scriptPromise.pipe({})`stdin`;102await execaPromise.pipe('stdin', {});103await scriptPromise.pipe('stdin', {});104105expectError(execaPromise.pipe(execaBufferPromise).stdout);106expectError(scriptPromise.pipe(execaBufferPromise).stdout);107expectError(execaPromise.pipe`stdin`.stdout);108expectError(scriptPromise.pipe`stdin`.stdout);109expectError(execaPromise.pipe('stdin').stdout);110expectError(scriptPromise.pipe('stdin').stdout);111112expectError(await execaPromise.pipe({})({}));113expectError(await scriptPromise.pipe({})({}));114expectError(await execaPromise.pipe({})(execaPromise));115expectError(await scriptPromise.pipe({})(execaPromise));116expectError(await execaPromise.pipe({})('stdin'));117expectError(await scriptPromise.pipe({})('stdin'));118119expectError(execaPromise.pipe(createWriteStream('output.txt')));120expectError(scriptPromise.pipe(createWriteStream('output.txt')));121expectError(execaPromise.pipe(false));122expectError(scriptPromise.pipe(false));123124expectError(execaPromise.pipe(execaBufferPromise, 'stdout'));125expectError(scriptPromise.pipe(execaBufferPromise, 'stdout'));126expectError(execaPromise.pipe('stdout')`stdin`);127expectError(scriptPromise.pipe('stdout')`stdin`);128129await execaPromise.pipe(execaBufferPromise, {from: 'stdout'});130await scriptPromise.pipe(execaBufferPromise, {from: 'stdout'});131await execaPromise.pipe({from: 'stdout'})`stdin`;132await scriptPromise.pipe({from: 'stdout'})`stdin`;133await execaPromise.pipe('stdin', {from: 'stdout'});134await scriptPromise.pipe('stdin', {from: 'stdout'});135136await execaPromise.pipe(execaBufferPromise, {from: 'stderr'});137await scriptPromise.pipe(execaBufferPromise, {from: 'stderr'});138await execaPromise.pipe({from: 'stderr'})`stdin`;139await scriptPromise.pipe({from: 'stderr'})`stdin`;140await execaPromise.pipe('stdin', {from: 'stderr'});141await scriptPromise.pipe('stdin', {from: 'stderr'});142143await execaPromise.pipe(execaBufferPromise, {from: 'all'});144await scriptPromise.pipe(execaBufferPromise, {from: 'all'});145await execaPromise.pipe({from: 'all'})`stdin`;146await scriptPromise.pipe({from: 'all'})`stdin`;147await execaPromise.pipe('stdin', {from: 'all'});148await scriptPromise.pipe('stdin', {from: 'all'});149150await execaPromise.pipe(execaBufferPromise, {from: 'fd3'});151await scriptPromise.pipe(execaBufferPromise, {from: 'fd3'});152await execaPromise.pipe({from: 'fd3'})`stdin`;153await scriptPromise.pipe({from: 'fd3'})`stdin`;154await execaPromise.pipe('stdin', {from: 'fd3'});155await scriptPromise.pipe('stdin', {from: 'fd3'});156157expectError(execaPromise.pipe(execaBufferPromise, {from: 'stdin'}));158expectError(scriptPromise.pipe(execaBufferPromise, {from: 'stdin'}));159expectError(execaPromise.pipe({from: 'stdin'})`stdin`);160expectError(scriptPromise.pipe({from: 'stdin'})`stdin`);161expectError(execaPromise.pipe('stdin', {from: 'stdin'}));162expectError(scriptPromise.pipe('stdin', {from: 'stdin'}));163164await execaPromise.pipe(execaBufferPromise, {to: 'stdin'});165await scriptPromise.pipe(execaBufferPromise, {to: 'stdin'});166await execaPromise.pipe({to: 'stdin'})`stdin`;167await scriptPromise.pipe({to: 'stdin'})`stdin`;168await execaPromise.pipe('stdin', {to: 'stdin'});169await scriptPromise.pipe('stdin', {to: 'stdin'});170171await execaPromise.pipe(execaBufferPromise, {to: 'fd3'});172await scriptPromise.pipe(execaBufferPromise, {to: 'fd3'});173await execaPromise.pipe({to: 'fd3'})`stdin`;174await scriptPromise.pipe({to: 'fd3'})`stdin`;175await execaPromise.pipe('stdin', {to: 'fd3'});176await scriptPromise.pipe('stdin', {to: 'fd3'});177178expectError(execaPromise.pipe(execaBufferPromise, {to: 'stdout'}));179expectError(scriptPromise.pipe(execaBufferPromise, {to: 'stdout'}));180expectError(execaPromise.pipe({to: 'stdout'})`stdin`);181expectError(scriptPromise.pipe({to: 'stdout'})`stdin`);182expectError(execaPromise.pipe('stdin', {to: 'stdout'}));183expectError(scriptPromise.pipe('stdin', {to: 'stdout'}));184185await execaPromise.pipe(execaBufferPromise, {unpipeSignal: new AbortController().signal});186await scriptPromise.pipe(execaBufferPromise, {unpipeSignal: new AbortController().signal});187await execaPromise.pipe({unpipeSignal: new AbortController().signal})`stdin`;188await scriptPromise.pipe({unpipeSignal: new AbortController().signal})`stdin`;189await execaPromise.pipe('stdin', {unpipeSignal: new AbortController().signal});190await scriptPromise.pipe('stdin', {unpipeSignal: new AbortController().signal});191expectError(await execaPromise.pipe(execaBufferPromise, {unpipeSignal: true}));192expectError(await scriptPromise.pipe(execaBufferPromise, {unpipeSignal: true}));193expectError(await execaPromise.pipe({unpipeSignal: true})`stdin`);194expectError(await scriptPromise.pipe({unpipeSignal: true})`stdin`);195expectError(await execaPromise.pipe('stdin', {unpipeSignal: true}));196expectError(await scriptPromise.pipe('stdin', {unpipeSignal: true}));197198expectType<EmptyExecaReturnValue>(await execaPromise.pipe('stdin'));199await execaPromise.pipe('stdin');200await execaPromise.pipe(fileUrl);201await execaPromise.pipe('stdin', []);202await execaPromise.pipe('stdin', stringArray);203await execaPromise.pipe('stdin', stringArray, {});204await execaPromise.pipe('stdin', stringArray, {from: 'stderr', to: 'stdin', all: true});205await execaPromise.pipe('stdin', {from: 'stderr'});206await execaPromise.pipe('stdin', {to: 'stdin'});207await execaPromise.pipe('stdin', {all: true});208209expectError(await execaPromise.pipe(stringArray));210expectError(await execaPromise.pipe('stdin', 'foo'));211expectError(await execaPromise.pipe('stdin', [false]));212expectError(await execaPromise.pipe('stdin', [], false));213expectError(await execaPromise.pipe('stdin', {other: true}));214expectError(await execaPromise.pipe('stdin', [], {other: true}));215expectError(await execaPromise.pipe('stdin', {from: 'fd'}));216expectError(await execaPromise.pipe('stdin', [], {from: 'fd'}));217expectError(await execaPromise.pipe('stdin', {from: 'fdNotANumber'}));218expectError(await execaPromise.pipe('stdin', [], {from: 'fdNotANumber'}));219expectError(await execaPromise.pipe('stdin', {from: 'other'}));220expectError(await execaPromise.pipe('stdin', [], {from: 'other'}));221expectError(await execaPromise.pipe('stdin', {to: 'fd'}));222expectError(await execaPromise.pipe('stdin', [], {to: 'fd'}));223expectError(await execaPromise.pipe('stdin', {to: 'fdNotANumber'}));224expectError(await execaPromise.pipe('stdin', [], {to: 'fdNotANumber'}));225expectError(await execaPromise.pipe('stdin', {to: 'other'}));226expectError(await execaPromise.pipe('stdin', [], {to: 'other'}));227228const pipeResult = await execaPromise.pipe`stdin`;229expectType<string>(pipeResult.stdout);230const ignorePipeResult = await execaPromise.pipe({stdout: 'ignore'})`stdin`;231expectType<undefined>(ignorePipeResult.stdout);232233const scriptPipeResult = await scriptPromise.pipe`stdin`;234expectType<string>(scriptPipeResult.stdout);235const ignoreScriptPipeResult = await scriptPromise.pipe({stdout: 'ignore'})`stdin`;236expectType<undefined>(ignoreScriptPipeResult.stdout);237238const shortcutPipeResult = await execaPromise.pipe('stdin');239expectType<string>(shortcutPipeResult.stdout);240const ignoreShortcutPipeResult = await execaPromise.pipe('stdin', {stdout: 'ignore'});241expectType<undefined>(ignoreShortcutPipeResult.stdout);242243const scriptShortcutPipeResult = await scriptPromise.pipe('stdin');244expectType<string>(scriptShortcutPipeResult.stdout);245const ignoreShortcutScriptPipeResult = await scriptPromise.pipe('stdin', {stdout: 'ignore'});246expectType<undefined>(ignoreShortcutScriptPipeResult.stdout);247248const unicornsResult = execaSync('unicorns');249expectError(unicornsResult.pipe);
added:types/arguments/encoding-option.d.ts+19 added
1type DefaultEncodingOption = 'utf8';2type TextEncodingOption =3 | DefaultEncodingOption4 | 'utf16le';56export type BufferEncodingOption = 'buffer';7export type BinaryEncodingOption =8 | BufferEncodingOption9 | 'hex'10 | 'base64'11 | 'base64url'12 | 'latin1'13 | 'ascii';1415// `options.encoding`16export type EncodingOption =17 | TextEncodingOption18 | BinaryEncodingOption19 | undefined;
added:types/arguments/fd-options.d.ts+8 added
1type FileDescriptorOption = `fd${number}`;23// `from` option of `subprocess.readable|duplex|iterable|pipe()`4// Also used by fd-specific options5export type FromOption = 'stdout' | 'stderr' | 'all' | FileDescriptorOption;67// `to` option of `subprocess.writable|duplex|pipe()`8export type ToOption = 'stdin' | FileDescriptorOption;
added:types/arguments/options.d.ts+430 added
1import type {Readable} from 'node:stream';2import type {Unless} from '../utils';3import type {StdinOptionCommon, StdoutStderrOptionCommon, StdioOptionsProperty} from '../stdio/type';4import type {FdGenericOption} from './specific';5import type {EncodingOption} from './encoding-option';67export type CommonOptions<IsSync extends boolean = boolean> = {8 /**9 Prefer locally installed binaries when looking for a binary to execute.1011 If you `$ npm install foo`, you can then `execa('foo')`.1213 @default `true` with `$`, `false` otherwise14 */15 readonly preferLocal?: boolean;1617 /**18 Preferred path to find locally installed binaries in (use with `preferLocal`).1920 @default process.cwd()21 */22 readonly localDir?: string | URL;2324 /**25 If `true`, runs with Node.js. The first argument must be a Node.js file.2627 @default `true` with `execaNode()`, `false` otherwise28 */29 readonly node?: boolean;3031 /**32 Path to the Node.js executable.3334 For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version.3536 Requires the `node` option to be `true`.3738 @default [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath) (current Node.js executable)39 */40 readonly nodePath?: string | URL;4142 /**43 List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.4445 Requires the `node` option to be `true`.4647 @default [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv) (current Node.js CLI options)48 */49 readonly nodeOptions?: readonly string[];5051 /**52 Write some input to the subprocess' `stdin`.5354 See also the `inputFile` and `stdin` options.55 */56 readonly input?: string | Uint8Array | Readable;5758 /**59 Use a file as input to the subprocess' `stdin`.6061 See also the `input` and `stdin` options.62 */63 readonly inputFile?: string | URL;6465 /**66 How to setup the subprocess' standard input. This can be:67 - `'pipe'`: Sets `subprocess.stdin` stream.68 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.69 - `'ignore'`: Do not use `stdin`.70 - `'inherit'`: Re-use the current process' `stdin`.71 - an integer: Re-use a specific file descriptor from the current process.72 - a Node.js `Readable` stream.73 - `{ file: 'path' }` object.74 - a file URL.75 - a web [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).76 - an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) or an [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)77 - an `Uint8Array`.7879 This can be an [array of values](https://github.com/sindresorhus/execa#redirect-stdinstdoutstderr-to-multiple-destinations) such as `['inherit', 'pipe']` or `[filePath, 'pipe']`.8081 This can also be a generator function or a [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) or a [web `TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) to transform the input. [Learn more.](https://github.com/sindresorhus/execa/tree/main/docs/transform.md)8283 @default `inherit` with `$`, `pipe` otherwise84 */85 readonly stdin?: StdinOptionCommon<IsSync>;8687 /**88 How to setup the subprocess' standard output. This can be:89 - `'pipe'`: Sets `result.stdout` (as a string or `Uint8Array`) and `subprocess.stdout` (as a stream).90 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.91 - `'ignore'`: Do not use `stdout`.92 - `'inherit'`: Re-use the current process' `stdout`.93 - an integer: Re-use a specific file descriptor from the current process.94 - a Node.js `Writable` stream.95 - `{ file: 'path' }` object.96 - a file URL.97 - a web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).9899 This can be an [array of values](https://github.com/sindresorhus/execa#redirect-stdinstdoutstderr-to-multiple-destinations) such as `['inherit', 'pipe']` or `[filePath, 'pipe']`.100101 This can also be a generator function or a [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) or a [web `TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) to transform the output. [Learn more.](https://github.com/sindresorhus/execa/tree/main/docs/transform.md)102103 @default 'pipe'104 */105 readonly stdout?: StdoutStderrOptionCommon<IsSync>;106107 /**108 How to setup the subprocess' standard error. This can be:109 - `'pipe'`: Sets `result.stderr` (as a string or `Uint8Array`) and `subprocess.stderr` (as a stream).110 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.111 - `'ignore'`: Do not use `stderr`.112 - `'inherit'`: Re-use the current process' `stderr`.113 - an integer: Re-use a specific file descriptor from the current process.114 - a Node.js `Writable` stream.115 - `{ file: 'path' }` object.116 - a file URL.117 - a web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).118119 This can be an [array of values](https://github.com/sindresorhus/execa#redirect-stdinstdoutstderr-to-multiple-destinations) such as `['inherit', 'pipe']` or `[filePath, 'pipe']`.120121 This can also be a generator function or a [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) or a [web `TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) to transform the output. [Learn more.](https://github.com/sindresorhus/execa/tree/main/docs/transform.md)122123 @default 'pipe'124 */125 readonly stderr?: StdoutStderrOptionCommon<IsSync>;126127 /**128 Like the `stdin`, `stdout` and `stderr` options but for all file descriptors at once. For example, `{stdio: ['ignore', 'pipe', 'pipe']}` is the same as `{stdin: 'ignore', stdout: 'pipe', stderr: 'pipe'}`.129130 A single string can be used as a shortcut. For example, `{stdio: 'pipe'}` is the same as `{stdin: 'pipe', stdout: 'pipe', stderr: 'pipe'}`.131132 The array can have more than 3 items, to create additional file descriptors beyond `stdin`/`stdout`/`stderr`. For example, `{stdio: ['pipe', 'pipe', 'pipe', 'pipe']}` sets a fourth file descriptor.133134 @default 'pipe'135 */136 readonly stdio?: StdioOptionsProperty<IsSync>;137138 /**139 Set `result.stdout`, `result.stderr`, `result.all` and `result.stdio` as arrays of strings, splitting the subprocess' output into lines.140141 This cannot be used if the `encoding` option is binary.142143 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.144145 @default false146 */147 readonly lines?: FdGenericOption<boolean>;148149 /**150 Setting this to `false` resolves the promise with the error instead of rejecting it.151152 @default true153 */154 readonly reject?: boolean;155156 /**157 Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.158159 If the `lines` option is true, this applies to each output line instead.160161 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.162163 @default true164 */165 readonly stripFinalNewline?: FdGenericOption<boolean>;166167 /**168 If `true`, the subprocess uses both the `env` option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).169 If `false`, only the `env` option is used, not `process.env`.170171 @default true172 */173 readonly extendEnv?: boolean;174175 /**176 Current working directory of the subprocess.177178 This is also used to resolve the `nodePath` option when it is a relative path.179180 @default process.cwd()181 */182 readonly cwd?: string | URL;183184 /**185 Environment key-value pairs.186187 Unless the `extendEnv` option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).188189 @default process.env190 */191 readonly env?: NodeJS.ProcessEnv;192193 /**194 Explicitly set the value of `argv[0]` sent to the subprocess. This will be set to `command` or `file` if not specified.195 */196 readonly argv0?: string;197198 /**199 Sets the user identity of the subprocess.200 */201 readonly uid?: number;202203 /**204 Sets the group identity of the subprocess.205 */206 readonly gid?: number;207208 /**209 If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.210211 We recommend against using this option since it is:212 - not cross-platform, encouraging shell-specific syntax.213 - slower, because of the additional shell interpretation.214 - unsafe, potentially allowing command injection.215216 @default false217 */218 readonly shell?: boolean | string | URL;219220 /**221 If the subprocess outputs text, specifies its character encoding, either `'utf8'` or `'utf16le'`.222223 If it outputs binary data instead, this should be either:224 - `'buffer'`: returns the binary output as an `Uint8Array`.225 - `'hex'`, `'base64'`, `'base64url'`, [`'latin1'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings) or [`'ascii'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings): encodes the binary output as a string.226227 The output is available with `result.stdout`, `result.stderr` and `result.stdio`.228229 @default 'utf8'230 */231 readonly encoding?: EncodingOption;232233 /**234 If `timeout` is greater than `0`, the subprocess will be terminated if it runs for longer than that amount of milliseconds.235236 @default 0237 */238 readonly timeout?: number;239240 /**241 Largest amount of data allowed on `stdout`, `stderr` and `stdio`.242243 When this threshold is hit, the subprocess fails and `error.isMaxBuffer` becomes `true`.244245 This is measured:246 - By default: in [characters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length).247 - If the `encoding` option is `'buffer'`: in bytes.248 - If the `lines` option is `true`: in lines.249 - If a transform in object mode is used: in objects.250251 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.252253 @default 100_000_000254 */255 readonly maxBuffer?: FdGenericOption<number>;256257 /**258 Signal used to terminate the subprocess when:259 - using the `cancelSignal`, `timeout`, `maxBuffer` or `cleanup` option260 - calling `subprocess.kill()` with no arguments261262 This can be either a name (like `"SIGTERM"`) or a number (like `9`).263264 @default 'SIGTERM'265 */266 readonly killSignal?: string | number;267268 /**269 If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL).270271 The grace period is 5 seconds by default. This feature can be disabled with `false`.272273 This works when the subprocess is terminated by either:274 - the `cancelSignal`, `timeout`, `maxBuffer` or `cleanup` option275 - calling `subprocess.kill()` with no arguments276277 This does not work when the subprocess is terminated by either:278 - calling `subprocess.kill()` with an argument279 - calling [`process.kill(subprocess.pid)`](https://nodejs.org/api/process.html#processkillpid-signal)280 - sending a termination signal from another process281282 Also, this does not work on Windows, because Windows [doesn't support signals](https://nodejs.org/api/process.html#process_signal_events): `SIGKILL` and `SIGTERM` both terminate the subprocess immediately. Other packages (such as [`taskkill`](https://github.com/sindresorhus/taskkill)) can be used to achieve fail-safe termination on Windows.283284 @default 5000285 */286 forceKillAfterDelay?: Unless<IsSync, number | false>;287288 /**289 If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.290291 @default false292 */293 readonly windowsVerbatimArguments?: boolean;294295 /**296 On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.297298 @default true299 */300 readonly windowsHide?: boolean;301302 /**303 If `verbose` is `'short'` or `'full'`, prints each command on `stderr` before executing it. When the command completes, prints its duration and (if it failed) its error.304305 If `verbose` is `'full'`, the command's `stdout` and `stderr` are printed too, unless either:306 - the `stdout`/`stderr` option is `ignore` or `inherit`.307 - the `stdout`/`stderr` is redirected to [a stream](https://nodejs.org/api/stream.html#readablepipedestination-options), a file, a file descriptor, or another subprocess.308 - the `encoding` option is binary.309310 This can also be set to `'full'` by setting the `NODE_DEBUG=execa` environment variable in the current process.311312 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.313314 @default 'none'315 */316 readonly verbose?: FdGenericOption<'none' | 'short' | 'full'>;317318 /**319 Kill the subprocess when the current process exits unless either:320 - the subprocess is `detached`.321 - the current process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit.322323 @default true324 */325 readonly cleanup?: Unless<IsSync, boolean>;326327 /**328 Whether to return the subprocess' output using the `result.stdout`, `result.stderr`, `result.all` and `result.stdio` properties.329330 On failure, the `error.stdout`, `error.stderr`, `error.all` and `error.stdio` properties are used instead.331332 When `buffer` is `false`, the output can still be read using the `subprocess.stdout`, `subprocess.stderr`, `subprocess.stdio` and `subprocess.all` streams. If the output is read, this should be done right away to avoid missing any data.333334 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.335336 @default true337 */338 readonly buffer?: FdGenericOption<boolean>;339340 /**341 Add a `subprocess.all` stream and a `result.all` property. They contain the combined/[interleaved](#ensuring-all-output-is-interleaved) output of the subprocess' `stdout` and `stderr`.342343 @default false344 */345 readonly all?: boolean;346347 /**348 Enables exchanging messages with the subprocess using `subprocess.send(message)` and `subprocess.on('message', (message) => {})`.349350 @default `true` if the `node` option is enabled, `false` otherwise351 */352 readonly ipc?: Unless<IsSync, boolean>;353354 /**355 Specify the kind of serialization used for sending messages between subprocesses when using the `ipc` option:356 - `json`: Uses `JSON.stringify()` and `JSON.parse()`.357 - `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)358359 [More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)360361 @default 'advanced'362 */363 readonly serialization?: Unless<IsSync, 'json' | 'advanced'>;364365 /**366 Prepare subprocess to run independently of the current process. Specific behavior depends on the platform.367368 @default false369 */370 readonly detached?: Unless<IsSync, boolean>;371372 /**373 You can abort the subprocess using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).374375 When `AbortController.abort()` is called, `result.isCanceled` becomes `true`.376377 @example378 ```379 import {execa} from 'execa';380381 const abortController = new AbortController();382 const subprocess = execa('node', [], {cancelSignal: abortController.signal});383384 setTimeout(() => {385 abortController.abort();386 }, 1000);387388 try {389 await subprocess;390 } catch (error) {391 console.log(error.isTerminated); // true392 console.log(error.isCanceled); // true393 }394 ```395 */396 readonly cancelSignal?: Unless<IsSync, AbortSignal>;397};398399/**400Subprocess options.401402Some options are related to the subprocess output: `verbose`, `lines`, `stripFinalNewline`, `buffer`, `maxBuffer`. By default, those options apply to all file descriptors (`stdout`, `stderr`, etc.). A plain object can be passed instead to apply them to only `stdout`, `stderr`, `fd3`, etc.403404@example405406```407await execa('./run.js', {verbose: 'full'}) // Same value for stdout and stderr408await execa('./run.js', {verbose: {stdout: 'none', stderr: 'full'}}) // Different values409```410*/411export type Options = CommonOptions<false>;412413/**414Subprocess options, with synchronous methods.415416Some options are related to the subprocess output: `verbose`, `lines`, `stripFinalNewline`, `buffer`, `maxBuffer`. By default, those options apply to all file descriptors (`stdout`, `stderr`, etc.). A plain object can be passed instead to apply them to only `stdout`, `stderr`, `fd3`, etc.417418@example419420```421execaSync('./run.js', {verbose: 'full'}) // Same value for stdout and stderr422execaSync('./run.js', {verbose: {stdout: 'none', stderr: 'full'}}) // Different values423```424*/425export type SyncOptions = CommonOptions<true>;426427export type StricterOptions<428 WideOptions extends CommonOptions,429 StrictOptions extends CommonOptions,430> = WideOptions extends StrictOptions ? WideOptions : StrictOptions;
added:types/arguments/specific.d.ts+48 added
1import type {FromOption} from './fd-options';23// Options which can be fd-specific like `{verbose: {stdout: 'none', stderr: 'full'}}`4export type FdGenericOption<OptionType = unknown> = OptionType | GenericOptionObject<OptionType>;56type GenericOptionObject<OptionType = unknown> = {7 readonly [FdName in FromOption]?: OptionType8};910// Retrieve fd-specific option's value11export type FdSpecificOption<12 GenericOption extends FdGenericOption,13 FdNumber extends string,14> = GenericOption extends GenericOptionObject15 ? FdSpecificObjectOption<GenericOption, FdNumber>16 : GenericOption;1718type FdSpecificObjectOption<19 GenericOption extends GenericOptionObject,20 FdNumber extends string,21> = keyof GenericOption extends FromOption22 ? FdNumberToFromOption<FdNumber, keyof GenericOption> extends never23 ? undefined24 : GenericOption[FdNumberToFromOption<FdNumber, keyof GenericOption>]25 : GenericOption;2627type FdNumberToFromOption<28 FdNumber extends string,29 FromOptions extends FromOption,30> = FdNumber extends '1'31 ? 'stdout' extends FromOptions32 ? 'stdout'33 : 'fd1' extends FromOptions34 ? 'fd1'35 : 'all' extends FromOptions36 ? 'all'37 : never38 : FdNumber extends '2'39 ? 'stderr' extends FromOptions40 ? 'stderr'41 : 'fd2' extends FromOptions42 ? 'fd2'43 : 'all' extends FromOptions44 ? 'all'45 : never46 : `fd${FdNumber}` extends FromOptions47 ? `fd${FdNumber}`48 : never;
added:types/methods/command.d.ts+83 added
1import type {Options, SyncOptions} from '../arguments/options';2import type {ExecaSyncResult} from '../return/result';3import type {ExecaSubprocess} from '../subprocess/subprocess';4import type {SimpleTemplateString} from './template';56type ExecaCommand<OptionsType extends Options> = {7 <NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaCommand<OptionsType & NewOptionsType>;89 (...templateString: SimpleTemplateString): ExecaSubprocess<OptionsType>;1011 <NewOptionsType extends Options = {}>(12 command: string,13 options?: NewOptionsType,14 ): ExecaSubprocess<OptionsType & NewOptionsType>;15};1617/**18`execa` with the template string syntax allows the `file` or the `arguments` to be user-defined (by injecting them with `${}`). However, if _both_ the `file` and the `arguments` are user-defined, _and_ those are supplied as a single string, then `execaCommand(command)` must be used instead.1920This is only intended for very specific cases, such as a REPL. This should be avoided otherwise.2122Just like `execa()`, this can bind options. It can also be run synchronously using `execaCommandSync()`.2324Arguments are automatically escaped. They can contain any character, but spaces must be escaped with a backslash like `execaCommand('echo has\\ space')`.2526@param command - The program/script to execute and its arguments.27@returns An `ExecaSubprocess` that is both:28- a `Promise` resolving or rejecting with a subprocess `result`.29- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.30@throws A subprocess `result` error3132@example33```34import {execaCommand} from 'execa';3536const {stdout} = await execaCommand('echo unicorns');37console.log(stdout);38//=> 'unicorns'39```40*/41export declare const execaCommand: ExecaCommand<{}>;4243type ExecaCommandSync<OptionsType extends SyncOptions> = {44 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaCommandSync<OptionsType & NewOptionsType>;4546 (...templateString: SimpleTemplateString): ExecaSyncResult<OptionsType>;4748 <NewOptionsType extends SyncOptions = {}>(49 command: string,50 options?: NewOptionsType,51 ): ExecaSyncResult<OptionsType & NewOptionsType>;52};5354/**55Same as `execaCommand()` but synchronous.5657Returns or throws a subprocess `result`. The `subprocess` is not returned: its methods and properties are not available.5859The following features cannot be used:60- Streams: `subprocess.stdin`, `subprocess.stdout`, `subprocess.stderr`, `subprocess.readable()`, `subprocess.writable()`, `subprocess.duplex()`.61- The `stdin`, `stdout`, `stderr` and `stdio` options cannot be `'overlapped'`, an async iterable, an async transform, a `Duplex`, nor a web stream. Node.js streams can be passed but only if either they [have a file descriptor](#redirect-a-nodejs-stream-fromto-stdinstdoutstderr), or the `input` option is used.62- Signal termination: `subprocess.kill()`, `subprocess.pid`, `cleanup` option, `cancelSignal` option, `forceKillAfterDelay` option.63- Piping multiple processes: `subprocess.pipe()`.64- `subprocess.iterable()`.65- `ipc` and `serialization` options.66- `result.all` is not interleaved.67- `detached` option.68- The `maxBuffer` option is always measured in bytes, not in characters, lines nor objects. Also, it ignores transforms and the `encoding` option.6970@param command - The program/script to execute and its arguments.71@returns A subprocess `result` object72@throws A subprocess `result` error7374@example75```76import {execaCommandSync} from 'execa';7778const {stdout} = execaCommandSync('echo unicorns');79console.log(stdout);80//=> 'unicorns'81```82*/83export declare const execaCommandSync: ExecaCommandSync<{}>;
added:types/methods/main-async.d.ts+202 added
1import type {Options} from '../arguments/options';2import type {ExecaSubprocess} from '../subprocess/subprocess';3import type {TemplateString} from './template';45type Execa<OptionsType extends Options> = {6 <NewOptionsType extends Options = {}>(options: NewOptionsType): Execa<OptionsType & NewOptionsType>;78 (...templateString: TemplateString): ExecaSubprocess<OptionsType>;910 <NewOptionsType extends Options = {}>(11 file: string | URL,12 arguments?: readonly string[],13 options?: NewOptionsType,14 ): ExecaSubprocess<OptionsType & NewOptionsType>;1516 <NewOptionsType extends Options = {}>(17 file: string | URL,18 options?: NewOptionsType,19 ): ExecaSubprocess<OptionsType & NewOptionsType>;20};2122/**23Executes a command using `file ...arguments`.2425Arguments are automatically escaped. They can contain any character, including spaces, tabs and newlines.2627When `command` is a template string, it includes both the `file` and its `arguments`.2829The `command` template string can inject any `${value}` with the following types: string, number, `subprocess` or an array of those types. For example: `` execa`echo one ${'two'} ${3} ${['four', 'five']}` ``. For `${subprocess}`, the subprocess's `stdout` is used.3031When `command` is a template string, arguments can contain any character, but spaces, tabs and newlines must use `${}` like `` execa`echo ${'has space'}` ``.3233The `command` template string can use multiple lines and indentation.3435`execa(options)` can be used to return a new instance of Execa but with different default `options`. Consecutive calls are merged to previous ones. This allows setting global options or sharing options between multiple commands.3637@param file - The program/script to execute, as a string or file URL38@param arguments - Arguments to pass to `file` on execution.39@returns An `ExecaSubprocess` that is both:40- a `Promise` resolving or rejecting with a subprocess `result`.41- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.42@throws A subprocess `result` error4344@example <caption>Promise interface</caption>45```46import {execa} from 'execa';4748const {stdout} = await execa('echo', ['unicorns']);49console.log(stdout);50//=> 'unicorns'51```5253@example <caption>Global/shared options</caption>54```55import {execa as execa_} from 'execa';5657const execa = execa_({verbose: 'full'});5859await execa('echo', ['unicorns']);60//=> 'unicorns'61```6263@example <caption>Template string interface</caption>6465```66import {execa} from 'execa';6768const arg = 'unicorns';69const {stdout} = await execa`echo ${arg} & rainbows!`;70console.log(stdout);71//=> 'unicorns & rainbows!'72```7374@example <caption>Template string multiple arguments</caption>7576```77import {execa} from 'execa';7879const args = ['unicorns', '&', 'rainbows!'];80const {stdout} = await execa`echo ${args}`;81console.log(stdout);82//=> 'unicorns & rainbows!'83```8485@example <caption>Template string with options</caption>8687```88import {execa} from 'execa';8990await execa({verbose: 'full'})`echo unicorns`;91//=> 'unicorns'92```9394@example <caption>Redirect output to a file</caption>95```96import {execa} from 'execa';9798// Similar to `echo unicorns > stdout.txt` in Bash99await execa('echo', ['unicorns'], {stdout: {file: 'stdout.txt'}});100101// Similar to `echo unicorns 2> stdout.txt` in Bash102await execa('echo', ['unicorns'], {stderr: {file: 'stderr.txt'}});103104// Similar to `echo unicorns &> stdout.txt` in Bash105await execa('echo', ['unicorns'], {stdout: {file: 'all.txt'}, stderr: {file: 'all.txt'}});106```107108@example <caption>Redirect input from a file</caption>109```110import {execa} from 'execa';111112// Similar to `cat < stdin.txt` in Bash113const {stdout} = await execa('cat', {inputFile: 'stdin.txt'});114console.log(stdout);115//=> 'unicorns'116```117118@example <caption>Save and pipe output from a subprocess</caption>119```120import {execa} from 'execa';121122const {stdout} = await execa('echo', ['unicorns'], {stdout: ['pipe', 'inherit']});123// Prints `unicorns`124console.log(stdout);125// Also returns 'unicorns'126```127128@example <caption>Pipe multiple subprocesses</caption>129```130import {execa} from 'execa';131132// Similar to `echo unicorns | cat` in Bash133const {stdout} = await execa('echo', ['unicorns']).pipe(execa('cat'));134console.log(stdout);135//=> 'unicorns'136```137138@example <caption>Pipe with template strings</caption>139```140import {execa} from 'execa';141142await execa`npm run build`143 .pipe`sort`144 .pipe`head -n2`;145```146147@example <caption>Iterate over output lines</caption>148```149import {execa} from 'execa';150151for await (const line of execa`npm run build`)) {152 if (line.includes('ERROR')) {153 console.log(line);154 }155}156```157158@example <caption>Handling errors</caption>159```160import {execa} from 'execa';161162// Catching an error163try {164 await execa('unknown', ['command']);165} catch (error) {166 console.log(error);167 /*168 ExecaError: Command failed with ENOENT: unknown command169 spawn unknown ENOENT170 at ...171 at ... {172 shortMessage: 'Command failed with ENOENT: unknown command\nspawn unknown ENOENT',173 originalMessage: 'spawn unknown ENOENT',174 command: 'unknown command',175 escapedCommand: 'unknown command',176 cwd: '/path/to/cwd',177 durationMs: 28.217566,178 failed: true,179 timedOut: false,180 isCanceled: false,181 isTerminated: false,182 isMaxBuffer: false,183 code: 'ENOENT',184 stdout: '',185 stderr: '',186 stdio: [undefined, '', ''],187 pipedFrom: []188 [cause]: Error: spawn unknown ENOENT189 at ...190 at ... {191 errno: -2,192 code: 'ENOENT',193 syscall: 'spawn unknown',194 path: 'unknown',195 spawnargs: [ 'command' ]196 }197 }198 \*\/199}200```201*/202export declare const execa: Execa<{}>;
added:types/methods/main-sync.d.ts+96 added
1import type {SyncOptions} from '../arguments/options';2import type {ExecaSyncResult} from '../return/result';3import type {TemplateString} from './template';45type ExecaSync<OptionsType extends SyncOptions> = {6 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaSync<OptionsType & NewOptionsType>;78 (...templateString: TemplateString): ExecaSyncResult<OptionsType>;910 <NewOptionsType extends SyncOptions = {}>(11 file: string | URL,12 arguments?: readonly string[],13 options?: NewOptionsType,14 ): ExecaSyncResult<OptionsType & NewOptionsType>;1516 <NewOptionsType extends SyncOptions = {}>(17 file: string | URL,18 options?: NewOptionsType,19 ): ExecaSyncResult<OptionsType & NewOptionsType>;20};2122/**23Same as `execa()` but synchronous.2425Returns or throws a subprocess `result`. The `subprocess` is not returned: its methods and properties are not available.2627The following features cannot be used:28- Streams: `subprocess.stdin`, `subprocess.stdout`, `subprocess.stderr`, `subprocess.readable()`, `subprocess.writable()`, `subprocess.duplex()`.29- The `stdin`, `stdout`, `stderr` and `stdio` options cannot be `'overlapped'`, an async iterable, an async transform, a `Duplex`, nor a web stream. Node.js streams can be passed but only if either they [have a file descriptor](#redirect-a-nodejs-stream-fromto-stdinstdoutstderr), or the `input` option is used.30- Signal termination: `subprocess.kill()`, `subprocess.pid`, `cleanup` option, `cancelSignal` option, `forceKillAfterDelay` option.31- Piping multiple processes: `subprocess.pipe()`.32- `subprocess.iterable()`.33- `ipc` and `serialization` options.34- `result.all` is not interleaved.35- `detached` option.36- The `maxBuffer` option is always measured in bytes, not in characters, lines nor objects. Also, it ignores transforms and the `encoding` option.3738@param file - The program/script to execute, as a string or file URL39@param arguments - Arguments to pass to `file` on execution.40@returns A subprocess `result` object41@throws A subprocess `result` error4243@example <caption>Promise interface</caption>44```45import {execa} from 'execa';4647const {stdout} = execaSync('echo', ['unicorns']);48console.log(stdout);49//=> 'unicorns'50```5152@example <caption>Redirect input from a file</caption>53```54import {execa} from 'execa';5556// Similar to `cat < stdin.txt` in Bash57const {stdout} = execaSync('cat', {inputFile: 'stdin.txt'});58console.log(stdout);59//=> 'unicorns'60```6162@example <caption>Handling errors</caption>63```64import {execa} from 'execa';6566// Catching an error67try {68 execaSync('unknown', ['command']);69} catch (error) {70 console.log(error);71 /*72 {73 message: 'Command failed with ENOENT: unknown command\nspawnSync unknown ENOENT',74 errno: -2,75 code: 'ENOENT',76 syscall: 'spawnSync unknown',77 path: 'unknown',78 spawnargs: ['command'],79 shortMessage: 'Command failed with ENOENT: unknown command\nspawnSync unknown ENOENT',80 originalMessage: 'spawnSync unknown ENOENT',81 command: 'unknown command',82 escapedCommand: 'unknown command',83 cwd: '/path/to/cwd',84 failed: true,85 timedOut: false,86 isCanceled: false,87 isTerminated: false,88 isMaxBuffer: false,89 stdio: [],90 pipedFrom: []91 }92 \*\/93}94```95*/96export declare const execaSync: ExecaSync<{}>;
added:types/methods/node.d.ts+44 added
1import type {Options} from '../arguments/options';2import type {ExecaSubprocess} from '../subprocess/subprocess';3import type {TemplateString} from './template';45type ExecaNode<OptionsType extends Options> = {6 <NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaNode<OptionsType & NewOptionsType>;78 (...templateString: TemplateString): ExecaSubprocess<OptionsType>;910 <NewOptionsType extends Options = {}>(11 scriptPath: string | URL,12 arguments?: readonly string[],13 options?: NewOptionsType,14 ): ExecaSubprocess<OptionsType & NewOptionsType>;1516 <NewOptionsType extends Options = {}>(17 scriptPath: string | URL,18 options?: NewOptionsType,19 ): ExecaSubprocess<OptionsType & NewOptionsType>;20};2122/**23Same as `execa()` but using the `node: true` option.24Executes a Node.js file using `node scriptPath ...arguments`.2526Just like `execa()`, this can use the template string syntax or bind options.2728This is the preferred method when executing Node.js files.2930@param scriptPath - Node.js script to execute, as a string or file URL31@param arguments - Arguments to pass to `scriptPath` on execution.32@returns An `ExecaSubprocess` that is both:33- a `Promise` resolving or rejecting with a subprocess `result`.34- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.35@throws A subprocess `result` error3637@example38```39import {execaNode} from 'execa';4041await execaNode('scriptPath', ['argument']);42```43*/44export declare const execaNode: ExecaNode<{}>;
added:types/methods/script.d.ts+80 added
1import type {CommonOptions, Options, SyncOptions, StricterOptions} from '../arguments/options';2import type {ExecaSyncResult} from '../return/result';3import type {ExecaSubprocess} from '../subprocess/subprocess';4import type {TemplateString} from './template';56type ExecaScriptCommon<OptionsType extends CommonOptions> = {7 <NewOptionsType extends CommonOptions = {}>(options: NewOptionsType): ExecaScript<OptionsType & NewOptionsType>;89 (...templateString: TemplateString): ExecaSubprocess<StricterOptions<OptionsType, Options>>;1011 <NewOptionsType extends Options = {}>(12 file: string | URL,13 arguments?: readonly string[],14 options?: NewOptionsType,15 ): ExecaSubprocess<OptionsType & NewOptionsType>;1617 <NewOptionsType extends Options = {}>(18 file: string | URL,19 options?: NewOptionsType,20 ): ExecaSubprocess<OptionsType & NewOptionsType>;21};2223type ExecaScriptSync<OptionsType extends CommonOptions> = {24 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaScriptSync<OptionsType & NewOptionsType>;2526 (...templateString: TemplateString): ExecaSyncResult<StricterOptions<OptionsType, SyncOptions>>;2728 <NewOptionsType extends SyncOptions = {}>(29 file: string | URL,30 arguments?: readonly string[],31 options?: NewOptionsType,32 ): ExecaSyncResult<OptionsType & NewOptionsType>;3334 <NewOptionsType extends SyncOptions = {}>(35 file: string | URL,36 options?: NewOptionsType,37 ): ExecaSyncResult<OptionsType & NewOptionsType>;38};3940type ExecaScript<OptionsType extends CommonOptions> = {41 sync: ExecaScriptSync<OptionsType>;42 s: ExecaScriptSync<OptionsType>;43} & ExecaScriptCommon<OptionsType>;4445/**46Same as `execa()` but using the `stdin: 'inherit'` and `preferLocal: true` options.4748Just like `execa()`, this can use the template string syntax or bind options. It can also be run synchronously using `$.sync()` or `$.s()`.4950This is the preferred method when executing multiple commands in a script file.5152@returns An `ExecaSubprocess` that is both:53 - a `Promise` resolving or rejecting with a subprocess `result`.54 - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.55@throws A subprocess `result` error5657@example <caption>Basic</caption>58```59import {$} from 'execa';6061const branch = await $`git branch --show-current`;62await $`dep deploy --branch=${branch}`;63```6465@example <caption>Verbose mode</caption>66```67> node file.js68unicorns69rainbows7071> NODE_DEBUG=execa node file.js72[19:49:00.360] [0] $ echo unicorns73unicorns74[19:49:00.383] [0] √ (done in 23ms)75[19:49:00.383] [1] $ echo rainbows76rainbows77[19:49:00.404] [1] √ (done in 21ms)78```79*/80export const $: ExecaScript<{}>;
added:types/methods/template.d.ts+14 added
1import type {CommonResultInstance} from '../return/result';23// Values allowed inside `...${...}...` template syntax4export type TemplateExpression =5 | string6 | number7 | CommonResultInstance8 | ReadonlyArray<string | number | CommonResultInstance>;910// `...${...}...` template syntax11export type TemplateString = readonly [TemplateStringsArray, ...readonly TemplateExpression[]];1213// `...${...}...` template syntax, but only allowing a single argument, for `execaCommand()`14export type SimpleTemplateString = readonly [TemplateStringsArray, string?];
added:types/return/final-error.d.ts+52 added
1import type {CommonOptions, Options, SyncOptions} from '../arguments/options';2// eslint-disable-next-line import/extensions3import {CommonResult} from './result';45declare abstract class CommonError<6 IsSync extends boolean = boolean,7 OptionsType extends CommonOptions = CommonOptions,8> extends CommonResult<IsSync, OptionsType> {9 readonly name: NonNullable<CommonResult['name']>;10 message: NonNullable<CommonResult['message']>;11 stack: NonNullable<CommonResult['stack']>;12 shortMessage: NonNullable<CommonResult['shortMessage']>;13 originalMessage: NonNullable<CommonResult['originalMessage']>;14}1516// `result.*` defined only on failure, i.e. on `error.*`17export type ErrorProperties =18 | 'name'19 | 'message'20 | 'stack'21 | 'cause'22 | 'shortMessage'23 | 'originalMessage'24 | 'code';2526/**27Exception thrown when the subprocess fails, either:28- its exit code is not `0`29- it was terminated with a signal, including `subprocess.kill()`30- timing out31- being canceled32- there's not enough memory or there are already too many subprocesses3334This has the same shape as successful results, with a few additional properties.35*/36export class ExecaError<OptionsType extends Options = Options> extends CommonError<false, OptionsType> {37 readonly name: 'ExecaError';38}3940/**41Exception thrown when the subprocess fails, either:42- its exit code is not `0`43- it was terminated with a signal, including `.kill()`44- timing out45- being canceled46- there's not enough memory or there are already too many subprocesses4748This has the same shape as successful results, with a few additional properties.49*/50export class ExecaSyncError<OptionsType extends SyncOptions = SyncOptions> extends CommonError<true, OptionsType> {51 readonly name: 'ExecaSyncError';52}
added:types/return/ignore.ts+26 added
1import type {NoStreamStdioOption, StdioOptionCommon} from '../stdio/type';2import type {IsInputFd} from '../stdio/direction';3import type {FdStdioOption} from '../stdio/option';4import type {FdSpecificOption} from '../arguments/specific';5import type {CommonOptions} from '../arguments/options';67// Whether `result.stdin|stdout|stderr|all|stdio[*]` is `undefined`8export type IgnoresResultOutput<9 FdNumber extends string,10 OptionsType extends CommonOptions = CommonOptions,11> = FdSpecificOption<OptionsType['buffer'], FdNumber> extends false12 ? true13 : IsInputFd<FdNumber, OptionsType> extends true14 ? true15 : IgnoresSubprocessOutput<FdNumber, OptionsType>;1617// Whether `subprocess.stdout|stderr|all` is `undefined|null`18export type IgnoresSubprocessOutput<19 FdNumber extends string,20 OptionsType extends CommonOptions = CommonOptions,21> = IgnoresOutput<FdNumber, FdStdioOption<FdNumber, OptionsType>>;2223type IgnoresOutput<24 FdNumber extends string,25 StdioOptionType extends StdioOptionCommon,26> = StdioOptionType extends NoStreamStdioOption<FdNumber> ? true : false;
added:types/return/result-all.d.ts+30 added
1import type {IsObjectFd} from '../transform/object-mode';2import type {CommonOptions} from '../arguments/options';3import type {FdSpecificOption} from '../arguments/specific';4import type {IgnoresResultOutput} from './ignore';5import type {ResultStdio} from './result-stdout';67// `result.all`8export type ResultAll<OptionsType extends CommonOptions = CommonOptions> =9 ResultAllProperty<OptionsType['all'], OptionsType>;1011type ResultAllProperty<12 AllOption extends CommonOptions['all'] = CommonOptions['all'],13 OptionsType extends CommonOptions = CommonOptions,14> = AllOption extends true15 ? ResultStdio<16 AllMainFd<OptionsType>,17 AllObjectFd<OptionsType>,18 AllLinesFd<OptionsType>,19 OptionsType20 >21 : undefined;2223type AllMainFd<OptionsType extends CommonOptions = CommonOptions> =24 IgnoresResultOutput<'1', OptionsType> extends true ? '2' : '1';2526type AllObjectFd<OptionsType extends CommonOptions = CommonOptions> =27 IsObjectFd<'1', OptionsType> extends true ? '1' : '2';2829type AllLinesFd<OptionsType extends CommonOptions = CommonOptions> =30 FdSpecificOption<OptionsType['lines'], '1'> extends true ? '1' : '2';
added:types/return/result-stdio.d.ts+18 added
1import type {StdioOptionsArray} from '../stdio/type';2import type {StdioOptionNormalizedArray} from '../stdio/array';3import type {CommonOptions} from '../arguments/options';4import type {ResultStdioNotAll} from './result-stdout';56// `result.stdio`7export type ResultStdioArray<OptionsType extends CommonOptions = CommonOptions> =8 MapResultStdio<StdioOptionNormalizedArray<OptionsType>, OptionsType>;910type MapResultStdio<11 StdioOptionsArrayType extends StdioOptionsArray,12 OptionsType extends CommonOptions = CommonOptions,13> = {14 -readonly [FdNumber in keyof StdioOptionsArrayType]: ResultStdioNotAll<15 FdNumber extends string ? FdNumber : string,16 OptionsType17 >18};
added:types/return/result-stdout.d.ts+50 added
1import type {BufferEncodingOption, BinaryEncodingOption} from '../arguments/encoding-option';2import type {IsObjectFd} from '../transform/object-mode';3import type {FdSpecificOption} from '../arguments/specific';4import type {CommonOptions} from '../arguments/options';5import type {IgnoresResultOutput} from './ignore';67// `result.stdout|stderr|stdio`8export type ResultStdioNotAll<9 FdNumber extends string,10 OptionsType extends CommonOptions = CommonOptions,11> = ResultStdio<FdNumber, FdNumber, FdNumber, OptionsType>;1213// `result.stdout|stderr|stdio|all`14export type ResultStdio<15 MainFdNumber extends string,16 ObjectFdNumber extends string,17 LinesFdNumber extends string,18 OptionsType extends CommonOptions = CommonOptions,19> = ResultStdioProperty<20ObjectFdNumber,21LinesFdNumber,22IgnoresResultOutput<MainFdNumber, OptionsType>,23OptionsType24>;2526type ResultStdioProperty<27 ObjectFdNumber extends string,28 LinesFdNumber extends string,29 StreamOutputIgnored extends boolean,30 OptionsType extends CommonOptions = CommonOptions,31> = StreamOutputIgnored extends true32 ? undefined33 : ResultStdioItem<34 IsObjectFd<ObjectFdNumber, OptionsType>,35 FdSpecificOption<OptionsType['lines'], LinesFdNumber>,36 OptionsType['encoding']37 >;3839type ResultStdioItem<40 IsObjectResult extends boolean,41 LinesOption extends boolean | undefined,42 Encoding extends CommonOptions['encoding'],43> = IsObjectResult extends true ? unknown[]44 : Encoding extends BufferEncodingOption45 ? Uint8Array46 : LinesOption extends true47 ? Encoding extends BinaryEncodingOption48 ? string49 : string[]50 : string;
added:types/return/result.d.ts+190 added
1import type {Unless} from '../utils';2import type {CommonOptions, Options, SyncOptions} from '../arguments/options';3import type {ErrorProperties} from './final-error';4import type {ResultAll} from './result-all';5import type {ResultStdioArray} from './result-stdio';6import type {ResultStdioNotAll} from './result-stdout';78export declare abstract class CommonResult<9 IsSync extends boolean = boolean,10 OptionsType extends CommonOptions = CommonOptions,11> {12 /**13 The file and arguments that were run, for logging purposes.1415 This is not escaped and should not be executed directly as a subprocess, including using `execa()` or `execaCommand()`.16 */17 command: string;1819 /**20 Same as `command` but escaped.2122 Unlike `command`, control characters are escaped, which makes it safe to print in a terminal.2324 This can also be copied and pasted into a shell, for debugging purposes.25 Since the escaping is fairly basic, this should not be executed directly as a subprocess, including using `execa()` or `execaCommand()`.26 */27 escapedCommand: string;2829 /**30 The numeric exit code of the subprocess that was run.3132 This is `undefined` when the subprocess could not be spawned or was terminated by a signal.33 */34 exitCode?: number;3536 /**37 The output of the subprocess on `stdout`.3839 This is `undefined` if the `stdout` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`. This is an array if the `lines` option is `true`, or if the `stdout` option is a transform in object mode.40 */41 stdout: ResultStdioNotAll<'1', OptionsType>;4243 /**44 The output of the subprocess on `stderr`.4546 This is `undefined` if the `stderr` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`. This is an array if the `lines` option is `true`, or if the `stderr` option is a transform in object mode.47 */48 stderr: ResultStdioNotAll<'2', OptionsType>;4950 /**51 The output of the subprocess on `stdin`, `stdout`, `stderr` and other file descriptors.5253 Items are `undefined` when their corresponding `stdio` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`. Items are arrays when their corresponding `stdio` option is a transform in object mode.54 */55 stdio: ResultStdioArray<OptionsType>;5657 /**58 Whether the subprocess failed to run.59 */60 failed: boolean;6162 /**63 Whether the subprocess timed out.64 */65 timedOut: boolean;6667 /**68 Whether the subprocess was terminated by a signal (like `SIGTERM`) sent by either:69 - The current process.70 - Another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).71 */72 isTerminated: boolean;7374 /**75 The name of the signal (like `SIGTERM`) that terminated the subprocess, sent by either:76 - The current process.77 - Another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).7879 If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`.80 */81 signal?: string;8283 /**84 A human-friendly description of the signal that was used to terminate the subprocess. For example, `Floating point arithmetic error`.8586 If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.87 */88 signalDescription?: string;8990 /**91 The current directory in which the command was run.92 */93 cwd: string;9495 /**96 Duration of the subprocess, in milliseconds.97 */98 durationMs: number;99100 /**101 Whether the subprocess was canceled using the `cancelSignal` option.102 */103 isCanceled: boolean;104105 /**106 Whether the subprocess failed because its output was larger than the `maxBuffer` option.107 */108 isMaxBuffer: boolean;109110 /**111 The output of the subprocess with `result.stdout` and `result.stderr` interleaved.112113 This is `undefined` if either:114 - the `all` option is `false` (default value).115 - both `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer`.116117 This is an array if the `lines` option is `true`, or if either the `stdout` or `stderr` option is a transform in object mode.118 */119 all: ResultAll<OptionsType>;120121 /**122 Results of the other subprocesses that were piped into this subprocess. This is useful to inspect a series of subprocesses piped with each other.123124 This array is initially empty and is populated each time the `subprocess.pipe()` method resolves.125 */126 pipedFrom: Unless<IsSync, ExecaResult[], []>;127128 /**129 Error message when the subprocess failed to run. In addition to the underlying error message, it also contains some information related to why the subprocess errored.130131 The subprocess `stderr`, `stdout` and other file descriptors' output are appended to the end, separated with newlines and not interleaved.132 */133 message?: string;134135 /**136 This is the same as the `message` property except it does not include the subprocess `stdout`/`stderr`/`stdio`.137 */138 shortMessage?: string;139140 /**141 Original error message. This is the same as the `message` property excluding the subprocess `stdout`/`stderr`/`stdio` and some additional information added by Execa.142143 This exists only if the subprocess exited due to an `error` event or a timeout.144 */145 originalMessage?: string;146147 /**148 Underlying error, if there is one. For example, this is set by `subprocess.kill(error)`.149150 This is usually an `Error` instance.151 */152 cause?: unknown;153154 /**155 Node.js-specific [error code](https://nodejs.org/api/errors.html#errorcode), when available.156 */157 code?: string;158159 // We cannot `extend Error` because `message` must be optional. So we copy its types here.160 readonly name?: Error['name'];161 stack?: Error['stack'];162}163164export type CommonResultInstance<165 IsSync extends boolean = boolean,166 OptionsType extends CommonOptions = CommonOptions,167> = InstanceType<typeof CommonResult<IsSync, OptionsType>>;168169type SuccessResult<170 IsSync extends boolean = boolean,171 OptionsType extends CommonOptions = CommonOptions,172> = CommonResultInstance<IsSync, OptionsType> & OmitErrorIfReject<OptionsType['reject']>;173174type OmitErrorIfReject<RejectOption extends CommonOptions['reject']> = RejectOption extends false175 ? {}176 : {[ErrorProperty in ErrorProperties]: never};177178/**179Result of a subprocess execution.180181When the subprocess fails, it is rejected with an `ExecaError` instead.182*/183export type ExecaResult<OptionsType extends Options = Options> = SuccessResult<false, OptionsType>;184185/**186Result of a subprocess execution.187188When the subprocess fails, it is rejected with an `ExecaError` instead.189*/190export type ExecaSyncResult<OptionsType extends SyncOptions = SyncOptions> = SuccessResult<true, OptionsType>;
added:types/stdio/array.d.ts+16 added
1import type {CommonOptions} from '../arguments/options';2import type {StdinOptionCommon, StdoutStderrOptionCommon, StdioOptionsArray} from './type';34// `options.stdio`, normalized as an array5export type StdioOptionNormalizedArray<OptionsType extends CommonOptions = CommonOptions> = StdioOptionNormalized<OptionsType['stdio']>;67type StdioOptionNormalized<StdioOption extends CommonOptions['stdio'] = CommonOptions['stdio']> = StdioOption extends StdioOptionsArray8 ? StdioOption9 : StdioOption extends StdinOptionCommon10 ? StdioOption extends StdoutStderrOptionCommon11 ? readonly [StdioOption, StdioOption, StdioOption]12 : DefaultStdioOption13 : DefaultStdioOption;1415// `options.stdio` default value16type DefaultStdioOption = readonly ['pipe', 'pipe', 'pipe'];
added:types/stdio/direction.d.ts+18 added
1import type {CommonOptions} from '../arguments/options';2import type {StdinOptionCommon, StdoutStderrOptionCommon, StdioOptionCommon} from './type';3import type {FdStdioArrayOption} from './option';45// Whether `result.stdio[FdNumber]` is an input stream6export type IsInputFd<7 FdNumber extends string,8 OptionsType extends CommonOptions = CommonOptions,9> = FdNumber extends '0'10 ? true11 : IsInputDescriptor<FdStdioArrayOption<FdNumber, OptionsType>>;1213// Whether `result.stdio[3+]` is an input stream14type IsInputDescriptor<StdioOptionType extends StdioOptionCommon> = StdioOptionType extends StdinOptionCommon15 ? StdioOptionType extends StdoutStderrOptionCommon16 ? false17 : true18 : false;
added:types/stdio/option.d.ts+35 added
1import type {CommonOptions} from '../arguments/options';2import type {StdioOptionNormalizedArray} from './array';3import type {StandardStreams, StdioOptionCommon, StdioOptionsArray, StdioOptionsProperty} from './type';45// `options.stdin|stdout|stderr|stdio` for a given file descriptor6export type FdStdioOption<7 FdNumber extends string,8 OptionsType extends CommonOptions = CommonOptions,9> = string extends FdNumber ? StdioOptionCommon10 : FdNumber extends keyof StandardStreams11 ? StandardStreams[FdNumber] extends keyof OptionsType12 ? OptionsType[StandardStreams[FdNumber]] extends undefined13 ? FdStdioArrayOption<FdNumber, OptionsType>14 : OptionsType[StandardStreams[FdNumber]]15 : FdStdioArrayOption<FdNumber, OptionsType>16 : FdStdioArrayOption<FdNumber, OptionsType>;1718// `options.stdio[FdNumber]`, excluding `options.stdin|stdout|stderr`19export type FdStdioArrayOption<20 FdNumber extends string,21 OptionsType extends CommonOptions = CommonOptions,22> = FdStdioArrayOptionProperty<FdNumber, StdioOptionNormalizedArray<OptionsType>>;2324type FdStdioArrayOptionProperty<25 FdNumber extends string,26 StdioOptionsType extends StdioOptionsProperty,27> = string extends FdNumber28 ? StdioOptionCommon | undefined29 : StdioOptionsType extends StdioOptionsArray30 ? FdNumber extends keyof StdioOptionsType31 ? StdioOptionsType[FdNumber]32 : StdioOptionNormalizedArray extends StdioOptionsType33 ? StdioOptionsType[number]34 : undefined35 : undefined;
added:types/stdio/type.d.ts+158 added
1import type {Readable, Writable} from 'node:stream';2import type {Not, And, Or, Unless, AndUnless} from '../utils';3import type {GeneratorTransform, GeneratorTransformFull, DuplexTransform, WebTransform} from '../transform/normalize';45type IsStandardStream<FdNumber extends string> = FdNumber extends keyof StandardStreams ? true : false;67export type StandardStreams = ['stdin', 'stdout', 'stderr'];89// When `options.stdin|stdout|stderr|stdio` is set to one of those values, no stream is created10export type NoStreamStdioOption<FdNumber extends string> =11 | 'ignore'12 | 'inherit'13 | 'ipc'14 | number15 | Readable16 | Writable17 | Unless<IsStandardStream<FdNumber>, undefined>18 | readonly [NoStreamStdioOption<FdNumber>];1920// `options.stdio` when it is not an array21type SimpleStdioOption<22 IsSync extends boolean,23 IsExtra extends boolean,24 IsArray extends boolean,25> =26 | undefined27 | 'pipe'28 | Unless<And<And<Not<IsSync>, IsArray>, IsExtra>, 'inherit'>29 | Unless<IsArray, 'ignore'>30 | Unless<IsSync, 'overlapped'>;3132// Values available in both `options.stdin|stdio` and `options.stdout|stderr|stdio`33type CommonStdioOption<34 IsSync extends boolean,35 IsExtra extends boolean,36 IsArray extends boolean,37> =38 | SimpleStdioOption<IsSync, IsExtra, IsArray>39 | URL40 | {file: string}41 | GeneratorTransform<IsSync>42 | GeneratorTransformFull<IsSync>43 | Unless<And<Not<IsSync>, IsArray>, 3 | 4 | 5 | 6 | 7 | 8 | 9>44 | Unless<Or<IsSync, IsArray>, 'ipc'>45 | Unless<IsSync, DuplexTransform | WebTransform | TransformStream>;4647// Synchronous iterables excluding strings, Uint8Arrays and Arrays48type IterableObject<IsArray extends boolean> = Iterable<unknown>49& object50& {readonly BYTES_PER_ELEMENT?: never}51& AndUnless<IsArray, {readonly lastIndexOf?: never}>;5253// `process.stdin|stdout|stderr` are `Duplex` with a `fd` property.54// This ensures they can only be passed to `stdin`/`stdout`/`stderr`, based on their direction.55type ProcessStdinFd = {readonly fd?: 0};56type ProcessStdoutStderrFd = {readonly fd?: 1 | 2};5758// Values available only in `options.stdin|stdio`59type InputStdioOption<60 IsSync extends boolean,61 IsExtra extends boolean,62 IsArray extends boolean,63> =64 | 065 | Unless<And<IsSync, IsExtra>, Uint8Array | IterableObject<IsArray>>66 | Unless<And<IsSync, IsArray>, Readable & ProcessStdinFd>67 | Unless<IsSync, (AsyncIterable<unknown> & ProcessStdinFd) | ReadableStream>;6869// Values available only in `options.stdout|stderr|stdio`70type OutputStdioOption<71 IsSync extends boolean,72 IsArray extends boolean,73> =74 | 175 | 276 | Unless<And<IsSync, IsArray>, Writable & ProcessStdoutStderrFd>77 | Unless<IsSync, WritableStream>;7879// `options.stdin` array items80type StdinSingleOption<81 IsSync extends boolean = boolean,82 IsExtra extends boolean = boolean,83 IsArray extends boolean = boolean,84> =85 | CommonStdioOption<IsSync, IsExtra, IsArray>86 | InputStdioOption<IsSync, IsExtra, IsArray>;8788// `options.stdin`89export type StdinOptionCommon<90 IsSync extends boolean = boolean,91 IsExtra extends boolean = boolean,92> =93 | StdinSingleOption<IsSync, IsExtra, false>94 | ReadonlyArray<StdinSingleOption<IsSync, IsExtra, true>>;9596// `options.stdin`, async97export type StdinOption = StdinOptionCommon<false, false>;98// `options.stdin`, sync99export type StdinOptionSync = StdinOptionCommon<true, false>;100101// `options.stdout|stderr` array items102type StdoutStderrSingleOption<103 IsSync extends boolean = boolean,104 IsExtra extends boolean = boolean,105 IsArray extends boolean = boolean,106> =107 | CommonStdioOption<IsSync, IsExtra, IsArray>108 | OutputStdioOption<IsSync, IsArray>;109110// `options.stdout|stderr`111export type StdoutStderrOptionCommon<112 IsSync extends boolean = boolean,113 IsExtra extends boolean = boolean,114> =115 | StdoutStderrSingleOption<IsSync, IsExtra, false>116 | ReadonlyArray<StdoutStderrSingleOption<IsSync, IsExtra, true>>;117118// `options.stdout|stderr`, async119export type StdoutStderrOption = StdoutStderrOptionCommon<false, false>;120// `options.stdout|stderr`, sync121export type StdoutStderrOptionSync = StdoutStderrOptionCommon<true, false>;122123// `options.stdio[3+]`124type StdioExtraOptionCommon<IsSync extends boolean = boolean> =125 | StdinOptionCommon<IsSync, true>126 | StdoutStderrOptionCommon<IsSync, true>;127128// `options.stdin|stdout|stderr|stdio` array items129export type StdioSingleOption<130 IsSync extends boolean = boolean,131 IsExtra extends boolean = boolean,132 IsArray extends boolean = boolean,133> =134 | StdinSingleOption<IsSync, IsExtra, IsArray>135 | StdoutStderrSingleOption<IsSync, IsExtra, IsArray>;136137// `options.stdin|stdout|stderr|stdio`138export type StdioOptionCommon<IsSync extends boolean = boolean> =139 | StdinOptionCommon<IsSync>140 | StdoutStderrOptionCommon<IsSync>;141142// `options.stdin|stdout|stderr|stdio`, async143export type StdioOption = StdioOptionCommon<false>;144// `options.stdin|stdout|stderr|stdio`, sync145export type StdioOptionSync = StdioOptionCommon<true>;146147// `options.stdio` when it is an array148export type StdioOptionsArray<IsSync extends boolean = boolean> = readonly [149 StdinOptionCommon<IsSync, false>,150 StdoutStderrOptionCommon<IsSync, false>,151 StdoutStderrOptionCommon<IsSync, false>,152 ...ReadonlyArray<StdioExtraOptionCommon<IsSync>>,153];154155// `options.stdio`156export type StdioOptionsProperty<IsSync extends boolean = boolean> =157 | SimpleStdioOption<IsSync, false, false>158 | StdioOptionsArray<IsSync>;
added:types/subprocess/all.d.ts+24 added
1import type {Readable} from 'node:stream';2import type {IgnoresSubprocessOutput} from '../return/ignore';3import type {Options} from '../arguments/options';45// `subprocess.all`6export type SubprocessAll<OptionsType extends Options = Options> = AllStream<OptionsType['all'], OptionsType>;78type AllStream<9 AllOption extends Options['all'] = Options['all'],10 OptionsType extends Options = Options,11> = AllOption extends true12 ? AllIfStdout<IgnoresSubprocessOutput<'1', OptionsType>, OptionsType>13 : undefined;1415type AllIfStdout<16 StdoutResultIgnored extends boolean,17 OptionsType extends Options = Options,18> = StdoutResultIgnored extends true19 ? AllIfStderr<IgnoresSubprocessOutput<'2', OptionsType>>20 : Readable;2122type AllIfStderr<StderrResultIgnored extends boolean> = StderrResultIgnored extends true23 ? undefined24 : Readable;
added:types/subprocess/stdio.d.ts+19 added
1import type {StdioOptionNormalizedArray} from '../stdio/array';2import type {StdioOptionsArray} from '../stdio/type';3import type {Options} from '../arguments/options';4import type {SubprocessStdioStream} from './stdout';56// `subprocess.stdio`7export type SubprocessStdioArray<OptionsType extends Options = Options> = MapStdioStreams<StdioOptionNormalizedArray<OptionsType>, OptionsType>;89// We cannot use mapped types because it must be compatible with Node.js `ChildProcess["stdio"]` which uses a tuple with exactly 5 items10type MapStdioStreams<11 StdioOptionsArrayType extends StdioOptionsArray,12 OptionsType extends Options = Options,13> = [14 SubprocessStdioStream<'0', OptionsType>,15 SubprocessStdioStream<'1', OptionsType>,16 SubprocessStdioStream<'2', OptionsType>,17 '3' extends keyof StdioOptionsArrayType ? SubprocessStdioStream<'3', OptionsType> : never,18 '4' extends keyof StdioOptionsArrayType ? SubprocessStdioStream<'4', OptionsType> : never,19];
added:types/subprocess/stdout.d.ts+22 added
1import type {Readable, Writable} from 'node:stream';2import type {IsInputFd} from '../stdio/direction';3import type {IgnoresSubprocessOutput} from '../return/ignore';4import type {Options} from '../arguments/options';56// `subprocess.stdin|stdout|stderr|stdio`7type SubprocessStdioStream<8 FdNumber extends string,9 OptionsType extends Options = Options,10> = SubprocessStream<FdNumber, IgnoresSubprocessOutput<FdNumber, OptionsType>, OptionsType>;1112type SubprocessStream<13 FdNumber extends string,14 StreamResultIgnored extends boolean,15 OptionsType extends Options = Options,16> = StreamResultIgnored extends true17 ? null18 : InputOutputStream<IsInputFd<FdNumber, OptionsType>>;1920type InputOutputStream<IsInput extends boolean> = IsInput extends true21 ? Writable22 : Readable;
added:types/subprocess/subprocess.d.ts+139 added
1import type {ChildProcess} from 'node:child_process';2import type {Readable, Writable, Duplex} from 'node:stream';3import type {StdioOptionsArray} from '../stdio/type';4import type {Options} from '../arguments/options';5import type {ExecaResult} from '../return/result';6import type {PipableSubprocess} from '../pipe';7import type {ReadableOptions, WritableOptions, DuplexOptions, SubprocessAsyncIterable} from '../convert';8import type {SubprocessStdioStream} from './stdout';9import type {SubprocessStdioArray} from './stdio';10import type {SubprocessAll} from './all';1112type HasIpc<OptionsType extends Options> = OptionsType['ipc'] extends true13 ? true14 : OptionsType['stdio'] extends StdioOptionsArray15 ? 'ipc' extends OptionsType['stdio'][number] ? true : false16 : false;1718export type ExecaResultPromise<OptionsType extends Options = Options> = {19 /**20 Process identifier ([PID](https://en.wikipedia.org/wiki/Process_identifier)).2122 This is `undefined` if the subprocess failed to spawn.23 */24 pid?: number;2526 /**27 Send a `message` to the subprocess. The type of `message` depends on the `serialization` option.28 The subprocess receives it as a [`message` event](https://nodejs.org/api/process.html#event-message).2930 This returns `true` on success.3132 This requires the `ipc` option to be `true`.3334 [More info.](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback)35 */36 send: HasIpc<OptionsType> extends true ? ChildProcess['send'] : undefined;3738 /**39 The subprocess `stdin` as a stream.4041 This is `null` if the `stdin` option is set to `'inherit'`, `'ignore'`, `Readable` or `integer`.4243 This is intended for advanced cases. Please consider using the `stdin` option, `input` option, `inputFile` option, or `subprocess.pipe()` instead.44 */45 stdin: SubprocessStdioStream<'0', OptionsType>;4647 /**48 The subprocess `stdout` as a stream.4950 This is `null` if the `stdout` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.5152 This is intended for advanced cases. Please consider using `result.stdout`, the `stdout` option, `subprocess.iterable()`, or `subprocess.pipe()` instead.53 */54 stdout: SubprocessStdioStream<'1', OptionsType>;5556 /**57 The subprocess `stderr` as a stream.5859 This is `null` if the `stderr` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.6061 This is intended for advanced cases. Please consider using `result.stderr`, the `stderr` option, `subprocess.iterable()`, or `subprocess.pipe()` instead.62 */63 stderr: SubprocessStdioStream<'2', OptionsType>;6465 /**66 Stream combining/interleaving `subprocess.stdout` and `subprocess.stderr`.6768 This is `undefined` if either:69 - the `all` option is `false` (the default value).70 - both `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer`.7172 This is intended for advanced cases. Please consider using `result.all`, the `stdout`/`stderr` option, `subprocess.iterable()`, or `subprocess.pipe()` instead.73 */74 all: SubprocessAll<OptionsType>;7576 /**77 The subprocess `stdin`, `stdout`, `stderr` and other files descriptors as an array of streams.7879 Each array item is `null` if the corresponding `stdin`, `stdout`, `stderr` or `stdio` option is set to `'inherit'`, `'ignore'`, `Stream` or `integer`.8081 This is intended for advanced cases. Please consider using `result.stdio`, the `stdio` option, `subprocess.iterable()` or `subprocess.pipe()` instead.82 */83 stdio: SubprocessStdioArray<OptionsType>;8485 /**86 Sends a [signal](https://nodejs.org/api/os.html#signal-constants) to the subprocess. The default signal is the `killSignal` option. `killSignal` defaults to `SIGTERM`, which terminates the subprocess.8788 This returns `false` when the signal could not be sent, for example when the subprocess has already exited.8990 When an error is passed as argument, it is set to the subprocess' `error.cause`. The subprocess is then terminated with the default signal. This does not emit the [`error` event](https://nodejs.org/api/child_process.html#event-error).9192 [More info.](https://nodejs.org/api/child_process.html#subprocesskillsignal)93 */94 kill(signal: Parameters<ChildProcess['kill']>[0], error?: Error): ReturnType<ChildProcess['kill']>;95 kill(error?: Error): ReturnType<ChildProcess['kill']>;9697 /**98 Subprocesses are [async iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator). They iterate over each output line.99100 The iteration waits for the subprocess to end. It throws if the subprocess fails. This means you do not need to `await` the subprocess' promise.101 */102 [Symbol.asyncIterator](): SubprocessAsyncIterable<undefined, OptionsType['encoding']>;103104 /**105 Same as `subprocess[Symbol.asyncIterator]` except options can be provided.106 */107 iterable<IterableOptions extends ReadableOptions = {}>(readableOptions?: IterableOptions): SubprocessAsyncIterable<IterableOptions['binary'], OptionsType['encoding']>;108109 /**110 Converts the subprocess to a readable stream.111112 Unlike `subprocess.stdout`, the stream waits for the subprocess to end and emits an [`error`](https://nodejs.org/api/stream.html#event-error) event if the subprocess fails. This means you do not need to `await` the subprocess' promise. On the other hand, you do need to handle to the stream `error` event. This can be done by using [`await finished(stream)`](https://nodejs.org/api/stream.html#streamfinishedstream-options), [`await pipeline(..., stream)`](https://nodejs.org/api/stream.html#streampipelinesource-transforms-destination-options) or [`await text(stream)`](https://nodejs.org/api/webstreams.html#streamconsumerstextstream) which throw an exception when the stream errors.113114 Before using this method, please first consider the `stdin`/`stdout`/`stderr`/`stdio` options, `subprocess.pipe()` or `subprocess.iterable()`.115 */116 readable(readableOptions?: ReadableOptions): Readable;117118 /**119 Converts the subprocess to a writable stream.120121 Unlike `subprocess.stdin`, the stream waits for the subprocess to end and emits an [`error`](https://nodejs.org/api/stream.html#event-error) event if the subprocess fails. This means you do not need to `await` the subprocess' promise. On the other hand, you do need to handle to the stream `error` event. This can be done by using [`await finished(stream)`](https://nodejs.org/api/stream.html#streamfinishedstream-options) or [`await pipeline(stream, ...)`](https://nodejs.org/api/stream.html#streampipelinesource-transforms-destination-options) which throw an exception when the stream errors.122123 Before using this method, please first consider the `stdin`/`stdout`/`stderr`/`stdio` options or `subprocess.pipe()`.124 */125 writable(writableOptions?: WritableOptions): Writable;126127 /**128 Converts the subprocess to a duplex stream.129130 The stream waits for the subprocess to end and emits an [`error`](https://nodejs.org/api/stream.html#event-error) event if the subprocess fails. This means you do not need to `await` the subprocess' promise. On the other hand, you do need to handle to the stream `error` event. This can be done by using [`await finished(stream)`](https://nodejs.org/api/stream.html#streamfinishedstream-options), [`await pipeline(..., stream, ...)`](https://nodejs.org/api/stream.html#streampipelinesource-transforms-destination-options) or [`await text(stream)`](https://nodejs.org/api/webstreams.html#streamconsumerstextstream) which throw an exception when the stream errors.131132 Before using this method, please first consider the `stdin`/`stdout`/`stderr`/`stdio` options, `subprocess.pipe()` or `subprocess.iterable()`.133 */134 duplex(duplexOptions?: DuplexOptions): Duplex;135} & PipableSubprocess;136137export type ExecaSubprocess<OptionsType extends Options = Options> = Omit<ChildProcess, keyof ExecaResultPromise<OptionsType>> &138ExecaResultPromise<OptionsType> &139Promise<ExecaResult<OptionsType>>;
added:types/transform/normalize.d.ts+56 added
1import type {Duplex} from 'node:stream';2import type {Unless} from '../utils';34// `options.std*: Generator`5// @todo Use `string`, `Uint8Array` or `unknown` for both the argument and the return type, based on whether `encoding: 'buffer'` and `objectMode: true` are used.6// See https://github.com/sindresorhus/execa/issues/6947export type GeneratorTransform<IsSync extends boolean> = (chunk: unknown) =>8| Unless<IsSync, AsyncGenerator<unknown, void, void>>9| Generator<unknown, void, void>;10type GeneratorFinal<IsSync extends boolean> = () =>11| Unless<IsSync, AsyncGenerator<unknown, void, void>>12| Generator<unknown, void, void>;1314/**15A transform or an array of transforms can be passed to the `stdin`, `stdout`, `stderr` or `stdio` option.1617A transform is either a generator function or a plain object with the following members.18*/19export type GeneratorTransformFull<IsSync extends boolean> = {20 /**21 Map or filter the input or output of the subprocess.22 */23 transform: GeneratorTransform<IsSync>;2425 /**26 Create additional lines after the last one.27 */28 final?: GeneratorFinal<IsSync>;2930 /**31 If `true`, iterate over arbitrary chunks of `Uint8Array`s instead of line `string`s.32 */33 binary?: boolean;3435 /**36 If `true`, keep newlines in each `line` argument. Also, this allows multiple `yield`s to produces a single line.37 */38 preserveNewlines?: boolean;3940 /**41 If `true`, allow `transformOptions.transform` and `transformOptions.final` to return any type, not just `string` or `Uint8Array`.42 */43 objectMode?: boolean;44};4546// `options.std*: Duplex`47export type DuplexTransform = {48 transform: Duplex;49 objectMode?: boolean;50};5152// `options.std*: TransformStream`53export type WebTransform = {54 transform: TransformStream;55 objectMode?: boolean;56};
added:types/transform/object-mode.d.ts+28 added
1import type {StdioSingleOption, StdioOptionCommon} from '../stdio/type';2import type {FdStdioOption} from '../stdio/option';3import type {CommonOptions} from '../arguments/options';4import type {GeneratorTransformFull, DuplexTransform, WebTransform} from './normalize';56// Whether a file descriptor is in object mode7// I.e. whether `result.stdout|stderr|stdio|all` is an array of `unknown` due to `objectMode: true`8export type IsObjectFd<9 FdNumber extends string,10 OptionsType extends CommonOptions = CommonOptions,11> = IsObjectStdioOption<FdStdioOption<FdNumber, OptionsType>>;1213type IsObjectStdioOption<StdioOptionType extends StdioOptionCommon> = IsObjectStdioSingleOption<StdioOptionType extends readonly StdioSingleOption[]14 ? StdioOptionType[number]15 : StdioOptionType16>;1718type IsObjectStdioSingleOption<StdioSingleOptionType extends StdioSingleOption> = StdioSingleOptionType extends GeneratorTransformFull<boolean> | WebTransform19 ? BooleanObjectMode<StdioSingleOptionType['objectMode']>20 : StdioSingleOptionType extends DuplexTransform21 ? DuplexObjectMode<StdioSingleOptionType>22 : false;2324type BooleanObjectMode<ObjectModeOption extends boolean | undefined> = ObjectModeOption extends true ? true : false;2526type DuplexObjectMode<OutputOption extends DuplexTransform> = OutputOption['objectMode'] extends boolean27 ? OutputOption['objectMode']28 : OutputOption['transform']['readableObjectMode'];
added:types/convert.d.ts+58 added
1import type {BinaryEncodingOption} from './arguments/encoding-option';2import type {Options} from './arguments/options';3import type {FromOption, ToOption} from './arguments/fd-options';45// `subprocess.readable|duplex|iterable()` options6export type ReadableOptions = {7 /**8 Which stream to read from the subprocess. A file descriptor like `"fd3"` can also be passed.910 `"all"` reads both `stdout` and `stderr`. This requires the `all` option to be `true`.1112 @default 'stdout'13 */14 readonly from?: FromOption;1516 /**17 If `false`, the stream iterates over lines. Each line is a string. Also, the stream is in [object mode](https://nodejs.org/api/stream.html#object-mode).1819 If `true`, the stream iterates over arbitrary chunks of data. Each line is an `Uint8Array` (with `subprocess.iterable()`) or a [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer) (otherwise).2021 This is always `true` when the `encoding` option is binary.2223 @default `false` with `subprocess.iterable()`, `true` otherwise24 */25 readonly binary?: boolean;2627 /**28 If both this option and the `binary` option is `false`, newlines are stripped from each line.2930 @default `false` with `subprocess.iterable()`, `true` otherwise31 */32 readonly preserveNewlines?: boolean;33};3435// `subprocess.writable|duplex()` options36export type WritableOptions = {37 /**38 Which stream to write to the subprocess. A file descriptor like `"fd3"` can also be passed.3940 @default 'stdin'41 */42 readonly to?: ToOption;43};4445// `subprocess.duplex()` options46export type DuplexOptions = ReadableOptions & WritableOptions;4748// `subprocess.iterable()` return value49export type SubprocessAsyncIterable<50 BinaryOption extends boolean | undefined,51 EncodingOption extends Options['encoding'],52> = AsyncIterableIterator<53EncodingOption extends BinaryEncodingOption54 ? Uint8Array55 : BinaryOption extends true56 ? Uint8Array57 : string58>;
added:types/pipe.d.ts+66 added
1import type {Options} from './arguments/options';2import type {ExecaResult} from './return/result';3import type {FromOption, ToOption} from './arguments/fd-options';4import type {ExecaSubprocess} from './subprocess/subprocess';5import type {TemplateExpression} from './methods/template';67// `subprocess.pipe()` options8type PipeOptions = {9 /**10 Which stream to pipe from the source subprocess. A file descriptor like `"fd3"` can also be passed.1112 `"all"` pipes both `stdout` and `stderr`. This requires the `all` option to be `true`.13 */14 readonly from?: FromOption;1516 /**17 Which stream to pipe to the destination subprocess. A file descriptor like `"fd3"` can also be passed.18 */19 readonly to?: ToOption;2021 /**22 Unpipe the subprocess when the signal aborts.2324 The `subprocess.pipe()` method will be rejected with a cancellation error.25 */26 readonly unpipeSignal?: AbortSignal;27};2829// `subprocess.pipe()`30type PipableSubprocess = {31 /**32 [Pipe](https://nodejs.org/api/stream.html#readablepipedestination-options) the subprocess' `stdout` to a second Execa subprocess' `stdin`. This resolves with that second subprocess' result. If either subprocess is rejected, this is rejected with that subprocess' error instead.3334 This follows the same syntax as `execa(file, arguments?, options?)` except both regular options and pipe-specific options can be specified.3536 This can be called multiple times to chain a series of subprocesses.3738 Multiple subprocesses can be piped to the same subprocess. Conversely, the same subprocess can be piped to multiple other subprocesses.39 */40 pipe<OptionsType extends Options & PipeOptions = {}>(41 file: string | URL,42 arguments?: readonly string[],43 options?: OptionsType,44 ): Promise<ExecaResult<OptionsType>> & PipableSubprocess;45 pipe<OptionsType extends Options & PipeOptions = {}>(46 file: string | URL,47 options?: OptionsType,48 ): Promise<ExecaResult<OptionsType>> & PipableSubprocess;4950 /**51 Like `subprocess.pipe(file, arguments?, options?)` but using a `command` template string instead. This follows the same syntax as `$`.52 */53 pipe(templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[]):54 Promise<ExecaResult<{}>> & PipableSubprocess;55 pipe<OptionsType extends Options & PipeOptions = {}>(options: OptionsType):56 (templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[])57 => Promise<ExecaResult<OptionsType>> & PipableSubprocess;5859 /**60 Like `subprocess.pipe(file, arguments?, options?)` but using the return value of another `execa()` call instead.6162 This is the most advanced method to pipe subprocesses. It is useful in specific cases, such as piping multiple subprocesses to the same subprocess.63 */64 pipe<Destination extends ExecaSubprocess>(destination: Destination, options?: PipeOptions):65 Promise<Awaited<Destination>> & PipableSubprocess;66};
added:types/utils.d.ts+9 added
1export type Not<Value extends boolean> = Value extends true ? false : true;23export type And<First extends boolean, Second extends boolean> = First extends true ? Second : false;45export type Or<First extends boolean, Second extends boolean> = First extends true ? true : Second;67export type Unless<Condition extends boolean, ThenValue, ElseValue = never> = Condition extends true ? ElseValue : ThenValue;89export type AndUnless<Condition extends boolean, ThenValue, ElseValue = unknown> = Condition extends true ? ElseValue : ThenValue;
modified:index.d.ts+12 added-1893 removed
1import {type ChildProcess} from 'node:child_process';2import {type Readable, type Writable, type Duplex} from 'node:stream';34type Not<Value extends boolean> = Value extends true ? false : true;56type And<First extends boolean, Second extends boolean> = First extends true ? Second : false;78type Or<First extends boolean, Second extends boolean> = First extends true ? true : Second;910type Unless<Condition extends boolean, ThenValue, ElseValue = never> = Condition extends true ? ElseValue : ThenValue;1112type AndUnless<Condition extends boolean, ThenValue, ElseValue = unknown> = Condition extends true ? ElseValue : ThenValue;1314type IsMainFd<FdNumber extends string> = FdNumber extends keyof StreamOptionsNames ? true : false;1516// When the `stdin`/`stdout`/`stderr`/`stdio` option is set to one of those values, no stream is created17type NoStreamStdioOption<FdNumber extends string> =18 | 'ignore'19 | 'inherit'20 | 'ipc'21 | number22 | Readable23 | Writable24 | Unless<IsMainFd<FdNumber>, undefined>25 | readonly [NoStreamStdioOption<FdNumber>];2627type BaseStdioOption<28 IsSync extends boolean,29 IsExtra extends boolean,30 IsArray extends boolean,31> =32 | 'pipe'33 | undefined34 | Unless<And<And<Not<IsSync>, IsArray>, IsExtra>, 'inherit'>35 | Unless<IsArray, 'ignore'>36 | Unless<IsSync, 'overlapped'>;3738// @todo Use `string`, `Uint8Array` or `unknown` for both the argument and the return type, based on whether `encoding: 'buffer'` and `objectMode: true` are used.39// See https://github.com/sindresorhus/execa/issues/69440type GeneratorTransform<IsSync extends boolean> = (chunk: unknown) =>41| Unless<IsSync, AsyncGenerator<unknown, void, void>>42| Generator<unknown, void, void>;43type GeneratorFinal<IsSync extends boolean> = () =>44| Unless<IsSync, AsyncGenerator<unknown, void, void>>45| Generator<unknown, void, void>;4647/**48A transform or an array of transforms can be passed to the `stdin`, `stdout`, `stderr` or `stdio` option.4950A transform is either a generator function or a plain object with the following members.51*/52type GeneratorTransformFull<IsSync extends boolean> = {53 /**54 Map or filter the input or output of the subprocess.55 */56 transform: GeneratorTransform<IsSync>;5758 /**59 Create additional lines after the last one.60 */61 final?: GeneratorFinal<IsSync>;6263 /**64 If `true`, iterate over arbitrary chunks of `Uint8Array`s instead of line `string`s.65 */66 binary?: boolean;6768 /**69 If `true`, keep newlines in each `line` argument. Also, this allows multiple `yield`s to produces a single line.70 */71 preserveNewlines?: boolean;7273 /**74 If `true`, allow `transformOptions.transform` and `transformOptions.final` to return any type, not just `string` or `Uint8Array`.75 */76 objectMode?: boolean;77};7879type DuplexTransform = {80 transform: Duplex;81 objectMode?: boolean;82};8384type WebTransform = {85 transform: TransformStream;86 objectMode?: boolean;87};8889type CommonStdioOption<90 IsSync extends boolean,91 IsExtra extends boolean,92 IsArray extends boolean,93> =94 | BaseStdioOption<IsSync, IsExtra, IsArray>95 | URL96 | {file: string}97 | GeneratorTransform<IsSync>98 | GeneratorTransformFull<IsSync>99 | Unless<And<Not<IsSync>, IsArray>, number>100 | Unless<Or<IsSync, IsArray>, 'ipc'>101 | Unless<IsSync, DuplexTransform | WebTransform | TransformStream>;102103// Synchronous iterables excluding strings, Uint8Arrays and Arrays104type IterableObject<IsArray extends boolean> = Iterable<unknown>105& object106& {readonly BYTES_PER_ELEMENT?: never}107& AndUnless<IsArray, {readonly lastIndexOf?: never}>;108109type InputStdioOption<110 IsSync extends boolean,111 IsExtra extends boolean,112 IsArray extends boolean,113> =114 | 0115 | Unless<And<IsSync, IsExtra>, Uint8Array | IterableObject<IsArray>>116 | Unless<And<IsSync, IsArray>, Readable>117 | Unless<IsSync, AsyncIterable<unknown> | ReadableStream>;118119type OutputStdioOption<120 IsSync extends boolean,121 IsArray extends boolean,122> =123 | 1124 | 2125 | Unless<And<IsSync, IsArray>, Writable>126 | Unless<IsSync, WritableStream>;127128type StdinSingleOption<129 IsSync extends boolean = boolean,130 IsExtra extends boolean = boolean,131 IsArray extends boolean = boolean,132> =133 | CommonStdioOption<IsSync, IsExtra, IsArray>134 | InputStdioOption<IsSync, IsExtra, IsArray>;135136type StdinOptionCommon<137 IsSync extends boolean = boolean,138 IsExtra extends boolean = boolean,139> =140 | StdinSingleOption<IsSync, IsExtra, false>141 | ReadonlyArray<StdinSingleOption<IsSync, IsExtra, true>>;142143export type StdinOption = StdinOptionCommon<false, false>;144export type StdinOptionSync = StdinOptionCommon<true, false>;145146type StdoutStderrSingleOption<147 IsSync extends boolean = boolean,148 IsExtra extends boolean = boolean,149 IsArray extends boolean = boolean,150> =151 | CommonStdioOption<IsSync, IsExtra, IsArray>152 | OutputStdioOption<IsSync, IsArray>;153154type StdoutStderrOptionCommon<155 IsSync extends boolean = boolean,156 IsExtra extends boolean = boolean,157> =158 | StdoutStderrSingleOption<IsSync, IsExtra, false>159 | ReadonlyArray<StdoutStderrSingleOption<IsSync, IsExtra, true>>;160161export type StdoutStderrOption = StdoutStderrOptionCommon<false, false>;162export type StdoutStderrOptionSync = StdoutStderrOptionCommon<true, false>;163164type StdioExtraOptionCommon<IsSync extends boolean = boolean> =165 | StdinOptionCommon<IsSync, true>166 | StdoutStderrOptionCommon<IsSync, true>;167168type StdioSingleOption<169 IsSync extends boolean = boolean,170 IsExtra extends boolean = boolean,171 IsArray extends boolean = boolean,172> =173 | StdinSingleOption<IsSync, IsExtra, IsArray>174 | StdoutStderrSingleOption<IsSync, IsExtra, IsArray>;175176type StdioOptionCommon<IsSync extends boolean = boolean> =177 | StdinOptionCommon<IsSync>178 | StdoutStderrOptionCommon<IsSync>;179180export type StdioOption = StdioOptionCommon<false>;181export type StdioOptionSync = StdioOptionCommon<true>;182183type StdioOptionsArray<IsSync extends boolean = boolean> = readonly [184 StdinOptionCommon<IsSync, false>,185 StdoutStderrOptionCommon<IsSync, false>,186 StdoutStderrOptionCommon<IsSync, false>,187 ...ReadonlyArray<StdioExtraOptionCommon<IsSync>>,188];189190type StdioOptions<IsSync extends boolean = boolean> =191 | BaseStdioOption<IsSync, false, false>192 | StdioOptionsArray<IsSync>;193194type DefaultEncodingOption = 'utf8';195type TextEncodingOption =196 | DefaultEncodingOption197 | 'utf16le';198type BufferEncodingOption = 'buffer';199type BinaryEncodingOption =200 | BufferEncodingOption201 | 'hex'202 | 'base64'203 | 'base64url'204 | 'latin1'205 | 'ascii';206type EncodingOption =207 | TextEncodingOption208 | BinaryEncodingOption209 | undefined;210211// Whether `result.stdout|stderr|all` is an array of values due to `objectMode: true`212type IsObjectStream<213 FdNumber extends string,214 OptionsType extends CommonOptions = CommonOptions,215> = IsObjectOutputOptions<StreamOption<FdNumber, OptionsType>>;216217type IsObjectOutputOptions<OutputOptions extends StdioOptionCommon> = IsObjectOutputOption<OutputOptions extends readonly StdioSingleOption[]218 ? OutputOptions[number]219 : OutputOptions220>;221222type IsObjectOutputOption<OutputOption extends StdioSingleOption> = OutputOption extends GeneratorTransformFull<boolean> | WebTransform223 ? BooleanObjectMode<OutputOption['objectMode']>224 : OutputOption extends DuplexTransform225 ? DuplexObjectMode<OutputOption>226 : false;227228type BooleanObjectMode<ObjectModeOption extends boolean | undefined> = ObjectModeOption extends true ? true : false;229230type DuplexObjectMode<OutputOption extends DuplexTransform> = OutputOption['objectMode'] extends boolean231 ? OutputOption['objectMode']232 : OutputOption['transform']['readableObjectMode'];233234// Whether `result.stdout|stderr|all` is `undefined`, excluding the `buffer` option235type IgnoresStreamResult<236 FdNumber extends string,237 OptionsType extends CommonOptions = CommonOptions,238> = IgnoresStdioResult<FdNumber, StreamOption<FdNumber, OptionsType>>;239240// Whether `result.stdio[*]` is `undefined`241type IgnoresStdioResult<242 FdNumber extends string,243 StdioOptionType extends StdioOptionCommon,244> = StdioOptionType extends NoStreamStdioOption<FdNumber> ? true : false;245246// Whether `result.stdout|stderr|all` is `undefined`247type IgnoresStreamOutput<248 FdNumber extends string,249 OptionsType extends CommonOptions = CommonOptions,250> = LacksBuffer<FdSpecificOption<OptionsType['buffer'], FdNumber>> extends true251 ? true252 : IsInputStdioDescriptor<FdNumber, OptionsType> extends true253 ? true254 : IgnoresStreamResult<FdNumber, OptionsType>;255256type LacksBuffer<BufferOption extends boolean | undefined> = BufferOption extends false ? true : false;257258// Whether `result.stdio[FdNumber]` is an input stream259type IsInputStdioDescriptor<260 FdNumber extends string,261 OptionsType extends CommonOptions = CommonOptions,262> = FdNumber extends '0'263 ? true264 : IsInputStdio<StdioProperty<FdNumber, OptionsType>>;265266// Whether `result.stdio[3+]` is an input stream267type IsInputStdio<StdioOptionType extends StdioOptionCommon> = StdioOptionType extends StdinOptionCommon268 ? StdioOptionType extends StdoutStderrOptionCommon269 ? false270 : true271 : false;272273// `options.stdin|stdout|stderr|stdio`274type StreamOption<275 FdNumber extends string,276 OptionsType extends CommonOptions = CommonOptions,277> = string extends FdNumber ? StdioOptionCommon278 : FdNumber extends keyof StreamOptionsNames279 ? StreamOptionsNames[FdNumber] extends keyof OptionsType280 ? OptionsType[StreamOptionsNames[FdNumber]] extends undefined281 ? StdioProperty<FdNumber, OptionsType>282 : OptionsType[StreamOptionsNames[FdNumber]]283 : StdioProperty<FdNumber, OptionsType>284 : StdioProperty<FdNumber, OptionsType>;285286type StreamOptionsNames = ['stdin', 'stdout', 'stderr'];287288// `options.stdio[FdNumber]`289type StdioProperty<290 FdNumber extends string,291 OptionsType extends CommonOptions = CommonOptions,292> = StdioOptionProperty<FdNumber, StdioArrayOption<OptionsType>>;293294type StdioOptionProperty<295 FdNumber extends string,296 StdioOptionsType extends StdioOptions,297> = string extends FdNumber298 ? StdioOptionCommon | undefined299 : StdioOptionsType extends StdioOptionsArray300 ? FdNumber extends keyof StdioOptionsType301 ? StdioOptionsType[FdNumber]302 : StdioArrayOption extends StdioOptionsType303 ? StdioOptionsType[number]304 : undefined305 : undefined;306307// Type of `result.stdout|stderr`308type NonAllStdioOutput<309 FdNumber extends string,310 OptionsType extends CommonOptions = CommonOptions,311> = StdioOutput<FdNumber, FdNumber, FdNumber, OptionsType>;312313type StdioOutput<314 MainFdNumber extends string,315 ObjectFdNumber extends string,316 LinesFdNumber extends string,317 OptionsType extends CommonOptions = CommonOptions,318> = StdioOutputResult<319ObjectFdNumber,320LinesFdNumber,321IgnoresStreamOutput<MainFdNumber, OptionsType>,322OptionsType323>;324325type StdioOutputResult<326 ObjectFdNumber extends string,327 LinesFdNumber extends string,328 StreamOutputIgnored extends boolean,329 OptionsType extends CommonOptions = CommonOptions,330> = StreamOutputIgnored extends true331 ? undefined332 : StreamEncoding<333 IsObjectStream<ObjectFdNumber, OptionsType>,334 FdSpecificOption<OptionsType['lines'], LinesFdNumber>,335 OptionsType['encoding']336 >;337338type StreamEncoding<339 IsObjectResult extends boolean,340 LinesOption extends boolean | undefined,341 Encoding extends CommonOptions['encoding'],342> = IsObjectResult extends true ? unknown[]343 : Encoding extends BufferEncodingOption344 ? Uint8Array345 : LinesOption extends true346 ? Encoding extends BinaryEncodingOption347 ? string348 : string[]349 : string;350351// Type of `result.all`352type AllOutput<OptionsType extends CommonOptions = CommonOptions> = AllOutputProperty<OptionsType['all'], OptionsType>;353354type AllOutputProperty<355 AllOption extends CommonOptions['all'] = CommonOptions['all'],356 OptionsType extends CommonOptions = CommonOptions,357> = AllOption extends true358 ? StdioOutput<359 AllMainFd<OptionsType>,360 AllObjectFd<OptionsType>,361 AllLinesFd<OptionsType>,362 OptionsType363 >364 : undefined;365366type AllMainFd<OptionsType extends CommonOptions = CommonOptions> = IgnoresStreamOutput<'1', OptionsType> extends true ? '2' : '1';367368type AllObjectFd<OptionsType extends CommonOptions = CommonOptions> = IsObjectStream<'1', OptionsType> extends true ? '1' : '2';369370type AllLinesFd<OptionsType extends CommonOptions = CommonOptions> = FdSpecificOption<OptionsType['lines'], '1'> extends true ? '1' : '2';371372// Type of `result.stdio`373type StdioArrayOutput<OptionsType extends CommonOptions = CommonOptions> = MapStdioOptions<StdioArrayOption<OptionsType>, OptionsType>;374375type MapStdioOptions<376 StdioOptionsArrayType extends StdioOptionsArray,377 OptionsType extends CommonOptions = CommonOptions,378> = {379 -readonly [FdNumber in keyof StdioOptionsArrayType]: NonAllStdioOutput<380 FdNumber extends string ? FdNumber : string,381 OptionsType382 >383};384385// `stdio` option386type StdioArrayOption<OptionsType extends CommonOptions = CommonOptions> = StdioArrayOptionValue<OptionsType['stdio']>;387388type StdioArrayOptionValue<StdioOption extends CommonOptions['stdio'] = CommonOptions['stdio']> = StdioOption extends StdioOptionsArray389 ? StdioOption390 : StdioOption extends StdinOptionCommon391 ? StdioOption extends StdoutStderrOptionCommon392 ? readonly [StdioOption, StdioOption, StdioOption]393 : DefaultStdio394 : DefaultStdio;395396type DefaultStdio = readonly ['pipe', 'pipe', 'pipe'];397398type StricterOptions<399 WideOptions extends CommonOptions,400 StrictOptions extends CommonOptions,401> = WideOptions extends StrictOptions ? WideOptions : StrictOptions;402403// Options which can be fd-specific like `{verbose: {stdout: 'none', stderr: 'full'}}`404type FdGenericOption<OptionType = unknown> = OptionType | GenericOptionObject<OptionType>;405406type GenericOptionObject<OptionType = unknown> = {407 readonly [FdName in FromOption]?: OptionType408};409410// Retrieve fd-specific option's value411type FdSpecificOption<412 GenericOption extends FdGenericOption,413 FdNumber extends string,414> = GenericOption extends GenericOptionObject415 ? FdSpecificObjectOption<GenericOption, FdNumber>416 : GenericOption;417418type FdSpecificObjectOption<419 GenericOption extends GenericOptionObject,420 FdNumber extends string,421> = keyof GenericOption extends FromOption422 ? FdNumberToFromOption<FdNumber, keyof GenericOption> extends never423 ? undefined424 : GenericOption[FdNumberToFromOption<FdNumber, keyof GenericOption>]425 : GenericOption;426427type FdNumberToFromOption<428 FdNumber extends string,429 FromOptions extends FromOption,430> = FdNumber extends '1'431 ? 'stdout' extends FromOptions432 ? 'stdout'433 : 'fd1' extends FromOptions434 ? 'fd1'435 : 'all' extends FromOptions436 ? 'all'437 : never438 : FdNumber extends '2'439 ? 'stderr' extends FromOptions440 ? 'stderr'441 : 'fd2' extends FromOptions442 ? 'fd2'443 : 'all' extends FromOptions444 ? 'all'445 : never446 : `fd${FdNumber}` extends FromOptions447 ? `fd${FdNumber}`448 : never;449450type CommonOptions<IsSync extends boolean = boolean> = {451 /**452 Prefer locally installed binaries when looking for a binary to execute.453454 If you `$ npm install foo`, you can then `execa('foo')`.455456 @default `true` with `$`, `false` otherwise457 */458 readonly preferLocal?: boolean;459460 /**461 Preferred path to find locally installed binaries in (use with `preferLocal`).462463 @default process.cwd()464 */465 readonly localDir?: string | URL;466467 /**468 If `true`, runs with Node.js. The first argument must be a Node.js file.469470 @default `true` with `execaNode()`, `false` otherwise471 */472 readonly node?: boolean;473474 /**475 Path to the Node.js executable.476477 For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version.478479 Requires the `node` option to be `true`.480481 @default [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath) (current Node.js executable)482 */483 readonly nodePath?: string | URL;484485 /**486 List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.487488 Requires the `node` option to be `true`.489490 @default [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv) (current Node.js CLI options)491 */492 readonly nodeOptions?: readonly string[];493494 /**495 Write some input to the subprocess' `stdin`.496497 See also the `inputFile` and `stdin` options.498 */499 readonly input?: string | Uint8Array | Readable;500501 /**502 Use a file as input to the subprocess' `stdin`.503504 See also the `input` and `stdin` options.505 */506 readonly inputFile?: string | URL;507508 /**509 How to setup the subprocess' standard input. This can be:510 - `'pipe'`: Sets `subprocess.stdin` stream.511 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.512 - `'ignore'`: Do not use `stdin`.513 - `'inherit'`: Re-use the current process' `stdin`.514 - an integer: Re-use a specific file descriptor from the current process.515 - a Node.js `Readable` stream.516 - `{ file: 'path' }` object.517 - a file URL.518 - a web [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).519 - an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) or an [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)520 - an `Uint8Array`.521522 This can be an [array of values](https://github.com/sindresorhus/execa#redirect-stdinstdoutstderr-to-multiple-destinations) such as `['inherit', 'pipe']` or `[filePath, 'pipe']`.523524 This can also be a generator function or a [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) or a [web `TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) to transform the input. [Learn more.](https://github.com/sindresorhus/execa/tree/main/docs/transform.md)525526 @default `inherit` with `$`, `pipe` otherwise527 */528 readonly stdin?: StdinOptionCommon<IsSync>;529530 /**531 How to setup the subprocess' standard output. This can be:532 - `'pipe'`: Sets `result.stdout` (as a string or `Uint8Array`) and `subprocess.stdout` (as a stream).533 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.534 - `'ignore'`: Do not use `stdout`.535 - `'inherit'`: Re-use the current process' `stdout`.536 - an integer: Re-use a specific file descriptor from the current process.537 - a Node.js `Writable` stream.538 - `{ file: 'path' }` object.539 - a file URL.540 - a web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).541542 This can be an [array of values](https://github.com/sindresorhus/execa#redirect-stdinstdoutstderr-to-multiple-destinations) such as `['inherit', 'pipe']` or `[filePath, 'pipe']`.543544 This can also be a generator function or a [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) or a [web `TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) to transform the output. [Learn more.](https://github.com/sindresorhus/execa/tree/main/docs/transform.md)545546 @default 'pipe'547 */548 readonly stdout?: StdoutStderrOptionCommon<IsSync>;549550 /**551 How to setup the subprocess' standard error. This can be:552 - `'pipe'`: Sets `result.stderr` (as a string or `Uint8Array`) and `subprocess.stderr` (as a stream).553 - `'overlapped'`: Like `'pipe'` but asynchronous on Windows.554 - `'ignore'`: Do not use `stderr`.555 - `'inherit'`: Re-use the current process' `stderr`.556 - an integer: Re-use a specific file descriptor from the current process.557 - a Node.js `Writable` stream.558 - `{ file: 'path' }` object.559 - a file URL.560 - a web [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream).561562 This can be an [array of values](https://github.com/sindresorhus/execa#redirect-stdinstdoutstderr-to-multiple-destinations) such as `['inherit', 'pipe']` or `[filePath, 'pipe']`.563564 This can also be a generator function or a [`Duplex`](https://nodejs.org/api/stream.html#class-streamduplex) or a [web `TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) to transform the output. [Learn more.](https://github.com/sindresorhus/execa/tree/main/docs/transform.md)565566 @default 'pipe'567 */568 readonly stderr?: StdoutStderrOptionCommon<IsSync>;569570 /**571 Like the `stdin`, `stdout` and `stderr` options but for all file descriptors at once. For example, `{stdio: ['ignore', 'pipe', 'pipe']}` is the same as `{stdin: 'ignore', stdout: 'pipe', stderr: 'pipe'}`.572573 A single string can be used as a shortcut. For example, `{stdio: 'pipe'}` is the same as `{stdin: 'pipe', stdout: 'pipe', stderr: 'pipe'}`.574575 The array can have more than 3 items, to create additional file descriptors beyond `stdin`/`stdout`/`stderr`. For example, `{stdio: ['pipe', 'pipe', 'pipe', 'pipe']}` sets a fourth file descriptor.576577 @default 'pipe'578 */579 readonly stdio?: StdioOptions<IsSync>;580581 /**582 Set `result.stdout`, `result.stderr`, `result.all` and `result.stdio` as arrays of strings, splitting the subprocess' output into lines.583584 This cannot be used if the `encoding` option is binary.585586 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.587588 @default false589 */590 readonly lines?: FdGenericOption<boolean>;591592 /**593 Setting this to `false` resolves the promise with the error instead of rejecting it.594595 @default true596 */597 readonly reject?: boolean;598599 /**600 Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.601602 If the `lines` option is true, this applies to each output line instead.603604 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.605606 @default true607 */608 readonly stripFinalNewline?: FdGenericOption<boolean>;609610 /**611 If `true`, the subprocess uses both the `env` option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).612 If `false`, only the `env` option is used, not `process.env`.613614 @default true615 */616 readonly extendEnv?: boolean;617618 /**619 Current working directory of the subprocess.620621 This is also used to resolve the `nodePath` option when it is a relative path.622623 @default process.cwd()624 */625 readonly cwd?: string | URL;626627 /**628 Environment key-value pairs.629630 Unless the `extendEnv` option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).631632 @default process.env633 */634 readonly env?: NodeJS.ProcessEnv;635636 /**637 Explicitly set the value of `argv[0]` sent to the subprocess. This will be set to `command` or `file` if not specified.638 */639 readonly argv0?: string;640641 /**642 Sets the user identity of the subprocess.643 */644 readonly uid?: number;645646 /**647 Sets the group identity of the subprocess.648 */649 readonly gid?: number;650651 /**652 If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.653654 We recommend against using this option since it is:655 - not cross-platform, encouraging shell-specific syntax.656 - slower, because of the additional shell interpretation.657 - unsafe, potentially allowing command injection.658659 @default false660 */661 readonly shell?: boolean | string | URL;662663 /**664 If the subprocess outputs text, specifies its character encoding, either `'utf8'` or `'utf16le'`.665666 If it outputs binary data instead, this should be either:667 - `'buffer'`: returns the binary output as an `Uint8Array`.668 - `'hex'`, `'base64'`, `'base64url'`, [`'latin1'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings) or [`'ascii'`](https://nodejs.org/api/buffer.html#buffers-and-character-encodings): encodes the binary output as a string.669670 The output is available with `result.stdout`, `result.stderr` and `result.stdio`.671672 @default 'utf8'673 */674 readonly encoding?: EncodingOption;675676 /**677 If `timeout` is greater than `0`, the subprocess will be terminated if it runs for longer than that amount of milliseconds.678679 @default 0680 */681 readonly timeout?: number;682683 /**684 Largest amount of data allowed on `stdout`, `stderr` and `stdio`.685686 When this threshold is hit, the subprocess fails and `error.isMaxBuffer` becomes `true`.687688 This is measured:689 - By default: in [characters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length).690 - If the `encoding` option is `'buffer'`: in bytes.691 - If the `lines` option is `true`: in lines.692 - If a transform in object mode is used: in objects.693694 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.695696 @default 100_000_000697 */698 readonly maxBuffer?: FdGenericOption<number>;699700 /**701 Signal used to terminate the subprocess when:702 - using the `cancelSignal`, `timeout`, `maxBuffer` or `cleanup` option703 - calling `subprocess.kill()` with no arguments704705 This can be either a name (like `"SIGTERM"`) or a number (like `9`).706707 @default 'SIGTERM'708 */709 readonly killSignal?: string | number;710711 /**712 If the subprocess is terminated but does not exit, forcefully exit it by sending [`SIGKILL`](https://en.wikipedia.org/wiki/Signal_(IPC)#SIGKILL).713714 The grace period is 5 seconds by default. This feature can be disabled with `false`.715716 This works when the subprocess is terminated by either:717 - the `cancelSignal`, `timeout`, `maxBuffer` or `cleanup` option718 - calling `subprocess.kill()` with no arguments719720 This does not work when the subprocess is terminated by either:721 - calling `subprocess.kill()` with an argument722 - calling [`process.kill(subprocess.pid)`](https://nodejs.org/api/process.html#processkillpid-signal)723 - sending a termination signal from another process724725 Also, this does not work on Windows, because Windows [doesn't support signals](https://nodejs.org/api/process.html#process_signal_events): `SIGKILL` and `SIGTERM` both terminate the subprocess immediately. Other packages (such as [`taskkill`](https://github.com/sindresorhus/taskkill)) can be used to achieve fail-safe termination on Windows.726727 @default 5000728 */729 forceKillAfterDelay?: Unless<IsSync, number | false>;730731 /**732 If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.733734 @default false735 */736 readonly windowsVerbatimArguments?: boolean;737738 /**739 On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.740741 @default true742 */743 readonly windowsHide?: boolean;744745 /**746 If `verbose` is `'short'` or `'full'`, prints each command on `stderr` before executing it. When the command completes, prints its duration and (if it failed) its error.747748 If `verbose` is `'full'`, the command's `stdout` and `stderr` are printed too, unless either:749 - the `stdout`/`stderr` option is `ignore` or `inherit`.750 - the `stdout`/`stderr` is redirected to [a stream](https://nodejs.org/api/stream.html#readablepipedestination-options), a file, a file descriptor, or another subprocess.751 - the `encoding` option is binary.752753 This can also be set to `'full'` by setting the `NODE_DEBUG=execa` environment variable in the current process.754755 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.756757 @default 'none'758 */759 readonly verbose?: FdGenericOption<'none' | 'short' | 'full'>;760761 /**762 Kill the subprocess when the current process exits unless either:763 - the subprocess is `detached`.764 - the current process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit.765766 @default true767 */768 readonly cleanup?: Unless<IsSync, boolean>;769770 /**771 Whether to return the subprocess' output using the `result.stdout`, `result.stderr`, `result.all` and `result.stdio` properties.772773 On failure, the `error.stdout`, `error.stderr`, `error.all` and `error.stdio` properties are used instead.774775 When `buffer` is `false`, the output can still be read using the `subprocess.stdout`, `subprocess.stderr`, `subprocess.stdio` and `subprocess.all` streams. If the output is read, this should be done right away to avoid missing any data.776777 By default, this applies to both `stdout` and `stderr`, but different values can also be passed.778779 @default true780 */781 readonly buffer?: FdGenericOption<boolean>;782783 /**784 Add a `subprocess.all` stream and a `result.all` property. They contain the combined/[interleaved](#ensuring-all-output-is-interleaved) output of the subprocess' `stdout` and `stderr`.785786 @default false787 */788 readonly all?: boolean;789790 /**791 Enables exchanging messages with the subprocess using `subprocess.send(message)` and `subprocess.on('message', (message) => {})`.792793 @default `true` if the `node` option is enabled, `false` otherwise794 */795 readonly ipc?: Unless<IsSync, boolean>;796797 /**798 Specify the kind of serialization used for sending messages between subprocesses when using the `ipc` option:799 - `json`: Uses `JSON.stringify()` and `JSON.parse()`.800 - `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)801802 [More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)803804 @default 'advanced'805 */806 readonly serialization?: Unless<IsSync, 'json' | 'advanced'>;807808 /**809 Prepare subprocess to run independently of the current process. Specific behavior depends on the platform.810811 @default false812 */813 readonly detached?: Unless<IsSync, boolean>;814815 /**816 You can abort the subprocess using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).817818 When `AbortController.abort()` is called, `result.isCanceled` becomes `true`.819820 @example821 ```822 import {execa} from 'execa';823824 const abortController = new AbortController();825 const subprocess = execa('node', [], {cancelSignal: abortController.signal});826827 setTimeout(() => {828 abortController.abort();829 }, 1000);830831 try {832 await subprocess;833 } catch (error) {834 console.log(error.isTerminated); // true835 console.log(error.isCanceled); // true836 }837 ```838 */839 readonly cancelSignal?: Unless<IsSync, AbortSignal>;840};841842/**843Subprocess options.844845Some options are related to the subprocess output: `verbose`, `lines`, `stripFinalNewline`, `buffer`, `maxBuffer`. By default, those options apply to all file descriptors (`stdout`, `stderr`, etc.). A plain object can be passed instead to apply them to only `stdout`, `stderr`, `fd3`, etc.846847@example848849```850await execa('./run.js', {verbose: 'full'}) // Same value for stdout and stderr851await execa('./run.js', {verbose: {stdout: 'none', stderr: 'full'}}) // Different values852```853*/854export type Options = CommonOptions<false>;855856/**857Subprocess options, with synchronous methods.858859Some options are related to the subprocess output: `verbose`, `lines`, `stripFinalNewline`, `buffer`, `maxBuffer`. By default, those options apply to all file descriptors (`stdout`, `stderr`, etc.). A plain object can be passed instead to apply them to only `stdout`, `stderr`, `fd3`, etc.860861@example862863```864execaSync('./run.js', {verbose: 'full'}) // Same value for stdout and stderr865execaSync('./run.js', {verbose: {stdout: 'none', stderr: 'full'}}) // Different values866```867*/868export type SyncOptions = CommonOptions<true>;869870declare abstract class CommonResult<871 IsSync extends boolean = boolean,872 OptionsType extends CommonOptions = CommonOptions,873> {874 /**875 The file and arguments that were run, for logging purposes.876877 This is not escaped and should not be executed directly as a subprocess, including using `execa()` or `execaCommand()`.878 */879 command: string;880881 /**882 Same as `command` but escaped.883884 Unlike `command`, control characters are escaped, which makes it safe to print in a terminal.885886 This can also be copied and pasted into a shell, for debugging purposes.887 Since the escaping is fairly basic, this should not be executed directly as a subprocess, including using `execa()` or `execaCommand()`.888 */889 escapedCommand: string;890891 /**892 The numeric exit code of the subprocess that was run.893894 This is `undefined` when the subprocess could not be spawned or was terminated by a signal.895 */896 exitCode?: number;897898 /**899 The output of the subprocess on `stdout`.900901 This is `undefined` if the `stdout` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`. This is an array if the `lines` option is `true`, or if the `stdout` option is a transform in object mode.902 */903 stdout: NonAllStdioOutput<'1', OptionsType>;904905 /**906 The output of the subprocess on `stderr`.907908 This is `undefined` if the `stderr` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`. This is an array if the `lines` option is `true`, or if the `stderr` option is a transform in object mode.909 */910 stderr: NonAllStdioOutput<'2', OptionsType>;911912 /**913 The output of the subprocess on `stdin`, `stdout`, `stderr` and other file descriptors.914915 Items are `undefined` when their corresponding `stdio` option is set to only `'inherit'`, `'ignore'`, `Writable` or `integer`. Items are arrays when their corresponding `stdio` option is a transform in object mode.916 */917 stdio: StdioArrayOutput<OptionsType>;918919 /**920 Whether the subprocess failed to run.921 */922 failed: boolean;923924 /**925 Whether the subprocess timed out.926 */927 timedOut: boolean;928929 /**930 Whether the subprocess was terminated by a signal (like `SIGTERM`) sent by either:931 - The current process.932 - Another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).933 */934 isTerminated: boolean;935936 /**937 The name of the signal (like `SIGTERM`) that terminated the subprocess, sent by either:938 - The current process.939 - Another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).940941 If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`.942 */943 signal?: string;944945 /**946 A human-friendly description of the signal that was used to terminate the subprocess. For example, `Floating point arithmetic error`.947948 If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.949 */950 signalDescription?: string;951952 /**953 The current directory in which the command was run.954 */955 cwd: string;956957 /**958 Duration of the subprocess, in milliseconds.959 */960 durationMs: number;961962 /**963 Whether the subprocess was canceled using the `cancelSignal` option.964 */965 isCanceled: boolean;966967 /**968 Whether the subprocess failed because its output was larger than the `maxBuffer` option.969 */970 isMaxBuffer: boolean;971972 /**973 The output of the subprocess with `result.stdout` and `result.stderr` interleaved.974975 This is `undefined` if either:976 - the `all` option is `false` (default value).977 - both `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer`.978979 This is an array if the `lines` option is `true`, or if either the `stdout` or `stderr` option is a transform in object mode.980 */981 all: AllOutput<OptionsType>;982983 /**984 Results of the other subprocesses that were piped into this subprocess. This is useful to inspect a series of subprocesses piped with each other.985986 This array is initially empty and is populated each time the `subprocess.pipe()` method resolves.987 */988 pipedFrom: Unless<IsSync, ExecaResult[], []>;989990 /**991 Error message when the subprocess failed to run. In addition to the underlying error message, it also contains some information related to why the subprocess errored.992993 The subprocess `stderr`, `stdout` and other file descriptors' output are appended to the end, separated with newlines and not interleaved.994 */995 message?: string;996997 /**998 This is the same as the `message` property except it does not include the subprocess `stdout`/`stderr`/`stdio`.999 */1000 shortMessage?: string;10011002 /**1003 Original error message. This is the same as the `message` property excluding the subprocess `stdout`/`stderr`/`stdio` and some additional information added by Execa.10041005 This exists only if the subprocess exited due to an `error` event or a timeout.1006 */1007 originalMessage?: string;10081009 /**1010 Underlying error, if there is one. For example, this is set by `subprocess.kill(error)`.10111012 This is usually an `Error` instance.1013 */1014 cause?: unknown;10151016 /**1017 Node.js-specific [error code](https://nodejs.org/api/errors.html#errorcode), when available.1018 */1019 code?: string;10201021 // We cannot `extend Error` because `message` must be optional. So we copy its types here.1022 readonly name?: Error['name'];1023 stack?: Error['stack'];1024}10251026type CommonResultInstance<1027 IsSync extends boolean = boolean,1028 OptionsType extends CommonOptions = CommonOptions,1029> = InstanceType<typeof CommonResult<IsSync, OptionsType>>;10301031type SuccessResult<1032 IsSync extends boolean = boolean,1033 OptionsType extends CommonOptions = CommonOptions,1034> = CommonResultInstance<IsSync, OptionsType> & OmitErrorIfReject<OptionsType['reject']>;10351036type OmitErrorIfReject<RejectOption extends CommonOptions['reject']> = RejectOption extends false1037 ? {}1038 : {[ErrorProperty in ErrorProperties]: never};10391040type ErrorProperties =1041 | 'name'1042 | 'message'1043 | 'stack'1044 | 'cause'1045 | 'shortMessage'1046 | 'originalMessage'1047 | 'code';10481049/**1050Result of a subprocess execution.10511052When the subprocess fails, it is rejected with an `ExecaError` instead.1053*/1054export type ExecaResult<OptionsType extends Options = Options> = SuccessResult<false, OptionsType>;10551056/**1057Result of a subprocess execution.10581059When the subprocess fails, it is rejected with an `ExecaError` instead.1060*/1061export type ExecaSyncResult<OptionsType extends SyncOptions = SyncOptions> = SuccessResult<true, OptionsType>;10621063declare abstract class CommonError<1064 IsSync extends boolean = boolean,1065 OptionsType extends CommonOptions = CommonOptions,1066> extends CommonResult<IsSync, OptionsType> {1067 readonly name: NonNullable<CommonResult['name']>;1068 message: NonNullable<CommonResult['message']>;1069 stack: NonNullable<CommonResult['stack']>;1070 shortMessage: NonNullable<CommonResult['shortMessage']>;1071 originalMessage: NonNullable<CommonResult['originalMessage']>;1072}10731074/**1075Exception thrown when the subprocess fails, either:1076- its exit code is not `0`1077- it was terminated with a signal, including `subprocess.kill()`1078- timing out1079- being canceled1080- there's not enough memory or there are already too many subprocesses10811082This has the same shape as successful results, with a few additional properties.1083*/1084export class ExecaError<OptionsType extends Options = Options> extends CommonError<false, OptionsType> {1085 readonly name: 'ExecaError';1086}10871088/**1089Exception thrown when the subprocess fails, either:1090- its exit code is not `0`1091- it was terminated with a signal, including `.kill()`1092- timing out1093- being canceled1094- there's not enough memory or there are already too many subprocesses10951096This has the same shape as successful results, with a few additional properties.1097*/1098export class ExecaSyncError<OptionsType extends SyncOptions = SyncOptions> extends CommonError<true, OptionsType> {1099 readonly name: 'ExecaSyncError';1100}11011102type StreamUnlessIgnored<1103 FdNumber extends string,1104 OptionsType extends Options = Options,1105> = SubprocessStream<FdNumber, IgnoresStreamResult<FdNumber, OptionsType>, OptionsType>;11061107type SubprocessStream<1108 FdNumber extends string,1109 StreamResultIgnored extends boolean,1110 OptionsType extends Options = Options,1111> = StreamResultIgnored extends true1112 ? null1113 : InputOutputStream<IsInputStdioDescriptor<FdNumber, OptionsType>>;11141115// Type of `subprocess.stdio`1116type StdioArrayStreams<OptionsType extends Options = Options> = MapStdioStreams<StdioArrayOption<OptionsType>, OptionsType>;11171118// We cannot use mapped types because it must be compatible with Node.js `ChildProcess["stdio"]` which uses a tuple with exactly 5 items1119type MapStdioStreams<1120 StdioOptionsArrayType extends StdioOptionsArray,1121 OptionsType extends Options = Options,1122> = [1123 StreamUnlessIgnored<'0', OptionsType>,1124 StreamUnlessIgnored<'1', OptionsType>,1125 StreamUnlessIgnored<'2', OptionsType>,1126 '3' extends keyof StdioOptionsArrayType ? StreamUnlessIgnored<'3', OptionsType> : never,1127 '4' extends keyof StdioOptionsArrayType ? StreamUnlessIgnored<'4', OptionsType> : never,1128];11291130type InputOutputStream<IsInput extends boolean> = IsInput extends true1131 ? Writable1132 : Readable;11331134type AllStream<OptionsType extends Options = Options> = AllStreamProperty<OptionsType['all'], OptionsType>;11351136type AllStreamProperty<1137 AllOption extends Options['all'] = Options['all'],1138 OptionsType extends Options = Options,1139> = AllOption extends true1140 ? AllIfStdout<IgnoresStreamResult<'1', OptionsType>, OptionsType>1141 : undefined;11421143type AllIfStdout<1144 StdoutResultIgnored extends boolean,1145 OptionsType extends Options = Options,1146> = StdoutResultIgnored extends true1147 ? AllIfStderr<IgnoresStreamResult<'2', OptionsType>>1148 : Readable;11491150type AllIfStderr<StderrResultIgnored extends boolean> = StderrResultIgnored extends true1151 ? undefined1152 : Readable;11531154type FileDescriptorOption = `fd${number}`;1155type FromOption = 'stdout' | 'stderr' | 'all' | FileDescriptorOption;1156type ToOption = 'stdin' | FileDescriptorOption;11571158type PipeOptions = {1159 /**1160 Which stream to pipe from the source subprocess. A file descriptor like `"fd3"` can also be passed.11611162 `"all"` pipes both `stdout` and `stderr`. This requires the `all` option to be `true`.1163 */1164 readonly from?: FromOption;11651166 /**1167 Which stream to pipe to the destination subprocess. A file descriptor like `"fd3"` can also be passed.1168 */1169 readonly to?: ToOption;11701171 /**1172 Unpipe the subprocess when the signal aborts.11731174 The `subprocess.pipe()` method will be rejected with a cancellation error.1175 */1176 readonly unpipeSignal?: AbortSignal;1177};11781179type PipableSubprocess = {1180 /**1181 [Pipe](https://nodejs.org/api/stream.html#readablepipedestination-options) the subprocess' `stdout` to a second Execa subprocess' `stdin`. This resolves with that second subprocess' result. If either subprocess is rejected, this is rejected with that subprocess' error instead.11821183 This follows the same syntax as `execa(file, arguments?, options?)` except both regular options and pipe-specific options can be specified.11841185 This can be called multiple times to chain a series of subprocesses.11861187 Multiple subprocesses can be piped to the same subprocess. Conversely, the same subprocess can be piped to multiple other subprocesses.1188 */1189 pipe<OptionsType extends Options & PipeOptions = {}>(1190 file: string | URL,1191 arguments?: readonly string[],1192 options?: OptionsType,1193 ): Promise<ExecaResult<OptionsType>> & PipableSubprocess;1194 pipe<OptionsType extends Options & PipeOptions = {}>(1195 file: string | URL,1196 options?: OptionsType,1197 ): Promise<ExecaResult<OptionsType>> & PipableSubprocess;11981199 /**1200 Like `subprocess.pipe(file, arguments?, options?)` but using a `command` template string instead. This follows the same syntax as `$`.1201 */1202 pipe(templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[]):1203 Promise<ExecaResult<{}>> & PipableSubprocess;1204 pipe<OptionsType extends Options & PipeOptions = {}>(options: OptionsType):1205 (templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[])1206 => Promise<ExecaResult<OptionsType>> & PipableSubprocess;12071208 /**1209 Like `subprocess.pipe(file, arguments?, options?)` but using the return value of another `execa()` call instead.12101211 This is the most advanced method to pipe subprocesses. It is useful in specific cases, such as piping multiple subprocesses to the same subprocess.1212 */1213 pipe<Destination extends ExecaSubprocess>(destination: Destination, options?: PipeOptions):1214 Promise<Awaited<Destination>> & PipableSubprocess;1215};12161217type ReadableOptions = {1218 /**1219 Which stream to read from the subprocess. A file descriptor like `"fd3"` can also be passed.12201221 `"all"` reads both `stdout` and `stderr`. This requires the `all` option to be `true`.12221223 @default 'stdout'1224 */1225 readonly from?: FromOption;12261227 /**1228 If `false`, the stream iterates over lines. Each line is a string. Also, the stream is in [object mode](https://nodejs.org/api/stream.html#object-mode).12291230 If `true`, the stream iterates over arbitrary chunks of data. Each line is an `Uint8Array` (with `subprocess.iterable()`) or a [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer) (otherwise).12311232 This is always `true` when the `encoding` option is binary.12331234 @default `false` with `subprocess.iterable()`, `true` otherwise1235 */1236 readonly binary?: boolean;12371238 /**1239 If both this option and the `binary` option is `false`, newlines are stripped from each line.12401241 @default `false` with `subprocess.iterable()`, `true` otherwise1242 */1243 readonly preserveNewlines?: boolean;1244};12451246type WritableOptions = {1247 /**1248 Which stream to write to the subprocess. A file descriptor like `"fd3"` can also be passed.12491250 @default 'stdin'1251 */1252 readonly to?: ToOption;1253};12541255type DuplexOptions = ReadableOptions & WritableOptions;12561257type SubprocessAsyncIterable<1258 BinaryOption extends boolean | undefined,1259 EncodingOption extends Options['encoding'],1260> = AsyncIterableIterator<1261EncodingOption extends BinaryEncodingOption1262 ? Uint8Array1263 : BinaryOption extends true1264 ? Uint8Array1265 : string1266>;12671268type HasIpc<OptionsType extends Options> = OptionsType['ipc'] extends true1269 ? true1270 : OptionsType['stdio'] extends StdioOptionsArray1271 ? 'ipc' extends OptionsType['stdio'][number] ? true : false1272 : false;12731274export type ExecaResultPromise<OptionsType extends Options = Options> = {1275 /**1276 Process identifier ([PID](https://en.wikipedia.org/wiki/Process_identifier)).12771278 This is `undefined` if the subprocess failed to spawn.1279 */1280 pid?: number;12811282 /**1283 Send a `message` to the subprocess. The type of `message` depends on the `serialization` option.1284 The subprocess receives it as a [`message` event](https://nodejs.org/api/process.html#event-message).12851286 This returns `true` on success.12871288 This requires the `ipc` option to be `true`.12891290 [More info.](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback)1291 */1292 send: HasIpc<OptionsType> extends true ? ChildProcess['send'] : undefined;12931294 /**1295 The subprocess `stdin` as a stream.12961297 This is `null` if the `stdin` option is set to `'inherit'`, `'ignore'`, `Readable` or `integer`.12981299 This is intended for advanced cases. Please consider using the `stdin` option, `input` option, `inputFile` option, or `subprocess.pipe()` instead.1300 */1301 stdin: StreamUnlessIgnored<'0', OptionsType>;13021303 /**1304 The subprocess `stdout` as a stream.13051306 This is `null` if the `stdout` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.13071308 This is intended for advanced cases. Please consider using `result.stdout`, the `stdout` option, `subprocess.iterable()`, or `subprocess.pipe()` instead.1309 */1310 stdout: StreamUnlessIgnored<'1', OptionsType>;13111312 /**1313 The subprocess `stderr` as a stream.13141315 This is `null` if the `stderr` option is set to `'inherit'`, `'ignore'`, `Writable` or `integer`.13161317 This is intended for advanced cases. Please consider using `result.stderr`, the `stderr` option, `subprocess.iterable()`, or `subprocess.pipe()` instead.1318 */1319 stderr: StreamUnlessIgnored<'2', OptionsType>;13201321 /**1322 Stream combining/interleaving `subprocess.stdout` and `subprocess.stderr`.13231324 This is `undefined` if either:1325 - the `all` option is `false` (the default value).1326 - both `stdout` and `stderr` options are set to `'inherit'`, `'ignore'`, `Writable` or `integer`.13271328 This is intended for advanced cases. Please consider using `result.all`, the `stdout`/`stderr` option, `subprocess.iterable()`, or `subprocess.pipe()` instead.1329 */1330 all: AllStream<OptionsType>;13311332 /**1333 The subprocess `stdin`, `stdout`, `stderr` and other files descriptors as an array of streams.13341335 Each array item is `null` if the corresponding `stdin`, `stdout`, `stderr` or `stdio` option is set to `'inherit'`, `'ignore'`, `Stream` or `integer`.13361337 This is intended for advanced cases. Please consider using `result.stdio`, the `stdio` option, `subprocess.iterable()` or `subprocess.pipe()` instead.1338 */1339 stdio: StdioArrayStreams<OptionsType>;13401341 catch<ResultType = never>(1342 onRejected?: (reason: ExecaError<OptionsType>) => ResultType | PromiseLike<ResultType>1343 ): Promise<ExecaResult<OptionsType> | ResultType>;13441345 /**1346 Sends a [signal](https://nodejs.org/api/os.html#signal-constants) to the subprocess. The default signal is the `killSignal` option. `killSignal` defaults to `SIGTERM`, which terminates the subprocess.13471348 This returns `false` when the signal could not be sent, for example when the subprocess has already exited.13491350 When an error is passed as argument, it is set to the subprocess' `error.cause`. The subprocess is then terminated with the default signal. This does not emit the [`error` event](https://nodejs.org/api/child_process.html#event-error).13511352 [More info.](https://nodejs.org/api/child_process.html#subprocesskillsignal)1353 */1354 kill(signal: Parameters<ChildProcess['kill']>[0], error?: Error): ReturnType<ChildProcess['kill']>;1355 kill(error?: Error): ReturnType<ChildProcess['kill']>;13561357 /**1358 Subprocesses are [async iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator). They iterate over each output line.13591360 The iteration waits for the subprocess to end. It throws if the subprocess fails. This means you do not need to `await` the subprocess' promise.1361 */1362 [Symbol.asyncIterator](): SubprocessAsyncIterable<undefined, OptionsType['encoding']>;13631364 /**1365 Same as `subprocess[Symbol.asyncIterator]` except options can be provided.1366 */1367 iterable<IterableOptions extends ReadableOptions = {}>(readableOptions?: IterableOptions): SubprocessAsyncIterable<IterableOptions['binary'], OptionsType['encoding']>;13681369 /**1370 Converts the subprocess to a readable stream.13711372 Unlike `subprocess.stdout`, the stream waits for the subprocess to end and emits an [`error`](https://nodejs.org/api/stream.html#event-error) event if the subprocess fails. This means you do not need to `await` the subprocess' promise. On the other hand, you do need to handle to the stream `error` event. This can be done by using [`await finished(stream)`](https://nodejs.org/api/stream.html#streamfinishedstream-options), [`await pipeline(..., stream)`](https://nodejs.org/api/stream.html#streampipelinesource-transforms-destination-options) or [`await text(stream)`](https://nodejs.org/api/webstreams.html#streamconsumerstextstream) which throw an exception when the stream errors.13731374 Before using this method, please first consider the `stdin`/`stdout`/`stderr`/`stdio` options, `subprocess.pipe()` or `subprocess.iterable()`.1375 */1376 readable(readableOptions?: ReadableOptions): Readable;13771378 /**1379 Converts the subprocess to a writable stream.13801381 Unlike `subprocess.stdin`, the stream waits for the subprocess to end and emits an [`error`](https://nodejs.org/api/stream.html#event-error) event if the subprocess fails. This means you do not need to `await` the subprocess' promise. On the other hand, you do need to handle to the stream `error` event. This can be done by using [`await finished(stream)`](https://nodejs.org/api/stream.html#streamfinishedstream-options) or [`await pipeline(stream, ...)`](https://nodejs.org/api/stream.html#streampipelinesource-transforms-destination-options) which throw an exception when the stream errors.13821383 Before using this method, please first consider the `stdin`/`stdout`/`stderr`/`stdio` options or `subprocess.pipe()`.1384 */1385 writable(writableOptions?: WritableOptions): Writable;13861387 /**1388 Converts the subprocess to a duplex stream.13891390 The stream waits for the subprocess to end and emits an [`error`](https://nodejs.org/api/stream.html#event-error) event if the subprocess fails. This means you do not need to `await` the subprocess' promise. On the other hand, you do need to handle to the stream `error` event. This can be done by using [`await finished(stream)`](https://nodejs.org/api/stream.html#streamfinishedstream-options), [`await pipeline(..., stream, ...)`](https://nodejs.org/api/stream.html#streampipelinesource-transforms-destination-options) or [`await text(stream)`](https://nodejs.org/api/webstreams.html#streamconsumerstextstream) which throw an exception when the stream errors.13911392 Before using this method, please first consider the `stdin`/`stdout`/`stderr`/`stdio` options, `subprocess.pipe()` or `subprocess.iterable()`.1393 */1394 duplex(duplexOptions?: DuplexOptions): Duplex;1395} & PipableSubprocess;13961397export type ExecaSubprocess<OptionsType extends Options = Options> = Omit<ChildProcess, keyof ExecaResultPromise<OptionsType>> &1398ExecaResultPromise<OptionsType> &1399Promise<ExecaResult<OptionsType>>;14001401type TemplateExpression = string | number | CommonResultInstance1402| ReadonlyArray<string | number | CommonResultInstance>;14031404type TemplateString = readonly [TemplateStringsArray, ...readonly TemplateExpression[]];1405type SimpleTemplateString = readonly [TemplateStringsArray, string?];14061407type Execa<OptionsType extends Options> = {1408 <NewOptionsType extends Options = {}>(options: NewOptionsType): Execa<OptionsType & NewOptionsType>;14091410 (...templateString: TemplateString): ExecaSubprocess<OptionsType>;14111412 <NewOptionsType extends Options = {}>(1413 file: string | URL,1414 arguments?: readonly string[],1415 options?: NewOptionsType,1416 ): ExecaSubprocess<OptionsType & NewOptionsType>;14171418 <NewOptionsType extends Options = {}>(1419 file: string | URL,1420 options?: NewOptionsType,1421 ): ExecaSubprocess<OptionsType & NewOptionsType>;1422};14231424/**1425Executes a command using `file ...arguments`.14261427Arguments are automatically escaped. They can contain any character, including spaces, tabs and newlines.14281429When `command` is a template string, it includes both the `file` and its `arguments`.14301431The `command` template string can inject any `${value}` with the following types: string, number, `subprocess` or an array of those types. For example: `` execa`echo one ${'two'} ${3} ${['four', 'five']}` ``. For `${subprocess}`, the subprocess's `stdout` is used.14321433When `command` is a template string, arguments can contain any character, but spaces, tabs and newlines must use `${}` like `` execa`echo ${'has space'}` ``.14341435The `command` template string can use multiple lines and indentation.14361437`execa(options)` can be used to return a new instance of Execa but with different default `options`. Consecutive calls are merged to previous ones. This allows setting global options or sharing options between multiple commands.14381439@param file - The program/script to execute, as a string or file URL1440@param arguments - Arguments to pass to `file` on execution.1441@returns An `ExecaSubprocess` that is both:1442- a `Promise` resolving or rejecting with a subprocess `result`.1443- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.1444@throws A subprocess `result` error14451446@example <caption>Promise interface</caption>1447```1448import {execa} from 'execa';14491450const {stdout} = await execa('echo', ['unicorns']);1451console.log(stdout);1452//=> 'unicorns'1453```14541455@example <caption>Global/shared options</caption>1456```1457import {execa as execa_} from 'execa';14581459const execa = execa_({verbose: 'full'});14601461await execa('echo', ['unicorns']);1462//=> 'unicorns'1463```14641465@example <caption>Template string interface</caption>14661467```1468import {execa} from 'execa';14691470const arg = 'unicorns';1471const {stdout} = await execa`echo ${arg} & rainbows!`;1472console.log(stdout);1473//=> 'unicorns & rainbows!'1474```14751476@example <caption>Template string multiple arguments</caption>14771478```1479import {execa} from 'execa';14801481const args = ['unicorns', '&', 'rainbows!'];1482const {stdout} = await execa`echo ${args}`;1483console.log(stdout);1484//=> 'unicorns & rainbows!'1485```14861487@example <caption>Template string with options</caption>14881489```1490import {execa} from 'execa';14911492await execa({verbose: 'full'})`echo unicorns`;1493//=> 'unicorns'1494```14951496@example <caption>Redirect output to a file</caption>1497```1498import {execa} from 'execa';14991500// Similar to `echo unicorns > stdout.txt` in Bash1501await execa('echo', ['unicorns'], {stdout: {file: 'stdout.txt'}});15021503// Similar to `echo unicorns 2> stdout.txt` in Bash1504await execa('echo', ['unicorns'], {stderr: {file: 'stderr.txt'}});15051506// Similar to `echo unicorns &> stdout.txt` in Bash1507await execa('echo', ['unicorns'], {stdout: {file: 'all.txt'}, stderr: {file: 'all.txt'}});1508```15091510@example <caption>Redirect input from a file</caption>1511```1512import {execa} from 'execa';15131514// Similar to `cat < stdin.txt` in Bash1515const {stdout} = await execa('cat', {inputFile: 'stdin.txt'});1516console.log(stdout);1517//=> 'unicorns'1518```15191520@example <caption>Save and pipe output from a subprocess</caption>1521```1522import {execa} from 'execa';15231524const {stdout} = await execa('echo', ['unicorns'], {stdout: ['pipe', 'inherit']});1525// Prints `unicorns`1526console.log(stdout);1527// Also returns 'unicorns'1528```15291530@example <caption>Pipe multiple subprocesses</caption>1531```1532import {execa} from 'execa';15331534// Similar to `echo unicorns | cat` in Bash1535const {stdout} = await execa('echo', ['unicorns']).pipe(execa('cat'));1536console.log(stdout);1537//=> 'unicorns'1538```15391540@example <caption>Pipe with template strings</caption>1541```1542import {execa} from 'execa';15431544await execa`npm run build`1545 .pipe`sort`1546 .pipe`head -n2`;1547```15481549@example <caption>Iterate over output lines</caption>1550```1551import {execa} from 'execa';15521553for await (const line of execa`npm run build`)) {1554 if (line.includes('ERROR')) {1555 console.log(line);1556 }1557}1558```15591560@example <caption>Handling errors</caption>1561```1562import {execa} from 'execa';15631564// Catching an error1565try {1566 await execa('unknown', ['command']);1567} catch (error) {1568 console.log(error);1569 /*1570 ExecaError: Command failed with ENOENT: unknown command1571 spawn unknown ENOENT1572 at ...1573 at ... {1574 shortMessage: 'Command failed with ENOENT: unknown command\nspawn unknown ENOENT',1575 originalMessage: 'spawn unknown ENOENT',1576 command: 'unknown command',1577 escapedCommand: 'unknown command',1578 cwd: '/path/to/cwd',1579 durationMs: 28.217566,1580 failed: true,1581 timedOut: false,1582 isCanceled: false,1583 isTerminated: false,1584 isMaxBuffer: false,1585 code: 'ENOENT',1586 stdout: '',1587 stderr: '',1588 stdio: [undefined, '', ''],1589 pipedFrom: []1590 [cause]: Error: spawn unknown ENOENT1591 at ...1592 at ... {1593 errno: -2,1594 code: 'ENOENT',1595 syscall: 'spawn unknown',1596 path: 'unknown',1597 spawnargs: [ 'command' ]1598 }1599 }1600 \*\/1601}1602```1603*/1604declare const execa: Execa<{}>;16051606type ExecaSync<OptionsType extends SyncOptions> = {1607 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaSync<OptionsType & NewOptionsType>;16081609 (...templateString: TemplateString): ExecaSyncResult<OptionsType>;16101611 <NewOptionsType extends SyncOptions = {}>(1612 file: string | URL,1613 arguments?: readonly string[],1614 options?: NewOptionsType,1615 ): ExecaSyncResult<OptionsType & NewOptionsType>;16161617 <NewOptionsType extends SyncOptions = {}>(1618 file: string | URL,1619 options?: NewOptionsType,1620 ): ExecaSyncResult<OptionsType & NewOptionsType>;1621};16221623/**1624Same as `execa()` but synchronous.16251626Returns or throws a subprocess `result`. The `subprocess` is not returned: its methods and properties are not available.16271628The following features cannot be used:1629- Streams: `subprocess.stdin`, `subprocess.stdout`, `subprocess.stderr`, `subprocess.readable()`, `subprocess.writable()`, `subprocess.duplex()`.1630- The `stdin`, `stdout`, `stderr` and `stdio` options cannot be `'overlapped'`, an async iterable, an async transform, a `Duplex`, nor a web stream. Node.js streams can be passed but only if either they [have a file descriptor](#redirect-a-nodejs-stream-fromto-stdinstdoutstderr), or the `input` option is used.1631- Signal termination: `subprocess.kill()`, `subprocess.pid`, `cleanup` option, `cancelSignal` option, `forceKillAfterDelay` option.1632- Piping multiple processes: `subprocess.pipe()`.1633- `subprocess.iterable()`.1634- `ipc` and `serialization` options.1635- `result.all` is not interleaved.1636- `detached` option.1637- The `maxBuffer` option is always measured in bytes, not in characters, lines nor objects. Also, it ignores transforms and the `encoding` option.16381639@param file - The program/script to execute, as a string or file URL1640@param arguments - Arguments to pass to `file` on execution.1641@returns A subprocess `result` object1642@throws A subprocess `result` error16431644@example <caption>Promise interface</caption>1645```1646import {execa} from 'execa';16471648const {stdout} = execaSync('echo', ['unicorns']);1649console.log(stdout);1650//=> 'unicorns'1651```16521653@example <caption>Redirect input from a file</caption>1654```1655import {execa} from 'execa';16561657// Similar to `cat < stdin.txt` in Bash1658const {stdout} = execaSync('cat', {inputFile: 'stdin.txt'});1659console.log(stdout);1660//=> 'unicorns'1661```16621663@example <caption>Handling errors</caption>1664```1665import {execa} from 'execa';16661667// Catching an error1668try {1669 execaSync('unknown', ['command']);1670} catch (error) {1671 console.log(error);1672 /*1673 {1674 message: 'Command failed with ENOENT: unknown command\nspawnSync unknown ENOENT',1675 errno: -2,1676 code: 'ENOENT',1677 syscall: 'spawnSync unknown',1678 path: 'unknown',1679 spawnargs: ['command'],1680 shortMessage: 'Command failed with ENOENT: unknown command\nspawnSync unknown ENOENT',1681 originalMessage: 'spawnSync unknown ENOENT',1682 command: 'unknown command',1683 escapedCommand: 'unknown command',1684 cwd: '/path/to/cwd',1685 failed: true,1686 timedOut: false,1687 isCanceled: false,1688 isTerminated: false,1689 isMaxBuffer: false,1690 stdio: [],1691 pipedFrom: []1692 }1693 \*\/1694}1695```1696*/1697declare const execaSync: ExecaSync<{}>;16981699type ExecaCommand<OptionsType extends Options> = {1700 <NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaCommand<OptionsType & NewOptionsType>;17011702 (...templateString: SimpleTemplateString): ExecaSubprocess<OptionsType>;17031704 <NewOptionsType extends Options = {}>(1705 command: string,1706 options?: NewOptionsType,1707 ): ExecaSubprocess<OptionsType & NewOptionsType>;1708};17091710/**1711`execa` with the template string syntax allows the `file` or the `arguments` to be user-defined (by injecting them with `${}`). However, if _both_ the `file` and the `arguments` are user-defined, _and_ those are supplied as a single string, then `execaCommand(command)` must be used instead.17121713This is only intended for very specific cases, such as a REPL. This should be avoided otherwise.17141715Just like `execa()`, this can bind options. It can also be run synchronously using `execaCommandSync()`.17161717Arguments are automatically escaped. They can contain any character, but spaces must be escaped with a backslash like `execaCommand('echo has\\ space')`.17181719@param command - The program/script to execute and its arguments.1720@returns An `ExecaSubprocess` that is both:1721- a `Promise` resolving or rejecting with a subprocess `result`.1722- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.1723@throws A subprocess `result` error17241725@example1726```1727import {execaCommand} from 'execa';17281729const {stdout} = await execaCommand('echo unicorns');1730console.log(stdout);1731//=> 'unicorns'1732```1733*/1734declare const execaCommand: ExecaCommand<{}>;17351736type ExecaCommandSync<OptionsType extends SyncOptions> = {1737 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaCommandSync<OptionsType & NewOptionsType>;17381739 (...templateString: SimpleTemplateString): ExecaSyncResult<OptionsType>;17401741 <NewOptionsType extends SyncOptions = {}>(1742 command: string,1743 options?: NewOptionsType,1744 ): ExecaSyncResult<OptionsType & NewOptionsType>;1745};17461747/**1748Same as `execaCommand()` but synchronous.17491750Returns or throws a subprocess `result`. The `subprocess` is not returned: its methods and properties are not available.17511752The following features cannot be used:1753- Streams: `subprocess.stdin`, `subprocess.stdout`, `subprocess.stderr`, `subprocess.readable()`, `subprocess.writable()`, `subprocess.duplex()`.1754- The `stdin`, `stdout`, `stderr` and `stdio` options cannot be `'overlapped'`, an async iterable, an async transform, a `Duplex`, nor a web stream. Node.js streams can be passed but only if either they [have a file descriptor](#redirect-a-nodejs-stream-fromto-stdinstdoutstderr), or the `input` option is used.1755- Signal termination: `subprocess.kill()`, `subprocess.pid`, `cleanup` option, `cancelSignal` option, `forceKillAfterDelay` option.1756- Piping multiple processes: `subprocess.pipe()`.1757- `subprocess.iterable()`.1758- `ipc` and `serialization` options.1759- `result.all` is not interleaved.1760- `detached` option.1761- The `maxBuffer` option is always measured in bytes, not in characters, lines nor objects. Also, it ignores transforms and the `encoding` option.17621763@param command - The program/script to execute and its arguments.1764@returns A subprocess `result` object1765@throws A subprocess `result` error17661767@example1768```1769import {execaCommandSync} from 'execa';17701771const {stdout} = execaCommandSync('echo unicorns');1772console.log(stdout);1773//=> 'unicorns'1774```1775*/1776declare const execaCommandSync: ExecaCommandSync<{}>;17771778type ExecaScriptCommon<OptionsType extends CommonOptions> = {1779 <NewOptionsType extends CommonOptions = {}>(options: NewOptionsType): ExecaScript<OptionsType & NewOptionsType>;17801781 (...templateString: TemplateString): ExecaSubprocess<StricterOptions<OptionsType, Options>>;17821783 <NewOptionsType extends Options = {}>(1784 file: string | URL,1785 arguments?: readonly string[],1786 options?: NewOptionsType,1787 ): ExecaSubprocess<OptionsType & NewOptionsType>;17881789 <NewOptionsType extends Options = {}>(1790 file: string | URL,1791 options?: NewOptionsType,1792 ): ExecaSubprocess<OptionsType & NewOptionsType>;1793};17941795type ExecaScriptSync<OptionsType extends CommonOptions> = {1796 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaScriptSync<OptionsType & NewOptionsType>;17971798 (...templateString: TemplateString): ExecaSyncResult<StricterOptions<OptionsType, SyncOptions>>;17991800 <NewOptionsType extends SyncOptions = {}>(1801 file: string | URL,1802 arguments?: readonly string[],1803 options?: NewOptionsType,1804 ): ExecaSyncResult<OptionsType & NewOptionsType>;18051806 <NewOptionsType extends SyncOptions = {}>(1807 file: string | URL,1808 options?: NewOptionsType,1809 ): ExecaSyncResult<OptionsType & NewOptionsType>;1810};18111812type ExecaScript<OptionsType extends CommonOptions> = {1813 sync: ExecaScriptSync<OptionsType>;1814 s: ExecaScriptSync<OptionsType>;1815} & ExecaScriptCommon<OptionsType>;18161817/**1818Same as `execa()` but using the `stdin: 'inherit'` and `preferLocal: true` options.18191820Just like `execa()`, this can use the template string syntax or bind options. It can also be run synchronously using `$.sync()` or `$.s()`.18211822This is the preferred method when executing multiple commands in a script file.18231824@returns An `ExecaSubprocess` that is both:1825 - a `Promise` resolving or rejecting with a subprocess `result`.1826 - a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.1827@throws A subprocess `result` error18281829@example <caption>Basic</caption>1830```1831import {$} from 'execa';18321833const branch = await $`git branch --show-current`;1834await $`dep deploy --branch=${branch}`;1835```18361837@example <caption>Verbose mode</caption>1838```1839> node file.js1840unicorns1841rainbows18421843> NODE_DEBUG=execa node file.js1844[19:49:00.360] [0] $ echo unicorns1845unicorns1846[19:49:00.383] [0] √ (done in 23ms)1847[19:49:00.383] [1] $ echo rainbows1848rainbows1849[19:49:00.404] [1] √ (done in 21ms)1850```1851*/1852export const $: ExecaScript<{}>;18531854type ExecaNode<OptionsType extends Options> = {1855 <NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaNode<OptionsType & NewOptionsType>;18561857 (...templateString: TemplateString): ExecaSubprocess<OptionsType>;18581859 <NewOptionsType extends Options = {}>(1860 scriptPath: string | URL,1861 arguments?: readonly string[],1862 options?: NewOptionsType,1863 ): ExecaSubprocess<OptionsType & NewOptionsType>;18641865 <NewOptionsType extends Options = {}>(1866 scriptPath: string | URL,1867 options?: NewOptionsType,1868 ): ExecaSubprocess<OptionsType & NewOptionsType>;1869};18701871/**1872Same as `execa()` but using the `node: true` option.1873Executes a Node.js file using `node scriptPath ...arguments`.18741875Just like `execa()`, this can use the template string syntax or bind options.18761877This is the preferred method when executing Node.js files.18781879@param scriptPath - Node.js script to execute, as a string or file URL1880@param arguments - Arguments to pass to `scriptPath` on execution.1881@returns An `ExecaSubprocess` that is both:1882- a `Promise` resolving or rejecting with a subprocess `result`.1883- a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with some additional methods and properties.1884@throws A subprocess `result` error18851886@example1887```1888import {execaNode} from 'execa';18891890await execaNode('scriptPath', ['argument']);1891```1892*/1893export const execaNode: ExecaNode<{}>;1export type {StdinOption, StdinOptionSync, StdoutStderrOption, StdoutStderrOptionSync, StdioOption, StdioOptionSync} from './types/stdio/type';2export type {Options, SyncOptions} from './types/arguments/options';3export type {ExecaResult, ExecaSyncResult} from './types/return/result';4export type {ExecaResultPromise, ExecaSubprocess} from './types/subprocess/subprocess';5/* eslint-disable import/extensions */6export {ExecaError, ExecaSyncError} from './types/return/final-error';7export {execa} from './types/methods/main-async';8export {execaSync} from './types/methods/main-sync';9export {execaCommand, execaCommandSync} from './types/methods/command';10export {$} from './types/methods/script';11export {execaNode} from './types/methods/node';12/* eslint-enable import/extensions */
deleted:index.test-d.ts-4133 removed
1// For some reason a default import of `process` causes2// `process.stdin`, `process.stderr`, and `process.stdout`3// to get treated as `any` by `@typescript-eslint/no-unsafe-assignment`.4import * as process from 'node:process';5import {Readable, Writable, Duplex, Transform} from 'node:stream';6import {createWriteStream} from 'node:fs';7import {expectType, expectNotType, expectError, expectAssignable, expectNotAssignable} from 'tsd';8import {9 $,10 execa,11 execaSync,12 execaCommand,13 execaCommandSync,14 execaNode,15 ExecaError,16 ExecaSyncError,17 type Options,18 type ExecaResult,19 type ExecaSubprocess,20 type SyncOptions,21 type ExecaSyncResult,22 type StdinOption,23 type StdinOptionSync,24 type StdoutStderrOption,25 type StdoutStderrOptionSync,26 type StdioOption,27 type StdioOptionSync,28} from './index.js';2930const pipeInherit = ['pipe', 'inherit'] as const;31const pipeUndefined = ['pipe', undefined] as const;3233const fileUrl = new URL('file:///test');34const fileObject = {file: './test'} as const;35const invalidFileObject = {file: fileUrl} as const;3637const stringArray = ['foo', 'bar'] as const;38const binaryArray = [new Uint8Array(), new Uint8Array()] as const;39const objectArray = [{}, {}] as const;4041const stringIterableFunction = function * () {42 yield '';43};4445const stringIterable = stringIterableFunction();4647const binaryIterableFunction = function * () {48 yield new Uint8Array(0);49};5051const binaryIterable = binaryIterableFunction();5253const objectIterableFunction = function * () {54 yield {};55};5657const objectIterable = objectIterableFunction();5859const asyncStringIterableFunction = async function * () {60 yield '';61};6263const asyncStringIterable = asyncStringIterableFunction();6465const asyncBinaryIterableFunction = async function * () {66 yield new Uint8Array(0);67};6869const asyncBinaryIterable = asyncBinaryIterableFunction();7071const asyncObjectIterableFunction = async function * () {72 yield {};73};7475const asyncObjectIterable = asyncObjectIterableFunction();7677const duplexStream = new Duplex();78const duplex = {transform: duplexStream} as const;79const duplexObject = {transform: duplexStream as Duplex & {readonly readableObjectMode: true}} as const;80const duplexNotObject = {transform: duplexStream as Duplex & {readonly readableObjectMode: false}} as const;81const duplexObjectProperty = {transform: duplexStream, objectMode: true as const} as const;82const duplexNotObjectProperty = {transform: duplexStream, objectMode: false as const} as const;83const duplexTransform = {transform: new Transform()} as const;84const duplexWithInvalidObjectMode = {...duplex, objectMode: 'true'} as const;8586const webTransformInstance = new TransformStream();87const webTransform = {transform: webTransformInstance} as const;88const webTransformObject = {transform: webTransformInstance, objectMode: true as const} as const;89const webTransformNotObject = {transform: webTransformInstance, objectMode: false as const} as const;90const webTransformWithInvalidObjectMode = {...webTransform, objectMode: 'true'} as const;9192const unknownGenerator = function * (line: unknown) {93 yield line;94};9596const unknownGeneratorFull = {transform: unknownGenerator, objectMode: true} as const;9798const unknownFinal = function * () {99 yield {} as unknown;100};101102const unknownFinalFull = {transform: unknownGenerator, final: unknownFinal, objectMode: true} as const;103104const objectGenerator = function * (line: unknown) {105 yield JSON.parse(line as string) as object;106};107108const objectGeneratorFull = {transform: objectGenerator, objectMode: true} as const;109110const objectFinal = function * () {111 yield {};112};113114const objectFinalFull = {transform: objectGenerator, final: objectFinal, objectMode: true} as const;115116const booleanGenerator = function * (line: boolean) {117 yield line;118};119120const booleanGeneratorFull = {transform: booleanGenerator} as const;121122const stringGenerator = function * (line: string) {123 yield line;124};125126const stringGeneratorFull = {transform: stringGenerator} as const;127128const invalidReturnGenerator = function * (line: unknown) {129 yield line;130 return false;131};132133const invalidReturnGeneratorFull = {transform: invalidReturnGenerator} as const;134135const invalidReturnFinal = function * () {136 yield {} as unknown;137 return false;138};139140const invalidReturnFinalFull = {transform: stringGenerator, final: invalidReturnFinal} as const;141142const asyncGenerator = async function * (line: unknown) {143 yield '';144};145146const asyncGeneratorFull = {transform: asyncGenerator} as const;147148const asyncFinal = async function * () {149 yield '';150};151152const asyncFinalFull = {transform: asyncGenerator, final: asyncFinal} as const;153154const transformWithBinary = {transform: unknownGenerator, binary: true} as const;155const transformWithInvalidBinary = {transform: unknownGenerator, binary: 'true'} as const;156const transformWithPreserveNewlines = {transform: unknownGenerator, preserveNewlines: true} as const;157const transformWithInvalidPreserveNewlines = {transform: unknownGenerator, preserveNewlines: 'true'} as const;158const transformWithObjectMode = {transform: unknownGenerator, objectMode: true} as const;159const transformWithInvalidObjectMode = {transform: unknownGenerator, objectMode: 'true'} as const;160const binaryOnly = {binary: true} as const;161const preserveNewlinesOnly = {preserveNewlines: true} as const;162const objectModeOnly = {objectMode: true} as const;163const finalOnly = {final: unknownFinal} as const;164165type AnyChunk = string | Uint8Array | string[] | unknown[] | undefined;166expectType<Writable | null>({} as ExecaSubprocess['stdin']);167expectType<Readable | null>({} as ExecaSubprocess['stdout']);168expectType<Readable | null>({} as ExecaSubprocess['stderr']);169expectType<Readable | undefined>({} as ExecaSubprocess['all']);170expectType<AnyChunk>({} as ExecaResult['stdout']);171expectType<AnyChunk>({} as ExecaResult['stderr']);172expectType<AnyChunk>({} as ExecaResult['all']);173expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as ExecaResult['stdio']);174expectType<AnyChunk>({} as ExecaSyncResult['stdout']);175expectType<AnyChunk>({} as ExecaSyncResult['stderr']);176expectType<AnyChunk>({} as ExecaSyncResult['all']);177expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as ExecaSyncResult['stdio']);178179try {180 const execaPromise = execa('unicorns', {all: true});181 const unicornsResult = await execaPromise;182183 const execaBufferPromise = execa('unicorns', {encoding: 'buffer', all: true});184 const bufferResult = await execaBufferPromise;185186 const execaHexPromise = execa('unicorns', {encoding: 'hex', all: true});187 const hexResult = await execaHexPromise;188189 const scriptPromise = $`unicorns`;190191 const pipeOptions = {from: 'stderr', to: 'fd3', all: true} as const;192193 type BufferExecaReturnValue = typeof bufferResult;194 type EmptyExecaReturnValue = ExecaResult<{}>;195 type ShortcutExecaReturnValue = ExecaResult<typeof pipeOptions>;196197 expectType<BufferExecaReturnValue>(await execaPromise.pipe(execaBufferPromise));198 expectType<BufferExecaReturnValue>(await scriptPromise.pipe(execaBufferPromise));199 expectNotType<BufferExecaReturnValue>(await execaPromise.pipe(execaPromise));200 expectNotType<BufferExecaReturnValue>(await scriptPromise.pipe(execaPromise));201 expectType<EmptyExecaReturnValue>(await execaPromise.pipe`stdin`);202 expectType<EmptyExecaReturnValue>(await scriptPromise.pipe`stdin`);203 expectType<ShortcutExecaReturnValue>(await execaPromise.pipe('stdin', pipeOptions));204 expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe('stdin', pipeOptions));205 expectType<BufferExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe(execaBufferPromise));206 expectType<BufferExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe(execaBufferPromise));207 expectType<EmptyExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe`stdin`);208 expectType<EmptyExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe`stdin`);209 expectType<ShortcutExecaReturnValue>(await execaPromise.pipe(execaPromise).pipe('stdin', pipeOptions));210 expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe(execaPromise).pipe('stdin', pipeOptions));211 expectType<BufferExecaReturnValue>(await execaPromise.pipe`stdin`.pipe(execaBufferPromise));212 expectType<BufferExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe(execaBufferPromise));213 expectType<EmptyExecaReturnValue>(await execaPromise.pipe`stdin`.pipe`stdin`);214 expectType<EmptyExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe`stdin`);215 expectType<ShortcutExecaReturnValue>(await execaPromise.pipe`stdin`.pipe('stdin', pipeOptions));216 expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe`stdin`.pipe('stdin', pipeOptions));217 expectType<BufferExecaReturnValue>(await execaPromise.pipe('pipe').pipe(execaBufferPromise));218 expectType<BufferExecaReturnValue>(await scriptPromise.pipe('pipe').pipe(execaBufferPromise));219 expectType<EmptyExecaReturnValue>(await execaPromise.pipe('pipe').pipe`stdin`);220 expectType<EmptyExecaReturnValue>(await scriptPromise.pipe('pipe').pipe`stdin`);221 expectType<ShortcutExecaReturnValue>(await execaPromise.pipe('pipe').pipe('stdin', pipeOptions));222 expectType<ShortcutExecaReturnValue>(await scriptPromise.pipe('pipe').pipe('stdin', pipeOptions));223 await execaPromise.pipe(execaPromise).pipe(execaBufferPromise, pipeOptions);224 await scriptPromise.pipe(execaPromise).pipe(execaBufferPromise, pipeOptions);225 await execaPromise.pipe(execaBufferPromise, pipeOptions).pipe`stdin`;226 await scriptPromise.pipe(execaBufferPromise, pipeOptions).pipe`stdin`;227 await execaPromise.pipe(execaBufferPromise, pipeOptions).pipe('stdin');228 await scriptPromise.pipe(execaBufferPromise, pipeOptions).pipe('stdin');229 await execaPromise.pipe`stdin`.pipe(execaBufferPromise, pipeOptions);230 await scriptPromise.pipe`stdin`.pipe(execaBufferPromise, pipeOptions);231 await execaPromise.pipe`stdin`.pipe(pipeOptions)`stdin`;232 await scriptPromise.pipe`stdin`.pipe(pipeOptions)`stdin`;233 await execaPromise.pipe`stdin`.pipe('stdin', pipeOptions);234 await scriptPromise.pipe`stdin`.pipe('stdin', pipeOptions);235 expectError(execaPromise.pipe(execaBufferPromise).stdout);236 expectError(scriptPromise.pipe(execaBufferPromise).stdout);237 expectError(execaPromise.pipe`stdin`.stdout);238 expectError(scriptPromise.pipe`stdin`.stdout);239 expectError(execaPromise.pipe('stdin').stdout);240 expectError(scriptPromise.pipe('stdin').stdout);241 expectError(execaPromise.pipe(createWriteStream('output.txt')));242 expectError(scriptPromise.pipe(createWriteStream('output.txt')));243 expectError(execaPromise.pipe(false));244 expectError(scriptPromise.pipe(false));245 await execaPromise.pipe(execaBufferPromise, {});246 await scriptPromise.pipe(execaBufferPromise, {});247 await execaPromise.pipe({})`stdin`;248 await scriptPromise.pipe({})`stdin`;249 await execaPromise.pipe('stdin', {});250 await scriptPromise.pipe('stdin', {});251 expectError(execaPromise.pipe(execaBufferPromise, 'stdout'));252 expectError(scriptPromise.pipe(execaBufferPromise, 'stdout'));253 expectError(execaPromise.pipe('stdout')`stdin`);254 expectError(scriptPromise.pipe('stdout')`stdin`);255 await execaPromise.pipe(execaBufferPromise, {from: 'stdout'});256 await scriptPromise.pipe(execaBufferPromise, {from: 'stdout'});257 await execaPromise.pipe({from: 'stdout'})`stdin`;258 await scriptPromise.pipe({from: 'stdout'})`stdin`;259 await execaPromise.pipe('stdin', {from: 'stdout'});260 await scriptPromise.pipe('stdin', {from: 'stdout'});261 await execaPromise.pipe(execaBufferPromise, {from: 'stderr'});262 await scriptPromise.pipe(execaBufferPromise, {from: 'stderr'});263 await execaPromise.pipe({from: 'stderr'})`stdin`;264 await scriptPromise.pipe({from: 'stderr'})`stdin`;265 await execaPromise.pipe('stdin', {from: 'stderr'});266 await scriptPromise.pipe('stdin', {from: 'stderr'});267 await execaPromise.pipe(execaBufferPromise, {from: 'all'});268 await scriptPromise.pipe(execaBufferPromise, {from: 'all'});269 await execaPromise.pipe({from: 'all'})`stdin`;270 await scriptPromise.pipe({from: 'all'})`stdin`;271 await execaPromise.pipe('stdin', {from: 'all'});272 await scriptPromise.pipe('stdin', {from: 'all'});273 await execaPromise.pipe(execaBufferPromise, {from: 'fd3'});274 await scriptPromise.pipe(execaBufferPromise, {from: 'fd3'});275 await execaPromise.pipe({from: 'fd3'})`stdin`;276 await scriptPromise.pipe({from: 'fd3'})`stdin`;277 await execaPromise.pipe('stdin', {from: 'fd3'});278 await scriptPromise.pipe('stdin', {from: 'fd3'});279 expectError(execaPromise.pipe(execaBufferPromise, {from: 'stdin'}));280 expectError(scriptPromise.pipe(execaBufferPromise, {from: 'stdin'}));281 expectError(execaPromise.pipe({from: 'stdin'})`stdin`);282 expectError(scriptPromise.pipe({from: 'stdin'})`stdin`);283 expectError(execaPromise.pipe('stdin', {from: 'stdin'}));284 expectError(scriptPromise.pipe('stdin', {from: 'stdin'}));285 await execaPromise.pipe(execaBufferPromise, {to: 'stdin'});286 await scriptPromise.pipe(execaBufferPromise, {to: 'stdin'});287 await execaPromise.pipe({to: 'stdin'})`stdin`;288 await scriptPromise.pipe({to: 'stdin'})`stdin`;289 await execaPromise.pipe('stdin', {to: 'stdin'});290 await scriptPromise.pipe('stdin', {to: 'stdin'});291 await execaPromise.pipe(execaBufferPromise, {to: 'fd3'});292 await scriptPromise.pipe(execaBufferPromise, {to: 'fd3'});293 await execaPromise.pipe({to: 'fd3'})`stdin`;294 await scriptPromise.pipe({to: 'fd3'})`stdin`;295 await execaPromise.pipe('stdin', {to: 'fd3'});296 await scriptPromise.pipe('stdin', {to: 'fd3'});297 expectError(execaPromise.pipe(execaBufferPromise, {to: 'stdout'}));298 expectError(scriptPromise.pipe(execaBufferPromise, {to: 'stdout'}));299 expectError(execaPromise.pipe({to: 'stdout'})`stdin`);300 expectError(scriptPromise.pipe({to: 'stdout'})`stdin`);301 expectError(execaPromise.pipe('stdin', {to: 'stdout'}));302 expectError(scriptPromise.pipe('stdin', {to: 'stdout'}));303 await execaPromise.pipe(execaBufferPromise, {unpipeSignal: new AbortController().signal});304 await scriptPromise.pipe(execaBufferPromise, {unpipeSignal: new AbortController().signal});305 await execaPromise.pipe({unpipeSignal: new AbortController().signal})`stdin`;306 await scriptPromise.pipe({unpipeSignal: new AbortController().signal})`stdin`;307 await execaPromise.pipe('stdin', {unpipeSignal: new AbortController().signal});308 await scriptPromise.pipe('stdin', {unpipeSignal: new AbortController().signal});309 expectError(await execaPromise.pipe(execaBufferPromise, {unpipeSignal: true}));310 expectError(await scriptPromise.pipe(execaBufferPromise, {unpipeSignal: true}));311 expectError(await execaPromise.pipe({unpipeSignal: true})`stdin`);312 expectError(await scriptPromise.pipe({unpipeSignal: true})`stdin`);313 expectError(await execaPromise.pipe('stdin', {unpipeSignal: true}));314 expectError(await scriptPromise.pipe('stdin', {unpipeSignal: true}));315 expectError(await execaPromise.pipe({})({}));316 expectError(await scriptPromise.pipe({})({}));317 expectError(await execaPromise.pipe({})(execaPromise));318 expectError(await scriptPromise.pipe({})(execaPromise));319 expectError(await execaPromise.pipe({})('stdin'));320 expectError(await scriptPromise.pipe({})('stdin'));321322 expectType<EmptyExecaReturnValue>(await execaPromise.pipe('stdin'));323 await execaPromise.pipe('stdin');324 await execaPromise.pipe(fileUrl);325 await execaPromise.pipe('stdin', []);326 await execaPromise.pipe('stdin', stringArray);327 await execaPromise.pipe('stdin', stringArray, {});328 await execaPromise.pipe('stdin', stringArray, {from: 'stderr', to: 'stdin', all: true});329 await execaPromise.pipe('stdin', {from: 'stderr'});330 await execaPromise.pipe('stdin', {to: 'stdin'});331 await execaPromise.pipe('stdin', {all: true});332 expectError(await execaPromise.pipe(stringArray));333 expectError(await execaPromise.pipe('stdin', 'foo'));334 expectError(await execaPromise.pipe('stdin', [false]));335 expectError(await execaPromise.pipe('stdin', [], false));336 expectError(await execaPromise.pipe('stdin', {other: true}));337 expectError(await execaPromise.pipe('stdin', [], {other: true}));338 expectError(await execaPromise.pipe('stdin', {from: 'fd'}));339 expectError(await execaPromise.pipe('stdin', [], {from: 'fd'}));340 expectError(await execaPromise.pipe('stdin', {from: 'fdNotANumber'}));341 expectError(await execaPromise.pipe('stdin', [], {from: 'fdNotANumber'}));342 expectError(await execaPromise.pipe('stdin', {from: 'other'}));343 expectError(await execaPromise.pipe('stdin', [], {from: 'other'}));344 expectError(await execaPromise.pipe('stdin', {to: 'fd'}));345 expectError(await execaPromise.pipe('stdin', [], {to: 'fd'}));346 expectError(await execaPromise.pipe('stdin', {to: 'fdNotANumber'}));347 expectError(await execaPromise.pipe('stdin', [], {to: 'fdNotANumber'}));348 expectError(await execaPromise.pipe('stdin', {to: 'other'}));349 expectError(await execaPromise.pipe('stdin', [], {to: 'other'}));350351 const pipeResult = await execaPromise.pipe`stdin`;352 expectType<string>(pipeResult.stdout);353 const ignorePipeResult = await execaPromise.pipe({stdout: 'ignore'})`stdin`;354 expectType<undefined>(ignorePipeResult.stdout);355356 const scriptPipeResult = await scriptPromise.pipe`stdin`;357 expectType<string>(scriptPipeResult.stdout);358 const ignoreScriptPipeResult = await scriptPromise.pipe({stdout: 'ignore'})`stdin`;359 expectType<undefined>(ignoreScriptPipeResult.stdout);360361 const shortcutPipeResult = await execaPromise.pipe('stdin');362 expectType<string>(shortcutPipeResult.stdout);363 const ignoreShortcutPipeResult = await execaPromise.pipe('stdin', {stdout: 'ignore'});364 expectType<undefined>(ignoreShortcutPipeResult.stdout);365366 const scriptShortcutPipeResult = await scriptPromise.pipe('stdin');367 expectType<string>(scriptShortcutPipeResult.stdout);368 const ignoreShortcutScriptPipeResult = await scriptPromise.pipe('stdin', {stdout: 'ignore'});369 expectType<undefined>(ignoreShortcutScriptPipeResult.stdout);370371 const asyncIteration = async () => {372 for await (const line of scriptPromise) {373 expectType<string>(line);374 }375376 for await (const line of scriptPromise.iterable()) {377 expectType<string>(line);378 }379380 for await (const line of scriptPromise.iterable({binary: false})) {381 expectType<string>(line);382 }383384 for await (const line of scriptPromise.iterable({binary: true})) {385 expectType<Uint8Array>(line);386 }387388 for await (const line of scriptPromise.iterable({} as {binary: boolean})) {389 expectType<string | Uint8Array>(line);390 }391392 for await (const line of execaBufferPromise) {393 expectType<Uint8Array>(line);394 }395396 for await (const line of execaBufferPromise.iterable()) {397 expectType<Uint8Array>(line);398 }399400 for await (const line of execaBufferPromise.iterable({binary: false})) {401 expectType<Uint8Array>(line);402 }403404 for await (const line of execaBufferPromise.iterable({binary: true})) {405 expectType<Uint8Array>(line);406 }407408 for await (const line of execaBufferPromise.iterable({} as {binary: boolean})) {409 expectType<Uint8Array>(line);410 }411 };412413 await asyncIteration();414 expectType<AsyncIterableIterator<string>>(scriptPromise.iterable());415 expectType<AsyncIterableIterator<string>>(scriptPromise.iterable({binary: false}));416 expectType<AsyncIterableIterator<Uint8Array>>(scriptPromise.iterable({binary: true}));417 expectType<AsyncIterableIterator<string | Uint8Array>>(scriptPromise.iterable({} as {binary: boolean}));418 expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable());419 expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable({binary: false}));420 expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable({binary: true}));421 expectType<AsyncIterableIterator<Uint8Array>>(execaBufferPromise.iterable({} as {binary: boolean}));422 expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable());423 expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable({binary: false}));424 expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable({binary: true}));425 expectType<AsyncIterableIterator<Uint8Array>>(execaHexPromise.iterable({} as {binary: boolean}));426427 expectType<Readable>(scriptPromise.readable());428 expectType<Writable>(scriptPromise.writable());429 expectType<Duplex>(scriptPromise.duplex());430431 scriptPromise.iterable({});432 scriptPromise.iterable({from: 'stdout'});433 scriptPromise.iterable({from: 'stderr'});434 scriptPromise.iterable({from: 'all'});435 scriptPromise.iterable({from: 'fd3'});436 scriptPromise.iterable({binary: false});437 scriptPromise.iterable({preserveNewlines: false});438 expectError(scriptPromise.iterable('stdout'));439 expectError(scriptPromise.iterable({from: 'stdin'}));440 expectError(scriptPromise.iterable({from: 'fd'}));441 expectError(scriptPromise.iterable({from: 'fdNotANumber'}));442 expectError(scriptPromise.iterable({binary: 'false'}));443 expectError(scriptPromise.iterable({preserveNewlines: 'false'}));444 expectError(scriptPromise.iterable({to: 'stdin'}));445 expectError(scriptPromise.iterable({other: 'stdout'}));446 scriptPromise.readable({});447 scriptPromise.readable({from: 'stdout'});448 scriptPromise.readable({from: 'stderr'});449 scriptPromise.readable({from: 'all'});450 scriptPromise.readable({from: 'fd3'});451 scriptPromise.readable({binary: false});452 scriptPromise.readable({preserveNewlines: false});453 expectError(scriptPromise.readable('stdout'));454 expectError(scriptPromise.readable({from: 'stdin'}));455 expectError(scriptPromise.readable({from: 'fd'}));456 expectError(scriptPromise.readable({from: 'fdNotANumber'}));457 expectError(scriptPromise.readable({binary: 'false'}));458 expectError(scriptPromise.readable({preserveNewlines: 'false'}));459 expectError(scriptPromise.readable({to: 'stdin'}));460 expectError(scriptPromise.readable({other: 'stdout'}));461 scriptPromise.writable({});462 scriptPromise.writable({to: 'stdin'});463 scriptPromise.writable({to: 'fd3'});464 expectError(scriptPromise.writable('stdin'));465 expectError(scriptPromise.writable({to: 'stdout'}));466 expectError(scriptPromise.writable({to: 'fd'}));467 expectError(scriptPromise.writable({to: 'fdNotANumber'}));468 expectError(scriptPromise.writable({from: 'stdout'}));469 expectError(scriptPromise.writable({binary: false}));470 expectError(scriptPromise.writable({preserveNewlines: false}));471 expectError(scriptPromise.writable({other: 'stdin'}));472 scriptPromise.duplex({});473 scriptPromise.duplex({from: 'stdout'});474 scriptPromise.duplex({from: 'stderr'});475 scriptPromise.duplex({from: 'all'});476 scriptPromise.duplex({from: 'fd3'});477 scriptPromise.duplex({from: 'stdout', to: 'stdin'});478 scriptPromise.duplex({from: 'stdout', to: 'fd3'});479 scriptPromise.duplex({binary: false});480 scriptPromise.duplex({preserveNewlines: false});481 expectError(scriptPromise.duplex('stdout'));482 expectError(scriptPromise.duplex({from: 'stdin'}));483 expectError(scriptPromise.duplex({from: 'stderr', to: 'stdout'}));484 expectError(scriptPromise.duplex({from: 'fd'}));485 expectError(scriptPromise.duplex({from: 'fdNotANumber'}));486 expectError(scriptPromise.duplex({to: 'fd'}));487 expectError(scriptPromise.duplex({to: 'fdNotANumber'}));488 expectError(scriptPromise.duplex({binary: 'false'}));489 expectError(scriptPromise.duplex({preserveNewlines: 'false'}));490 expectError(scriptPromise.duplex({other: 'stdout'}));491492 expectType<Readable>(execaPromise.all);493 const noAllPromise = execa('unicorns');494 expectType<undefined>(noAllPromise.all);495 const noAllResult = await noAllPromise;496 expectType<undefined>(noAllResult.all);497498 expectType<string>(unicornsResult.command);499 expectType<string>(unicornsResult.escapedCommand);500 expectType<number | undefined>(unicornsResult.exitCode);501 expectType<boolean>(unicornsResult.failed);502 expectType<boolean>(unicornsResult.timedOut);503 expectType<boolean>(unicornsResult.isCanceled);504 expectType<boolean>(unicornsResult.isTerminated);505 expectType<boolean>(unicornsResult.isMaxBuffer);506 expectType<string | undefined>(unicornsResult.signal);507 expectType<string | undefined>(unicornsResult.signalDescription);508 expectType<string>(unicornsResult.cwd);509 expectType<number>(unicornsResult.durationMs);510 expectType<ExecaResult[]>(unicornsResult.pipedFrom);511512 expectType<undefined>(unicornsResult.stdio[0]);513 expectType<string>(unicornsResult.stdout);514 expectType<string>(unicornsResult.stdio[1]);515 expectType<string>(unicornsResult.stderr);516 expectType<string>(unicornsResult.stdio[2]);517 expectType<string>(unicornsResult.all);518 expectType<string | undefined>(unicornsResult.stdio[3 as number]);519520 expectType<number | undefined>(execaBufferPromise.pid);521522 expectType<boolean>(execa('unicorns', {ipc: true}).send({}));523 execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']}).send({});524 execa('unicorns', {stdio: ['pipe', 'pipe', 'ipc', 'pipe']}).send({});525 execa('unicorns', {ipc: true}).send('message');526 execa('unicorns', {ipc: true}).send({}, undefined, {keepOpen: true});527 expectError(execa('unicorns', {ipc: true}).send({}, true));528 expectType<undefined>(execa('unicorns', {}).send);529 expectType<undefined>(execa('unicorns', {ipc: false}).send);530 expectType<undefined>(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']}).send);531532 expectType<Writable>(execaBufferPromise.stdin);533 expectType<Writable>(execaBufferPromise.stdio[0]);534 expectType<Readable>(execaBufferPromise.stdout);535 expectType<Readable>(execaBufferPromise.stdio[1]);536 expectType<Readable>(execaBufferPromise.stderr);537 expectType<Readable>(execaBufferPromise.stdio[2]);538 expectType<Readable>(execaBufferPromise.all);539 expectError(execaBufferPromise.stdio[3].destroy());540 expectType<Uint8Array>(bufferResult.stdout);541 expectType<Uint8Array>(bufferResult.stdio[1]);542 expectType<Uint8Array>(bufferResult.stderr);543 expectType<Uint8Array>(bufferResult.stdio[2]);544 expectType<Uint8Array>(bufferResult.all);545546 expectType<Writable>(execaHexPromise.stdin);547 expectType<Writable>(execaHexPromise.stdio[0]);548 expectType<Readable>(execaHexPromise.stdout);549 expectType<Readable>(execaHexPromise.stdio[1]);550 expectType<Readable>(execaHexPromise.stderr);551 expectType<Readable>(execaHexPromise.stdio[2]);552 expectType<Readable>(execaHexPromise.all);553 expectError(execaHexPromise.stdio[3].destroy());554 expectType<string>(hexResult.stdout);555 expectType<string>(hexResult.stdio[1]);556 expectType<string>(hexResult.stderr);557 expectType<string>(hexResult.stdio[2]);558 expectType<string>(hexResult.all);559560 const linesResult = await execa('unicorns', {lines: true, all: true});561 expectType<string[]>(linesResult.stdout);562 expectType<string[]>(linesResult.stdio[1]);563 expectType<string[]>(linesResult.stderr);564 expectType<string[]>(linesResult.stdio[2]);565 expectType<string[]>(linesResult.all);566567 const linesBufferResult = await execa('unicorns', {lines: true, encoding: 'buffer', all: true});568 expectType<Uint8Array>(linesBufferResult.stdout);569 expectType<Uint8Array>(linesBufferResult.stdio[1]);570 expectType<Uint8Array>(linesBufferResult.stderr);571 expectType<Uint8Array>(linesBufferResult.stdio[2]);572 expectType<Uint8Array>(linesBufferResult.all);573574 const linesHexResult = await execa('unicorns', {lines: true, encoding: 'hex', all: true});575 expectType<string>(linesHexResult.stdout);576 expectType<string>(linesHexResult.stdio[1]);577 expectType<string>(linesHexResult.stderr);578 expectType<string>(linesHexResult.stdio[2]);579 expectType<string>(linesHexResult.all);580581 const noBufferPromise = execa('unicorns', {buffer: false, all: true});582 expectType<Writable>(noBufferPromise.stdin);583 expectType<Writable>(noBufferPromise.stdio[0]);584 expectType<Readable>(noBufferPromise.stdout);585 expectType<Readable>(noBufferPromise.stdio[1]);586 expectType<Readable>(noBufferPromise.stderr);587 expectType<Readable>(noBufferPromise.stdio[2]);588 expectType<Readable>(noBufferPromise.all);589 expectError(noBufferPromise.stdio[3].destroy());590 const noBufferResult = await noBufferPromise;591 expectType<undefined>(noBufferResult.stdout);592 expectType<undefined>(noBufferResult.stdio[1]);593 expectType<undefined>(noBufferResult.stderr);594 expectType<undefined>(noBufferResult.stdio[2]);595 expectType<undefined>(noBufferResult.all);596597 const multipleStdinPromise = execa('unicorns', {stdin: ['inherit', 'pipe']});598 expectType<Writable>(multipleStdinPromise.stdin);599600 const multipleStdoutPromise = execa('unicorns', {stdout: ['inherit', 'pipe'] as ['inherit', 'pipe'], all: true});601 expectType<Writable>(multipleStdoutPromise.stdin);602 expectType<Writable>(multipleStdoutPromise.stdio[0]);603 expectType<Readable>(multipleStdoutPromise.stdout);604 expectType<Readable>(multipleStdoutPromise.stdio[1]);605 expectType<Readable>(multipleStdoutPromise.stderr);606 expectType<Readable>(multipleStdoutPromise.stdio[2]);607 expectType<Readable>(multipleStdoutPromise.all);608 expectError(multipleStdoutPromise.stdio[3].destroy());609 const multipleStdoutResult = await multipleStdoutPromise;610 expectType<string>(multipleStdoutResult.stdout);611 expectType<string>(multipleStdoutResult.stdio[1]);612 expectType<string>(multipleStdoutResult.stderr);613 expectType<string>(multipleStdoutResult.stdio[2]);614 expectType<string>(multipleStdoutResult.all);615616 const ignoreAnyPromise = execa('unicorns', {stdin: 'ignore', stdout: 'ignore', stderr: 'ignore', all: true});617 expectType<null>(ignoreAnyPromise.stdin);618 expectType<null>(ignoreAnyPromise.stdio[0]);619 expectType<null>(ignoreAnyPromise.stdout);620 expectType<null>(ignoreAnyPromise.stdio[1]);621 expectType<null>(ignoreAnyPromise.stderr);622 expectType<null>(ignoreAnyPromise.stdio[2]);623 expectType<undefined>(ignoreAnyPromise.all);624 expectError(ignoreAnyPromise.stdio[3].destroy());625 const ignoreAnyResult = await ignoreAnyPromise;626 expectType<undefined>(ignoreAnyResult.stdout);627 expectType<undefined>(ignoreAnyResult.stdio[1]);628 expectType<undefined>(ignoreAnyResult.stderr);629 expectType<undefined>(ignoreAnyResult.stdio[2]);630 expectType<undefined>(ignoreAnyResult.all);631632 const ignoreAllPromise = execa('unicorns', {stdio: 'ignore', all: true});633 expectType<null>(ignoreAllPromise.stdin);634 expectType<null>(ignoreAllPromise.stdio[0]);635 expectType<null>(ignoreAllPromise.stdout);636 expectType<null>(ignoreAllPromise.stdio[1]);637 expectType<null>(ignoreAllPromise.stderr);638 expectType<null>(ignoreAllPromise.stdio[2]);639 expectType<undefined>(ignoreAllPromise.all);640 expectError(ignoreAllPromise.stdio[3].destroy());641 const ignoreAllResult = await ignoreAllPromise;642 expectType<undefined>(ignoreAllResult.stdout);643 expectType<undefined>(ignoreAllResult.stdio[1]);644 expectType<undefined>(ignoreAllResult.stderr);645 expectType<undefined>(ignoreAllResult.stdio[2]);646 expectType<undefined>(ignoreAllResult.all);647648 const ignoreStdioArrayPromise = execa('unicorns', {stdio: ['ignore', 'ignore', 'pipe', 'pipe'], all: true});649 expectType<null>(ignoreStdioArrayPromise.stdin);650 expectType<null>(ignoreStdioArrayPromise.stdio[0]);651 expectType<null>(ignoreStdioArrayPromise.stdout);652 expectType<null>(ignoreStdioArrayPromise.stdio[1]);653 expectType<Readable>(ignoreStdioArrayPromise.stderr);654 expectType<Readable>(ignoreStdioArrayPromise.stdio[2]);655 expectType<Readable>(ignoreStdioArrayPromise.all);656 expectType<Readable>(ignoreStdioArrayPromise.stdio[3]);657 const ignoreStdioArrayResult = await ignoreStdioArrayPromise;658 expectType<undefined>(ignoreStdioArrayResult.stdout);659 expectType<undefined>(ignoreStdioArrayResult.stdio[1]);660 expectType<string>(ignoreStdioArrayResult.stderr);661 expectType<string>(ignoreStdioArrayResult.stdio[2]);662 expectType<string>(ignoreStdioArrayResult.all);663664 const ignoreStdioArrayReadPromise = execa('unicorns', {stdio: ['ignore', 'ignore', 'pipe', new Uint8Array()], all: true});665 expectType<Writable>(ignoreStdioArrayReadPromise.stdio[3]);666667 const ignoreStdinPromise = execa('unicorns', {stdin: 'ignore'});668 expectType<null>(ignoreStdinPromise.stdin);669670 const ignoreStdoutPromise = execa('unicorns', {stdout: 'ignore', all: true});671 expectType<Writable>(ignoreStdoutPromise.stdin);672 expectType<Writable>(ignoreStdoutPromise.stdio[0]);673 expectType<null>(ignoreStdoutPromise.stdout);674 expectType<null>(ignoreStdoutPromise.stdio[1]);675 expectType<Readable>(ignoreStdoutPromise.stderr);676 expectType<Readable>(ignoreStdoutPromise.stdio[2]);677 expectType<Readable>(ignoreStdoutPromise.all);678 expectError(ignoreStdoutPromise.stdio[3].destroy());679 const ignoreStdoutResult = await ignoreStdoutPromise;680 expectType<undefined>(ignoreStdoutResult.stdout);681 expectType<string>(ignoreStdoutResult.stderr);682 expectType<string>(ignoreStdoutResult.all);683684 const ignoreStderrPromise = execa('unicorns', {stderr: 'ignore', all: true});685 expectType<Writable>(ignoreStderrPromise.stdin);686 expectType<Writable>(ignoreStderrPromise.stdio[0]);687 expectType<Readable>(ignoreStderrPromise.stdout);688 expectType<Readable>(ignoreStderrPromise.stdio[1]);689 expectType<null>(ignoreStderrPromise.stderr);690 expectType<null>(ignoreStderrPromise.stdio[2]);691 expectType<Readable>(ignoreStderrPromise.all);692 expectError(ignoreStderrPromise.stdio[3].destroy());693 const ignoreStderrResult = await ignoreStderrPromise;694 expectType<string>(ignoreStderrResult.stdout);695 expectType<undefined>(ignoreStderrResult.stderr);696 expectType<string>(ignoreStderrResult.all);697698 const ignoreStdioPromise = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore'], all: true});699 expectType<Writable>(ignoreStdioPromise.stdin);700 expectType<Writable>(ignoreStdioPromise.stdio[0]);701 expectType<Readable>(ignoreStdioPromise.stdout);702 expectType<Readable>(ignoreStdioPromise.stdio[1]);703 expectType<Readable>(ignoreStdioPromise.stderr);704 expectType<Readable>(ignoreStdioPromise.stdio[2]);705 expectType<Readable>(ignoreStdioPromise.all);706 expectType<null>(ignoreStdioPromise.stdio[3]);707 const ignoreStdioResult = await ignoreStdioPromise;708 expectType<string>(ignoreStdioResult.stdout);709 expectType<string>(ignoreStdioResult.stderr);710 expectType<string>(ignoreStdioResult.all);711712 const inheritStdoutResult = await execa('unicorns', {stdout: 'inherit', all: true});713 expectType<undefined>(inheritStdoutResult.stdout);714 expectType<string>(inheritStdoutResult.stderr);715 expectType<string>(inheritStdoutResult.all);716717 const inheritArrayStdoutResult = await execa('unicorns', {stdout: ['inherit'] as ['inherit'], all: true});718 expectType<undefined>(inheritArrayStdoutResult.stdout);719 expectType<string>(inheritArrayStdoutResult.stderr);720 expectType<string>(inheritArrayStdoutResult.all);721722 const inheritStderrResult = await execa('unicorns', {stderr: 'inherit', all: true});723 expectType<string>(inheritStderrResult.stdout);724 expectType<undefined>(inheritStderrResult.stderr);725 expectType<string>(inheritStderrResult.all);726727 const inheritArrayStderrResult = await execa('unicorns', {stderr: ['inherit'] as ['inherit'], all: true});728 expectType<string>(inheritArrayStderrResult.stdout);729 expectType<undefined>(inheritArrayStderrResult.stderr);730 expectType<string>(inheritArrayStderrResult.all);731732 const ipcStdoutResult = await execa('unicorns', {stdout: 'ipc', all: true});733 expectType<undefined>(ipcStdoutResult.stdout);734 expectType<string>(ipcStdoutResult.stderr);735 expectType<string>(ipcStdoutResult.all);736737 const ipcStderrResult = await execa('unicorns', {stderr: 'ipc', all: true});738 expectType<string>(ipcStderrResult.stdout);739 expectType<undefined>(ipcStderrResult.stderr);740 expectType<string>(ipcStderrResult.all);741742 const numberStdoutResult = await execa('unicorns', {stdout: 1, all: true});743 expectType<undefined>(numberStdoutResult.stdout);744 expectType<string>(numberStdoutResult.stderr);745 expectType<string>(numberStdoutResult.all);746747 const numberArrayStdoutResult = await execa('unicorns', {stdout: [1] as [1], all: true});748 expectType<undefined>(numberArrayStdoutResult.stdout);749 expectType<string>(numberArrayStdoutResult.stderr);750 expectType<string>(numberArrayStdoutResult.all);751752 const numberStderrResult = await execa('unicorns', {stderr: 1, all: true});753 expectType<string>(numberStderrResult.stdout);754 expectType<undefined>(numberStderrResult.stderr);755 expectType<string>(numberStderrResult.all);756757 const numberArrayStderrResult = await execa('unicorns', {stderr: [1] as [1], all: true});758 expectType<string>(numberArrayStderrResult.stdout);759 expectType<undefined>(numberArrayStderrResult.stderr);760 expectType<string>(numberArrayStderrResult.all);761762 const streamStdoutResult = await execa('unicorns', {stdout: process.stdout, all: true});763 expectType<undefined>(streamStdoutResult.stdout);764 expectType<string>(streamStdoutResult.stderr);765 expectType<string>(streamStdoutResult.all);766767 const streamArrayStdoutResult = await execa('unicorns', {stdout: [process.stdout] as [typeof process.stdout], all: true});768 expectType<undefined>(streamArrayStdoutResult.stdout);769 expectType<string>(streamArrayStdoutResult.stderr);770 expectType<string>(streamArrayStdoutResult.all);771772 const streamStderrResult = await execa('unicorns', {stderr: process.stdout, all: true});773 expectType<string>(streamStderrResult.stdout);774 expectType<undefined>(streamStderrResult.stderr);775 expectType<string>(streamStderrResult.all);776777 const streamArrayStderrResult = await execa('unicorns', {stderr: [process.stdout] as [typeof process.stdout], all: true});778 expectType<string>(streamArrayStderrResult.stdout);779 expectType<undefined>(streamArrayStderrResult.stderr);780 expectType<string>(streamArrayStderrResult.all);781782 const undefinedStdoutResult = await execa('unicorns', {stdout: undefined, all: true});783 expectType<string>(undefinedStdoutResult.stdout);784 expectType<string>(undefinedStdoutResult.stderr);785 expectType<string>(undefinedStdoutResult.all);786787 const undefinedArrayStdoutResult = await execa('unicorns', {stdout: [undefined] as const, all: true});788 expectType<string>(undefinedArrayStdoutResult.stdout);789 expectType<string>(undefinedArrayStdoutResult.stderr);790 expectType<string>(undefinedArrayStdoutResult.all);791792 const undefinedStderrResult = await execa('unicorns', {stderr: undefined, all: true});793 expectType<string>(undefinedStderrResult.stdout);794 expectType<string>(undefinedStderrResult.stderr);795 expectType<string>(undefinedStderrResult.all);796797 const undefinedArrayStderrResult = await execa('unicorns', {stderr: [undefined] as const, all: true});798 expectType<string>(undefinedArrayStderrResult.stdout);799 expectType<string>(undefinedArrayStderrResult.stderr);800 expectType<string>(undefinedArrayStderrResult.all);801802 const fd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']});803 expectType<string>(fd3Result.stdio[3]);804805 const inputFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe', new Readable()]]});806 expectType<undefined>(inputFd3Result.stdio[3]);807808 const outputFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe', new Writable()]]});809 expectType<string>(outputFd3Result.stdio[3]);810811 const bufferFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], encoding: 'buffer'});812 expectType<Uint8Array>(bufferFd3Result.stdio[3]);813814 const linesFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], lines: true});815 expectType<string[]>(linesFd3Result.stdio[3]);816817 const linesBufferFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], lines: true, encoding: 'buffer'});818 expectType<Uint8Array>(linesBufferFd3Result.stdio[3]);819820 const noBufferFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], buffer: false});821 expectType<undefined>(noBufferFd3Result.stdio[3]);822823 const ignoreFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});824 expectType<undefined>(ignoreFd3Result.stdio[3]);825826 const undefinedFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', undefined]});827 expectType<undefined>(undefinedFd3Result.stdio[3]);828829 const undefinedArrayFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [undefined] as const]});830 expectType<undefined>(undefinedArrayFd3Result.stdio[3]);831832 const objectTransformLinesStdoutResult = await execa('unicorns', {lines: true, stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}});833 expectType<unknown[]>(objectTransformLinesStdoutResult.stdout);834 expectType<[undefined, unknown[], string[]]>(objectTransformLinesStdoutResult.stdio);835836 const objectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransformObject});837 expectType<unknown[]>(objectWebTransformStdoutResult.stdout);838 expectType<[undefined, unknown[], string]>(objectWebTransformStdoutResult.stdio);839840 const objectDuplexStdoutResult = await execa('unicorns', {stdout: duplexObject});841 expectType<unknown[]>(objectDuplexStdoutResult.stdout);842 expectType<[undefined, unknown[], string]>(objectDuplexStdoutResult.stdio);843844 const objectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: duplexObjectProperty});845 expectType<unknown[]>(objectDuplexPropertyStdoutResult.stdout);846 expectType<[undefined, unknown[], string]>(objectDuplexPropertyStdoutResult.stdio);847848 const objectTransformStdoutResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}});849 expectType<unknown[]>(objectTransformStdoutResult.stdout);850 expectType<[undefined, unknown[], string]>(objectTransformStdoutResult.stdio);851852 const objectWebTransformStderrResult = await execa('unicorns', {stderr: webTransformObject});853 expectType<unknown[]>(objectWebTransformStderrResult.stderr);854 expectType<[undefined, string, unknown[]]>(objectWebTransformStderrResult.stdio);855856 const objectDuplexStderrResult = await execa('unicorns', {stderr: duplexObject});857 expectType<unknown[]>(objectDuplexStderrResult.stderr);858 expectType<[undefined, string, unknown[]]>(objectDuplexStderrResult.stdio);859860 const objectDuplexPropertyStderrResult = await execa('unicorns', {stderr: duplexObjectProperty});861 expectType<unknown[]>(objectDuplexPropertyStderrResult.stderr);862 expectType<[undefined, string, unknown[]]>(objectDuplexPropertyStderrResult.stdio);863864 const objectTransformStderrResult = await execa('unicorns', {stderr: {transform: objectGenerator, final: objectFinal, objectMode: true}});865 expectType<unknown[]>(objectTransformStderrResult.stderr);866 expectType<[undefined, string, unknown[]]>(objectTransformStderrResult.stdio);867868 const objectWebTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', webTransformObject]});869 expectType<unknown[]>(objectWebTransformStdioResult.stderr);870 expectType<[undefined, string, unknown[]]>(objectWebTransformStdioResult.stdio);871872 const objectDuplexStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexObject]});873 expectType<unknown[]>(objectDuplexStdioResult.stderr);874 expectType<[undefined, string, unknown[]]>(objectDuplexStdioResult.stdio);875876 const objectDuplexPropertyStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexObjectProperty]});877 expectType<unknown[]>(objectDuplexPropertyStdioResult.stderr);878 expectType<[undefined, string, unknown[]]>(objectDuplexPropertyStdioResult.stdio);879880 const objectTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', {transform: objectGenerator, final: objectFinal, objectMode: true}]});881 expectType<unknown[]>(objectTransformStdioResult.stderr);882 expectType<[undefined, string, unknown[]]>(objectTransformStdioResult.stdio);883884 const singleObjectWebTransformStdoutResult = await execa('unicorns', {stdout: [webTransformObject]});885 expectType<unknown[]>(singleObjectWebTransformStdoutResult.stdout);886 expectType<[undefined, unknown[], string]>(singleObjectWebTransformStdoutResult.stdio);887888 const singleObjectDuplexStdoutResult = await execa('unicorns', {stdout: [duplexObject]});889 expectType<unknown[]>(singleObjectDuplexStdoutResult.stdout);890 expectType<[undefined, unknown[], string]>(singleObjectDuplexStdoutResult.stdio);891892 const singleObjectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: [duplexObjectProperty]});893 expectType<unknown[]>(singleObjectDuplexPropertyStdoutResult.stdout);894 expectType<[undefined, unknown[], string]>(singleObjectDuplexPropertyStdoutResult.stdio);895896 const singleObjectTransformStdoutResult = await execa('unicorns', {stdout: [{transform: objectGenerator, final: objectFinal, objectMode: true}]});897 expectType<unknown[]>(singleObjectTransformStdoutResult.stdout);898 expectType<[undefined, unknown[], string]>(singleObjectTransformStdoutResult.stdio);899900 const manyObjectWebTransformStdoutResult = await execa('unicorns', {stdout: [webTransformObject, webTransformObject]});901 expectType<unknown[]>(manyObjectWebTransformStdoutResult.stdout);902 expectType<[undefined, unknown[], string]>(manyObjectWebTransformStdoutResult.stdio);903904 const manyObjectDuplexStdoutResult = await execa('unicorns', {stdout: [duplexObject, duplexObject]});905 expectType<unknown[]>(manyObjectDuplexStdoutResult.stdout);906 expectType<[undefined, unknown[], string]>(manyObjectDuplexStdoutResult.stdio);907908 const manyObjectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: [duplexObjectProperty, duplexObjectProperty]});909 expectType<unknown[]>(manyObjectDuplexPropertyStdoutResult.stdout);910 expectType<[undefined, unknown[], string]>(manyObjectDuplexPropertyStdoutResult.stdio);911912 const manyObjectTransformStdoutResult = await execa('unicorns', {stdout: [{transform: objectGenerator, final: objectFinal, objectMode: true}, {transform: objectGenerator, final: objectFinal, objectMode: true}]});913 expectType<unknown[]>(manyObjectTransformStdoutResult.stdout);914 expectType<[undefined, unknown[], string]>(manyObjectTransformStdoutResult.stdio);915916 const falseObjectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransformNotObject});917 expectType<string>(falseObjectWebTransformStdoutResult.stdout);918 expectType<[undefined, string, string]>(falseObjectWebTransformStdoutResult.stdio);919920 const falseObjectDuplexStdoutResult = await execa('unicorns', {stdout: duplexNotObject});921 expectType<string>(falseObjectDuplexStdoutResult.stdout);922 expectType<[undefined, string, string]>(falseObjectDuplexStdoutResult.stdio);923924 const falseObjectDuplexPropertyStdoutResult = await execa('unicorns', {stdout: duplexNotObjectProperty});925 expectType<string>(falseObjectDuplexPropertyStdoutResult.stdout);926 expectType<[undefined, string, string]>(falseObjectDuplexPropertyStdoutResult.stdio);927928 const falseObjectTransformStdoutResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: false}});929 expectType<string>(falseObjectTransformStdoutResult.stdout);930 expectType<[undefined, string, string]>(falseObjectTransformStdoutResult.stdio);931932 const falseObjectWebTransformStderrResult = await execa('unicorns', {stderr: webTransformNotObject});933 expectType<string>(falseObjectWebTransformStderrResult.stderr);934 expectType<[undefined, string, string]>(falseObjectWebTransformStderrResult.stdio);935936 const falseObjectDuplexStderrResult = await execa('unicorns', {stderr: duplexNotObject});937 expectType<string>(falseObjectDuplexStderrResult.stderr);938 expectType<[undefined, string, string]>(falseObjectDuplexStderrResult.stdio);939940 const falseObjectDuplexPropertyStderrResult = await execa('unicorns', {stderr: duplexNotObjectProperty});941 expectType<string>(falseObjectDuplexPropertyStderrResult.stderr);942 expectType<[undefined, string, string]>(falseObjectDuplexPropertyStderrResult.stdio);943944 const falseObjectTransformStderrResult = await execa('unicorns', {stderr: {transform: objectGenerator, final: objectFinal, objectMode: false}});945 expectType<string>(falseObjectTransformStderrResult.stderr);946 expectType<[undefined, string, string]>(falseObjectTransformStderrResult.stdio);947948 const falseObjectWebTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', webTransformNotObject]});949 expectType<string>(falseObjectWebTransformStdioResult.stderr);950 expectType<[undefined, string, string]>(falseObjectWebTransformStdioResult.stdio);951952 const falseObjectDuplexStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexNotObject]});953 expectType<string>(falseObjectDuplexStdioResult.stderr);954 expectType<[undefined, string, string]>(falseObjectDuplexStdioResult.stdio);955956 const falseObjectDuplexPropertyStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', duplexNotObjectProperty]});957 expectType<string>(falseObjectDuplexPropertyStdioResult.stderr);958 expectType<[undefined, string, string]>(falseObjectDuplexPropertyStdioResult.stdio);959960 const falseObjectTransformStdioResult = await execa('unicorns', {stdio: ['pipe', 'pipe', {transform: objectGenerator, final: objectFinal, objectMode: false}]});961 expectType<string>(falseObjectTransformStdioResult.stderr);962 expectType<[undefined, string, string]>(falseObjectTransformStdioResult.stdio);963964 const topObjectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransformInstance});965 expectType<string>(topObjectWebTransformStdoutResult.stdout);966 expectType<[undefined, string, string]>(topObjectWebTransformStdoutResult.stdio);967968 const undefinedObjectWebTransformStdoutResult = await execa('unicorns', {stdout: webTransform});969 expectType<string>(undefinedObjectWebTransformStdoutResult.stdout);970 expectType<[undefined, string, string]>(undefinedObjectWebTransformStdoutResult.stdio);971972 const undefinedObjectDuplexStdoutResult = await execa('unicorns', {stdout: duplex});973 expectType<string | unknown[]>(undefinedObjectDuplexStdoutResult.stdout);974 expectType<[undefined, string | unknown[], string]>(undefinedObjectDuplexStdoutResult.stdio);975976 const undefinedObjectTransformStdoutResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal}});977 expectType<string>(undefinedObjectTransformStdoutResult.stdout);978 expectType<[undefined, string, string]>(undefinedObjectTransformStdoutResult.stdio);979980 const noObjectTransformStdoutResult = await execa('unicorns', {stdout: objectGenerator, final: objectFinal});981 expectType<string>(noObjectTransformStdoutResult.stdout);982 expectType<[undefined, string, string]>(noObjectTransformStdoutResult.stdio);983984 const trueTrueObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: true}, all: true});985 expectType<unknown[]>(trueTrueObjectTransformResult.stdout);986 expectType<unknown[]>(trueTrueObjectTransformResult.stderr);987 expectType<unknown[]>(trueTrueObjectTransformResult.all);988 expectType<[undefined, unknown[], unknown[]]>(trueTrueObjectTransformResult.stdio);989990 const trueFalseObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: true}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: false}, all: true});991 expectType<unknown[]>(trueFalseObjectTransformResult.stdout);992 expectType<string>(trueFalseObjectTransformResult.stderr);993 expectType<unknown[]>(trueFalseObjectTransformResult.all);994 expectType<[undefined, unknown[], string]>(trueFalseObjectTransformResult.stdio);995996 const falseTrueObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: false}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: true}, all: true});997 expectType<string>(falseTrueObjectTransformResult.stdout);998 expectType<unknown[]>(falseTrueObjectTransformResult.stderr);999 expectType<unknown[]>(falseTrueObjectTransformResult.all);1000 expectType<[undefined, string, unknown[]]>(falseTrueObjectTransformResult.stdio);10011002 const falseFalseObjectTransformResult = await execa('unicorns', {stdout: {transform: objectGenerator, final: objectFinal, objectMode: false}, stderr: {transform: objectGenerator, final: objectFinal, objectMode: false}, all: true});1003 expectType<string>(falseFalseObjectTransformResult.stdout);1004 expectType<string>(falseFalseObjectTransformResult.stderr);1005 expectType<string>(falseFalseObjectTransformResult.all);1006 expectType<[undefined, string, string]>(falseFalseObjectTransformResult.stdio);1007} catch (error: unknown) {1008 if (error instanceof ExecaError) {1009 expectAssignable<ExecaError>(error);1010 expectType<'ExecaError'>(error.name);1011 expectType<string>(error.message);1012 expectType<number | undefined>(error.exitCode);1013 expectType<boolean>(error.failed);1014 expectType<boolean>(error.timedOut);1015 expectType<boolean>(error.isCanceled);1016 expectType<boolean>(error.isTerminated);1017 expectType<boolean>(error.isMaxBuffer);1018 expectType<string | undefined>(error.signal);1019 expectType<string | undefined>(error.signalDescription);1020 expectType<string>(error.cwd);1021 expectType<number>(error.durationMs);1022 expectType<string>(error.shortMessage);1023 expectType<string>(error.originalMessage);1024 expectType<string | undefined>(error.code);1025 expectType<unknown>(error.cause);1026 expectType<ExecaResult[]>(error.pipedFrom);1027 }10281029 const noAllError = error as ExecaError<{}>;1030 expectType<undefined>(noAllError.stdio[0]);1031 expectType<undefined>(noAllError.all);10321033 const execaStringError = error as ExecaError<{all: true}>;1034 expectType<string>(execaStringError.stdout);1035 expectType<string>(execaStringError.stdio[1]);1036 expectType<string>(execaStringError.stderr);1037 expectType<string>(execaStringError.stdio[2]);1038 expectType<string>(execaStringError.all);10391040 const execaBufferError = error as ExecaError<{encoding: 'buffer'; all: true}>;1041 expectType<Uint8Array>(execaBufferError.stdout);1042 expectType<Uint8Array>(execaBufferError.stdio[1]);1043 expectType<Uint8Array>(execaBufferError.stderr);1044 expectType<Uint8Array>(execaBufferError.stdio[2]);1045 expectType<Uint8Array>(execaBufferError.all);10461047 const execaLinesError = error as ExecaError<{lines: true; all: true}>;1048 expectType<string[]>(execaLinesError.stdout);1049 expectType<string[]>(execaLinesError.stdio[1]);1050 expectType<string[]>(execaLinesError.stderr);1051 expectType<string[]>(execaLinesError.stdio[2]);1052 expectType<string[]>(execaLinesError.all);10531054 const execaLinesBufferError = error as ExecaError<{lines: true; encoding: 'buffer'; all: true}>;1055 expectType<Uint8Array>(execaLinesBufferError.stdout);1056 expectType<Uint8Array>(execaLinesBufferError.stdio[1]);1057 expectType<Uint8Array>(execaLinesBufferError.stderr);1058 expectType<Uint8Array>(execaLinesBufferError.stdio[2]);1059 expectType<Uint8Array>(execaLinesBufferError.all);10601061 const noBufferError = error as ExecaError<{buffer: false; all: true}>;1062 expectType<undefined>(noBufferError.stdout);1063 expectType<undefined>(noBufferError.stdio[1]);1064 expectType<undefined>(noBufferError.stderr);1065 expectType<undefined>(noBufferError.stdio[2]);1066 expectType<undefined>(noBufferError.all);10671068 const ignoreStdoutError = error as ExecaError<{stdout: 'ignore'; all: true}>;1069 expectType<undefined>(ignoreStdoutError.stdout);1070 expectType<undefined>(ignoreStdoutError.stdio[1]);1071 expectType<string>(ignoreStdoutError.stderr);1072 expectType<string>(ignoreStdoutError.stdio[2]);1073 expectType<string>(ignoreStdoutError.all);10741075 const ignoreStderrError = error as ExecaError<{stderr: 'ignore'; all: true}>;1076 expectType<string>(ignoreStderrError.stdout);1077 expectType<undefined>(ignoreStderrError.stderr);1078 expectType<string>(ignoreStderrError.all);10791080 const inheritStdoutError = error as ExecaError<{stdout: 'inherit'; all: true}>;1081 expectType<undefined>(inheritStdoutError.stdout);1082 expectType<string>(inheritStdoutError.stderr);1083 expectType<string>(inheritStdoutError.all);10841085 const inheritStderrError = error as ExecaError<{stderr: 'inherit'; all: true}>;1086 expectType<string>(inheritStderrError.stdout);1087 expectType<undefined>(inheritStderrError.stderr);1088 expectType<string>(inheritStderrError.all);10891090 const ipcStdoutError = error as ExecaError<{stdout: 'ipc'; all: true}>;1091 expectType<undefined>(ipcStdoutError.stdout);1092 expectType<string>(ipcStdoutError.stderr);1093 expectType<string>(ipcStdoutError.all);10941095 const ipcStderrError = error as ExecaError<{stderr: 'ipc'; all: true}>;1096 expectType<string>(ipcStderrError.stdout);1097 expectType<undefined>(ipcStderrError.stderr);1098 expectType<string>(ipcStderrError.all);10991100 const numberStdoutError = error as ExecaError<{stdout: 1; all: true}>;1101 expectType<undefined>(numberStdoutError.stdout);1102 expectType<string>(numberStdoutError.stderr);1103 expectType<string>(numberStdoutError.all);11041105 const numberStderrError = error as ExecaError<{stderr: 1; all: true}>;1106 expectType<string>(numberStderrError.stdout);1107 expectType<undefined>(numberStderrError.stderr);1108 expectType<string>(numberStderrError.all);11091110 const streamStdoutError = error as ExecaError<{stdout: typeof process.stdout; all: true}>;1111 expectType<undefined>(streamStdoutError.stdout);1112 expectType<string>(streamStdoutError.stderr);1113 expectType<string>(streamStdoutError.all);11141115 const streamStderrError = error as ExecaError<{stderr: typeof process.stdout; all: true}>;1116 expectType<string>(streamStderrError.stdout);1117 expectType<undefined>(streamStderrError.stderr);1118 expectType<string>(streamStderrError.all);11191120 const objectTransformStdoutError = error as ExecaError<{stdout: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: true}}>;1121 expectType<unknown[]>(objectTransformStdoutError.stdout);1122 expectType<[undefined, unknown[], string]>(objectTransformStdoutError.stdio);11231124 const objectTransformStderrError = error as ExecaError<{stderr: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: true}}>;1125 expectType<unknown[]>(objectTransformStderrError.stderr);1126 expectType<[undefined, string, unknown[]]>(objectTransformStderrError.stdio);11271128 const objectTransformStdioError = error as ExecaError<{stdio: ['pipe', 'pipe', {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: true}]}>;1129 expectType<unknown[]>(objectTransformStdioError.stderr);1130 expectType<[undefined, string, unknown[]]>(objectTransformStdioError.stdio);11311132 const falseObjectTransformStdoutError = error as ExecaError<{stdout: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: false}}>;1133 expectType<string>(falseObjectTransformStdoutError.stdout);1134 expectType<[undefined, string, string]>(falseObjectTransformStdoutError.stdio);11351136 const falseObjectTransformStderrError = error as ExecaError<{stderr: {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: false}}>;1137 expectType<string>(falseObjectTransformStderrError.stderr);1138 expectType<[undefined, string, string]>(falseObjectTransformStderrError.stdio);11391140 const falseObjectTransformStdioError = error as ExecaError<{stdio: ['pipe', 'pipe', {transform: typeof objectGenerator; final: typeof objectFinal; objectMode: false}]}>;1141 expectType<string>(falseObjectTransformStdioError.stderr);1142 expectType<[undefined, string, string]>(falseObjectTransformStdioError.stdio);1143}11441145const rejectsResult = await execa('unicorns');1146expectError(rejectsResult.stack?.toString());1147expectError(rejectsResult.message?.toString());1148expectError(rejectsResult.shortMessage?.toString());1149expectError(rejectsResult.originalMessage?.toString());1150expectError(rejectsResult.code?.toString());1151expectError(rejectsResult.cause?.valueOf());11521153const noRejectsResult = await execa('unicorns', {reject: false});1154expectType<string | undefined>(noRejectsResult.stack);1155expectType<string | undefined>(noRejectsResult.message);1156expectType<string | undefined>(noRejectsResult.shortMessage);1157expectType<string | undefined>(noRejectsResult.originalMessage);1158expectType<string | undefined>(noRejectsResult.code);1159expectType<unknown>(noRejectsResult.cause);11601161try {1162 const unicornsResult = execaSync('unicorns', {all: true});11631164 expectAssignable<ExecaSyncResult>(unicornsResult);1165 expectType<string>(unicornsResult.command);1166 expectType<string>(unicornsResult.escapedCommand);1167 expectType<number | undefined>(unicornsResult.exitCode);1168 expectError(unicornsResult.pipe);1169 expectType<boolean>(unicornsResult.failed);1170 expectType<boolean>(unicornsResult.timedOut);1171 expectType<boolean>(unicornsResult.isCanceled);1172 expectType<boolean>(unicornsResult.isTerminated);1173 expectType<boolean>(unicornsResult.isMaxBuffer);1174 expectType<string | undefined>(unicornsResult.signal);1175 expectType<string | undefined>(unicornsResult.signalDescription);1176 expectType<string>(unicornsResult.cwd);1177 expectType<number>(unicornsResult.durationMs);1178 expectType<[]>(unicornsResult.pipedFrom);11791180 expectType<undefined>(unicornsResult.stdio[0]);1181 expectType<string>(unicornsResult.stdout);1182 expectType<string>(unicornsResult.stdio[1]);1183 expectType<string>(unicornsResult.stderr);1184 expectType<string>(unicornsResult.stdio[2]);1185 expectType<string>(unicornsResult.all);11861187 const bufferResult = execaSync('unicorns', {encoding: 'buffer', all: true});1188 expectType<Uint8Array>(bufferResult.stdout);1189 expectType<Uint8Array>(bufferResult.stdio[1]);1190 expectType<Uint8Array>(bufferResult.stderr);1191 expectType<Uint8Array>(bufferResult.stdio[2]);1192 expectType<Uint8Array>(bufferResult.all);11931194 const linesResult = execaSync('unicorns', {lines: true, all: true});1195 expectType<string[]>(linesResult.stdout);1196 expectType<string[]>(linesResult.stderr);1197 expectType<string[]>(linesResult.all);11981199 const linesBufferResult = execaSync('unicorns', {lines: true, encoding: 'buffer', all: true});1200 expectType<Uint8Array>(linesBufferResult.stdout);1201 expectType<Uint8Array>(linesBufferResult.stderr);1202 expectType<Uint8Array>(linesBufferResult.all);12031204 const linesHexResult = execaSync('unicorns', {lines: true, encoding: 'hex', all: true});1205 expectType<string>(linesHexResult.stdout);1206 expectType<string>(linesHexResult.stderr);1207 expectType<string>(linesHexResult.all);12081209 const noBufferResult = execaSync('unicorns', {buffer: false, all: true});1210 expectType<undefined>(noBufferResult.stdout);1211 expectType<undefined>(noBufferResult.stderr);1212 expectType<undefined>(noBufferResult.all);12131214 const ignoreStdoutResult = execaSync('unicorns', {stdout: 'ignore', all: true});1215 expectType<undefined>(ignoreStdoutResult.stdout);1216 expectType<undefined>(ignoreStdoutResult.stdio[1]);1217 expectType<string>(ignoreStdoutResult.stderr);1218 expectType<string>(ignoreStdoutResult.stdio[2]);1219 expectType<string>(ignoreStdoutResult.all);12201221 const ignoreStderrResult = execaSync('unicorns', {stderr: 'ignore', all: true});1222 expectType<string>(ignoreStderrResult.stdout);1223 expectType<undefined>(ignoreStderrResult.stderr);1224 expectType<string>(ignoreStderrResult.all);12251226 const inheritStdoutResult = execaSync('unicorns', {stdout: 'inherit', all: true});1227 expectType<undefined>(inheritStdoutResult.stdout);1228 expectType<string>(inheritStdoutResult.stderr);1229 expectType<string>(inheritStdoutResult.all);12301231 const inheritStderrResult = execaSync('unicorns', {stderr: 'inherit', all: true});1232 expectType<string>(inheritStderrResult.stdout);1233 expectType<undefined>(inheritStderrResult.stderr);1234 expectType<string>(inheritStderrResult.all);12351236 const numberStdoutResult = execaSync('unicorns', {stdout: 1, all: true});1237 expectType<undefined>(numberStdoutResult.stdout);1238 expectType<string>(numberStdoutResult.stderr);1239 expectType<string>(numberStdoutResult.all);12401241 const numberStderrResult = execaSync('unicorns', {stderr: 1, all: true});1242 expectType<string>(numberStderrResult.stdout);1243 expectType<undefined>(numberStderrResult.stderr);1244 expectType<string>(numberStderrResult.all);1245} catch (error: unknown) {1246 if (error instanceof ExecaSyncError) {1247 expectAssignable<ExecaSyncError>(error);1248 expectType<'ExecaSyncError'>(error.name);1249 expectType<string>(error.message);1250 expectType<number | undefined>(error.exitCode);1251 expectType<boolean>(error.failed);1252 expectType<boolean>(error.timedOut);1253 expectType<boolean>(error.isCanceled);1254 expectType<boolean>(error.isTerminated);1255 expectType<boolean>(error.isMaxBuffer);1256 expectType<string | undefined>(error.signal);1257 expectType<string | undefined>(error.signalDescription);1258 expectType<string>(error.cwd);1259 expectType<number>(error.durationMs);1260 expectType<string>(error.shortMessage);1261 expectType<string>(error.originalMessage);1262 expectType<string | undefined>(error.code);1263 expectType<unknown>(error.cause);1264 expectType<[]>(error.pipedFrom);1265 }12661267 const execaStringError = error as ExecaSyncError<{all: true}>;1268 expectType<undefined>(execaStringError.stdio[0]);1269 expectType<string>(execaStringError.stdout);1270 expectType<string>(execaStringError.stdio[1]);1271 expectType<string>(execaStringError.stderr);1272 expectType<string>(execaStringError.stdio[2]);1273 expectType<string>(execaStringError.all);12741275 const execaBufferError = error as ExecaSyncError<{encoding: 'buffer'; all: true}>;1276 expectType<Uint8Array>(execaBufferError.stdout);1277 expectType<Uint8Array>(execaBufferError.stdio[1]);1278 expectType<Uint8Array>(execaBufferError.stderr);1279 expectType<Uint8Array>(execaBufferError.stdio[2]);1280 expectType<Uint8Array>(execaBufferError.all);12811282 const execaLinesError = error as ExecaSyncError<{lines: true; all: true}>;1283 expectType<string[]>(execaLinesError.stdout);1284 expectType<string[]>(execaLinesError.stderr);1285 expectType<string[]>(execaLinesError.all);12861287 const execaLinesBufferError = error as ExecaSyncError<{lines: true; encoding: 'buffer'; all: true}>;1288 expectType<Uint8Array>(execaLinesBufferError.stdout);1289 expectType<Uint8Array>(execaLinesBufferError.stderr);1290 expectType<Uint8Array>(execaLinesBufferError.all);12911292 const noBufferError = error as ExecaSyncError<{buffer: false; all: true}>;1293 expectType<undefined>(noBufferError.stdout);1294 expectType<undefined>(noBufferError.stderr);1295 expectType<undefined>(noBufferError.all);12961297 const ignoreStdoutError = error as ExecaSyncError<{stdout: 'ignore'; all: true}>;1298 expectType<undefined>(ignoreStdoutError.stdout);1299 expectType<undefined>(ignoreStdoutError.stdio[1]);1300 expectType<string>(ignoreStdoutError.stderr);1301 expectType<string>(ignoreStdoutError.stdio[2]);1302 expectType<string>(ignoreStdoutError.all);13031304 const ignoreStderrError = error as ExecaSyncError<{stderr: 'ignore'; all: true}>;1305 expectType<string>(ignoreStderrError.stdout);1306 expectType<undefined>(ignoreStderrError.stderr);1307 expectType<string>(ignoreStderrError.all);13081309 const inheritStdoutError = error as ExecaSyncError<{stdout: 'inherit'; all: true}>;1310 expectType<undefined>(inheritStdoutError.stdout);1311 expectType<string>(inheritStdoutError.stderr);1312 expectType<string>(inheritStdoutError.all);13131314 const inheritStderrError = error as ExecaSyncError<{stderr: 'inherit'; all: true}>;1315 expectType<string>(inheritStderrError.stdout);1316 expectType<undefined>(inheritStderrError.stderr);1317 expectType<string>(inheritStderrError.all);13181319 const numberStdoutError = error as ExecaSyncError<{stdout: 1; all: true}>;1320 expectType<undefined>(numberStdoutError.stdout);1321 expectType<string>(numberStdoutError.stderr);1322 expectType<string>(numberStdoutError.all);13231324 const numberStderrError = error as ExecaSyncError<{stderr: 1; all: true}>;1325 expectType<string>(numberStderrError.stdout);1326 expectType<undefined>(numberStderrError.stderr);1327 expectType<string>(numberStderrError.all);1328}13291330const rejectsSyncResult = execaSync('unicorns');1331expectError(rejectsSyncResult.stack?.toString());1332expectError(rejectsSyncResult.message?.toString());1333expectError(rejectsSyncResult.shortMessage?.toString());1334expectError(rejectsSyncResult.originalMessage?.toString());1335expectError(rejectsSyncResult.code?.toString());1336expectError(rejectsSyncResult.cause?.valueOf());13371338const noRejectsSyncResult = execaSync('unicorns', {reject: false});1339expectType<string | undefined>(noRejectsSyncResult.stack);1340expectType<string | undefined>(noRejectsSyncResult.message);1341expectType<string | undefined>(noRejectsSyncResult.shortMessage);1342expectType<string | undefined>(noRejectsSyncResult.originalMessage);13431344expectAssignable<Options>({cleanup: false});1345expectNotAssignable<SyncOptions>({cleanup: false});1346expectAssignable<SyncOptions>({preferLocal: false});13471348/* eslint-disable @typescript-eslint/no-floating-promises */1349execa('unicorns', {preferLocal: false});1350execaSync('unicorns', {preferLocal: false});1351expectError(execa('unicorns', {preferLocal: 'false'}));1352expectError(execaSync('unicorns', {preferLocal: 'false'}));1353execa('unicorns', {localDir: '.'});1354execaSync('unicorns', {localDir: '.'});1355execa('unicorns', {localDir: fileUrl});1356execaSync('unicorns', {localDir: fileUrl});1357expectError(execa('unicorns', {localDir: false}));1358expectError(execaSync('unicorns', {localDir: false}));1359execa('unicorns', {node: true});1360execaSync('unicorns', {node: true});1361expectError(execa('unicorns', {node: 'true'}));1362expectError(execaSync('unicorns', {node: 'true'}));1363execa('unicorns', {nodePath: './node'});1364execaSync('unicorns', {nodePath: './node'});1365execa('unicorns', {nodePath: fileUrl});1366execaSync('unicorns', {nodePath: fileUrl});1367expectError(execa('unicorns', {nodePath: false}));1368expectError(execaSync('unicorns', {nodePath: false}));1369execa('unicorns', {nodeOptions: ['--async-stack-traces'] as const});1370execaSync('unicorns', {nodeOptions: ['--async-stack-traces'] as const});1371expectError(execa('unicorns', {nodeOptions: [false] as const}));1372expectError(execaSync('unicorns', {nodeOptions: [false] as const}));1373execa('unicorns', {input: ''});1374execaSync('unicorns', {input: ''});1375execa('unicorns', {input: new Uint8Array()});1376execaSync('unicorns', {input: new Uint8Array()});1377execa('unicorns', {input: process.stdin});1378execaSync('unicorns', {input: process.stdin});1379expectError(execa('unicorns', {input: false}));1380expectError(execaSync('unicorns', {input: false}));1381execa('unicorns', {inputFile: ''});1382execaSync('unicorns', {inputFile: ''});1383execa('unicorns', {inputFile: fileUrl});1384execaSync('unicorns', {inputFile: fileUrl});1385expectError(execa('unicorns', {inputFile: false}));1386expectError(execaSync('unicorns', {inputFile: false}));1387execa('unicorns', {lines: false});1388execaSync('unicorns', {lines: false});1389expectError(execa('unicorns', {lines: 'false'}));1390expectError(execaSync('unicorns', {lines: 'false'}));1391execa('unicorns', {reject: false});1392execaSync('unicorns', {reject: false});1393expectError(execa('unicorns', {reject: 'false'}));1394expectError(execaSync('unicorns', {reject: 'false'}));1395execa('unicorns', {stripFinalNewline: false});1396execaSync('unicorns', {stripFinalNewline: false});1397expectError(execa('unicorns', {stripFinalNewline: 'false'}));1398expectError(execaSync('unicorns', {stripFinalNewline: 'false'}));1399execa('unicorns', {extendEnv: false});1400execaSync('unicorns', {extendEnv: false});1401expectError(execa('unicorns', {extendEnv: 'false'}));1402expectError(execaSync('unicorns', {extendEnv: 'false'}));1403execa('unicorns', {cwd: '.'});1404execaSync('unicorns', {cwd: '.'});1405execa('unicorns', {cwd: fileUrl});1406execaSync('unicorns', {cwd: fileUrl});1407expectError(execa('unicorns', {cwd: false}));1408expectError(execaSync('unicorns', {cwd: false}));1409// eslint-disable-next-line @typescript-eslint/naming-convention1410execa('unicorns', {env: {PATH: ''}});1411// eslint-disable-next-line @typescript-eslint/naming-convention1412execaSync('unicorns', {env: {PATH: ''}});1413expectError(execa('unicorns', {env: false}));1414expectError(execaSync('unicorns', {env: false}));1415execa('unicorns', {argv0: ''});1416execaSync('unicorns', {argv0: ''});1417expectError(execa('unicorns', {argv0: false}));1418expectError(execaSync('unicorns', {argv0: false}));1419execa('unicorns', {uid: 0});1420execaSync('unicorns', {uid: 0});1421expectError(execa('unicorns', {uid: '0'}));1422expectError(execaSync('unicorns', {uid: '0'}));1423execa('unicorns', {gid: 0});1424execaSync('unicorns', {gid: 0});1425expectError(execa('unicorns', {gid: '0'}));1426expectError(execaSync('unicorns', {gid: '0'}));1427execa('unicorns', {shell: true});1428execaSync('unicorns', {shell: true});1429execa('unicorns', {shell: '/bin/sh'});1430execaSync('unicorns', {shell: '/bin/sh'});1431execa('unicorns', {shell: fileUrl});1432execaSync('unicorns', {shell: fileUrl});1433expectError(execa('unicorns', {shell: {}}));1434expectError(execaSync('unicorns', {shell: {}}));1435execa('unicorns', {timeout: 1000});1436execaSync('unicorns', {timeout: 1000});1437expectError(execa('unicorns', {timeout: '1000'}));1438expectError(execaSync('unicorns', {timeout: '1000'}));1439execa('unicorns', {maxBuffer: 1000});1440execaSync('unicorns', {maxBuffer: 1000});1441expectError(execa('unicorns', {maxBuffer: '1000'}));1442expectError(execaSync('unicorns', {maxBuffer: '1000'}));1443execa('unicorns', {killSignal: 'SIGTERM'});1444execaSync('unicorns', {killSignal: 'SIGTERM'});1445execa('unicorns', {killSignal: 9});1446execaSync('unicorns', {killSignal: 9});1447expectError(execa('unicorns', {killSignal: false}));1448expectError(execaSync('unicorns', {killSignal: false}));1449execa('unicorns', {forceKillAfterDelay: false});1450expectError(execaSync('unicorns', {forceKillAfterDelay: false}));1451execa('unicorns', {forceKillAfterDelay: 42});1452expectError(execaSync('unicorns', {forceKillAfterDelay: 42}));1453expectError(execa('unicorns', {forceKillAfterDelay: 'true'}));1454expectError(execaSync('unicorns', {forceKillAfterDelay: 'true'}));1455execa('unicorns', {windowsVerbatimArguments: true});1456execaSync('unicorns', {windowsVerbatimArguments: true});1457expectError(execa('unicorns', {windowsVerbatimArguments: 'true'}));1458expectError(execaSync('unicorns', {windowsVerbatimArguments: 'true'}));1459execa('unicorns', {windowsHide: false});1460execaSync('unicorns', {windowsHide: false});1461expectError(execa('unicorns', {windowsHide: 'false'}));1462expectError(execaSync('unicorns', {windowsHide: 'false'}));1463execa('unicorns', {verbose: 'none'});1464execaSync('unicorns', {verbose: 'none'});1465execa('unicorns', {verbose: 'short'});1466execaSync('unicorns', {verbose: 'short'});1467execa('unicorns', {verbose: 'full'});1468execaSync('unicorns', {verbose: 'full'});1469expectError(execa('unicorns', {verbose: 'other'}));1470expectError(execaSync('unicorns', {verbose: 'other'}));1471execa('unicorns', {cleanup: false});1472expectError(execaSync('unicorns', {cleanup: false}));1473expectError(execa('unicorns', {cleanup: 'false'}));1474expectError(execaSync('unicorns', {cleanup: 'false'}));1475execa('unicorns', {buffer: false});1476execaSync('unicorns', {buffer: false});1477expectError(execa('unicorns', {buffer: 'false'}));1478expectError(execaSync('unicorns', {buffer: 'false'}));1479execa('unicorns', {all: true});1480execaSync('unicorns', {all: true});1481expectError(execa('unicorns', {all: 'true'}));1482expectError(execaSync('unicorns', {all: 'true'}));1483execa('unicorns', {ipc: true});1484expectError(execaSync('unicorns', {ipc: true}));1485expectError(execa('unicorns', {ipc: 'true'}));1486expectError(execaSync('unicorns', {ipc: 'true'}));1487execa('unicorns', {serialization: 'json'});1488expectError(execaSync('unicorns', {serialization: 'json'}));1489execa('unicorns', {serialization: 'advanced'});1490expectError(execaSync('unicorns', {serialization: 'advanced'}));1491expectError(execa('unicorns', {serialization: 'other'}));1492expectError(execaSync('unicorns', {serialization: 'other'}));1493execa('unicorns', {detached: true});1494expectError(execaSync('unicorns', {detached: true}));1495expectError(execa('unicorns', {detached: 'true'}));1496expectError(execaSync('unicorns', {detached: 'true'}));1497execa('unicorns', {cancelSignal: new AbortController().signal});1498expectError(execaSync('unicorns', {cancelSignal: new AbortController().signal}));1499expectError(execa('unicorns', {cancelSignal: false}));1500expectError(execaSync('unicorns', {cancelSignal: false}));15011502execa('unicorns', {encoding: 'utf8'});1503execaSync('unicorns', {encoding: 'utf8'});1504/* eslint-disable unicorn/text-encoding-identifier-case */1505expectError(execa('unicorns', {encoding: 'utf-8'}));1506expectError(execaSync('unicorns', {encoding: 'utf-8'}));1507expectError(execa('unicorns', {encoding: 'UTF8'}));1508expectError(execaSync('unicorns', {encoding: 'UTF8'}));1509/* eslint-enable unicorn/text-encoding-identifier-case */1510execa('unicorns', {encoding: 'utf16le'});1511execaSync('unicorns', {encoding: 'utf16le'});1512expectError(execa('unicorns', {encoding: 'utf-16le'}));1513expectError(execaSync('unicorns', {encoding: 'utf-16le'}));1514expectError(execa('unicorns', {encoding: 'ucs2'}));1515expectError(execaSync('unicorns', {encoding: 'ucs2'}));1516expectError(execa('unicorns', {encoding: 'ucs-2'}));1517expectError(execaSync('unicorns', {encoding: 'ucs-2'}));1518execa('unicorns', {encoding: 'buffer'});1519execaSync('unicorns', {encoding: 'buffer'});1520expectError(execa('unicorns', {encoding: null}));1521expectError(execaSync('unicorns', {encoding: null}));1522execa('unicorns', {encoding: 'hex'});1523execaSync('unicorns', {encoding: 'hex'});1524execa('unicorns', {encoding: 'base64'});1525execaSync('unicorns', {encoding: 'base64'});1526execa('unicorns', {encoding: 'base64url'});1527execaSync('unicorns', {encoding: 'base64url'});1528execa('unicorns', {encoding: 'latin1'});1529execaSync('unicorns', {encoding: 'latin1'});1530expectError(execa('unicorns', {encoding: 'binary'}));1531expectError(execaSync('unicorns', {encoding: 'binary'}));1532execa('unicorns', {encoding: 'ascii'});1533execaSync('unicorns', {encoding: 'ascii'});1534expectError(execa('unicorns', {encoding: 'unknownEncoding'}));1535expectError(execaSync('unicorns', {encoding: 'unknownEncoding'}));15361537execa('unicorns', {maxBuffer: {}});1538expectError(execa('unicorns', {maxBuffer: []}));1539execa('unicorns', {maxBuffer: {stdout: 0}});1540execa('unicorns', {maxBuffer: {stderr: 0}});1541execa('unicorns', {maxBuffer: {stdout: 0, stderr: 0} as const});1542execa('unicorns', {maxBuffer: {all: 0}});1543execa('unicorns', {maxBuffer: {fd1: 0}});1544execa('unicorns', {maxBuffer: {fd2: 0}});1545execa('unicorns', {maxBuffer: {fd3: 0}});1546expectError(execa('unicorns', {maxBuffer: {stdout: '0'}}));1547execaSync('unicorns', {maxBuffer: {}});1548expectError(execaSync('unicorns', {maxBuffer: []}));1549execaSync('unicorns', {maxBuffer: {stdout: 0}});1550execaSync('unicorns', {maxBuffer: {stderr: 0}});1551execaSync('unicorns', {maxBuffer: {stdout: 0, stderr: 0} as const});1552execaSync('unicorns', {maxBuffer: {all: 0}});1553execaSync('unicorns', {maxBuffer: {fd1: 0}});1554execaSync('unicorns', {maxBuffer: {fd2: 0}});1555execaSync('unicorns', {maxBuffer: {fd3: 0}});1556expectError(execaSync('unicorns', {maxBuffer: {stdout: '0'}}));1557execa('unicorns', {verbose: {}});1558expectError(execa('unicorns', {verbose: []}));1559execa('unicorns', {verbose: {stdout: 'none'}});1560execa('unicorns', {verbose: {stderr: 'none'}});1561execa('unicorns', {verbose: {stdout: 'none', stderr: 'none'} as const});1562execa('unicorns', {verbose: {all: 'none'}});1563execa('unicorns', {verbose: {fd1: 'none'}});1564execa('unicorns', {verbose: {fd2: 'none'}});1565execa('unicorns', {verbose: {fd3: 'none'}});1566expectError(execa('unicorns', {verbose: {stdout: 'other'}}));1567execaSync('unicorns', {verbose: {}});1568expectError(execaSync('unicorns', {verbose: []}));1569execaSync('unicorns', {verbose: {stdout: 'none'}});1570execaSync('unicorns', {verbose: {stderr: 'none'}});1571execaSync('unicorns', {verbose: {stdout: 'none', stderr: 'none'} as const});1572execaSync('unicorns', {verbose: {all: 'none'}});1573execaSync('unicorns', {verbose: {fd1: 'none'}});1574execaSync('unicorns', {verbose: {fd2: 'none'}});1575execaSync('unicorns', {verbose: {fd3: 'none'}});1576expectError(execaSync('unicorns', {verbose: {stdout: 'other'}}));1577execa('unicorns', {stripFinalNewline: {}});1578expectError(execa('unicorns', {stripFinalNewline: []}));1579execa('unicorns', {stripFinalNewline: {stdout: true}});1580execa('unicorns', {stripFinalNewline: {stderr: true}});1581execa('unicorns', {stripFinalNewline: {stdout: true, stderr: true} as const});1582execa('unicorns', {stripFinalNewline: {all: true}});1583execa('unicorns', {stripFinalNewline: {fd1: true}});1584execa('unicorns', {stripFinalNewline: {fd2: true}});1585execa('unicorns', {stripFinalNewline: {fd3: true}});1586expectError(execa('unicorns', {stripFinalNewline: {stdout: 'true'}}));1587execaSync('unicorns', {stripFinalNewline: {}});1588expectError(execaSync('unicorns', {stripFinalNewline: []}));1589execaSync('unicorns', {stripFinalNewline: {stdout: true}});1590execaSync('unicorns', {stripFinalNewline: {stderr: true}});1591execaSync('unicorns', {stripFinalNewline: {stdout: true, stderr: true} as const});1592execaSync('unicorns', {stripFinalNewline: {all: true}});1593execaSync('unicorns', {stripFinalNewline: {fd1: true}});1594execaSync('unicorns', {stripFinalNewline: {fd2: true}});1595execaSync('unicorns', {stripFinalNewline: {fd3: true}});1596expectError(execaSync('unicorns', {stripFinalNewline: {stdout: 'true'}}));1597execa('unicorns', {lines: {}});1598expectError(execa('unicorns', {lines: []}));1599execa('unicorns', {lines: {stdout: true}});1600execa('unicorns', {lines: {stderr: true}});1601execa('unicorns', {lines: {stdout: true, stderr: true} as const});1602execa('unicorns', {lines: {all: true}});1603execa('unicorns', {lines: {fd1: true}});1604execa('unicorns', {lines: {fd2: true}});1605execa('unicorns', {lines: {fd3: true}});1606expectError(execa('unicorns', {lines: {stdout: 'true'}}));1607execaSync('unicorns', {lines: {}});1608expectError(execaSync('unicorns', {lines: []}));1609execaSync('unicorns', {lines: {stdout: true}});1610execaSync('unicorns', {lines: {stderr: true}});1611execaSync('unicorns', {lines: {stdout: true, stderr: true} as const});1612execaSync('unicorns', {lines: {all: true}});1613execaSync('unicorns', {lines: {fd1: true}});1614execaSync('unicorns', {lines: {fd2: true}});1615execaSync('unicorns', {lines: {fd3: true}});1616expectError(execaSync('unicorns', {lines: {stdout: 'true'}}));1617execa('unicorns', {buffer: {}});1618expectError(execa('unicorns', {buffer: []}));1619execa('unicorns', {buffer: {stdout: true}});1620execa('unicorns', {buffer: {stderr: true}});1621execa('unicorns', {buffer: {stdout: true, stderr: true} as const});1622execa('unicorns', {buffer: {all: true}});1623execa('unicorns', {buffer: {fd1: true}});1624execa('unicorns', {buffer: {fd2: true}});1625execa('unicorns', {buffer: {fd3: true}});1626expectError(execa('unicorns', {buffer: {stdout: 'true'}}));1627execaSync('unicorns', {buffer: {}});1628expectError(execaSync('unicorns', {buffer: []}));1629execaSync('unicorns', {buffer: {stdout: true}});1630execaSync('unicorns', {buffer: {stderr: true}});1631execaSync('unicorns', {buffer: {stdout: true, stderr: true} as const});1632execaSync('unicorns', {buffer: {all: true}});1633execaSync('unicorns', {buffer: {fd1: true}});1634execaSync('unicorns', {buffer: {fd2: true}});1635execaSync('unicorns', {buffer: {fd3: true}});1636expectError(execaSync('unicorns', {buffer: {stdout: 'true'}}));16371638expectType<string[]>(execaSync('unicorns', {lines: {stdout: true, fd1: false}}).stdout);1639expectType<string[]>(execaSync('unicorns', {lines: {stdout: true, all: false}}).stdout);1640expectType<string[]>(execaSync('unicorns', {lines: {fd1: true, all: false}}).stdout);1641expectType<string[]>(execaSync('unicorns', {lines: {stderr: true, fd2: false}}).stderr);1642expectType<string[]>(execaSync('unicorns', {lines: {stderr: true, all: false}}).stderr);1643expectType<string[]>(execaSync('unicorns', {lines: {fd2: true, all: false}}).stderr);1644expectType<string[]>(execaSync('unicorns', {lines: {fd1: false, stdout: true}}).stdout);1645expectType<string[]>(execaSync('unicorns', {lines: {all: false, stdout: true}}).stdout);1646expectType<string[]>(execaSync('unicorns', {lines: {all: false, fd1: true}}).stdout);1647expectType<string[]>(execaSync('unicorns', {lines: {fd2: false, stderr: true}}).stderr);1648expectType<string[]>(execaSync('unicorns', {lines: {all: false, stderr: true}}).stderr);1649expectType<string[]>(execaSync('unicorns', {lines: {all: false, fd2: true}}).stderr);16501651const linesStdoutResult = await execa('unicorns', {all: true, lines: {stdout: true}});1652expectType<string[]>(linesStdoutResult.stdout);1653expectType<string[]>(linesStdoutResult.stdio[1]);1654expectType<string>(linesStdoutResult.stderr);1655expectType<string>(linesStdoutResult.stdio[2]);1656expectType<string[]>(linesStdoutResult.all);16571658const linesStderrResult = await execa('unicorns', {all: true, lines: {stderr: true}});1659expectType<string>(linesStderrResult.stdout);1660expectType<string>(linesStderrResult.stdio[1]);1661expectType<string[]>(linesStderrResult.stderr);1662expectType<string[]>(linesStderrResult.stdio[2]);1663expectType<string[]>(linesStderrResult.all);16641665const linesFd1Result = await execa('unicorns', {all: true, lines: {fd1: true}});1666expectType<string[]>(linesFd1Result.stdout);1667expectType<string[]>(linesFd1Result.stdio[1]);1668expectType<string>(linesFd1Result.stderr);1669expectType<string>(linesFd1Result.stdio[2]);1670expectType<string[]>(linesFd1Result.all);16711672const linesFd2Result = await execa('unicorns', {all: true, lines: {fd2: true}});1673expectType<string>(linesFd2Result.stdout);1674expectType<string>(linesFd2Result.stdio[1]);1675expectType<string[]>(linesFd2Result.stderr);1676expectType<string[]>(linesFd2Result.stdio[2]);1677expectType<string[]>(linesFd2Result.all);16781679const linesAllResult = await execa('unicorns', {all: true, lines: {all: true}});1680expectType<string[]>(linesAllResult.stdout);1681expectType<string[]>(linesAllResult.stdio[1]);1682expectType<string[]>(linesAllResult.stderr);1683expectType<string[]>(linesAllResult.stdio[2]);1684expectType<string[]>(linesAllResult.all);16851686const linesFd3Result = await execa('unicorns', {all: true, lines: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});1687expectType<string>(linesFd3Result.stdout);1688expectType<string>(linesFd3Result.stdio[1]);1689expectType<string>(linesFd3Result.stderr);1690expectType<string>(linesFd3Result.stdio[2]);1691expectType<string>(linesFd3Result.all);1692expectType<string[]>(linesFd3Result.stdio[3]);1693expectType<string>(linesFd3Result.stdio[4]);16941695const linesStdoutResultSync = execaSync('unicorns', {all: true, lines: {stdout: true}});1696expectType<string[]>(linesStdoutResultSync.stdout);1697expectType<string[]>(linesStdoutResultSync.stdio[1]);1698expectType<string>(linesStdoutResultSync.stderr);1699expectType<string>(linesStdoutResultSync.stdio[2]);1700expectType<string[]>(linesStdoutResultSync.all);17011702const linesStderrResultSync = execaSync('unicorns', {all: true, lines: {stderr: true}});1703expectType<string>(linesStderrResultSync.stdout);1704expectType<string>(linesStderrResultSync.stdio[1]);1705expectType<string[]>(linesStderrResultSync.stderr);1706expectType<string[]>(linesStderrResultSync.stdio[2]);1707expectType<string[]>(linesStderrResultSync.all);17081709const linesFd1ResultSync = execaSync('unicorns', {all: true, lines: {fd1: true}});1710expectType<string[]>(linesFd1ResultSync.stdout);1711expectType<string[]>(linesFd1ResultSync.stdio[1]);1712expectType<string>(linesFd1ResultSync.stderr);1713expectType<string>(linesFd1ResultSync.stdio[2]);1714expectType<string[]>(linesFd1ResultSync.all);17151716const linesFd2ResultSync = execaSync('unicorns', {all: true, lines: {fd2: true}});1717expectType<string>(linesFd2ResultSync.stdout);1718expectType<string>(linesFd2ResultSync.stdio[1]);1719expectType<string[]>(linesFd2ResultSync.stderr);1720expectType<string[]>(linesFd2ResultSync.stdio[2]);1721expectType<string[]>(linesFd2ResultSync.all);17221723const linesAllResultSync = execaSync('unicorns', {all: true, lines: {all: true}});1724expectType<string[]>(linesAllResultSync.stdout);1725expectType<string[]>(linesAllResultSync.stdio[1]);1726expectType<string[]>(linesAllResultSync.stderr);1727expectType<string[]>(linesAllResultSync.stdio[2]);1728expectType<string[]>(linesAllResultSync.all);17291730const linesFd3ResultSync = execaSync('unicorns', {all: true, lines: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});1731expectType<string>(linesFd3ResultSync.stdout);1732expectType<string>(linesFd3ResultSync.stdio[1]);1733expectType<string>(linesFd3ResultSync.stderr);1734expectType<string>(linesFd3ResultSync.stdio[2]);1735expectType<string>(linesFd3ResultSync.all);1736expectType<string[]>(linesFd3ResultSync.stdio[3]);1737expectType<string>(linesFd3ResultSync.stdio[4]);17381739const noBufferStdoutResult = await execa('unicorns', {all: true, buffer: {stdout: false}});1740expectType<undefined>(noBufferStdoutResult.stdout);1741expectType<undefined>(noBufferStdoutResult.stdio[1]);1742expectType<string>(noBufferStdoutResult.stderr);1743expectType<string>(noBufferStdoutResult.stdio[2]);1744expectType<string>(noBufferStdoutResult.all);17451746const noBufferStderrResult = await execa('unicorns', {all: true, buffer: {stderr: false}});1747expectType<string>(noBufferStderrResult.stdout);1748expectType<string>(noBufferStderrResult.stdio[1]);1749expectType<undefined>(noBufferStderrResult.stderr);1750expectType<undefined>(noBufferStderrResult.stdio[2]);1751expectType<string>(noBufferStderrResult.all);17521753const noBufferFd1Result = await execa('unicorns', {all: true, buffer: {fd1: false}});1754expectType<undefined>(noBufferFd1Result.stdout);1755expectType<undefined>(noBufferFd1Result.stdio[1]);1756expectType<string>(noBufferFd1Result.stderr);1757expectType<string>(noBufferFd1Result.stdio[2]);1758expectType<string>(noBufferFd1Result.all);17591760const noBufferFd2Result = await execa('unicorns', {all: true, buffer: {fd2: false}});1761expectType<string>(noBufferFd2Result.stdout);1762expectType<string>(noBufferFd2Result.stdio[1]);1763expectType<undefined>(noBufferFd2Result.stderr);1764expectType<undefined>(noBufferFd2Result.stdio[2]);1765expectType<string>(noBufferFd2Result.all);17661767const noBufferAllResult = await execa('unicorns', {all: true, buffer: {all: false}});1768expectType<undefined>(noBufferAllResult.stdout);1769expectType<undefined>(noBufferAllResult.stdio[1]);1770expectType<undefined>(noBufferAllResult.stderr);1771expectType<undefined>(noBufferAllResult.stdio[2]);1772expectType<undefined>(noBufferAllResult.all);17731774const noBufferFd3Result = await execa('unicorns', {all: true, buffer: {fd3: false}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});1775expectType<string>(noBufferFd3Result.stdout);1776expectType<string>(noBufferFd3Result.stdio[1]);1777expectType<string>(noBufferFd3Result.stderr);1778expectType<string>(noBufferFd3Result.stdio[2]);1779expectType<string>(noBufferFd3Result.all);1780expectType<undefined>(noBufferFd3Result.stdio[3]);1781expectType<string>(noBufferFd3Result.stdio[4]);17821783const noBufferStdoutResultSync = execaSync('unicorns', {all: true, buffer: {stdout: false}});1784expectType<undefined>(noBufferStdoutResultSync.stdout);1785expectType<undefined>(noBufferStdoutResultSync.stdio[1]);1786expectType<string>(noBufferStdoutResultSync.stderr);1787expectType<string>(noBufferStdoutResultSync.stdio[2]);1788expectType<string>(noBufferStdoutResultSync.all);17891790const noBufferStderrResultSync = execaSync('unicorns', {all: true, buffer: {stderr: false}});1791expectType<string>(noBufferStderrResultSync.stdout);1792expectType<string>(noBufferStderrResultSync.stdio[1]);1793expectType<undefined>(noBufferStderrResultSync.stderr);1794expectType<undefined>(noBufferStderrResultSync.stdio[2]);1795expectType<string>(noBufferStderrResultSync.all);17961797const noBufferFd1ResultSync = execaSync('unicorns', {all: true, buffer: {fd1: false}});1798expectType<undefined>(noBufferFd1ResultSync.stdout);1799expectType<undefined>(noBufferFd1ResultSync.stdio[1]);1800expectType<string>(noBufferFd1ResultSync.stderr);1801expectType<string>(noBufferFd1ResultSync.stdio[2]);1802expectType<string>(noBufferFd1ResultSync.all);18031804const noBufferFd2ResultSync = execaSync('unicorns', {all: true, buffer: {fd2: false}});1805expectType<string>(noBufferFd2ResultSync.stdout);1806expectType<string>(noBufferFd2ResultSync.stdio[1]);1807expectType<undefined>(noBufferFd2ResultSync.stderr);1808expectType<undefined>(noBufferFd2ResultSync.stdio[2]);1809expectType<string>(noBufferFd2ResultSync.all);18101811const noBufferAllResultSync = execaSync('unicorns', {all: true, buffer: {all: false}});1812expectType<undefined>(noBufferAllResultSync.stdout);1813expectType<undefined>(noBufferAllResultSync.stdio[1]);1814expectType<undefined>(noBufferAllResultSync.stderr);1815expectType<undefined>(noBufferAllResultSync.stdio[2]);1816expectType<undefined>(noBufferAllResultSync.all);18171818const noBufferFd3ResultSync = execaSync('unicorns', {all: true, buffer: {fd3: false}, stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']});1819expectType<string>(noBufferFd3ResultSync.stdout);1820expectType<string>(noBufferFd3ResultSync.stdio[1]);1821expectType<string>(noBufferFd3ResultSync.stderr);1822expectType<string>(noBufferFd3ResultSync.stdio[2]);1823expectType<string>(noBufferFd3ResultSync.all);1824expectType<undefined>(noBufferFd3ResultSync.stdio[3]);1825expectType<string>(noBufferFd3ResultSync.stdio[4]);18261827expectError(execa('unicorns', {stdio: []}));1828expectError(execaSync('unicorns', {stdio: []}));1829expectError(execa('unicorns', {stdio: ['pipe']}));1830expectError(execaSync('unicorns', {stdio: ['pipe']}));1831expectError(execa('unicorns', {stdio: ['pipe', 'pipe']}));1832expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe']}));1833execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'pipe']});1834execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'pipe']});1835expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'unknown']}));1836expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'unknown']}));1837execa('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});1838execaSync('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});1839execa('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]});1840expectError(execaSync('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]}));1841execa('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});1842execaSync('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});1843execa('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]});1844expectError(execaSync('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]}));1845execa('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});1846execaSync('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});1847execa('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]});1848expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]}));1849expectError(execa('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));1850expectError(execaSync('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));1851expectError(execa('unicorns', {stdio: [[new Writable()], ['pipe'], ['pipe']]}));1852expectError(execaSync('unicorns', {stdio: [[new Writable()], ['pipe'], ['pipe']]}));1853expectError(execa('unicorns', {stdio: ['pipe', new Readable(), 'pipe']}));1854expectError(execaSync('unicorns', {stdio: ['pipe', new Readable(), 'pipe']}));1855expectError(execa('unicorns', {stdio: [['pipe'], [new Readable()], ['pipe']]}));1856expectError(execaSync('unicorns', {stdio: [['pipe'], [new Readable()], ['pipe']]}));1857expectError(execa('unicorns', {stdio: ['pipe', 'pipe', new Readable()]}));1858expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', new Readable()]}));1859expectError(execa('unicorns', {stdio: [['pipe'], ['pipe'], [new Readable()]]}));1860expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Readable()]]}));1861expectAssignable<StdioOption>([new Uint8Array(), new Uint8Array()]);1862expectAssignable<StdioOptionSync>([new Uint8Array(), new Uint8Array()]);1863expectNotAssignable<StdioOption>([new Writable(), new Uint8Array()]);1864expectNotAssignable<StdioOptionSync>([new Writable(), new Uint8Array()]);18651866expectError(execa('unicorns', {stdin: 'unknown'}));1867expectError(execaSync('unicorns', {stdin: 'unknown'}));1868expectError(execa('unicorns', {stdin: ['unknown']}));1869expectError(execaSync('unicorns', {stdin: ['unknown']}));1870expectError(execa('unicorns', {stdout: 'unknown'}));1871expectError(execaSync('unicorns', {stdout: 'unknown'}));1872expectError(execa('unicorns', {stdout: ['unknown']}));1873expectError(execaSync('unicorns', {stdout: ['unknown']}));1874expectError(execa('unicorns', {stderr: 'unknown'}));1875expectError(execaSync('unicorns', {stderr: 'unknown'}));1876expectError(execa('unicorns', {stderr: ['unknown']}));1877expectError(execaSync('unicorns', {stderr: ['unknown']}));1878expectError(execa('unicorns', {stdio: 'unknown'}));1879expectError(execaSync('unicorns', {stdio: 'unknown'}));1880expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'unknown']}));1881expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'unknown']}));1882expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['unknown']]}));1883expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['unknown']]}));1884expectNotAssignable<StdinOption>('unknown');1885expectNotAssignable<StdinOptionSync>('unknown');1886expectNotAssignable<StdinOption>(['unknown']);1887expectNotAssignable<StdinOptionSync>(['unknown']);1888expectNotAssignable<StdoutStderrOption>('unknown');1889expectNotAssignable<StdoutStderrOptionSync>('unknown');1890expectNotAssignable<StdoutStderrOption>(['unknown']);1891expectNotAssignable<StdoutStderrOptionSync>(['unknown']);1892expectNotAssignable<StdioOption>('unknown');1893expectNotAssignable<StdioOptionSync>('unknown');1894expectNotAssignable<StdioOption>(['unknown']);1895expectNotAssignable<StdioOptionSync>(['unknown']);1896execa('unicorns', {stdin: pipeInherit});1897execaSync('unicorns', {stdin: pipeInherit});1898execa('unicorns', {stdout: pipeInherit});1899execaSync('unicorns', {stdout: pipeInherit});1900execa('unicorns', {stderr: pipeInherit});1901execaSync('unicorns', {stderr: pipeInherit});1902expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeInherit]}));1903execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeInherit]});1904expectAssignable<StdinOption>(pipeInherit);1905expectAssignable<StdinOptionSync>(pipeInherit);1906expectAssignable<StdoutStderrOption>(pipeInherit);1907expectAssignable<StdoutStderrOptionSync>(pipeInherit);1908expectAssignable<StdioOption>(pipeInherit);1909expectAssignable<StdioOptionSync>(pipeInherit);1910execa('unicorns', {stdin: pipeUndefined});1911execaSync('unicorns', {stdin: pipeUndefined});1912execa('unicorns', {stdout: pipeUndefined});1913execaSync('unicorns', {stdout: pipeUndefined});1914execa('unicorns', {stderr: pipeUndefined});1915execaSync('unicorns', {stderr: pipeUndefined});1916execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeUndefined]});1917execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeUndefined]});1918expectAssignable<StdinOption>(pipeUndefined);1919expectAssignable<StdinOptionSync>(pipeUndefined);1920expectAssignable<StdoutStderrOption>(pipeUndefined);1921expectAssignable<StdoutStderrOptionSync>(pipeUndefined);1922expectAssignable<StdioOption>(pipeUndefined);1923expectAssignable<StdioOptionSync>(pipeUndefined);1924execa('unicorns', {stdin: 'pipe'});1925execaSync('unicorns', {stdin: 'pipe'});1926execa('unicorns', {stdin: ['pipe']});1927execaSync('unicorns', {stdin: ['pipe']});1928execa('unicorns', {stdout: 'pipe'});1929execaSync('unicorns', {stdout: 'pipe'});1930execa('unicorns', {stdout: ['pipe']});1931execaSync('unicorns', {stdout: ['pipe']});1932execa('unicorns', {stderr: 'pipe'});1933execaSync('unicorns', {stderr: 'pipe'});1934execa('unicorns', {stderr: ['pipe']});1935execaSync('unicorns', {stderr: ['pipe']});1936execa('unicorns', {stdio: 'pipe'});1937execaSync('unicorns', {stdio: 'pipe'});1938execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']});1939execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']});1940execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe']]});1941execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['pipe']]});1942expectAssignable<StdinOption>('pipe');1943expectAssignable<StdinOptionSync>('pipe');1944expectAssignable<StdinOption>(['pipe']);1945expectAssignable<StdinOptionSync>(['pipe']);1946expectAssignable<StdoutStderrOption>('pipe');1947expectAssignable<StdoutStderrOptionSync>('pipe');1948expectAssignable<StdoutStderrOption>(['pipe']);1949expectAssignable<StdoutStderrOptionSync>(['pipe']);1950expectAssignable<StdioOption>('pipe');1951expectAssignable<StdioOptionSync>('pipe');1952expectAssignable<StdioOption>(['pipe']);1953expectAssignable<StdioOptionSync>(['pipe']);1954execa('unicorns', {stdin: undefined});1955execaSync('unicorns', {stdin: undefined});1956execa('unicorns', {stdin: [undefined]});1957execaSync('unicorns', {stdin: [undefined]});1958execa('unicorns', {stdout: undefined});1959execaSync('unicorns', {stdout: undefined});1960execa('unicorns', {stdout: [undefined]});1961execaSync('unicorns', {stdout: [undefined]});1962execa('unicorns', {stderr: undefined});1963execaSync('unicorns', {stderr: undefined});1964execa('unicorns', {stderr: [undefined]});1965execaSync('unicorns', {stderr: [undefined]});1966execa('unicorns', {stdio: undefined});1967execaSync('unicorns', {stdio: undefined});1968execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', undefined]});1969execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', undefined]});1970execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [undefined]]});1971execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [undefined]]});1972expectAssignable<StdinOption>(undefined);1973expectAssignable<StdinOptionSync>(undefined);1974expectAssignable<StdinOption>([undefined]);1975expectAssignable<StdinOptionSync>([undefined]);1976expectAssignable<StdoutStderrOption>(undefined);1977expectAssignable<StdoutStderrOptionSync>(undefined);1978expectAssignable<StdoutStderrOption>([undefined]);1979expectAssignable<StdoutStderrOptionSync>([undefined]);1980expectAssignable<StdioOption>(undefined);1981expectAssignable<StdioOptionSync>(undefined);1982expectAssignable<StdioOption>([undefined]);1983expectAssignable<StdioOptionSync>([undefined]);1984expectError(execa('unicorns', {stdin: null}));1985expectError(execaSync('unicorns', {stdin: null}));1986expectError(execa('unicorns', {stdin: [null]}));1987expectError(execaSync('unicorns', {stdin: [null]}));1988expectError(execa('unicorns', {stdout: null}));1989expectError(execaSync('unicorns', {stdout: null}));1990expectError(execa('unicorns', {stdout: [null]}));1991expectError(execaSync('unicorns', {stdout: [null]}));1992expectError(execa('unicorns', {stderr: null}));1993expectError(execaSync('unicorns', {stderr: null}));1994expectError(execa('unicorns', {stderr: [null]}));1995expectError(execaSync('unicorns', {stderr: [null]}));1996expectError(execa('unicorns', {stdio: null}));1997expectError(execaSync('unicorns', {stdio: null}));1998expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', null]}));1999expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', null]}));2000expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [null]]}));2001expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [null]]}));2002expectNotAssignable<StdinOption>(null);2003expectNotAssignable<StdinOptionSync>(null);2004expectNotAssignable<StdinOption>([null]);2005expectNotAssignable<StdinOptionSync>([null]);2006expectNotAssignable<StdoutStderrOption>(null);2007expectNotAssignable<StdoutStderrOptionSync>(null);2008expectNotAssignable<StdoutStderrOption>([null]);2009expectNotAssignable<StdoutStderrOptionSync>([null]);2010expectNotAssignable<StdioOption>(null);2011expectNotAssignable<StdioOptionSync>(null);2012expectNotAssignable<StdioOption>([null]);2013expectNotAssignable<StdioOptionSync>([null]);2014execa('unicorns', {stdin: 'inherit'});2015execaSync('unicorns', {stdin: 'inherit'});2016execa('unicorns', {stdin: ['inherit']});2017execaSync('unicorns', {stdin: ['inherit']});2018execa('unicorns', {stdout: 'inherit'});2019execaSync('unicorns', {stdout: 'inherit'});2020execa('unicorns', {stdout: ['inherit']});2021execaSync('unicorns', {stdout: ['inherit']});2022execa('unicorns', {stderr: 'inherit'});2023execaSync('unicorns', {stderr: 'inherit'});2024execa('unicorns', {stderr: ['inherit']});2025execaSync('unicorns', {stderr: ['inherit']});2026execa('unicorns', {stdio: 'inherit'});2027execaSync('unicorns', {stdio: 'inherit'});2028execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'inherit']});2029execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'inherit']});2030expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['inherit']]}));2031execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['inherit']]});2032expectAssignable<StdinOption>('inherit');2033expectAssignable<StdinOptionSync>('inherit');2034expectAssignable<StdinOption>(['inherit']);2035expectAssignable<StdinOptionSync>(['inherit']);2036expectAssignable<StdoutStderrOption>('inherit');2037expectAssignable<StdoutStderrOptionSync>('inherit');2038expectAssignable<StdoutStderrOption>(['inherit']);2039expectAssignable<StdoutStderrOptionSync>(['inherit']);2040expectAssignable<StdioOption>('inherit');2041expectAssignable<StdioOptionSync>('inherit');2042expectAssignable<StdioOption>(['inherit']);2043expectAssignable<StdioOptionSync>(['inherit']);2044execa('unicorns', {stdin: 'ignore'});2045execaSync('unicorns', {stdin: 'ignore'});2046expectError(execa('unicorns', {stdin: ['ignore']}));2047expectError(execaSync('unicorns', {stdin: ['ignore']}));2048execa('unicorns', {stdout: 'ignore'});2049execaSync('unicorns', {stdout: 'ignore'});2050expectError(execa('unicorns', {stdout: ['ignore']}));2051expectError(execaSync('unicorns', {stdout: ['ignore']}));2052execa('unicorns', {stderr: 'ignore'});2053execaSync('unicorns', {stderr: 'ignore'});2054expectError(execa('unicorns', {stderr: ['ignore']}));2055expectError(execaSync('unicorns', {stderr: ['ignore']}));2056execa('unicorns', {stdio: 'ignore'});2057execaSync('unicorns', {stdio: 'ignore'});2058execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});2059execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});2060expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ignore']]}));2061expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ignore']]}));2062expectAssignable<StdinOption>('ignore');2063expectAssignable<StdinOptionSync>('ignore');2064expectNotAssignable<StdinOption>(['ignore']);2065expectNotAssignable<StdinOptionSync>(['ignore']);2066expectAssignable<StdoutStderrOption>('ignore');2067expectAssignable<StdoutStderrOptionSync>('ignore');2068expectNotAssignable<StdoutStderrOption>(['ignore']);2069expectNotAssignable<StdoutStderrOptionSync>(['ignore']);2070expectAssignable<StdioOption>('ignore');2071expectAssignable<StdioOptionSync>('ignore');2072expectNotAssignable<StdioOption>(['ignore']);2073expectNotAssignable<StdioOptionSync>(['ignore']);2074execa('unicorns', {stdin: 'overlapped'});2075expectError(execaSync('unicorns', {stdin: 'overlapped'}));2076execa('unicorns', {stdin: ['overlapped']});2077expectError(execaSync('unicorns', {stdin: ['overlapped']}));2078execa('unicorns', {stdout: 'overlapped'});2079expectError(execaSync('unicorns', {stdout: 'overlapped'}));2080execa('unicorns', {stdout: ['overlapped']});2081expectError(execaSync('unicorns', {stdout: ['overlapped']}));2082execa('unicorns', {stderr: 'overlapped'});2083expectError(execaSync('unicorns', {stderr: 'overlapped'}));2084execa('unicorns', {stderr: ['overlapped']});2085expectError(execaSync('unicorns', {stderr: ['overlapped']}));2086execa('unicorns', {stdio: 'overlapped'});2087expectError(execaSync('unicorns', {stdio: 'overlapped'}));2088execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'overlapped']});2089expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'overlapped']}));2090execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['overlapped']]});2091expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['overlapped']]}));2092expectAssignable<StdinOption>('overlapped');2093expectNotAssignable<StdinOptionSync>('overlapped');2094expectAssignable<StdinOption>(['overlapped']);2095expectNotAssignable<StdinOptionSync>(['overlapped']);2096expectAssignable<StdoutStderrOption>('overlapped');2097expectNotAssignable<StdoutStderrOptionSync>('overlapped');2098expectAssignable<StdoutStderrOption>(['overlapped']);2099expectNotAssignable<StdoutStderrOptionSync>(['overlapped']);2100expectAssignable<StdioOption>('overlapped');2101expectNotAssignable<StdioOptionSync>('overlapped');2102expectAssignable<StdioOption>(['overlapped']);2103expectNotAssignable<StdioOptionSync>(['overlapped']);2104execa('unicorns', {stdin: 'ipc'});2105expectError(execaSync('unicorns', {stdin: 'ipc'}));2106expectError(execa('unicorns', {stdin: ['ipc']}));2107expectError(execaSync('unicorns', {stdin: ['ipc']}));2108execa('unicorns', {stdout: 'ipc'});2109expectError(execaSync('unicorns', {stdout: 'ipc'}));2110expectError(execa('unicorns', {stdout: ['ipc']}));2111expectError(execaSync('unicorns', {stdout: ['ipc']}));2112execa('unicorns', {stderr: 'ipc'});2113expectError(execaSync('unicorns', {stderr: 'ipc'}));2114expectError(execa('unicorns', {stderr: ['ipc']}));2115expectError(execaSync('unicorns', {stderr: ['ipc']}));2116expectError(execa('unicorns', {stdio: 'ipc'}));2117expectError(execaSync('unicorns', {stdio: 'ipc'}));2118execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']});2119expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']}));2120expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ipc']]}));2121expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', ['ipc']]}));2122expectAssignable<StdinOption>('ipc');2123expectNotAssignable<StdinOptionSync>('ipc');2124expectNotAssignable<StdinOption>(['ipc']);2125expectNotAssignable<StdinOptionSync>(['ipc']);2126expectAssignable<StdoutStderrOption>('ipc');2127expectNotAssignable<StdoutStderrOptionSync>('ipc');2128expectNotAssignable<StdoutStderrOption>(['ipc']);2129expectNotAssignable<StdoutStderrOptionSync>(['ipc']);2130expectAssignable<StdioOption>('ipc');2131expectNotAssignable<StdioOptionSync>('ipc');2132expectNotAssignable<StdioOption>(['ipc']);2133expectNotAssignable<StdioOptionSync>(['ipc']);2134execa('unicorns', {stdin: 0});2135execaSync('unicorns', {stdin: 0});2136execa('unicorns', {stdin: [0]});2137execaSync('unicorns', {stdin: [0]});2138expectError(execa('unicorns', {stdin: [1]}));2139expectError(execa('unicorns', {stdin: [2]}));2140execa('unicorns', {stdin: 3});2141execaSync('unicorns', {stdin: 3});2142expectError(execa('unicorns', {stdin: [3]}));2143execaSync('unicorns', {stdin: [3]});2144expectError(execa('unicorns', {stdout: [0]}));2145execa('unicorns', {stdout: 1});2146execaSync('unicorns', {stdout: 1});2147execa('unicorns', {stdout: [1]});2148execaSync('unicorns', {stdout: [1]});2149execa('unicorns', {stdout: 2});2150execaSync('unicorns', {stdout: 2});2151execa('unicorns', {stdout: [2]});2152execaSync('unicorns', {stdout: [2]});2153execa('unicorns', {stdout: 3});2154execaSync('unicorns', {stdout: 3});2155expectError(execa('unicorns', {stdout: [3]}));2156execaSync('unicorns', {stdout: [3]});2157expectError(execa('unicorns', {stderr: [0]}));2158execa('unicorns', {stderr: 1});2159execaSync('unicorns', {stderr: 1});2160execa('unicorns', {stderr: [1]});2161execaSync('unicorns', {stderr: [1]});2162execa('unicorns', {stderr: 1});2163execaSync('unicorns', {stderr: 2});2164execa('unicorns', {stderr: [2]});2165execaSync('unicorns', {stderr: [2]});2166execa('unicorns', {stderr: 3});2167execaSync('unicorns', {stderr: 3});2168expectError(execa('unicorns', {stderr: [3]}));2169execaSync('unicorns', {stderr: [3]});2170expectError(execa('unicorns', {stdio: 0}));2171expectError(execaSync('unicorns', {stdio: 0}));2172expectError(execa('unicorns', {stdio: 1}));2173expectError(execaSync('unicorns', {stdio: 1}));2174expectError(execa('unicorns', {stdio: 2}));2175expectError(execaSync('unicorns', {stdio: 2}));2176expectError(execa('unicorns', {stdio: 3}));2177expectError(execaSync('unicorns', {stdio: 3}));2178execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 0]});2179execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 0]});2180execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [0]]});2181execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [0]]});2182execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 1]});2183execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 1]});2184execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [1]]});2185execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [1]]});2186execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 2]});2187execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 2]});2188execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [2]]});2189execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [2]]});2190execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 3]});2191execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 3]});2192expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [3]]}));2193execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [3]]});2194expectAssignable<StdinOption>(0);2195expectAssignable<StdinOptionSync>(0);2196expectAssignable<StdinOption>([0]);2197expectAssignable<StdinOptionSync>([0]);2198expectAssignable<StdoutStderrOption>(1);2199expectAssignable<StdoutStderrOptionSync>(1);2200expectAssignable<StdoutStderrOption>([1]);2201expectAssignable<StdoutStderrOptionSync>([1]);2202expectAssignable<StdoutStderrOption>(2);2203expectAssignable<StdoutStderrOptionSync>(2);2204expectAssignable<StdoutStderrOption>([2]);2205expectAssignable<StdoutStderrOptionSync>([2]);2206expectAssignable<StdioOption>(3);2207expectAssignable<StdioOptionSync>(3);2208expectNotAssignable<StdioOption>([3]);2209expectAssignable<StdioOptionSync>([3]);2210execa('unicorns', {stdin: process.stdin});2211execaSync('unicorns', {stdin: process.stdin});2212execa('unicorns', {stdin: [process.stdin]});2213expectError(execaSync('unicorns', {stdin: [process.stdin]}));2214execa('unicorns', {stdout: process.stdout});2215execaSync('unicorns', {stdout: process.stdout});2216execa('unicorns', {stdout: [process.stdout]});2217expectError(execaSync('unicorns', {stdout: [process.stdout]}));2218execa('unicorns', {stderr: process.stderr});2219execaSync('unicorns', {stderr: process.stderr});2220execa('unicorns', {stderr: [process.stderr]});2221expectError(execaSync('unicorns', {stderr: [process.stderr]}));2222expectError(execa('unicorns', {stdio: process.stderr}));2223expectError(execaSync('unicorns', {stdio: process.stderr}));2224expectAssignable<StdinOption>(process.stdin);2225expectAssignable<StdinOptionSync>(process.stdin);2226expectAssignable<StdinOption>([process.stdin]);2227expectNotAssignable<StdinOptionSync>([process.stdin]);2228expectAssignable<StdoutStderrOption>(process.stdout);2229expectAssignable<StdoutStderrOptionSync>(process.stdout);2230expectAssignable<StdoutStderrOption>([process.stdout]);2231expectNotAssignable<StdoutStderrOptionSync>([process.stdout]);2232expectAssignable<StdoutStderrOption>(process.stderr);2233expectAssignable<StdoutStderrOptionSync>(process.stderr);2234expectAssignable<StdoutStderrOption>([process.stderr]);2235expectNotAssignable<StdoutStderrOptionSync>([process.stderr]);2236execa('unicorns', {stdin: new Readable()});2237execaSync('unicorns', {stdin: new Readable()});2238execa('unicorns', {stdin: [new Readable()]});2239expectError(execaSync('unicorns', {stdin: [new Readable()]}));2240expectError(execa('unicorns', {stdout: new Readable()}));2241expectError(execaSync('unicorns', {stdout: new Readable()}));2242expectError(execa('unicorns', {stdout: [new Readable()]}));2243expectError(execaSync('unicorns', {stdout: [new Readable()]}));2244expectError(execa('unicorns', {stderr: new Readable()}));2245expectError(execaSync('unicorns', {stderr: new Readable()}));2246expectError(execa('unicorns', {stderr: [new Readable()]}));2247expectError(execaSync('unicorns', {stderr: [new Readable()]}));2248expectError(execa('unicorns', {stdio: new Readable()}));2249expectError(execaSync('unicorns', {stdio: new Readable()}));2250execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Readable()]});2251execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Readable()]});2252execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Readable()]]});2253expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Readable()]]}));2254expectAssignable<StdinOption>(new Readable());2255expectAssignable<StdinOptionSync>(new Readable());2256expectAssignable<StdinOption>([new Readable()]);2257expectNotAssignable<StdinOptionSync>([new Readable()]);2258expectNotAssignable<StdoutStderrOption>(new Readable());2259expectNotAssignable<StdoutStderrOptionSync>(new Readable());2260expectNotAssignable<StdoutStderrOption>([new Readable()]);2261expectNotAssignable<StdoutStderrOptionSync>([new Readable()]);2262expectAssignable<StdioOption>(new Readable());2263expectAssignable<StdioOptionSync>(new Readable());2264expectAssignable<StdioOption>([new Readable()]);2265expectNotAssignable<StdioOptionSync>([new Readable()]);2266expectError(execa('unicorns', {stdin: new Writable()}));2267expectError(execaSync('unicorns', {stdin: new Writable()}));2268expectError(execa('unicorns', {stdin: [new Writable()]}));2269expectError(execaSync('unicorns', {stdin: [new Writable()]}));2270execa('unicorns', {stdout: new Writable()});2271execaSync('unicorns', {stdout: new Writable()});2272execa('unicorns', {stdout: [new Writable()]});2273expectError(execaSync('unicorns', {stdout: [new Writable()]}));2274execa('unicorns', {stderr: new Writable()});2275execaSync('unicorns', {stderr: new Writable()});2276execa('unicorns', {stderr: [new Writable()]});2277expectError(execaSync('unicorns', {stderr: [new Writable()]}));2278expectError(execa('unicorns', {stdio: new Writable()}));2279expectError(execaSync('unicorns', {stdio: new Writable()}));2280execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Writable()]});2281execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Writable()]});2282execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Writable()]]});2283expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Writable()]]}));2284expectNotAssignable<StdinOption>(new Writable());2285expectNotAssignable<StdinOptionSync>(new Writable());2286expectNotAssignable<StdinOption>([new Writable()]);2287expectNotAssignable<StdinOptionSync>([new Writable()]);2288expectAssignable<StdoutStderrOption>(new Writable());2289expectAssignable<StdoutStderrOptionSync>(new Writable());2290expectAssignable<StdoutStderrOption>([new Writable()]);2291expectNotAssignable<StdoutStderrOptionSync>([new Writable()]);2292expectAssignable<StdioOption>(new Writable());2293expectAssignable<StdioOptionSync>(new Writable());2294expectAssignable<StdioOption>([new Writable()]);2295expectNotAssignable<StdioOptionSync>([new Writable()]);2296execa('unicorns', {stdin: new ReadableStream()});2297expectError(execaSync('unicorns', {stdin: new ReadableStream()}));2298execa('unicorns', {stdin: [new ReadableStream()]});2299expectError(execaSync('unicorns', {stdin: [new ReadableStream()]}));2300expectError(execa('unicorns', {stdout: new ReadableStream()}));2301expectError(execaSync('unicorns', {stdout: new ReadableStream()}));2302expectError(execa('unicorns', {stdout: [new ReadableStream()]}));2303expectError(execaSync('unicorns', {stdout: [new ReadableStream()]}));2304expectError(execa('unicorns', {stderr: new ReadableStream()}));2305expectError(execaSync('unicorns', {stderr: new ReadableStream()}));2306expectError(execa('unicorns', {stderr: [new ReadableStream()]}));2307expectError(execaSync('unicorns', {stderr: [new ReadableStream()]}));2308expectError(execa('unicorns', {stdio: new ReadableStream()}));2309expectError(execaSync('unicorns', {stdio: new ReadableStream()}));2310execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new ReadableStream()]});2311expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new ReadableStream()]}));2312execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new ReadableStream()]]});2313expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new ReadableStream()]]}));2314expectAssignable<StdinOption>(new ReadableStream());2315expectNotAssignable<StdinOptionSync>(new ReadableStream());2316expectAssignable<StdinOption>([new ReadableStream()]);2317expectNotAssignable<StdinOptionSync>([new ReadableStream()]);2318expectNotAssignable<StdoutStderrOption>(new ReadableStream());2319expectNotAssignable<StdoutStderrOptionSync>(new ReadableStream());2320expectNotAssignable<StdoutStderrOption>([new ReadableStream()]);2321expectNotAssignable<StdoutStderrOptionSync>([new ReadableStream()]);2322expectAssignable<StdioOption>(new ReadableStream());2323expectNotAssignable<StdioOptionSync>(new ReadableStream());2324expectAssignable<StdioOption>([new ReadableStream()]);2325expectNotAssignable<StdioOptionSync>([new ReadableStream()]);2326expectError(execa('unicorns', {stdin: new WritableStream()}));2327expectError(execaSync('unicorns', {stdin: new WritableStream()}));2328expectError(execa('unicorns', {stdin: [new WritableStream()]}));2329expectError(execaSync('unicorns', {stdin: [new WritableStream()]}));2330execa('unicorns', {stdout: new WritableStream()});2331expectError(execaSync('unicorns', {stdout: new WritableStream()}));2332execa('unicorns', {stdout: [new WritableStream()]});2333expectError(execaSync('unicorns', {stdout: [new WritableStream()]}));2334execa('unicorns', {stderr: new WritableStream()});2335expectError(execaSync('unicorns', {stderr: new WritableStream()}));2336execa('unicorns', {stderr: [new WritableStream()]});2337expectError(execaSync('unicorns', {stderr: [new WritableStream()]}));2338expectError(execa('unicorns', {stdio: new WritableStream()}));2339expectError(execaSync('unicorns', {stdio: new WritableStream()}));2340execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new WritableStream()]});2341expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new WritableStream()]}));2342execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new WritableStream()]]});2343expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new WritableStream()]]}));2344expectNotAssignable<StdinOption>(new WritableStream());2345expectNotAssignable<StdinOptionSync>(new WritableStream());2346expectNotAssignable<StdinOption>([new WritableStream()]);2347expectNotAssignable<StdinOptionSync>([new WritableStream()]);2348expectAssignable<StdoutStderrOption>(new WritableStream());2349expectNotAssignable<StdoutStderrOptionSync>(new WritableStream());2350expectAssignable<StdoutStderrOption>([new WritableStream()]);2351expectNotAssignable<StdoutStderrOptionSync>([new WritableStream()]);2352expectAssignable<StdioOption>(new WritableStream());2353expectNotAssignable<StdioOptionSync>(new WritableStream());2354expectAssignable<StdioOption>([new WritableStream()]);2355expectNotAssignable<StdioOptionSync>([new WritableStream()]);2356execa('unicorns', {stdin: new Uint8Array()});2357execaSync('unicorns', {stdin: new Uint8Array()});2358execa('unicorns', {stdin: [new Uint8Array()]});2359execaSync('unicorns', {stdin: [new Uint8Array()]});2360expectError(execa('unicorns', {stdout: new Uint8Array()}));2361expectError(execaSync('unicorns', {stdout: new Uint8Array()}));2362expectError(execa('unicorns', {stdout: [new Uint8Array()]}));2363expectError(execaSync('unicorns', {stdout: [new Uint8Array()]}));2364expectError(execa('unicorns', {stderr: new Uint8Array()}));2365expectError(execaSync('unicorns', {stderr: new Uint8Array()}));2366expectError(execa('unicorns', {stderr: [new Uint8Array()]}));2367expectError(execaSync('unicorns', {stderr: [new Uint8Array()]}));2368expectError(execa('unicorns', {stdio: new Uint8Array()}));2369expectError(execaSync('unicorns', {stdio: new Uint8Array()}));2370execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Uint8Array()]});2371expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Uint8Array()]}));2372execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Uint8Array()]]});2373expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Uint8Array()]]}));2374expectAssignable<StdinOption>(new Uint8Array());2375expectAssignable<StdinOptionSync>(new Uint8Array());2376expectAssignable<StdinOption>([new Uint8Array()]);2377expectAssignable<StdinOptionSync>([new Uint8Array()]);2378expectNotAssignable<StdoutStderrOption>(new Uint8Array());2379expectNotAssignable<StdoutStderrOptionSync>(new Uint8Array());2380expectNotAssignable<StdoutStderrOption>([new Uint8Array()]);2381expectNotAssignable<StdoutStderrOptionSync>([new Uint8Array()]);2382expectAssignable<StdioOption>(new Uint8Array());2383expectAssignable<StdioOptionSync>(new Uint8Array());2384expectAssignable<StdioOption>([new Uint8Array()]);2385expectAssignable<StdioOptionSync>([new Uint8Array()]);2386execa('unicorns', {stdin: fileUrl});2387execaSync('unicorns', {stdin: fileUrl});2388execa('unicorns', {stdin: [fileUrl]});2389execaSync('unicorns', {stdin: [fileUrl]});2390execa('unicorns', {stdout: fileUrl});2391execaSync('unicorns', {stdout: fileUrl});2392execa('unicorns', {stdout: [fileUrl]});2393execaSync('unicorns', {stdout: [fileUrl]});2394execa('unicorns', {stderr: fileUrl});2395execaSync('unicorns', {stderr: fileUrl});2396execa('unicorns', {stderr: [fileUrl]});2397execaSync('unicorns', {stderr: [fileUrl]});2398expectError(execa('unicorns', {stdio: fileUrl}));2399expectError(execaSync('unicorns', {stdio: fileUrl}));2400execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileUrl]});2401execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileUrl]});2402execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileUrl]]});2403execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileUrl]]});2404expectAssignable<StdinOption>(fileUrl);2405expectAssignable<StdinOptionSync>(fileUrl);2406expectAssignable<StdinOption>([fileUrl]);2407expectAssignable<StdinOptionSync>([fileUrl]);2408expectAssignable<StdoutStderrOption>(fileUrl);2409expectAssignable<StdoutStderrOptionSync>(fileUrl);2410expectAssignable<StdoutStderrOption>([fileUrl]);2411expectAssignable<StdoutStderrOptionSync>([fileUrl]);2412expectAssignable<StdioOption>(fileUrl);2413expectAssignable<StdioOptionSync>(fileUrl);2414expectAssignable<StdioOption>([fileUrl]);2415expectAssignable<StdioOptionSync>([fileUrl]);2416execa('unicorns', {stdin: fileObject});2417execaSync('unicorns', {stdin: fileObject});2418execa('unicorns', {stdin: [fileObject]});2419execaSync('unicorns', {stdin: [fileObject]});2420execa('unicorns', {stdout: fileObject});2421execaSync('unicorns', {stdout: fileObject});2422execa('unicorns', {stdout: [fileObject]});2423execaSync('unicorns', {stdout: [fileObject]});2424execa('unicorns', {stderr: fileObject});2425execaSync('unicorns', {stderr: fileObject});2426execa('unicorns', {stderr: [fileObject]});2427execaSync('unicorns', {stderr: [fileObject]});2428expectError(execa('unicorns', {stdio: fileObject}));2429expectError(execaSync('unicorns', {stdio: fileObject}));2430execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileObject]});2431execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileObject]});2432execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileObject]]});2433execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileObject]]});2434expectAssignable<StdinOption>(fileObject);2435expectAssignable<StdinOptionSync>(fileObject);2436expectAssignable<StdinOption>([fileObject]);2437expectAssignable<StdinOptionSync>([fileObject]);2438expectAssignable<StdoutStderrOption>(fileObject);2439expectAssignable<StdoutStderrOptionSync>(fileObject);2440expectAssignable<StdoutStderrOption>([fileObject]);2441expectAssignable<StdoutStderrOptionSync>([fileObject]);2442expectAssignable<StdioOption>(fileObject);2443expectAssignable<StdioOptionSync>(fileObject);2444expectAssignable<StdioOption>([fileObject]);2445expectAssignable<StdioOptionSync>([fileObject]);2446expectError(execa('unicorns', {stdin: invalidFileObject}));2447expectError(execaSync('unicorns', {stdin: invalidFileObject}));2448expectError(execa('unicorns', {stdin: [invalidFileObject]}));2449expectError(execaSync('unicorns', {stdin: [invalidFileObject]}));2450expectError(execa('unicorns', {stdout: invalidFileObject}));2451expectError(execaSync('unicorns', {stdout: invalidFileObject}));2452expectError(execa('unicorns', {stdout: [invalidFileObject]}));2453expectError(execaSync('unicorns', {stdout: [invalidFileObject]}));2454expectError(execa('unicorns', {stderr: invalidFileObject}));2455expectError(execaSync('unicorns', {stderr: invalidFileObject}));2456expectError(execa('unicorns', {stderr: [invalidFileObject]}));2457expectError(execaSync('unicorns', {stderr: [invalidFileObject]}));2458expectError(execa('unicorns', {stdio: invalidFileObject}));2459expectError(execaSync('unicorns', {stdio: invalidFileObject}));2460expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidFileObject]}));2461expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidFileObject]}));2462expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidFileObject]]}));2463expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidFileObject]]}));2464expectNotAssignable<StdinOption>(invalidFileObject);2465expectNotAssignable<StdinOptionSync>(invalidFileObject);2466expectNotAssignable<StdinOption>([invalidFileObject]);2467expectNotAssignable<StdinOptionSync>([invalidFileObject]);2468expectNotAssignable<StdoutStderrOption>(invalidFileObject);2469expectNotAssignable<StdoutStderrOptionSync>(invalidFileObject);2470expectNotAssignable<StdoutStderrOption>([invalidFileObject]);2471expectNotAssignable<StdoutStderrOptionSync>([invalidFileObject]);2472expectNotAssignable<StdioOption>(invalidFileObject);2473expectNotAssignable<StdioOptionSync>(invalidFileObject);2474expectNotAssignable<StdioOption>([invalidFileObject]);2475expectNotAssignable<StdioOptionSync>([invalidFileObject]);2476execa('unicorns', {stdin: [stringArray]});2477execaSync('unicorns', {stdin: [stringArray]});2478expectError(execa('unicorns', {stdout: [stringArray]}));2479expectError(execaSync('unicorns', {stdout: [stringArray]}));2480expectError(execa('unicorns', {stderr: [stringArray]}));2481expectError(execaSync('unicorns', {stderr: [stringArray]}));2482execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringArray]]});2483expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringArray]]}));2484execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[stringArray]]]});2485expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[stringArray]]]}));2486expectAssignable<StdinOption>([stringArray]);2487expectAssignable<StdinOptionSync>([stringArray]);2488expectNotAssignable<StdoutStderrOption>([stringArray]);2489expectNotAssignable<StdoutStderrOptionSync>([stringArray]);2490expectAssignable<StdioOption>([stringArray]);2491expectAssignable<StdioOptionSync>([stringArray]);2492execa('unicorns', {stdin: [binaryArray]});2493execaSync('unicorns', {stdin: [binaryArray]});2494expectError(execa('unicorns', {stdout: [binaryArray]}));2495expectError(execaSync('unicorns', {stdout: [binaryArray]}));2496expectError(execa('unicorns', {stderr: [binaryArray]}));2497expectError(execaSync('unicorns', {stderr: [binaryArray]}));2498execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryArray]]});2499expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryArray]]}));2500execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[binaryArray]]]});2501expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[binaryArray]]]}));2502expectAssignable<StdinOption>([binaryArray]);2503expectAssignable<StdinOptionSync>([binaryArray]);2504expectNotAssignable<StdoutStderrOption>([binaryArray]);2505expectNotAssignable<StdoutStderrOptionSync>([binaryArray]);2506expectAssignable<StdioOption>([binaryArray]);2507expectAssignable<StdioOptionSync>([binaryArray]);2508execa('unicorns', {stdin: [objectArray]});2509execaSync('unicorns', {stdin: [objectArray]});2510expectError(execa('unicorns', {stdout: [objectArray]}));2511expectError(execaSync('unicorns', {stdout: [objectArray]}));2512expectError(execa('unicorns', {stderr: [objectArray]}));2513expectError(execaSync('unicorns', {stderr: [objectArray]}));2514execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectArray]]});2515expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectArray]]}));2516execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[objectArray]]]});2517expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[objectArray]]]}));2518expectAssignable<StdinOption>([objectArray]);2519expectAssignable<StdinOptionSync>([objectArray]);2520expectNotAssignable<StdoutStderrOption>([objectArray]);2521expectNotAssignable<StdoutStderrOptionSync>([objectArray]);2522expectAssignable<StdioOption>([objectArray]);2523expectAssignable<StdioOptionSync>([objectArray]);2524execa('unicorns', {stdin: stringIterable});2525execaSync('unicorns', {stdin: stringIterable});2526execa('unicorns', {stdin: [stringIterable]});2527execaSync('unicorns', {stdin: [stringIterable]});2528expectError(execa('unicorns', {stdout: stringIterable}));2529expectError(execaSync('unicorns', {stdout: stringIterable}));2530expectError(execa('unicorns', {stdout: [stringIterable]}));2531expectError(execaSync('unicorns', {stdout: [stringIterable]}));2532expectError(execa('unicorns', {stderr: stringIterable}));2533expectError(execaSync('unicorns', {stderr: stringIterable}));2534expectError(execa('unicorns', {stderr: [stringIterable]}));2535expectError(execaSync('unicorns', {stderr: [stringIterable]}));2536expectError(execa('unicorns', {stdio: stringIterable}));2537expectError(execaSync('unicorns', {stdio: stringIterable}));2538execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringIterable]});2539expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringIterable]}));2540execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringIterable]]});2541expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringIterable]]}));2542expectAssignable<StdinOption>(stringIterable);2543expectAssignable<StdinOptionSync>(stringIterable);2544expectAssignable<StdinOption>([stringIterable]);2545expectAssignable<StdinOptionSync>([stringIterable]);2546expectNotAssignable<StdoutStderrOption>(stringIterable);2547expectNotAssignable<StdoutStderrOptionSync>(stringIterable);2548expectNotAssignable<StdoutStderrOption>([stringIterable]);2549expectNotAssignable<StdoutStderrOptionSync>([stringIterable]);2550expectAssignable<StdioOption>(stringIterable);2551expectAssignable<StdioOptionSync>(stringIterable);2552expectAssignable<StdioOption>([stringIterable]);2553expectAssignable<StdioOptionSync>([stringIterable]);2554execa('unicorns', {stdin: binaryIterable});2555execaSync('unicorns', {stdin: binaryIterable});2556execa('unicorns', {stdin: [binaryIterable]});2557execaSync('unicorns', {stdin: [binaryIterable]});2558expectError(execa('unicorns', {stdout: binaryIterable}));2559expectError(execaSync('unicorns', {stdout: binaryIterable}));2560expectError(execa('unicorns', {stdout: [binaryIterable]}));2561expectError(execaSync('unicorns', {stdout: [binaryIterable]}));2562expectError(execa('unicorns', {stderr: binaryIterable}));2563expectError(execaSync('unicorns', {stderr: binaryIterable}));2564expectError(execa('unicorns', {stderr: [binaryIterable]}));2565expectError(execaSync('unicorns', {stderr: [binaryIterable]}));2566expectError(execa('unicorns', {stdio: binaryIterable}));2567expectError(execaSync('unicorns', {stdio: binaryIterable}));2568execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryIterable]});2569expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryIterable]}));2570execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryIterable]]});2571expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryIterable]]}));2572expectAssignable<StdinOption>(binaryIterable);2573expectAssignable<StdinOptionSync>(binaryIterable);2574expectAssignable<StdinOption>([binaryIterable]);2575expectAssignable<StdinOptionSync>([binaryIterable]);2576expectNotAssignable<StdoutStderrOption>(binaryIterable);2577expectNotAssignable<StdoutStderrOptionSync>(binaryIterable);2578expectNotAssignable<StdoutStderrOption>([binaryIterable]);2579expectNotAssignable<StdoutStderrOptionSync>([binaryIterable]);2580expectAssignable<StdioOption>(binaryIterable);2581expectAssignable<StdioOptionSync>(binaryIterable);2582expectAssignable<StdioOption>([binaryIterable]);2583expectAssignable<StdioOptionSync>([binaryIterable]);2584execa('unicorns', {stdin: objectIterable});2585execaSync('unicorns', {stdin: objectIterable});2586execa('unicorns', {stdin: [objectIterable]});2587execaSync('unicorns', {stdin: [objectIterable]});2588expectError(execa('unicorns', {stdout: objectIterable}));2589expectError(execaSync('unicorns', {stdout: objectIterable}));2590expectError(execa('unicorns', {stdout: [objectIterable]}));2591expectError(execaSync('unicorns', {stdout: [objectIterable]}));2592expectError(execa('unicorns', {stderr: objectIterable}));2593expectError(execaSync('unicorns', {stderr: objectIterable}));2594expectError(execa('unicorns', {stderr: [objectIterable]}));2595expectError(execaSync('unicorns', {stderr: [objectIterable]}));2596expectError(execa('unicorns', {stdio: objectIterable}));2597expectError(execaSync('unicorns', {stdio: objectIterable}));2598execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectIterable]});2599expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectIterable]}));2600execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectIterable]]});2601expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectIterable]]}));2602expectAssignable<StdinOption>(objectIterable);2603expectAssignable<StdinOptionSync>(objectIterable);2604expectAssignable<StdinOption>([objectIterable]);2605expectAssignable<StdinOptionSync>([objectIterable]);2606expectNotAssignable<StdoutStderrOption>(objectIterable);2607expectNotAssignable<StdoutStderrOptionSync>(objectIterable);2608expectNotAssignable<StdoutStderrOption>([objectIterable]);2609expectNotAssignable<StdoutStderrOptionSync>([objectIterable]);2610expectAssignable<StdioOption>(objectIterable);2611expectAssignable<StdioOptionSync>(objectIterable);2612expectAssignable<StdioOption>([objectIterable]);2613expectAssignable<StdioOptionSync>([objectIterable]);2614execa('unicorns', {stdin: asyncStringIterable});2615expectError(execaSync('unicorns', {stdin: asyncStringIterable}));2616execa('unicorns', {stdin: [asyncStringIterable]});2617expectError(execaSync('unicorns', {stdin: [asyncStringIterable]}));2618expectError(execa('unicorns', {stdout: asyncStringIterable}));2619expectError(execaSync('unicorns', {stdout: asyncStringIterable}));2620expectError(execa('unicorns', {stdout: [asyncStringIterable]}));2621expectError(execaSync('unicorns', {stdout: [asyncStringIterable]}));2622expectError(execa('unicorns', {stderr: asyncStringIterable}));2623expectError(execaSync('unicorns', {stderr: asyncStringIterable}));2624expectError(execa('unicorns', {stderr: [asyncStringIterable]}));2625expectError(execaSync('unicorns', {stderr: [asyncStringIterable]}));2626expectError(execa('unicorns', {stdio: asyncStringIterable}));2627expectError(execaSync('unicorns', {stdio: asyncStringIterable}));2628execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncStringIterable]});2629expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncStringIterable]}));2630execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncStringIterable]]});2631expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncStringIterable]]}));2632expectAssignable<StdinOption>(asyncStringIterable);2633expectNotAssignable<StdinOptionSync>(asyncStringIterable);2634expectAssignable<StdinOption>([asyncStringIterable]);2635expectNotAssignable<StdinOptionSync>([asyncStringIterable]);2636expectNotAssignable<StdoutStderrOption>(asyncStringIterable);2637expectNotAssignable<StdoutStderrOptionSync>(asyncStringIterable);2638expectNotAssignable<StdoutStderrOption>([asyncStringIterable]);2639expectNotAssignable<StdoutStderrOptionSync>([asyncStringIterable]);2640expectAssignable<StdioOption>(asyncStringIterable);2641expectNotAssignable<StdioOptionSync>(asyncStringIterable);2642expectAssignable<StdioOption>([asyncStringIterable]);2643expectNotAssignable<StdioOptionSync>([asyncStringIterable]);2644execa('unicorns', {stdin: asyncBinaryIterable});2645expectError(execaSync('unicorns', {stdin: asyncBinaryIterable}));2646execa('unicorns', {stdin: [asyncBinaryIterable]});2647expectError(execaSync('unicorns', {stdin: [asyncBinaryIterable]}));2648expectError(execa('unicorns', {stdout: asyncBinaryIterable}));2649expectError(execaSync('unicorns', {stdout: asyncBinaryIterable}));2650expectError(execa('unicorns', {stdout: [asyncBinaryIterable]}));2651expectError(execaSync('unicorns', {stdout: [asyncBinaryIterable]}));2652expectError(execa('unicorns', {stderr: asyncBinaryIterable}));2653expectError(execaSync('unicorns', {stderr: asyncBinaryIterable}));2654expectError(execa('unicorns', {stderr: [asyncBinaryIterable]}));2655expectError(execaSync('unicorns', {stderr: [asyncBinaryIterable]}));2656expectError(execa('unicorns', {stdio: asyncBinaryIterable}));2657expectError(execaSync('unicorns', {stdio: asyncBinaryIterable}));2658execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncBinaryIterable]});2659expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncBinaryIterable]}));2660execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncBinaryIterable]]});2661expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncBinaryIterable]]}));2662expectAssignable<StdinOption>(asyncBinaryIterable);2663expectNotAssignable<StdinOptionSync>(asyncBinaryIterable);2664expectAssignable<StdinOption>([asyncBinaryIterable]);2665expectNotAssignable<StdinOptionSync>([asyncBinaryIterable]);2666expectNotAssignable<StdoutStderrOption>(asyncBinaryIterable);2667expectNotAssignable<StdoutStderrOptionSync>(asyncBinaryIterable);2668expectNotAssignable<StdoutStderrOption>([asyncBinaryIterable]);2669expectNotAssignable<StdoutStderrOptionSync>([asyncBinaryIterable]);2670expectAssignable<StdioOption>(asyncBinaryIterable);2671expectNotAssignable<StdioOptionSync>(asyncBinaryIterable);2672expectAssignable<StdioOption>([asyncBinaryIterable]);2673expectNotAssignable<StdioOptionSync>([asyncBinaryIterable]);2674execa('unicorns', {stdin: asyncObjectIterable});2675expectError(execaSync('unicorns', {stdin: asyncObjectIterable}));2676execa('unicorns', {stdin: [asyncObjectIterable]});2677expectError(execaSync('unicorns', {stdin: [asyncObjectIterable]}));2678expectError(execa('unicorns', {stdout: asyncObjectIterable}));2679expectError(execaSync('unicorns', {stdout: asyncObjectIterable}));2680expectError(execa('unicorns', {stdout: [asyncObjectIterable]}));2681expectError(execaSync('unicorns', {stdout: [asyncObjectIterable]}));2682expectError(execa('unicorns', {stderr: asyncObjectIterable}));2683expectError(execaSync('unicorns', {stderr: asyncObjectIterable}));2684expectError(execa('unicorns', {stderr: [asyncObjectIterable]}));2685expectError(execaSync('unicorns', {stderr: [asyncObjectIterable]}));2686expectError(execa('unicorns', {stdio: asyncObjectIterable}));2687expectError(execaSync('unicorns', {stdio: asyncObjectIterable}));2688execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncObjectIterable]});2689expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncObjectIterable]}));2690execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncObjectIterable]]});2691expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncObjectIterable]]}));2692expectAssignable<StdinOption>(asyncObjectIterable);2693expectNotAssignable<StdinOptionSync>(asyncObjectIterable);2694expectAssignable<StdinOption>([asyncObjectIterable]);2695expectNotAssignable<StdinOptionSync>([asyncObjectIterable]);2696expectNotAssignable<StdoutStderrOption>(asyncObjectIterable);2697expectNotAssignable<StdoutStderrOptionSync>(asyncObjectIterable);2698expectNotAssignable<StdoutStderrOption>([asyncObjectIterable]);2699expectNotAssignable<StdoutStderrOptionSync>([asyncObjectIterable]);2700expectAssignable<StdioOption>(asyncObjectIterable);2701expectNotAssignable<StdioOptionSync>(asyncObjectIterable);2702expectAssignable<StdioOption>([asyncObjectIterable]);2703expectNotAssignable<StdioOptionSync>([asyncObjectIterable]);2704execa('unicorns', {stdin: duplex});2705expectError(execaSync('unicorns', {stdin: duplex}));2706execa('unicorns', {stdin: [duplex]});2707expectError(execaSync('unicorns', {stdin: [duplex]}));2708execa('unicorns', {stdout: duplex});2709expectError(execaSync('unicorns', {stdout: duplex}));2710execa('unicorns', {stdout: [duplex]});2711expectError(execaSync('unicorns', {stdout: [duplex]}));2712execa('unicorns', {stderr: duplex});2713expectError(execaSync('unicorns', {stderr: duplex}));2714execa('unicorns', {stderr: [duplex]});2715expectError(execaSync('unicorns', {stderr: [duplex]}));2716expectError(execa('unicorns', {stdio: duplex}));2717expectError(execaSync('unicorns', {stdio: duplex}));2718execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplex]});2719expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplex]}));2720execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplex]]});2721expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplex]]}));2722expectAssignable<StdinOption>(duplex);2723expectNotAssignable<StdinOptionSync>(duplex);2724expectAssignable<StdinOption>([duplex]);2725expectNotAssignable<StdinOptionSync>([duplex]);2726expectAssignable<StdoutStderrOption>(duplex);2727expectNotAssignable<StdoutStderrOptionSync>(duplex);2728expectAssignable<StdoutStderrOption>([duplex]);2729expectNotAssignable<StdoutStderrOptionSync>([duplex]);2730expectAssignable<StdioOption>(duplex);2731expectNotAssignable<StdioOptionSync>(duplex);2732expectAssignable<StdioOption>([duplex]);2733expectNotAssignable<StdioOptionSync>([duplex]);2734execa('unicorns', {stdin: duplexTransform});2735expectError(execaSync('unicorns', {stdin: duplexTransform}));2736execa('unicorns', {stdin: [duplexTransform]});2737expectError(execaSync('unicorns', {stdin: [duplexTransform]}));2738execa('unicorns', {stdout: duplexTransform});2739expectError(execaSync('unicorns', {stdout: duplexTransform}));2740execa('unicorns', {stdout: [duplexTransform]});2741expectError(execaSync('unicorns', {stdout: [duplexTransform]}));2742execa('unicorns', {stderr: duplexTransform});2743expectError(execaSync('unicorns', {stderr: duplexTransform}));2744execa('unicorns', {stderr: [duplexTransform]});2745expectError(execaSync('unicorns', {stderr: [duplexTransform]}));2746expectError(execa('unicorns', {stdio: duplexTransform}));2747expectError(execaSync('unicorns', {stdio: duplexTransform}));2748execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexTransform]});2749expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexTransform]}));2750execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexTransform]]});2751expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexTransform]]}));2752expectAssignable<StdinOption>(duplexTransform);2753expectNotAssignable<StdinOptionSync>(duplexTransform);2754expectAssignable<StdinOption>([duplexTransform]);2755expectNotAssignable<StdinOptionSync>([duplexTransform]);2756expectAssignable<StdoutStderrOption>(duplexTransform);2757expectNotAssignable<StdoutStderrOptionSync>(duplexTransform);2758expectAssignable<StdoutStderrOption>([duplexTransform]);2759expectNotAssignable<StdoutStderrOptionSync>([duplexTransform]);2760expectAssignable<StdioOption>(duplexTransform);2761expectNotAssignable<StdioOptionSync>(duplexTransform);2762expectAssignable<StdioOption>([duplexTransform]);2763expectNotAssignable<StdioOptionSync>([duplexTransform]);2764execa('unicorns', {stdin: duplexObjectProperty});2765expectError(execaSync('unicorns', {stdin: duplexObjectProperty}));2766execa('unicorns', {stdin: [duplexObjectProperty]});2767expectError(execaSync('unicorns', {stdin: [duplexObjectProperty]}));2768execa('unicorns', {stdout: duplexObjectProperty});2769expectError(execaSync('unicorns', {stdout: duplexObjectProperty}));2770execa('unicorns', {stdout: [duplexObjectProperty]});2771expectError(execaSync('unicorns', {stdout: [duplexObjectProperty]}));2772execa('unicorns', {stderr: duplexObjectProperty});2773expectError(execaSync('unicorns', {stderr: duplexObjectProperty}));2774execa('unicorns', {stderr: [duplexObjectProperty]});2775expectError(execaSync('unicorns', {stderr: [duplexObjectProperty]}));2776expectError(execa('unicorns', {stdio: duplexObjectProperty}));2777expectError(execaSync('unicorns', {stdio: duplexObjectProperty}));2778execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexObjectProperty]});2779expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexObjectProperty]}));2780execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexObjectProperty]]});2781expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexObjectProperty]]}));2782expectAssignable<StdinOption>(duplexObjectProperty);2783expectNotAssignable<StdinOptionSync>(duplexObjectProperty);2784expectAssignable<StdinOption>([duplexObjectProperty]);2785expectNotAssignable<StdinOptionSync>([duplexObjectProperty]);2786expectAssignable<StdoutStderrOption>(duplexObjectProperty);2787expectNotAssignable<StdoutStderrOptionSync>(duplexObjectProperty);2788expectAssignable<StdoutStderrOption>([duplexObjectProperty]);2789expectNotAssignable<StdoutStderrOptionSync>([duplexObjectProperty]);2790expectAssignable<StdioOption>(duplexObjectProperty);2791expectNotAssignable<StdioOptionSync>(duplexObjectProperty);2792expectAssignable<StdioOption>([duplexObjectProperty]);2793expectNotAssignable<StdioOptionSync>([duplexObjectProperty]);2794expectError(execa('unicorns', {stdin: duplexWithInvalidObjectMode}));2795expectError(execaSync('unicorns', {stdin: duplexWithInvalidObjectMode}));2796expectError(execa('unicorns', {stdin: [duplexWithInvalidObjectMode]}));2797expectError(execaSync('unicorns', {stdin: [duplexWithInvalidObjectMode]}));2798expectError(execa('unicorns', {stdout: duplexWithInvalidObjectMode}));2799expectError(execaSync('unicorns', {stdout: duplexWithInvalidObjectMode}));2800expectError(execa('unicorns', {stdout: [duplexWithInvalidObjectMode]}));2801expectError(execaSync('unicorns', {stdout: [duplexWithInvalidObjectMode]}));2802expectError(execa('unicorns', {stderr: duplexWithInvalidObjectMode}));2803expectError(execaSync('unicorns', {stderr: duplexWithInvalidObjectMode}));2804expectError(execa('unicorns', {stderr: [duplexWithInvalidObjectMode]}));2805expectError(execaSync('unicorns', {stderr: [duplexWithInvalidObjectMode]}));2806expectError(execa('unicorns', {stdio: duplexWithInvalidObjectMode}));2807expectError(execaSync('unicorns', {stdio: duplexWithInvalidObjectMode}));2808expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexWithInvalidObjectMode]}));2809expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexWithInvalidObjectMode]}));2810expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexWithInvalidObjectMode]]}));2811expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexWithInvalidObjectMode]]}));2812expectNotAssignable<StdinOption>(duplexWithInvalidObjectMode);2813expectNotAssignable<StdinOptionSync>(duplexWithInvalidObjectMode);2814expectNotAssignable<StdinOption>([duplexWithInvalidObjectMode]);2815expectNotAssignable<StdinOptionSync>([duplexWithInvalidObjectMode]);2816expectNotAssignable<StdoutStderrOption>(duplexWithInvalidObjectMode);2817expectNotAssignable<StdoutStderrOptionSync>(duplexWithInvalidObjectMode);2818expectNotAssignable<StdoutStderrOption>([duplexWithInvalidObjectMode]);2819expectNotAssignable<StdoutStderrOptionSync>([duplexWithInvalidObjectMode]);2820expectNotAssignable<StdioOption>(duplexWithInvalidObjectMode);2821expectNotAssignable<StdioOptionSync>(duplexWithInvalidObjectMode);2822expectNotAssignable<StdioOption>([duplexWithInvalidObjectMode]);2823expectNotAssignable<StdioOptionSync>([duplexWithInvalidObjectMode]);2824execa('unicorns', {stdin: webTransformInstance});2825expectError(execaSync('unicorns', {stdin: webTransformInstance}));2826execa('unicorns', {stdin: [webTransformInstance]});2827expectError(execaSync('unicorns', {stdin: [webTransformInstance]}));2828execa('unicorns', {stdout: webTransformInstance});2829expectError(execaSync('unicorns', {stdout: webTransformInstance}));2830execa('unicorns', {stdout: [webTransformInstance]});2831expectError(execaSync('unicorns', {stdout: [webTransformInstance]}));2832execa('unicorns', {stderr: webTransformInstance});2833expectError(execaSync('unicorns', {stderr: webTransformInstance}));2834execa('unicorns', {stderr: [webTransformInstance]});2835expectError(execaSync('unicorns', {stderr: [webTransformInstance]}));2836expectError(execa('unicorns', {stdio: webTransformInstance}));2837expectError(execaSync('unicorns', {stdio: webTransformInstance}));2838execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformInstance]});2839expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformInstance]}));2840execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformInstance]]});2841expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformInstance]]}));2842expectAssignable<StdinOption>(webTransformInstance);2843expectNotAssignable<StdinOptionSync>(webTransformInstance);2844expectAssignable<StdinOption>([webTransformInstance]);2845expectNotAssignable<StdinOptionSync>([webTransformInstance]);2846expectAssignable<StdoutStderrOption>(webTransformInstance);2847expectNotAssignable<StdoutStderrOptionSync>(webTransformInstance);2848expectAssignable<StdoutStderrOption>([webTransformInstance]);2849expectNotAssignable<StdoutStderrOptionSync>([webTransformInstance]);2850expectAssignable<StdioOption>(webTransformInstance);2851expectNotAssignable<StdioOptionSync>(webTransformInstance);2852expectAssignable<StdioOption>([webTransformInstance]);2853expectNotAssignable<StdioOptionSync>([webTransformInstance]);2854execa('unicorns', {stdin: webTransform});2855expectError(execaSync('unicorns', {stdin: webTransform}));2856execa('unicorns', {stdin: [webTransform]});2857expectError(execaSync('unicorns', {stdin: [webTransform]}));2858execa('unicorns', {stdout: webTransform});2859expectError(execaSync('unicorns', {stdout: webTransform}));2860execa('unicorns', {stdout: [webTransform]});2861expectError(execaSync('unicorns', {stdout: [webTransform]}));2862execa('unicorns', {stderr: webTransform});2863expectError(execaSync('unicorns', {stderr: webTransform}));2864execa('unicorns', {stderr: [webTransform]});2865expectError(execaSync('unicorns', {stderr: [webTransform]}));2866expectError(execa('unicorns', {stdio: webTransform}));2867expectError(execaSync('unicorns', {stdio: webTransform}));2868execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransform]});2869expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransform]}));2870execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransform]]});2871expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransform]]}));2872expectAssignable<StdinOption>(webTransform);2873expectNotAssignable<StdinOptionSync>(webTransform);2874expectAssignable<StdinOption>([webTransform]);2875expectNotAssignable<StdinOptionSync>([webTransform]);2876expectAssignable<StdoutStderrOption>(webTransform);2877expectNotAssignable<StdoutStderrOptionSync>(webTransform);2878expectAssignable<StdoutStderrOption>([webTransform]);2879expectNotAssignable<StdoutStderrOptionSync>([webTransform]);2880expectAssignable<StdioOption>(webTransform);2881expectNotAssignable<StdioOptionSync>(webTransform);2882expectAssignable<StdioOption>([webTransform]);2883expectNotAssignable<StdioOptionSync>([webTransform]);2884execa('unicorns', {stdin: webTransformObject});2885expectError(execaSync('unicorns', {stdin: webTransformObject}));2886execa('unicorns', {stdin: [webTransformObject]});2887expectError(execaSync('unicorns', {stdin: [webTransformObject]}));2888execa('unicorns', {stdout: webTransformObject});2889expectError(execaSync('unicorns', {stdout: webTransformObject}));2890execa('unicorns', {stdout: [webTransformObject]});2891expectError(execaSync('unicorns', {stdout: [webTransformObject]}));2892execa('unicorns', {stderr: webTransformObject});2893expectError(execaSync('unicorns', {stderr: webTransformObject}));2894execa('unicorns', {stderr: [webTransformObject]});2895expectError(execaSync('unicorns', {stderr: [webTransformObject]}));2896expectError(execa('unicorns', {stdio: webTransformObject}));2897expectError(execaSync('unicorns', {stdio: webTransformObject}));2898execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformObject]});2899expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformObject]}));2900execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformObject]]});2901expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformObject]]}));2902expectAssignable<StdinOption>(webTransformObject);2903expectNotAssignable<StdinOptionSync>(webTransformObject);2904expectAssignable<StdinOption>([webTransformObject]);2905expectNotAssignable<StdinOptionSync>([webTransformObject]);2906expectAssignable<StdoutStderrOption>(webTransformObject);2907expectNotAssignable<StdoutStderrOptionSync>(webTransformObject);2908expectAssignable<StdoutStderrOption>([webTransformObject]);2909expectNotAssignable<StdoutStderrOptionSync>([webTransformObject]);2910expectAssignable<StdioOption>(webTransformObject);2911expectNotAssignable<StdioOptionSync>(webTransformObject);2912expectAssignable<StdioOption>([webTransformObject]);2913expectNotAssignable<StdioOptionSync>([webTransformObject]);2914expectError(execa('unicorns', {stdin: webTransformWithInvalidObjectMode}));2915expectError(execaSync('unicorns', {stdin: webTransformWithInvalidObjectMode}));2916expectError(execa('unicorns', {stdin: [webTransformWithInvalidObjectMode]}));2917expectError(execaSync('unicorns', {stdin: [webTransformWithInvalidObjectMode]}));2918expectError(execa('unicorns', {stdout: webTransformWithInvalidObjectMode}));2919expectError(execaSync('unicorns', {stdout: webTransformWithInvalidObjectMode}));2920expectError(execa('unicorns', {stdout: [webTransformWithInvalidObjectMode]}));2921expectError(execaSync('unicorns', {stdout: [webTransformWithInvalidObjectMode]}));2922expectError(execa('unicorns', {stderr: webTransformWithInvalidObjectMode}));2923expectError(execaSync('unicorns', {stderr: webTransformWithInvalidObjectMode}));2924expectError(execa('unicorns', {stderr: [webTransformWithInvalidObjectMode]}));2925expectError(execaSync('unicorns', {stderr: [webTransformWithInvalidObjectMode]}));2926expectError(execa('unicorns', {stdio: webTransformWithInvalidObjectMode}));2927expectError(execaSync('unicorns', {stdio: webTransformWithInvalidObjectMode}));2928expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformWithInvalidObjectMode]}));2929expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformWithInvalidObjectMode]}));2930expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformWithInvalidObjectMode]]}));2931expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformWithInvalidObjectMode]]}));2932expectNotAssignable<StdinOption>(webTransformWithInvalidObjectMode);2933expectNotAssignable<StdinOptionSync>(webTransformWithInvalidObjectMode);2934expectNotAssignable<StdinOption>([webTransformWithInvalidObjectMode]);2935expectNotAssignable<StdinOptionSync>([webTransformWithInvalidObjectMode]);2936expectNotAssignable<StdoutStderrOption>(webTransformWithInvalidObjectMode);2937expectNotAssignable<StdoutStderrOptionSync>(webTransformWithInvalidObjectMode);2938expectNotAssignable<StdoutStderrOption>([webTransformWithInvalidObjectMode]);2939expectNotAssignable<StdoutStderrOptionSync>([webTransformWithInvalidObjectMode]);2940expectNotAssignable<StdioOption>(webTransformWithInvalidObjectMode);2941expectNotAssignable<StdioOptionSync>(webTransformWithInvalidObjectMode);2942expectNotAssignable<StdioOption>([webTransformWithInvalidObjectMode]);2943expectNotAssignable<StdioOptionSync>([webTransformWithInvalidObjectMode]);2944execa('unicorns', {stdin: unknownGenerator});2945execaSync('unicorns', {stdin: unknownGenerator});2946execa('unicorns', {stdin: [unknownGenerator]});2947execaSync('unicorns', {stdin: [unknownGenerator]});2948execa('unicorns', {stdout: unknownGenerator});2949execaSync('unicorns', {stdout: unknownGenerator});2950execa('unicorns', {stdout: [unknownGenerator]});2951execaSync('unicorns', {stdout: [unknownGenerator]});2952execa('unicorns', {stderr: unknownGenerator});2953execaSync('unicorns', {stderr: unknownGenerator});2954execa('unicorns', {stderr: [unknownGenerator]});2955execaSync('unicorns', {stderr: [unknownGenerator]});2956expectError(execa('unicorns', {stdio: unknownGenerator}));2957expectError(execaSync('unicorns', {stdio: unknownGenerator}));2958execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGenerator]});2959execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGenerator]});2960execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGenerator]]});2961execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGenerator]]});2962expectAssignable<StdinOption>(unknownGenerator);2963expectAssignable<StdinOptionSync>(unknownGenerator);2964expectAssignable<StdinOption>([unknownGenerator]);2965expectAssignable<StdinOptionSync>([unknownGenerator]);2966expectAssignable<StdoutStderrOption>(unknownGenerator);2967expectAssignable<StdoutStderrOptionSync>(unknownGenerator);2968expectAssignable<StdoutStderrOption>([unknownGenerator]);2969expectAssignable<StdoutStderrOptionSync>([unknownGenerator]);2970expectAssignable<StdioOption>(unknownGenerator);2971expectAssignable<StdioOptionSync>(unknownGenerator);2972expectAssignable<StdioOption>([unknownGenerator]);2973expectAssignable<StdioOptionSync>([unknownGenerator]);2974execa('unicorns', {stdin: unknownGeneratorFull});2975execaSync('unicorns', {stdin: unknownGeneratorFull});2976execa('unicorns', {stdin: [unknownGeneratorFull]});2977execaSync('unicorns', {stdin: [unknownGeneratorFull]});2978execa('unicorns', {stdout: unknownGeneratorFull});2979execaSync('unicorns', {stdout: unknownGeneratorFull});2980execa('unicorns', {stdout: [unknownGeneratorFull]});2981execaSync('unicorns', {stdout: [unknownGeneratorFull]});2982execa('unicorns', {stderr: unknownGeneratorFull});2983execaSync('unicorns', {stderr: unknownGeneratorFull});2984execa('unicorns', {stderr: [unknownGeneratorFull]});2985execaSync('unicorns', {stderr: [unknownGeneratorFull]});2986expectError(execa('unicorns', {stdio: unknownGeneratorFull}));2987expectError(execaSync('unicorns', {stdio: unknownGeneratorFull}));2988execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGeneratorFull]});2989execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGeneratorFull]});2990execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGeneratorFull]]});2991execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGeneratorFull]]});2992expectAssignable<StdinOption>(unknownGeneratorFull);2993expectAssignable<StdinOptionSync>(unknownGeneratorFull);2994expectAssignable<StdinOption>([unknownGeneratorFull]);2995expectAssignable<StdinOptionSync>([unknownGeneratorFull]);2996expectAssignable<StdoutStderrOption>(unknownGeneratorFull);2997expectAssignable<StdoutStderrOptionSync>(unknownGeneratorFull);2998expectAssignable<StdoutStderrOption>([unknownGeneratorFull]);2999expectAssignable<StdoutStderrOptionSync>([unknownGeneratorFull]);3000expectAssignable<StdioOption>(unknownGeneratorFull);3001expectAssignable<StdioOptionSync>(unknownGeneratorFull);3002expectAssignable<StdioOption>([unknownGeneratorFull]);3003expectAssignable<StdioOptionSync>([unknownGeneratorFull]);3004execa('unicorns', {stdin: unknownFinalFull});3005execaSync('unicorns', {stdin: unknownFinalFull});3006execa('unicorns', {stdin: [unknownFinalFull]});3007execaSync('unicorns', {stdin: [unknownFinalFull]});3008execa('unicorns', {stdout: unknownFinalFull});3009execaSync('unicorns', {stdout: unknownFinalFull});3010execa('unicorns', {stdout: [unknownFinalFull]});3011execaSync('unicorns', {stdout: [unknownFinalFull]});3012execa('unicorns', {stderr: unknownFinalFull});3013execaSync('unicorns', {stderr: unknownFinalFull});3014execa('unicorns', {stderr: [unknownFinalFull]});3015execaSync('unicorns', {stderr: [unknownFinalFull]});3016expectError(execa('unicorns', {stdio: unknownFinalFull}));3017expectError(execaSync('unicorns', {stdio: unknownFinalFull}));3018execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownFinalFull]});3019execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownFinalFull]});3020execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownFinalFull]]});3021execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownFinalFull]]});3022expectAssignable<StdinOption>(unknownFinalFull);3023expectAssignable<StdinOptionSync>(unknownFinalFull);3024expectAssignable<StdinOption>([unknownFinalFull]);3025expectAssignable<StdinOptionSync>([unknownFinalFull]);3026expectAssignable<StdoutStderrOption>(unknownFinalFull);3027expectAssignable<StdoutStderrOptionSync>(unknownFinalFull);3028expectAssignable<StdoutStderrOption>([unknownFinalFull]);3029expectAssignable<StdoutStderrOptionSync>([unknownFinalFull]);3030expectAssignable<StdioOption>(unknownFinalFull);3031expectAssignable<StdioOptionSync>(unknownFinalFull);3032expectAssignable<StdioOption>([unknownFinalFull]);3033expectAssignable<StdioOptionSync>([unknownFinalFull]);3034execa('unicorns', {stdin: objectGenerator});3035execaSync('unicorns', {stdin: objectGenerator});3036execa('unicorns', {stdin: [objectGenerator]});3037execaSync('unicorns', {stdin: [objectGenerator]});3038execa('unicorns', {stdout: objectGenerator});3039execaSync('unicorns', {stdout: objectGenerator});3040execa('unicorns', {stdout: [objectGenerator]});3041execaSync('unicorns', {stdout: [objectGenerator]});3042execa('unicorns', {stderr: objectGenerator});3043execaSync('unicorns', {stderr: objectGenerator});3044execa('unicorns', {stderr: [objectGenerator]});3045execaSync('unicorns', {stderr: [objectGenerator]});3046expectError(execa('unicorns', {stdio: objectGenerator}));3047expectError(execaSync('unicorns', {stdio: objectGenerator}));3048execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGenerator]});3049execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGenerator]});3050execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGenerator]]});3051execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGenerator]]});3052expectAssignable<StdinOption>(objectGenerator);3053expectAssignable<StdinOptionSync>(objectGenerator);3054expectAssignable<StdinOption>([objectGenerator]);3055expectAssignable<StdinOptionSync>([objectGenerator]);3056expectAssignable<StdoutStderrOption>(objectGenerator);3057expectAssignable<StdoutStderrOptionSync>(objectGenerator);3058expectAssignable<StdoutStderrOption>([objectGenerator]);3059expectAssignable<StdoutStderrOptionSync>([objectGenerator]);3060expectAssignable<StdioOption>(objectGenerator);3061expectAssignable<StdioOptionSync>(objectGenerator);3062expectAssignable<StdioOption>([objectGenerator]);3063expectAssignable<StdioOptionSync>([objectGenerator]);3064execa('unicorns', {stdin: objectGeneratorFull});3065execaSync('unicorns', {stdin: objectGeneratorFull});3066execa('unicorns', {stdin: [objectGeneratorFull]});3067execaSync('unicorns', {stdin: [objectGeneratorFull]});3068execa('unicorns', {stdout: objectGeneratorFull});3069execaSync('unicorns', {stdout: objectGeneratorFull});3070execa('unicorns', {stdout: [objectGeneratorFull]});3071execaSync('unicorns', {stdout: [objectGeneratorFull]});3072execa('unicorns', {stderr: objectGeneratorFull});3073execaSync('unicorns', {stderr: objectGeneratorFull});3074execa('unicorns', {stderr: [objectGeneratorFull]});3075execaSync('unicorns', {stderr: [objectGeneratorFull]});3076expectError(execa('unicorns', {stdio: objectGeneratorFull}));3077expectError(execaSync('unicorns', {stdio: objectGeneratorFull}));3078execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGeneratorFull]});3079execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectGeneratorFull]});3080execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGeneratorFull]]});3081execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectGeneratorFull]]});3082expectAssignable<StdinOption>(objectGeneratorFull);3083expectAssignable<StdinOptionSync>(objectGeneratorFull);3084expectAssignable<StdinOption>([objectGeneratorFull]);3085expectAssignable<StdinOptionSync>([objectGeneratorFull]);3086expectAssignable<StdoutStderrOption>(objectGeneratorFull);3087expectAssignable<StdoutStderrOptionSync>(objectGeneratorFull);3088expectAssignable<StdoutStderrOption>([objectGeneratorFull]);3089expectAssignable<StdoutStderrOptionSync>([objectGeneratorFull]);3090expectAssignable<StdioOption>(objectGeneratorFull);3091expectAssignable<StdioOptionSync>(objectGeneratorFull);3092expectAssignable<StdioOption>([objectGeneratorFull]);3093expectAssignable<StdioOptionSync>([objectGeneratorFull]);3094execa('unicorns', {stdin: objectFinalFull});3095execaSync('unicorns', {stdin: objectFinalFull});3096execa('unicorns', {stdin: [objectFinalFull]});3097execaSync('unicorns', {stdin: [objectFinalFull]});3098execa('unicorns', {stdout: objectFinalFull});3099execaSync('unicorns', {stdout: objectFinalFull});3100execa('unicorns', {stdout: [objectFinalFull]});3101execaSync('unicorns', {stdout: [objectFinalFull]});3102execa('unicorns', {stderr: objectFinalFull});3103execaSync('unicorns', {stderr: objectFinalFull});3104execa('unicorns', {stderr: [objectFinalFull]});3105execaSync('unicorns', {stderr: [objectFinalFull]});3106expectError(execa('unicorns', {stdio: objectFinalFull}));3107expectError(execaSync('unicorns', {stdio: objectFinalFull}));3108execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectFinalFull]});3109execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectFinalFull]});3110execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectFinalFull]]});3111execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectFinalFull]]});3112expectAssignable<StdinOption>(objectFinalFull);3113expectAssignable<StdinOptionSync>(objectFinalFull);3114expectAssignable<StdinOption>([objectFinalFull]);3115expectAssignable<StdinOptionSync>([objectFinalFull]);3116expectAssignable<StdoutStderrOption>(objectFinalFull);3117expectAssignable<StdoutStderrOptionSync>(objectFinalFull);3118expectAssignable<StdoutStderrOption>([objectFinalFull]);3119expectAssignable<StdoutStderrOptionSync>([objectFinalFull]);3120expectAssignable<StdioOption>(objectFinalFull);3121expectAssignable<StdioOptionSync>(objectFinalFull);3122expectAssignable<StdioOption>([objectFinalFull]);3123expectAssignable<StdioOptionSync>([objectFinalFull]);3124expectError(execa('unicorns', {stdin: booleanGenerator}));3125expectError(execaSync('unicorns', {stdin: booleanGenerator}));3126expectError(execa('unicorns', {stdin: [booleanGenerator]}));3127expectError(execaSync('unicorns', {stdin: [booleanGenerator]}));3128expectError(execa('unicorns', {stdout: booleanGenerator}));3129expectError(execaSync('unicorns', {stdout: booleanGenerator}));3130expectError(execa('unicorns', {stdout: [booleanGenerator]}));3131expectError(execaSync('unicorns', {stdout: [booleanGenerator]}));3132expectError(execa('unicorns', {stderr: booleanGenerator}));3133expectError(execaSync('unicorns', {stderr: booleanGenerator}));3134expectError(execa('unicorns', {stderr: [booleanGenerator]}));3135expectError(execaSync('unicorns', {stderr: [booleanGenerator]}));3136expectError(execa('unicorns', {stdio: booleanGenerator}));3137expectError(execaSync('unicorns', {stdio: booleanGenerator}));3138expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGenerator]}));3139expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGenerator]}));3140expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGenerator]]}));3141expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGenerator]]}));3142expectNotAssignable<StdinOption>(booleanGenerator);3143expectNotAssignable<StdinOptionSync>(booleanGenerator);3144expectNotAssignable<StdinOption>([booleanGenerator]);3145expectNotAssignable<StdinOptionSync>([booleanGenerator]);3146expectNotAssignable<StdoutStderrOption>(booleanGenerator);3147expectNotAssignable<StdoutStderrOptionSync>(booleanGenerator);3148expectNotAssignable<StdoutStderrOption>([booleanGenerator]);3149expectNotAssignable<StdoutStderrOptionSync>([booleanGenerator]);3150expectNotAssignable<StdioOption>(booleanGenerator);3151expectNotAssignable<StdioOptionSync>(booleanGenerator);3152expectNotAssignable<StdioOption>([booleanGenerator]);3153expectNotAssignable<StdioOptionSync>([booleanGenerator]);3154expectError(execa('unicorns', {stdin: booleanGeneratorFull}));3155expectError(execaSync('unicorns', {stdin: booleanGeneratorFull}));3156expectError(execa('unicorns', {stdin: [booleanGeneratorFull]}));3157expectError(execaSync('unicorns', {stdin: [booleanGeneratorFull]}));3158expectError(execa('unicorns', {stdout: booleanGeneratorFull}));3159expectError(execaSync('unicorns', {stdout: booleanGeneratorFull}));3160expectError(execa('unicorns', {stdout: [booleanGeneratorFull]}));3161expectError(execaSync('unicorns', {stdout: [booleanGeneratorFull]}));3162expectError(execa('unicorns', {stderr: booleanGeneratorFull}));3163expectError(execaSync('unicorns', {stderr: booleanGeneratorFull}));3164expectError(execa('unicorns', {stderr: [booleanGeneratorFull]}));3165expectError(execaSync('unicorns', {stderr: [booleanGeneratorFull]}));3166expectError(execa('unicorns', {stdio: booleanGeneratorFull}));3167expectError(execaSync('unicorns', {stdio: booleanGeneratorFull}));3168expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGeneratorFull]}));3169expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGeneratorFull]}));3170expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGeneratorFull]]}));3171expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGeneratorFull]]}));3172expectNotAssignable<StdinOption>(booleanGeneratorFull);3173expectNotAssignable<StdinOptionSync>(booleanGeneratorFull);3174expectNotAssignable<StdinOption>([booleanGeneratorFull]);3175expectNotAssignable<StdinOptionSync>([booleanGeneratorFull]);3176expectNotAssignable<StdoutStderrOption>(booleanGeneratorFull);3177expectNotAssignable<StdoutStderrOptionSync>(booleanGeneratorFull);3178expectNotAssignable<StdoutStderrOption>([booleanGeneratorFull]);3179expectNotAssignable<StdoutStderrOptionSync>([booleanGeneratorFull]);3180expectNotAssignable<StdioOption>(booleanGeneratorFull);3181expectNotAssignable<StdioOptionSync>(booleanGeneratorFull);3182expectNotAssignable<StdioOption>([booleanGeneratorFull]);3183expectNotAssignable<StdioOptionSync>([booleanGeneratorFull]);3184expectError(execa('unicorns', {stdin: stringGenerator}));3185expectError(execaSync('unicorns', {stdin: stringGenerator}));3186expectError(execa('unicorns', {stdin: [stringGenerator]}));3187expectError(execaSync('unicorns', {stdin: [stringGenerator]}));3188expectError(execa('unicorns', {stdout: stringGenerator}));3189expectError(execaSync('unicorns', {stdout: stringGenerator}));3190expectError(execa('unicorns', {stdout: [stringGenerator]}));3191expectError(execaSync('unicorns', {stdout: [stringGenerator]}));3192expectError(execa('unicorns', {stderr: stringGenerator}));3193expectError(execaSync('unicorns', {stderr: stringGenerator}));3194expectError(execa('unicorns', {stderr: [stringGenerator]}));3195expectError(execaSync('unicorns', {stderr: [stringGenerator]}));3196expectError(execa('unicorns', {stdio: stringGenerator}));3197expectError(execaSync('unicorns', {stdio: stringGenerator}));3198expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGenerator]}));3199expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGenerator]}));3200expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGenerator]]}));3201expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGenerator]]}));3202expectNotAssignable<StdinOption>(stringGenerator);3203expectNotAssignable<StdinOptionSync>(stringGenerator);3204expectNotAssignable<StdinOption>([stringGenerator]);3205expectNotAssignable<StdinOptionSync>([stringGenerator]);3206expectNotAssignable<StdoutStderrOption>(stringGenerator);3207expectNotAssignable<StdoutStderrOptionSync>(stringGenerator);3208expectNotAssignable<StdoutStderrOption>([stringGenerator]);3209expectNotAssignable<StdoutStderrOptionSync>([stringGenerator]);3210expectNotAssignable<StdioOption>(stringGenerator);3211expectNotAssignable<StdioOptionSync>(stringGenerator);3212expectNotAssignable<StdioOption>([stringGenerator]);3213expectNotAssignable<StdioOptionSync>([stringGenerator]);3214expectError(execa('unicorns', {stdin: stringGeneratorFull}));3215expectError(execaSync('unicorns', {stdin: stringGeneratorFull}));3216expectError(execa('unicorns', {stdin: [stringGeneratorFull]}));3217expectError(execaSync('unicorns', {stdin: [stringGeneratorFull]}));3218expectError(execa('unicorns', {stdout: stringGeneratorFull}));3219expectError(execaSync('unicorns', {stdout: stringGeneratorFull}));3220expectError(execa('unicorns', {stdout: [stringGeneratorFull]}));3221expectError(execaSync('unicorns', {stdout: [stringGeneratorFull]}));3222expectError(execa('unicorns', {stderr: stringGeneratorFull}));3223expectError(execaSync('unicorns', {stderr: stringGeneratorFull}));3224expectError(execa('unicorns', {stderr: [stringGeneratorFull]}));3225expectError(execaSync('unicorns', {stderr: [stringGeneratorFull]}));3226expectError(execa('unicorns', {stdio: stringGeneratorFull}));3227expectError(execaSync('unicorns', {stdio: stringGeneratorFull}));3228expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGeneratorFull]}));3229expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGeneratorFull]}));3230expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGeneratorFull]]}));3231expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGeneratorFull]]}));3232expectNotAssignable<StdinOption>(stringGeneratorFull);3233expectNotAssignable<StdinOptionSync>(stringGeneratorFull);3234expectNotAssignable<StdinOption>([stringGeneratorFull]);3235expectNotAssignable<StdinOptionSync>([stringGeneratorFull]);3236expectNotAssignable<StdoutStderrOption>(stringGeneratorFull);3237expectNotAssignable<StdoutStderrOptionSync>(stringGeneratorFull);3238expectNotAssignable<StdoutStderrOption>([stringGeneratorFull]);3239expectNotAssignable<StdoutStderrOptionSync>([stringGeneratorFull]);3240expectNotAssignable<StdioOption>(stringGeneratorFull);3241expectNotAssignable<StdioOptionSync>(stringGeneratorFull);3242expectNotAssignable<StdioOption>([stringGeneratorFull]);3243expectNotAssignable<StdioOptionSync>([stringGeneratorFull]);3244expectError(execa('unicorns', {stdin: invalidReturnGenerator}));3245expectError(execaSync('unicorns', {stdin: invalidReturnGenerator}));3246expectError(execa('unicorns', {stdin: [invalidReturnGenerator]}));3247expectError(execaSync('unicorns', {stdin: [invalidReturnGenerator]}));3248expectError(execa('unicorns', {stdout: invalidReturnGenerator}));3249expectError(execaSync('unicorns', {stdout: invalidReturnGenerator}));3250expectError(execa('unicorns', {stdout: [invalidReturnGenerator]}));3251expectError(execaSync('unicorns', {stdout: [invalidReturnGenerator]}));3252expectError(execa('unicorns', {stderr: invalidReturnGenerator}));3253expectError(execaSync('unicorns', {stderr: invalidReturnGenerator}));3254expectError(execa('unicorns', {stderr: [invalidReturnGenerator]}));3255expectError(execaSync('unicorns', {stderr: [invalidReturnGenerator]}));3256expectError(execa('unicorns', {stdio: invalidReturnGenerator}));3257expectError(execaSync('unicorns', {stdio: invalidReturnGenerator}));3258expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGenerator]}));3259expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGenerator]}));3260expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGenerator]]}));3261expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGenerator]]}));3262expectNotAssignable<StdinOption>(invalidReturnGenerator);3263expectNotAssignable<StdinOptionSync>(invalidReturnGenerator);3264expectNotAssignable<StdinOption>([invalidReturnGenerator]);3265expectNotAssignable<StdinOptionSync>([invalidReturnGenerator]);3266expectNotAssignable<StdoutStderrOption>(invalidReturnGenerator);3267expectNotAssignable<StdoutStderrOptionSync>(invalidReturnGenerator);3268expectNotAssignable<StdoutStderrOption>([invalidReturnGenerator]);3269expectNotAssignable<StdoutStderrOptionSync>([invalidReturnGenerator]);3270expectNotAssignable<StdioOption>(invalidReturnGenerator);3271expectNotAssignable<StdioOptionSync>(invalidReturnGenerator);3272expectNotAssignable<StdioOption>([invalidReturnGenerator]);3273expectNotAssignable<StdioOptionSync>([invalidReturnGenerator]);3274expectError(execa('unicorns', {stdin: invalidReturnGeneratorFull}));3275expectError(execaSync('unicorns', {stdin: invalidReturnGeneratorFull}));3276expectError(execa('unicorns', {stdin: [invalidReturnGeneratorFull]}));3277expectError(execaSync('unicorns', {stdin: [invalidReturnGeneratorFull]}));3278expectError(execa('unicorns', {stdout: invalidReturnGeneratorFull}));3279expectError(execaSync('unicorns', {stdout: invalidReturnGeneratorFull}));3280expectError(execa('unicorns', {stdout: [invalidReturnGeneratorFull]}));3281expectError(execaSync('unicorns', {stdout: [invalidReturnGeneratorFull]}));3282expectError(execa('unicorns', {stderr: invalidReturnGeneratorFull}));3283expectError(execaSync('unicorns', {stderr: invalidReturnGeneratorFull}));3284expectError(execa('unicorns', {stderr: [invalidReturnGeneratorFull]}));3285expectError(execaSync('unicorns', {stderr: [invalidReturnGeneratorFull]}));3286expectError(execa('unicorns', {stdio: invalidReturnGeneratorFull}));3287expectError(execaSync('unicorns', {stdio: invalidReturnGeneratorFull}));3288expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGeneratorFull]}));3289expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnGeneratorFull]}));3290expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGeneratorFull]]}));3291expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnGeneratorFull]]}));3292expectNotAssignable<StdinOption>(invalidReturnGeneratorFull);3293expectNotAssignable<StdinOptionSync>(invalidReturnGeneratorFull);3294expectNotAssignable<StdinOption>([invalidReturnGeneratorFull]);3295expectNotAssignable<StdinOptionSync>([invalidReturnGeneratorFull]);3296expectNotAssignable<StdoutStderrOption>(invalidReturnGeneratorFull);3297expectNotAssignable<StdoutStderrOptionSync>(invalidReturnGeneratorFull);3298expectNotAssignable<StdoutStderrOption>([invalidReturnGeneratorFull]);3299expectNotAssignable<StdoutStderrOptionSync>([invalidReturnGeneratorFull]);3300expectNotAssignable<StdioOption>(invalidReturnGeneratorFull);3301expectNotAssignable<StdioOptionSync>(invalidReturnGeneratorFull);3302expectNotAssignable<StdioOption>([invalidReturnGeneratorFull]);3303expectNotAssignable<StdioOptionSync>([invalidReturnGeneratorFull]);3304execa('unicorns', {stdin: asyncGenerator});3305expectError(execaSync('unicorns', {stdin: asyncGenerator}));3306execa('unicorns', {stdin: [asyncGenerator]});3307expectError(execaSync('unicorns', {stdin: [asyncGenerator]}));3308execa('unicorns', {stdout: asyncGenerator});3309expectError(execaSync('unicorns', {stdout: asyncGenerator}));3310execa('unicorns', {stdout: [asyncGenerator]});3311expectError(execaSync('unicorns', {stdout: [asyncGenerator]}));3312execa('unicorns', {stderr: asyncGenerator});3313expectError(execaSync('unicorns', {stderr: asyncGenerator}));3314execa('unicorns', {stderr: [asyncGenerator]});3315expectError(execaSync('unicorns', {stderr: [asyncGenerator]}));3316expectError(execa('unicorns', {stdio: asyncGenerator}));3317expectError(execaSync('unicorns', {stdio: asyncGenerator}));3318execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGenerator]});3319expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGenerator]}));3320execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGenerator]]});3321expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGenerator]]}));3322expectAssignable<StdinOption>(asyncGenerator);3323expectNotAssignable<StdinOptionSync>(asyncGenerator);3324expectAssignable<StdinOption>([asyncGenerator]);3325expectNotAssignable<StdinOptionSync>([asyncGenerator]);3326expectAssignable<StdoutStderrOption>(asyncGenerator);3327expectNotAssignable<StdoutStderrOptionSync>(asyncGenerator);3328expectAssignable<StdoutStderrOption>([asyncGenerator]);3329expectNotAssignable<StdoutStderrOptionSync>([asyncGenerator]);3330expectAssignable<StdioOption>(asyncGenerator);3331expectNotAssignable<StdioOptionSync>(asyncGenerator);3332expectAssignable<StdioOption>([asyncGenerator]);3333expectNotAssignable<StdioOptionSync>([asyncGenerator]);3334execa('unicorns', {stdin: asyncGeneratorFull});3335expectError(execaSync('unicorns', {stdin: asyncGeneratorFull}));3336execa('unicorns', {stdin: [asyncGeneratorFull]});3337expectError(execaSync('unicorns', {stdin: [asyncGeneratorFull]}));3338execa('unicorns', {stdout: asyncGeneratorFull});3339expectError(execaSync('unicorns', {stdout: asyncGeneratorFull}));3340execa('unicorns', {stdout: [asyncGeneratorFull]});3341expectError(execaSync('unicorns', {stdout: [asyncGeneratorFull]}));3342execa('unicorns', {stderr: asyncGeneratorFull});3343expectError(execaSync('unicorns', {stderr: asyncGeneratorFull}));3344execa('unicorns', {stderr: [asyncGeneratorFull]});3345expectError(execaSync('unicorns', {stderr: [asyncGeneratorFull]}));3346expectError(execa('unicorns', {stdio: asyncGeneratorFull}));3347expectError(execaSync('unicorns', {stdio: asyncGeneratorFull}));3348execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGeneratorFull]});3349expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncGeneratorFull]}));3350execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGeneratorFull]]});3351expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncGeneratorFull]]}));3352expectAssignable<StdinOption>(asyncGeneratorFull);3353expectNotAssignable<StdinOptionSync>(asyncGeneratorFull);3354expectAssignable<StdinOption>([asyncGeneratorFull]);3355expectNotAssignable<StdinOptionSync>([asyncGeneratorFull]);3356expectAssignable<StdoutStderrOption>(asyncGeneratorFull);3357expectNotAssignable<StdoutStderrOptionSync>(asyncGeneratorFull);3358expectAssignable<StdoutStderrOption>([asyncGeneratorFull]);3359expectNotAssignable<StdoutStderrOptionSync>([asyncGeneratorFull]);3360expectAssignable<StdioOption>(asyncGeneratorFull);3361expectNotAssignable<StdioOptionSync>(asyncGeneratorFull);3362expectAssignable<StdioOption>([asyncGeneratorFull]);3363expectNotAssignable<StdioOptionSync>([asyncGeneratorFull]);3364execa('unicorns', {stdin: asyncFinalFull});3365expectError(execaSync('unicorns', {stdin: asyncFinalFull}));3366execa('unicorns', {stdin: [asyncFinalFull]});3367expectError(execaSync('unicorns', {stdin: [asyncFinalFull]}));3368execa('unicorns', {stdout: asyncFinalFull});3369expectError(execaSync('unicorns', {stdout: asyncFinalFull}));3370execa('unicorns', {stdout: [asyncFinalFull]});3371expectError(execaSync('unicorns', {stdout: [asyncFinalFull]}));3372execa('unicorns', {stderr: asyncFinalFull});3373expectError(execaSync('unicorns', {stderr: asyncFinalFull}));3374execa('unicorns', {stderr: [asyncFinalFull]});3375expectError(execaSync('unicorns', {stderr: [asyncFinalFull]}));3376expectError(execa('unicorns', {stdio: asyncFinalFull}));3377expectError(execaSync('unicorns', {stdio: asyncFinalFull}));3378execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncFinalFull]});3379expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncFinalFull]}));3380execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncFinalFull]]});3381expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncFinalFull]]}));3382expectAssignable<StdinOption>(asyncFinalFull);3383expectNotAssignable<StdinOptionSync>(asyncFinalFull);3384expectAssignable<StdinOption>([asyncFinalFull]);3385expectNotAssignable<StdinOptionSync>([asyncFinalFull]);3386expectAssignable<StdoutStderrOption>(asyncFinalFull);3387expectNotAssignable<StdoutStderrOptionSync>(asyncFinalFull);3388expectAssignable<StdoutStderrOption>([asyncFinalFull]);3389expectNotAssignable<StdoutStderrOptionSync>([asyncFinalFull]);3390expectAssignable<StdioOption>(asyncFinalFull);3391expectNotAssignable<StdioOptionSync>(asyncFinalFull);3392expectAssignable<StdioOption>([asyncFinalFull]);3393expectNotAssignable<StdioOptionSync>([asyncFinalFull]);3394expectError(execa('unicorns', {stdin: invalidReturnFinalFull}));3395expectError(execaSync('unicorns', {stdin: invalidReturnFinalFull}));3396expectError(execa('unicorns', {stdin: [invalidReturnFinalFull]}));3397expectError(execaSync('unicorns', {stdin: [invalidReturnFinalFull]}));3398expectError(execa('unicorns', {stdout: invalidReturnFinalFull}));3399expectError(execaSync('unicorns', {stdout: invalidReturnFinalFull}));3400expectError(execa('unicorns', {stdout: [invalidReturnFinalFull]}));3401expectError(execaSync('unicorns', {stdout: [invalidReturnFinalFull]}));3402expectError(execa('unicorns', {stderr: invalidReturnFinalFull}));3403expectError(execaSync('unicorns', {stderr: invalidReturnFinalFull}));3404expectError(execa('unicorns', {stderr: [invalidReturnFinalFull]}));3405expectError(execaSync('unicorns', {stderr: [invalidReturnFinalFull]}));3406expectError(execa('unicorns', {stdio: invalidReturnFinalFull}));3407expectError(execaSync('unicorns', {stdio: invalidReturnFinalFull}));3408expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnFinalFull]}));3409expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidReturnFinalFull]}));3410expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnFinalFull]]}));3411expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidReturnFinalFull]]}));3412expectNotAssignable<StdinOption>(invalidReturnFinalFull);3413expectNotAssignable<StdinOptionSync>(invalidReturnFinalFull);3414expectNotAssignable<StdinOption>([invalidReturnFinalFull]);3415expectNotAssignable<StdinOptionSync>([invalidReturnFinalFull]);3416expectNotAssignable<StdoutStderrOption>(invalidReturnFinalFull);3417expectNotAssignable<StdoutStderrOptionSync>(invalidReturnFinalFull);3418expectNotAssignable<StdoutStderrOption>([invalidReturnFinalFull]);3419expectNotAssignable<StdoutStderrOptionSync>([invalidReturnFinalFull]);3420expectNotAssignable<StdioOption>(invalidReturnFinalFull);3421expectNotAssignable<StdioOptionSync>(invalidReturnFinalFull);3422expectNotAssignable<StdioOption>([invalidReturnFinalFull]);3423expectNotAssignable<StdioOptionSync>([invalidReturnFinalFull]);3424execa('unicorns', {stdin: transformWithBinary});3425execaSync('unicorns', {stdin: transformWithBinary});3426execa('unicorns', {stdin: [transformWithBinary]});3427execaSync('unicorns', {stdin: [transformWithBinary]});3428execa('unicorns', {stdout: transformWithBinary});3429execaSync('unicorns', {stdout: transformWithBinary});3430execa('unicorns', {stdout: [transformWithBinary]});3431execaSync('unicorns', {stdout: [transformWithBinary]});3432execa('unicorns', {stderr: transformWithBinary});3433execaSync('unicorns', {stderr: transformWithBinary});3434execa('unicorns', {stderr: [transformWithBinary]});3435execaSync('unicorns', {stderr: [transformWithBinary]});3436expectError(execa('unicorns', {stdio: transformWithBinary}));3437expectError(execaSync('unicorns', {stdio: transformWithBinary}));3438execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithBinary]});3439execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithBinary]});3440execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithBinary]]});3441execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithBinary]]});3442expectAssignable<StdinOption>(transformWithBinary);3443expectAssignable<StdinOptionSync>(transformWithBinary);3444expectAssignable<StdinOption>([transformWithBinary]);3445expectAssignable<StdinOptionSync>([transformWithBinary]);3446expectAssignable<StdoutStderrOption>(transformWithBinary);3447expectAssignable<StdoutStderrOptionSync>(transformWithBinary);3448expectAssignable<StdoutStderrOption>([transformWithBinary]);3449expectAssignable<StdoutStderrOptionSync>([transformWithBinary]);3450expectAssignable<StdioOption>(transformWithBinary);3451expectAssignable<StdioOptionSync>(transformWithBinary);3452expectAssignable<StdioOption>([transformWithBinary]);3453expectAssignable<StdioOptionSync>([transformWithBinary]);3454expectError(execa('unicorns', {stdin: transformWithInvalidBinary}));3455expectError(execaSync('unicorns', {stdin: transformWithInvalidBinary}));3456expectError(execa('unicorns', {stdin: [transformWithInvalidBinary]}));3457expectError(execaSync('unicorns', {stdin: [transformWithInvalidBinary]}));3458expectError(execa('unicorns', {stdout: transformWithInvalidBinary}));3459expectError(execaSync('unicorns', {stdout: transformWithInvalidBinary}));3460expectError(execa('unicorns', {stdout: [transformWithInvalidBinary]}));3461expectError(execaSync('unicorns', {stdout: [transformWithInvalidBinary]}));3462expectError(execa('unicorns', {stderr: transformWithInvalidBinary}));3463expectError(execaSync('unicorns', {stderr: transformWithInvalidBinary}));3464expectError(execa('unicorns', {stderr: [transformWithInvalidBinary]}));3465expectError(execaSync('unicorns', {stderr: [transformWithInvalidBinary]}));3466expectError(execa('unicorns', {stdio: transformWithInvalidBinary}));3467expectError(execaSync('unicorns', {stdio: transformWithInvalidBinary}));3468expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidBinary]}));3469expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidBinary]}));3470expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidBinary]]}));3471expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidBinary]]}));3472expectNotAssignable<StdinOption>(transformWithInvalidBinary);3473expectNotAssignable<StdinOptionSync>(transformWithInvalidBinary);3474expectNotAssignable<StdinOption>([transformWithInvalidBinary]);3475expectNotAssignable<StdinOptionSync>([transformWithInvalidBinary]);3476expectNotAssignable<StdoutStderrOption>(transformWithInvalidBinary);3477expectNotAssignable<StdoutStderrOptionSync>(transformWithInvalidBinary);3478expectNotAssignable<StdoutStderrOption>([transformWithInvalidBinary]);3479expectNotAssignable<StdoutStderrOptionSync>([transformWithInvalidBinary]);3480expectNotAssignable<StdioOption>(transformWithInvalidBinary);3481expectNotAssignable<StdioOptionSync>(transformWithInvalidBinary);3482expectNotAssignable<StdioOption>([transformWithInvalidBinary]);3483expectNotAssignable<StdioOptionSync>([transformWithInvalidBinary]);3484execa('unicorns', {stdin: transformWithPreserveNewlines});3485execaSync('unicorns', {stdin: transformWithPreserveNewlines});3486execa('unicorns', {stdin: [transformWithPreserveNewlines]});3487execaSync('unicorns', {stdin: [transformWithPreserveNewlines]});3488execa('unicorns', {stdout: transformWithPreserveNewlines});3489execaSync('unicorns', {stdout: transformWithPreserveNewlines});3490execa('unicorns', {stdout: [transformWithPreserveNewlines]});3491execaSync('unicorns', {stdout: [transformWithPreserveNewlines]});3492execa('unicorns', {stderr: transformWithPreserveNewlines});3493execaSync('unicorns', {stderr: transformWithPreserveNewlines});3494execa('unicorns', {stderr: [transformWithPreserveNewlines]});3495execaSync('unicorns', {stderr: [transformWithPreserveNewlines]});3496expectError(execa('unicorns', {stdio: transformWithPreserveNewlines}));3497expectError(execaSync('unicorns', {stdio: transformWithPreserveNewlines}));3498execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithPreserveNewlines]});3499execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithPreserveNewlines]});3500execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithPreserveNewlines]]});3501execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithPreserveNewlines]]});3502expectAssignable<StdinOption>(transformWithPreserveNewlines);3503expectAssignable<StdinOptionSync>(transformWithPreserveNewlines);3504expectAssignable<StdinOption>([transformWithPreserveNewlines]);3505expectAssignable<StdinOptionSync>([transformWithPreserveNewlines]);3506expectAssignable<StdoutStderrOption>(transformWithPreserveNewlines);3507expectAssignable<StdoutStderrOptionSync>(transformWithPreserveNewlines);3508expectAssignable<StdoutStderrOption>([transformWithPreserveNewlines]);3509expectAssignable<StdoutStderrOptionSync>([transformWithPreserveNewlines]);3510expectAssignable<StdioOption>(transformWithPreserveNewlines);3511expectAssignable<StdioOptionSync>(transformWithPreserveNewlines);3512expectAssignable<StdioOption>([transformWithPreserveNewlines]);3513expectAssignable<StdioOptionSync>([transformWithPreserveNewlines]);3514expectError(execa('unicorns', {stdin: transformWithInvalidPreserveNewlines}));3515expectError(execaSync('unicorns', {stdin: transformWithInvalidPreserveNewlines}));3516expectError(execa('unicorns', {stdin: [transformWithInvalidPreserveNewlines]}));3517expectError(execaSync('unicorns', {stdin: [transformWithInvalidPreserveNewlines]}));3518expectError(execa('unicorns', {stdout: transformWithInvalidPreserveNewlines}));3519expectError(execaSync('unicorns', {stdout: transformWithInvalidPreserveNewlines}));3520expectError(execa('unicorns', {stdout: [transformWithInvalidPreserveNewlines]}));3521expectError(execaSync('unicorns', {stdout: [transformWithInvalidPreserveNewlines]}));3522expectError(execa('unicorns', {stderr: transformWithInvalidPreserveNewlines}));3523expectError(execaSync('unicorns', {stderr: transformWithInvalidPreserveNewlines}));3524expectError(execa('unicorns', {stderr: [transformWithInvalidPreserveNewlines]}));3525expectError(execaSync('unicorns', {stderr: [transformWithInvalidPreserveNewlines]}));3526expectError(execa('unicorns', {stdio: transformWithInvalidPreserveNewlines}));3527expectError(execaSync('unicorns', {stdio: transformWithInvalidPreserveNewlines}));3528expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidPreserveNewlines]}));3529expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidPreserveNewlines]}));3530expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidPreserveNewlines]]}));3531expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidPreserveNewlines]]}));3532expectNotAssignable<StdinOption>(transformWithInvalidPreserveNewlines);3533expectNotAssignable<StdinOptionSync>(transformWithInvalidPreserveNewlines);3534expectNotAssignable<StdinOption>([transformWithInvalidPreserveNewlines]);3535expectNotAssignable<StdinOptionSync>([transformWithInvalidPreserveNewlines]);3536expectNotAssignable<StdoutStderrOption>(transformWithInvalidPreserveNewlines);3537expectNotAssignable<StdoutStderrOptionSync>(transformWithInvalidPreserveNewlines);3538expectNotAssignable<StdoutStderrOption>([transformWithInvalidPreserveNewlines]);3539expectNotAssignable<StdoutStderrOptionSync>([transformWithInvalidPreserveNewlines]);3540expectNotAssignable<StdioOption>(transformWithInvalidPreserveNewlines);3541expectNotAssignable<StdioOptionSync>(transformWithInvalidPreserveNewlines);3542expectNotAssignable<StdioOption>([transformWithInvalidPreserveNewlines]);3543expectNotAssignable<StdioOptionSync>([transformWithInvalidPreserveNewlines]);3544execa('unicorns', {stdin: transformWithObjectMode});3545execaSync('unicorns', {stdin: transformWithObjectMode});3546execa('unicorns', {stdin: [transformWithObjectMode]});3547execaSync('unicorns', {stdin: [transformWithObjectMode]});3548execa('unicorns', {stdout: transformWithObjectMode});3549execaSync('unicorns', {stdout: transformWithObjectMode});3550execa('unicorns', {stdout: [transformWithObjectMode]});3551execaSync('unicorns', {stdout: [transformWithObjectMode]});3552execa('unicorns', {stderr: transformWithObjectMode});3553execaSync('unicorns', {stderr: transformWithObjectMode});3554execa('unicorns', {stderr: [transformWithObjectMode]});3555execaSync('unicorns', {stderr: [transformWithObjectMode]});3556expectError(execa('unicorns', {stdio: transformWithObjectMode}));3557expectError(execaSync('unicorns', {stdio: transformWithObjectMode}));3558execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithObjectMode]});3559execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithObjectMode]});3560execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithObjectMode]]});3561execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithObjectMode]]});3562expectAssignable<StdinOption>(transformWithObjectMode);3563expectAssignable<StdinOptionSync>(transformWithObjectMode);3564expectAssignable<StdinOption>([transformWithObjectMode]);3565expectAssignable<StdinOptionSync>([transformWithObjectMode]);3566expectAssignable<StdoutStderrOption>(transformWithObjectMode);3567expectAssignable<StdoutStderrOptionSync>(transformWithObjectMode);3568expectAssignable<StdoutStderrOption>([transformWithObjectMode]);3569expectAssignable<StdoutStderrOptionSync>([transformWithObjectMode]);3570expectAssignable<StdioOption>(transformWithObjectMode);3571expectAssignable<StdioOptionSync>(transformWithObjectMode);3572expectAssignable<StdioOption>([transformWithObjectMode]);3573expectAssignable<StdioOptionSync>([transformWithObjectMode]);3574expectError(execa('unicorns', {stdin: transformWithInvalidObjectMode}));3575expectError(execaSync('unicorns', {stdin: transformWithInvalidObjectMode}));3576expectError(execa('unicorns', {stdin: [transformWithInvalidObjectMode]}));3577expectError(execaSync('unicorns', {stdin: [transformWithInvalidObjectMode]}));3578expectError(execa('unicorns', {stdout: transformWithInvalidObjectMode}));3579expectError(execaSync('unicorns', {stdout: transformWithInvalidObjectMode}));3580expectError(execa('unicorns', {stdout: [transformWithInvalidObjectMode]}));3581expectError(execaSync('unicorns', {stdout: [transformWithInvalidObjectMode]}));3582expectError(execa('unicorns', {stderr: transformWithInvalidObjectMode}));3583expectError(execaSync('unicorns', {stderr: transformWithInvalidObjectMode}));3584expectError(execa('unicorns', {stderr: [transformWithInvalidObjectMode]}));3585expectError(execaSync('unicorns', {stderr: [transformWithInvalidObjectMode]}));3586expectError(execa('unicorns', {stdio: transformWithInvalidObjectMode}));3587expectError(execaSync('unicorns', {stdio: transformWithInvalidObjectMode}));3588expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidObjectMode]}));3589expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithInvalidObjectMode]}));3590expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidObjectMode]]}));3591expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithInvalidObjectMode]]}));3592expectNotAssignable<StdinOption>(transformWithInvalidObjectMode);3593expectNotAssignable<StdinOptionSync>(transformWithInvalidObjectMode);3594expectNotAssignable<StdinOption>([transformWithInvalidObjectMode]);3595expectNotAssignable<StdinOptionSync>([transformWithInvalidObjectMode]);3596expectNotAssignable<StdoutStderrOption>(transformWithInvalidObjectMode);3597expectNotAssignable<StdoutStderrOptionSync>(transformWithInvalidObjectMode);3598expectNotAssignable<StdoutStderrOption>([transformWithInvalidObjectMode]);3599expectNotAssignable<StdoutStderrOptionSync>([transformWithInvalidObjectMode]);3600expectNotAssignable<StdioOption>(transformWithInvalidObjectMode);3601expectNotAssignable<StdioOptionSync>(transformWithInvalidObjectMode);3602expectNotAssignable<StdioOption>([transformWithInvalidObjectMode]);3603expectNotAssignable<StdioOptionSync>([transformWithInvalidObjectMode]);3604expectError(execa('unicorns', {stdin: {}}));3605expectError(execaSync('unicorns', {stdin: {}}));3606expectError(execa('unicorns', {stdin: [{}]}));3607expectError(execaSync('unicorns', {stdin: [{}]}));3608expectError(execa('unicorns', {stdout: {}}));3609expectError(execaSync('unicorns', {stdout: {}}));3610expectError(execa('unicorns', {stdout: [{}]}));3611expectError(execaSync('unicorns', {stdout: [{}]}));3612expectError(execa('unicorns', {stderr: {}}));3613expectError(execaSync('unicorns', {stderr: {}}));3614expectError(execa('unicorns', {stderr: [{}]}));3615expectError(execaSync('unicorns', {stderr: [{}]}));3616expectError(execa('unicorns', {stdio: {}}));3617expectError(execaSync('unicorns', {stdio: {}}));3618expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {}]}));3619expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {}]}));3620expectNotAssignable<StdinOption>({});3621expectNotAssignable<StdinOptionSync>({});3622expectNotAssignable<StdinOption>([{}]);3623expectNotAssignable<StdinOptionSync>([{}]);3624expectNotAssignable<StdoutStderrOption>({});3625expectNotAssignable<StdoutStderrOptionSync>({});3626expectNotAssignable<StdoutStderrOption>([{}]);3627expectNotAssignable<StdoutStderrOptionSync>([{}]);3628expectNotAssignable<StdioOption>({});3629expectNotAssignable<StdioOptionSync>({});3630expectNotAssignable<StdioOption>([{}]);3631expectNotAssignable<StdioOptionSync>([{}]);3632expectError(execa('unicorns', {stdin: binaryOnly}));3633expectError(execaSync('unicorns', {stdin: binaryOnly}));3634expectError(execa('unicorns', {stdin: [binaryOnly]}));3635expectError(execaSync('unicorns', {stdin: [binaryOnly]}));3636expectError(execa('unicorns', {stdout: binaryOnly}));3637expectError(execaSync('unicorns', {stdout: binaryOnly}));3638expectError(execa('unicorns', {stdout: [binaryOnly]}));3639expectError(execaSync('unicorns', {stdout: [binaryOnly]}));3640expectError(execa('unicorns', {stderr: binaryOnly}));3641expectError(execaSync('unicorns', {stderr: binaryOnly}));3642expectError(execa('unicorns', {stderr: [binaryOnly]}));3643expectError(execaSync('unicorns', {stderr: [binaryOnly]}));3644expectError(execa('unicorns', {stdio: binaryOnly}));3645expectError(execaSync('unicorns', {stdio: binaryOnly}));3646expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryOnly]}));3647expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryOnly]}));3648expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryOnly]]}));3649expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryOnly]]}));3650expectNotAssignable<StdinOption>(binaryOnly);3651expectNotAssignable<StdinOptionSync>(binaryOnly);3652expectNotAssignable<StdinOption>([binaryOnly]);3653expectNotAssignable<StdinOptionSync>([binaryOnly]);3654expectNotAssignable<StdoutStderrOption>(binaryOnly);3655expectNotAssignable<StdoutStderrOptionSync>(binaryOnly);3656expectNotAssignable<StdoutStderrOption>([binaryOnly]);3657expectNotAssignable<StdoutStderrOptionSync>([binaryOnly]);3658expectNotAssignable<StdioOption>(binaryOnly);3659expectNotAssignable<StdioOptionSync>(binaryOnly);3660expectNotAssignable<StdioOption>([binaryOnly]);3661expectNotAssignable<StdioOptionSync>([binaryOnly]);3662expectError(execa('unicorns', {stdin: preserveNewlinesOnly}));3663expectError(execaSync('unicorns', {stdin: preserveNewlinesOnly}));3664expectError(execa('unicorns', {stdin: [preserveNewlinesOnly]}));3665expectError(execaSync('unicorns', {stdin: [preserveNewlinesOnly]}));3666expectError(execa('unicorns', {stdout: preserveNewlinesOnly}));3667expectError(execaSync('unicorns', {stdout: preserveNewlinesOnly}));3668expectError(execa('unicorns', {stdout: [preserveNewlinesOnly]}));3669expectError(execaSync('unicorns', {stdout: [preserveNewlinesOnly]}));3670expectError(execa('unicorns', {stderr: preserveNewlinesOnly}));3671expectError(execaSync('unicorns', {stderr: preserveNewlinesOnly}));3672expectError(execa('unicorns', {stderr: [preserveNewlinesOnly]}));3673expectError(execaSync('unicorns', {stderr: [preserveNewlinesOnly]}));3674expectError(execa('unicorns', {stdio: preserveNewlinesOnly}));3675expectError(execaSync('unicorns', {stdio: preserveNewlinesOnly}));3676expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', preserveNewlinesOnly]}));3677expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', preserveNewlinesOnly]}));3678expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [preserveNewlinesOnly]]}));3679expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [preserveNewlinesOnly]]}));3680expectNotAssignable<StdinOption>(preserveNewlinesOnly);3681expectNotAssignable<StdinOptionSync>(preserveNewlinesOnly);3682expectNotAssignable<StdinOption>([preserveNewlinesOnly]);3683expectNotAssignable<StdinOptionSync>([preserveNewlinesOnly]);3684expectNotAssignable<StdoutStderrOption>(preserveNewlinesOnly);3685expectNotAssignable<StdoutStderrOptionSync>(preserveNewlinesOnly);3686expectNotAssignable<StdoutStderrOption>([preserveNewlinesOnly]);3687expectNotAssignable<StdoutStderrOptionSync>([preserveNewlinesOnly]);3688expectNotAssignable<StdioOption>(preserveNewlinesOnly);3689expectNotAssignable<StdioOptionSync>(preserveNewlinesOnly);3690expectNotAssignable<StdioOption>([preserveNewlinesOnly]);3691expectNotAssignable<StdioOptionSync>([preserveNewlinesOnly]);3692expectError(execa('unicorns', {stdin: objectModeOnly}));3693expectError(execaSync('unicorns', {stdin: objectModeOnly}));3694expectError(execa('unicorns', {stdin: [objectModeOnly]}));3695expectError(execaSync('unicorns', {stdin: [objectModeOnly]}));3696expectError(execa('unicorns', {stdout: objectModeOnly}));3697expectError(execaSync('unicorns', {stdout: objectModeOnly}));3698expectError(execa('unicorns', {stdout: [objectModeOnly]}));3699expectError(execaSync('unicorns', {stdout: [objectModeOnly]}));3700expectError(execa('unicorns', {stderr: objectModeOnly}));3701expectError(execaSync('unicorns', {stderr: objectModeOnly}));3702expectError(execa('unicorns', {stderr: [objectModeOnly]}));3703expectError(execaSync('unicorns', {stderr: [objectModeOnly]}));3704expectError(execa('unicorns', {stdio: objectModeOnly}));3705expectError(execaSync('unicorns', {stdio: objectModeOnly}));3706expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectModeOnly]}));3707expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectModeOnly]}));3708expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectModeOnly]]}));3709expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectModeOnly]]}));3710expectNotAssignable<StdinOption>(objectModeOnly);3711expectNotAssignable<StdinOptionSync>(objectModeOnly);3712expectNotAssignable<StdinOption>([objectModeOnly]);3713expectNotAssignable<StdinOptionSync>([objectModeOnly]);3714expectNotAssignable<StdoutStderrOption>(objectModeOnly);3715expectNotAssignable<StdoutStderrOptionSync>(objectModeOnly);3716expectNotAssignable<StdoutStderrOption>([objectModeOnly]);3717expectNotAssignable<StdoutStderrOptionSync>([objectModeOnly]);3718expectNotAssignable<StdioOption>(objectModeOnly);3719expectNotAssignable<StdioOptionSync>(objectModeOnly);3720expectNotAssignable<StdioOption>([objectModeOnly]);3721expectNotAssignable<StdioOptionSync>([objectModeOnly]);3722expectError(execa('unicorns', {stdin: finalOnly}));3723expectError(execaSync('unicorns', {stdin: finalOnly}));3724expectError(execa('unicorns', {stdin: [finalOnly]}));3725expectError(execaSync('unicorns', {stdin: [finalOnly]}));3726expectError(execa('unicorns', {stdout: finalOnly}));3727expectError(execaSync('unicorns', {stdout: finalOnly}));3728expectError(execa('unicorns', {stdout: [finalOnly]}));3729expectError(execaSync('unicorns', {stdout: [finalOnly]}));3730expectError(execa('unicorns', {stderr: finalOnly}));3731expectError(execaSync('unicorns', {stderr: finalOnly}));3732expectError(execa('unicorns', {stderr: [finalOnly]}));3733expectError(execaSync('unicorns', {stderr: [finalOnly]}));3734expectError(execa('unicorns', {stdio: finalOnly}));3735expectError(execaSync('unicorns', {stdio: finalOnly}));3736expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', finalOnly]}));3737expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', finalOnly]}));3738expectError(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [finalOnly]]}));3739expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [finalOnly]]}));3740expectNotAssignable<StdinOption>(finalOnly);3741expectNotAssignable<StdinOptionSync>(finalOnly);3742expectNotAssignable<StdinOption>([finalOnly]);3743expectNotAssignable<StdinOptionSync>([finalOnly]);3744expectNotAssignable<StdoutStderrOption>(finalOnly);3745expectNotAssignable<StdoutStderrOptionSync>(finalOnly);3746expectNotAssignable<StdoutStderrOption>([finalOnly]);3747expectNotAssignable<StdoutStderrOptionSync>([finalOnly]);3748expectNotAssignable<StdioOption>(finalOnly);3749expectNotAssignable<StdioOptionSync>(finalOnly);3750expectNotAssignable<StdioOption>([finalOnly]);3751expectNotAssignable<StdioOptionSync>([finalOnly]);37523753/* eslint-enable @typescript-eslint/no-floating-promises */3754expectType<boolean>(execa('unicorns').kill());3755execa('unicorns').kill('SIGKILL');3756execa('unicorns').kill(undefined);3757execa('unicorns').kill(new Error('test'));3758execa('unicorns').kill('SIGKILL', new Error('test'));3759execa('unicorns').kill(undefined, new Error('test'));3760expectError(execa('unicorns').kill(null));3761expectError(execa('unicorns').kill(0n));3762expectError(execa('unicorns').kill([new Error('test')]));3763expectError(execa('unicorns').kill({message: 'test'}));3764expectError(execa('unicorns').kill(undefined, {}));3765expectError(execa('unicorns').kill('SIGKILL', {}));3766expectError(execa('unicorns').kill(null, new Error('test')));37673768expectError(execa());3769expectError(execa(true));3770expectError(execa(['unicorns', 'arg']));3771expectAssignable<ExecaSubprocess>(execa('unicorns'));3772expectAssignable<ExecaSubprocess>(execa(fileUrl));3773expectAssignable<ExecaSubprocess>(execa('unicorns', []));3774expectAssignable<ExecaSubprocess>(execa('unicorns', ['foo']));3775expectAssignable<ExecaSubprocess>(execa('unicorns', {}));3776expectAssignable<ExecaSubprocess>(execa('unicorns', [], {}));3777expectError(execa('unicorns', 'foo'));3778expectError(execa('unicorns', [true]));3779expectError(execa('unicorns', [], []));3780expectError(execa('unicorns', {other: true}));3781expectAssignable<ExecaSubprocess>(execa`unicorns`);3782expectAssignable<typeof execa>(execa({}));3783expectAssignable<ExecaSubprocess>(execa({})('unicorns'));3784expectAssignable<ExecaSubprocess>(execa({})`unicorns`);3785expectType<ExecaResult<{}>>(await execa('unicorns'));3786expectType<ExecaResult<{}>>(await execa`unicorns`);3787expectAssignable<{stdout: string}>(await execa('unicorns'));3788expectAssignable<{stdout: Uint8Array}>(await execa('unicorns', {encoding: 'buffer'}));3789expectAssignable<{stdout: string}>(await execa('unicorns', ['foo']));3790expectAssignable<{stdout: Uint8Array}>(await execa('unicorns', ['foo'], {encoding: 'buffer'}));3791expectAssignable<{stdout: string}>(await execa({})('unicorns'));3792expectAssignable<{stdout: Uint8Array}>(await execa({encoding: 'buffer'})('unicorns'));3793expectAssignable<{stdout: Uint8Array}>(await execa({})({encoding: 'buffer'})('unicorns'));3794expectAssignable<{stdout: Uint8Array}>(await execa({encoding: 'buffer'})({})('unicorns'));3795expectAssignable<{stdout: string}>(await execa({})`unicorns`);3796expectAssignable<{stdout: Uint8Array}>(await execa({encoding: 'buffer'})`unicorns`);3797expectAssignable<{stdout: Uint8Array}>(await execa({})({encoding: 'buffer'})`unicorns`);3798expectAssignable<{stdout: Uint8Array}>(await execa({encoding: 'buffer'})({})`unicorns`);3799expectType<ExecaResult<{}>>(await execa`${'unicorns'}`);3800expectType<ExecaResult<{}>>(await execa`unicorns ${'foo'}`);3801expectType<ExecaResult<{}>>(await execa`unicorns ${'foo'} ${'bar'}`);3802expectType<ExecaResult<{}>>(await execa`unicorns ${1}`);3803expectType<ExecaResult<{}>>(await execa`unicorns ${stringArray}`);3804expectType<ExecaResult<{}>>(await execa`unicorns ${[1, 2]}`);3805expectType<ExecaResult<{}>>(await execa`unicorns ${await execa`echo foo`}`);3806expectError(await execa`unicorns ${execa`echo foo`}`);3807expectType<ExecaResult<{}>>(await execa`unicorns ${[await execa`echo foo`, 'bar']}`);3808expectError(await execa`unicorns ${[execa`echo foo`, 'bar']}`);3809expectType<ExecaResult<{}>>(await execa`unicorns ${true.toString()}`);3810expectError(await execa`unicorns ${true}`);38113812expectError(execaSync());3813expectError(execaSync(true));3814expectError(execaSync(['unicorns', 'arg']));3815expectType<ExecaSyncResult<{}>>(execaSync('unicorns'));3816expectType<ExecaSyncResult<{}>>(execaSync(fileUrl));3817expectType<ExecaSyncResult<{}>>(execaSync('unicorns', []));3818expectType<ExecaSyncResult<{}>>(execaSync('unicorns', ['foo']));3819expectType<ExecaSyncResult<{}>>(execaSync('unicorns', {}));3820expectType<ExecaSyncResult<{}>>(execaSync('unicorns', [], {}));3821expectError(execaSync('unicorns', 'foo'));3822expectError(execaSync('unicorns', [true]));3823expectError(execaSync('unicorns', [], []));3824expectError(execaSync('unicorns', {other: true}));3825expectType<ExecaSyncResult<{}>>(execaSync`unicorns`);3826expectAssignable<typeof execaSync>(execaSync({}));3827expectType<ExecaSyncResult<{}>>(execaSync({})('unicorns'));3828expectType<ExecaSyncResult<{}>>(execaSync({})`unicorns`);3829expectType<ExecaSyncResult<{}>>(execaSync('unicorns'));3830expectType<ExecaSyncResult<{}>>(execaSync`unicorns`);3831expectAssignable<{stdout: string}>(execaSync('unicorns'));3832expectAssignable<{stdout: Uint8Array}>(execaSync('unicorns', {encoding: 'buffer'}));3833expectAssignable<{stdout: string}>(execaSync('unicorns', ['foo']));3834expectAssignable<{stdout: Uint8Array}>(execaSync('unicorns', ['foo'], {encoding: 'buffer'}));3835expectAssignable<{stdout: string}>(execaSync({})('unicorns'));3836expectAssignable<{stdout: Uint8Array}>(execaSync({encoding: 'buffer'})('unicorns'));3837expectAssignable<{stdout: Uint8Array}>(execaSync({})({encoding: 'buffer'})('unicorns'));3838expectAssignable<{stdout: Uint8Array}>(execaSync({encoding: 'buffer'})({})('unicorns'));3839expectAssignable<{stdout: string}>(execaSync({})`unicorns`);3840expectAssignable<{stdout: Uint8Array}>(execaSync({encoding: 'buffer'})`unicorns`);3841expectAssignable<{stdout: Uint8Array}>(execaSync({})({encoding: 'buffer'})`unicorns`);3842expectAssignable<{stdout: Uint8Array}>(execaSync({encoding: 'buffer'})({})`unicorns`);3843expectType<ExecaSyncResult<{}>>(execaSync`${'unicorns'}`);3844expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${'foo'}`);3845expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${'foo'} ${'bar'}`);3846expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${1}`);3847expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${stringArray}`);3848expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${[1, 2]}`);3849expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${execaSync`echo foo`}`);3850expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${[execaSync`echo foo`, 'bar']}`);3851expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${false.toString()}`);3852expectError(execaSync`unicorns ${false}`);38533854expectError(execaCommand());3855expectError(execaCommand(true));3856expectError(execaCommand(['unicorns', 'arg']));3857expectAssignable<ExecaSubprocess>(execaCommand('unicorns'));3858expectError(execaCommand(fileUrl));3859expectError(execaCommand('unicorns', []));3860expectError(execaCommand('unicorns', ['foo']));3861expectAssignable<ExecaSubprocess>(execaCommand('unicorns', {}));3862expectError(execaCommand('unicorns', [], {}));3863expectError(execaCommand('unicorns', 'foo'));3864expectError(execaCommand('unicorns', [true]));3865expectError(execaCommand('unicorns', [], []));3866expectError(execaCommand('unicorns', {other: true}));3867expectAssignable<ExecaSubprocess>(execaCommand`unicorns`);3868expectAssignable<typeof execaCommand>(execaCommand({}));3869expectAssignable<ExecaSubprocess>(execaCommand({})('unicorns'));3870expectAssignable<ExecaSubprocess>(execaCommand({})`unicorns`);3871expectType<ExecaResult<{}>>(await execaCommand('unicorns'));3872expectType<ExecaResult<{}>>(await execaCommand`unicorns`);3873expectAssignable<{stdout: string}>(await execaCommand('unicorns'));3874expectAssignable<{stdout: Uint8Array}>(await execaCommand('unicorns', {encoding: 'buffer'}));3875expectAssignable<{stdout: string}>(await execaCommand({})('unicorns'));3876expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})('unicorns'));3877expectAssignable<{stdout: Uint8Array}>(await execaCommand({})({encoding: 'buffer'})('unicorns'));3878expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})({})('unicorns'));3879expectAssignable<{stdout: string}>(await execaCommand({})`unicorns`);3880expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})`unicorns`);3881expectAssignable<{stdout: Uint8Array}>(await execaCommand({})({encoding: 'buffer'})`unicorns`);3882expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})({})`unicorns`);3883expectType<ExecaResult<{}>>(await execaCommand`${'unicorns'}`);3884expectType<ExecaResult<{}>>(await execaCommand`unicorns ${'foo'}`);3885expectError(await execaCommand`unicorns ${'foo'} ${'bar'}`);3886expectError(await execaCommand`unicorns ${1}`);3887expectError(await execaCommand`unicorns ${stringArray}`);3888expectError(await execaCommand`unicorns ${[1, 2]}`);3889expectError(await execaCommand`unicorns ${await execaCommand`echo foo`}`);3890expectError(await execaCommand`unicorns ${execaCommand`echo foo`}`);3891expectError(await execaCommand`unicorns ${[await execaCommand`echo foo`, 'bar']}`);3892expectError(await execaCommand`unicorns ${[execaCommand`echo foo`, 'bar']}`);3893expectType<ExecaResult<{}>>(await execaCommand`unicorns ${true.toString()}`);3894expectError(await execaCommand`unicorns ${true}`);38953896expectError(execaCommandSync());3897expectError(execaCommandSync(true));3898expectError(execaCommandSync(['unicorns', 'arg']));3899expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns'));3900expectError(execaCommandSync(fileUrl));3901expectError(execaCommandSync('unicorns', []));3902expectError(execaCommandSync('unicorns', ['foo']));3903expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns', {}));3904expectError(execaCommandSync('unicorns', [], {}));3905expectError(execaCommandSync('unicorns', 'foo'));3906expectError(execaCommandSync('unicorns', [true]));3907expectError(execaCommandSync('unicorns', [], []));3908expectError(execaCommandSync('unicorns', {other: true}));3909expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns`);3910expectAssignable<typeof execaCommandSync>(execaCommandSync({}));3911expectType<ExecaSyncResult<{}>>(execaCommandSync({})('unicorns'));3912expectType<ExecaSyncResult<{}>>(execaCommandSync({})`unicorns`);3913expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns'));3914expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns`);3915expectAssignable<{stdout: string}>(execaCommandSync('unicorns'));3916expectAssignable<{stdout: Uint8Array}>(execaCommandSync('unicorns', {encoding: 'buffer'}));3917expectAssignable<{stdout: string}>(execaCommandSync({})('unicorns'));3918expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})('unicorns'));3919expectAssignable<{stdout: Uint8Array}>(execaCommandSync({})({encoding: 'buffer'})('unicorns'));3920expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})({})('unicorns'));3921expectAssignable<{stdout: string}>(execaCommandSync({})`unicorns`);3922expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})`unicorns`);3923expectAssignable<{stdout: Uint8Array}>(execaCommandSync({})({encoding: 'buffer'})`unicorns`);3924expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})({})`unicorns`);3925expectType<ExecaSyncResult<{}>>(execaCommandSync`${'unicorns'}`);3926expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns ${'foo'}`);3927expectError(execaCommandSync`unicorns ${'foo'} ${'bar'}`);3928expectError(execaCommandSync`unicorns ${1}`);3929expectError(execaCommandSync`unicorns ${stringArray}`);3930expectError(execaCommandSync`unicorns ${[1, 2]}`);3931expectError(execaCommandSync`unicorns ${execaCommandSync`echo foo`}`);3932expectError(execaCommandSync`unicorns ${[execaCommandSync`echo foo`, 'bar']}`);3933expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns ${false.toString()}`);3934expectError(execaCommandSync`unicorns ${false}`);39353936expectError($());3937expectError($(true));3938expectError($(['unicorns', 'arg']));3939expectAssignable<ExecaSubprocess>($('unicorns'));3940expectAssignable<ExecaSubprocess>($(fileUrl));3941expectAssignable<ExecaSubprocess>($('unicorns', []));3942expectAssignable<ExecaSubprocess>($('unicorns', ['foo']));3943expectAssignable<ExecaSubprocess>($('unicorns', {}));3944expectAssignable<ExecaSubprocess>($('unicorns', [], {}));3945expectError($('unicorns', 'foo'));3946expectError($('unicorns', [true]));3947expectError($('unicorns', [], []));3948expectError($('unicorns', {other: true}));3949expectAssignable<ExecaSubprocess>($`unicorns`);3950expectAssignable<typeof $>($({}));3951expectAssignable<ExecaSubprocess>($({})('unicorns'));3952expectAssignable<ExecaSubprocess>($({})`unicorns`);3953expectType<ExecaResult<{}>>(await $('unicorns'));3954expectType<ExecaResult<{}>>(await $`unicorns`);3955expectAssignable<{stdout: string}>(await $('unicorns'));3956expectAssignable<{stdout: Uint8Array}>(await $('unicorns', {encoding: 'buffer'}));3957expectAssignable<{stdout: string}>(await $('unicorns', ['foo']));3958expectAssignable<{stdout: Uint8Array}>(await $('unicorns', ['foo'], {encoding: 'buffer'}));3959expectAssignable<{stdout: string}>(await $({})('unicorns'));3960expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})('unicorns'));3961expectAssignable<{stdout: Uint8Array}>(await $({})({encoding: 'buffer'})('unicorns'));3962expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})({})('unicorns'));3963expectAssignable<{stdout: string}>(await $({})`unicorns`);3964expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})`unicorns`);3965expectAssignable<{stdout: Uint8Array}>(await $({})({encoding: 'buffer'})`unicorns`);3966expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})({})`unicorns`);3967expectType<ExecaResult<{}>>(await $`${'unicorns'}`);3968expectType<ExecaResult<{}>>(await $`unicorns ${'foo'}`);3969expectType<ExecaResult<{}>>(await $`unicorns ${'foo'} ${'bar'}`);3970expectType<ExecaResult<{}>>(await $`unicorns ${1}`);3971expectType<ExecaResult<{}>>(await $`unicorns ${stringArray}`);3972expectType<ExecaResult<{}>>(await $`unicorns ${[1, 2]}`);3973expectType<ExecaResult<{}>>(await $`unicorns ${await $`echo foo`}`);3974expectError(await $`unicorns ${$`echo foo`}`);3975expectType<ExecaResult<{}>>(await $`unicorns ${[await $`echo foo`, 'bar']}`);3976expectError(await $`unicorns ${[$`echo foo`, 'bar']}`);3977expectType<ExecaResult<{}>>(await $`unicorns ${true.toString()}`);3978expectError(await $`unicorns ${true}`);39793980expectError($.sync());3981expectError($.sync(true));3982expectError($.sync(['unicorns', 'arg']));3983expectType<ExecaSyncResult<{}>>($.sync('unicorns'));3984expectType<ExecaSyncResult<{}>>($.sync(fileUrl));3985expectType<ExecaSyncResult<{}>>($.sync('unicorns', []));3986expectType<ExecaSyncResult<{}>>($.sync('unicorns', ['foo']));3987expectType<ExecaSyncResult<{}>>($.sync('unicorns', {}));3988expectType<ExecaSyncResult<{}>>($.sync('unicorns', [], {}));3989expectError($.sync('unicorns', 'foo'));3990expectError($.sync('unicorns', [true]));3991expectError($.sync('unicorns', [], []));3992expectError($.sync('unicorns', {other: true}));3993expectType<ExecaSyncResult<{}>>($.sync`unicorns`);3994expectAssignable<typeof $.sync>($.sync({}));3995expectType<ExecaSyncResult<{}>>($.sync({})('unicorns'));3996expectType<ExecaSyncResult<{}>>($({}).sync('unicorns'));3997expectType<ExecaSyncResult<{}>>($.sync({})`unicorns`);3998expectType<ExecaSyncResult<{}>>($({}).sync`unicorns`);3999expectType<ExecaSyncResult<{}>>($.sync('unicorns'));4000expectType<ExecaSyncResult<{}>>($.sync`unicorns`);4001expectAssignable<{stdout: string}>($.sync('unicorns'));4002expectAssignable<{stdout: Uint8Array}>($.sync('unicorns', {encoding: 'buffer'}));4003expectAssignable<{stdout: string}>($.sync('unicorns', ['foo']));4004expectAssignable<{stdout: Uint8Array}>($.sync('unicorns', ['foo'], {encoding: 'buffer'}));4005expectAssignable<{stdout: string}>($.sync({})('unicorns'));4006expectAssignable<{stdout: string}>($({}).sync('unicorns'));4007expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})('unicorns'));4008expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync('unicorns'));4009expectAssignable<{stdout: Uint8Array}>($.sync({})({encoding: 'buffer'})('unicorns'));4010expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).sync('unicorns'));4011expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})({})('unicorns'));4012expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync({})('unicorns'));4013expectAssignable<{stdout: string}>($.sync({})`unicorns`);4014expectAssignable<{stdout: string}>($({}).sync`unicorns`);4015expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})`unicorns`);4016expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync`unicorns`);4017expectAssignable<{stdout: Uint8Array}>($.sync({})({encoding: 'buffer'})`unicorns`);4018expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).sync`unicorns`);4019expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})({})`unicorns`);4020expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync({})`unicorns`);4021expectType<ExecaSyncResult<{}>>($.sync`${'unicorns'}`);4022expectType<ExecaSyncResult<{}>>($.sync`unicorns ${'foo'}`);4023expectType<ExecaSyncResult<{}>>($.sync`unicorns ${'foo'} ${'bar'}`);4024expectType<ExecaSyncResult<{}>>($.sync`unicorns ${1}`);4025expectType<ExecaSyncResult<{}>>($.sync`unicorns ${stringArray}`);4026expectType<ExecaSyncResult<{}>>($.sync`unicorns ${[1, 2]}`);4027expectType<ExecaSyncResult<{}>>($.sync`unicorns ${$.sync`echo foo`}`);4028expectType<ExecaSyncResult<{}>>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);4029expectType<ExecaSyncResult<{}>>($.sync`unicorns ${false.toString()}`);4030expectError($.sync`unicorns ${false}`);40314032expectError($.s());4033expectError($.s(true));4034expectError($.s(['unicorns', 'arg']));4035expectType<ExecaSyncResult<{}>>($.s('unicorns'));4036expectType<ExecaSyncResult<{}>>($.s(fileUrl));4037expectType<ExecaSyncResult<{}>>($.s('unicorns', []));4038expectType<ExecaSyncResult<{}>>($.s('unicorns', ['foo']));4039expectType<ExecaSyncResult<{}>>($.s('unicorns', {}));4040expectType<ExecaSyncResult<{}>>($.s('unicorns', [], {}));4041expectError($.s('unicorns', 'foo'));4042expectError($.s('unicorns', [true]));4043expectError($.s('unicorns', [], []));4044expectError($.s('unicorns', {other: true}));4045expectType<ExecaSyncResult<{}>>($.s`unicorns`);4046expectAssignable<typeof $.s>($.s({}));4047expectType<ExecaSyncResult<{}>>($.s({})('unicorns'));4048expectType<ExecaSyncResult<{}>>($({}).s('unicorns'));4049expectType<ExecaSyncResult<{}>>($.s({})`unicorns`);4050expectType<ExecaSyncResult<{}>>($({}).s`unicorns`);4051expectType<ExecaSyncResult<{}>>($.s('unicorns'));4052expectType<ExecaSyncResult<{}>>($.s`unicorns`);4053expectAssignable<{stdout: string}>($.s('unicorns'));4054expectAssignable<{stdout: Uint8Array}>($.s('unicorns', {encoding: 'buffer'}));4055expectAssignable<{stdout: string}>($.s('unicorns', ['foo']));4056expectAssignable<{stdout: Uint8Array}>($.s('unicorns', ['foo'], {encoding: 'buffer'}));4057expectAssignable<{stdout: string}>($.s({})('unicorns'));4058expectAssignable<{stdout: string}>($({}).s('unicorns'));4059expectAssignable<{stdout: Uint8Array}>($.s({encoding: 'buffer'})('unicorns'));4060expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).s('unicorns'));4061expectAssignable<{stdout: Uint8Array}>($.s({})({encoding: 'buffer'})('unicorns'));4062expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).s('unicorns'));4063expectAssignable<{stdout: Uint8Array}>($.s({encoding: 'buffer'})({})('unicorns'));4064expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).s({})('unicorns'));4065expectAssignable<{stdout: string}>($.s({})`unicorns`);4066expectAssignable<{stdout: string}>($({}).s`unicorns`);4067expectAssignable<{stdout: Uint8Array}>($.s({encoding: 'buffer'})`unicorns`);4068expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).s`unicorns`);4069expectAssignable<{stdout: Uint8Array}>($.s({})({encoding: 'buffer'})`unicorns`);4070expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).s`unicorns`);4071expectAssignable<{stdout: Uint8Array}>($.s({encoding: 'buffer'})({})`unicorns`);4072expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).s({})`unicorns`);4073expectType<ExecaSyncResult<{}>>($.s`${'unicorns'}`);4074expectType<ExecaSyncResult<{}>>($.s`unicorns ${'foo'}`);4075expectType<ExecaSyncResult<{}>>($.s`unicorns ${'foo'} ${'bar'}`);4076expectType<ExecaSyncResult<{}>>($.s`unicorns ${1}`);4077expectType<ExecaSyncResult<{}>>($.s`unicorns ${stringArray}`);4078expectType<ExecaSyncResult<{}>>($.s`unicorns ${[1, 2]}`);4079expectType<ExecaSyncResult<{}>>($.s`unicorns ${$.s`echo foo`}`);4080expectType<ExecaSyncResult<{}>>($.s`unicorns ${[$.s`echo foo`, 'bar']}`);4081expectType<ExecaSyncResult<{}>>($.s`unicorns ${false.toString()}`);4082expectError($.s`unicorns ${false}`);40834084expectError(execaNode());4085expectError(execaNode(true));4086expectError(execaNode(['unicorns', 'arg']));4087expectAssignable<ExecaSubprocess>(execaNode('unicorns'));4088expectAssignable<ExecaSubprocess>(execaNode(fileUrl));4089expectAssignable<ExecaSubprocess>(execaNode('unicorns', []));4090expectAssignable<ExecaSubprocess>(execaNode('unicorns', ['foo']));4091expectAssignable<ExecaSubprocess>(execaNode('unicorns', {}));4092expectAssignable<ExecaSubprocess>(execaNode('unicorns', [], {}));4093expectError(execaNode('unicorns', 'foo'));4094expectError(execaNode('unicorns', [true]));4095expectError(execaNode('unicorns', [], []));4096expectError(execaNode('unicorns', {other: true}));4097expectAssignable<ExecaSubprocess>(execaNode`unicorns`);4098expectAssignable<typeof execaNode>(execaNode({}));4099expectAssignable<ExecaSubprocess>(execaNode({})('unicorns'));4100expectAssignable<ExecaSubprocess>(execaNode({})`unicorns`);4101expectType<ExecaResult<{}>>(await execaNode('unicorns'));4102expectType<ExecaResult<{}>>(await execaNode`unicorns`);4103expectAssignable<{stdout: string}>(await execaNode('unicorns'));4104expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {encoding: 'buffer'}));4105expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo']));4106expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', ['foo'], {encoding: 'buffer'}));4107expectAssignable<{stdout: string}>(await execaNode({})('unicorns'));4108expectAssignable<{stdout: Uint8Array}>(await execaNode({encoding: 'buffer'})('unicorns'));4109expectAssignable<{stdout: Uint8Array}>(await execaNode({})({encoding: 'buffer'})('unicorns'));4110expectAssignable<{stdout: Uint8Array}>(await execaNode({encoding: 'buffer'})({})('unicorns'));4111expectAssignable<{stdout: string}>(await execaNode({})`unicorns`);4112expectAssignable<{stdout: Uint8Array}>(await execaNode({encoding: 'buffer'})`unicorns`);4113expectAssignable<{stdout: Uint8Array}>(await execaNode({})({encoding: 'buffer'})`unicorns`);4114expectAssignable<{stdout: Uint8Array}>(await execaNode({encoding: 'buffer'})({})`unicorns`);4115expectType<ExecaResult<{}>>(await execaNode`${'unicorns'}`);4116expectType<ExecaResult<{}>>(await execaNode`unicorns ${'foo'}`);4117expectType<ExecaResult<{}>>(await execaNode`unicorns ${'foo'} ${'bar'}`);4118expectType<ExecaResult<{}>>(await execaNode`unicorns ${1}`);4119expectType<ExecaResult<{}>>(await execaNode`unicorns ${stringArray}`);4120expectType<ExecaResult<{}>>(await execaNode`unicorns ${[1, 2]}`);4121expectType<ExecaResult<{}>>(await execaNode`unicorns ${await execaNode`echo foo`}`);4122expectError(await execaNode`unicorns ${execaNode`echo foo`}`);4123expectType<ExecaResult<{}>>(await execaNode`unicorns ${[await execaNode`echo foo`, 'bar']}`);4124expectError(await execaNode`unicorns ${[execaNode`echo foo`, 'bar']}`);4125expectType<ExecaResult<{}>>(await execaNode`unicorns ${true.toString()}`);4126expectError(await execaNode`unicorns ${true}`);41274128expectAssignable<ExecaSubprocess>(execaNode('unicorns', {nodePath: './node'}));4129expectAssignable<ExecaSubprocess>(execaNode('unicorns', {nodePath: fileUrl}));4130expectAssignable<{stdout: string}>(await execaNode('unicorns', {nodeOptions: ['--async-stack-traces']}));4131expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));4132expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces']}));4133expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));
modified:package.json+3 added-2 removed
23 unmodified lines
24 },25 "files": [26 "index.js",27 "index.d.ts",28 "lib"28 "lib",29 "types"30 ],31 "keywords": [32 "exec",33 "child",
54 unmodified lines
88 },89 "ava": {90 "workerThreads": false,91 "concurrency": 1,91 "timeout": "120s"92 "timeout": "240s"93 },94 "xo": {95 "rules": {96 "unicorn/no-empty-file": "off",
4 unmodified lines