Limit breaking changes with types (#682)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by GitHub · parent add2f65 · Browse files · 2 files·+96 added−89 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+96 added−89 removed
- other:+96 added−89 removed
Provenance
- Commit
73f4b8c- Tree
fe49b7a- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
add2f65
2 files changed+96 added−89 removed
modified:index.d.ts+42 added-35 removed
81 unmodified lines82 83 // Whether `result.stdout|stderr|all` is `undefined`, excluding the `buffer` option84 type IgnoresStreamResult<85 StreamIndex extends string,86- OptionsType extends Options = Options,86+ OptionsType extends CommonOptions = CommonOptions,87 // `result.stdin` is always `undefined`88 > = StreamIndex extends '0' ? true89 // When using `stdout|stderr: 'inherit'`, or `'ignore'`, etc. , `result.std*` is `undefined`90 : OptionsType[TupleItem<StdioOptionNames, StreamIndex>] extends NoOutputStdioOption ? true22 unmodified lines113 114 // Whether `result.stdout|stderr|all` is `undefined`115 type IgnoresStreamOutput<116 StreamIndex extends string,117- OptionsType extends Options = Options,117+ OptionsType extends CommonOptions = CommonOptions,118 > = OptionsType extends {buffer: false} ? true119 : IgnoresStreamResult<StreamIndex, OptionsType> extends true ? true : false;120 121 // Type of `result.stdout|stderr`122 type StdioOutput<123 StreamIndex extends string,124- OptionsType extends Options = Options,124+ OptionsType extends CommonOptions = CommonOptions,125 > = IgnoresStreamOutput<StreamIndex, OptionsType> extends true126 ? undefined127 : StreamResult<OptionsType>;128 129-type StreamResult<OptionsType extends Options = Options> =129+type StreamResult<OptionsType extends CommonOptions = CommonOptions> =130 // Default value for `encoding`, when `OptionsType` is `{}`131 unknown extends OptionsType['encoding'] ? string132 // Any value for `encoding`, when `OptionsType` is `Options`133 : EncodingOption extends OptionsType['encoding'] ? Uint8Array | string7 unmodified lines141 ? StdioOutput<'2', OptionsType>142 : StdioOutput<'1', OptionsType>;143 144 // Type of `result.stdio`145-type StdioArrayOutput<OptionsType extends Options = Options> = MapStdioOptions<145+type StdioArrayOutput<OptionsType extends CommonOptions = CommonOptions> = MapStdioOptions<146 OptionsType['stdio'] extends StdioOptionsArray ? OptionsType['stdio'] : ['pipe', 'pipe', 'pipe'],147 OptionsType148 >;149 150 type MapStdioOptions<151 StdioOptionsArrayType extends StdioOptionsArray,152- OptionsType extends Options = Options,152+ OptionsType extends CommonOptions = CommonOptions,153 > = {154 [StreamIndex in keyof StdioOptionsArrayType]: StdioOutput<155 StreamIndex extends string ? StreamIndex : string,156 OptionsType157 >158 };159 160+type StricterOptions<161+ WideOptions extends CommonOptions,162+ StrictOptions extends CommonOptions,163+> = keyof WideOptions extends never ? {} : WideOptions & StrictOptions;164+160-export type Options<IsSync extends boolean = boolean> = {165+type CommonOptions<IsSync extends boolean = boolean> = {166 /**167 Prefer locally installed binaries when looking for a binary to execute.168 169 If you `$ npm install foo`, you can then `execa('foo')`.288 unmodified lines458 */459 readonly signal?: AbortSignal;460 });461 462+export type Options = CommonOptions<false>;457-export type SyncOptions = Options<true>;463+export type SyncOptions = CommonOptions<true>;464 465 export type NodeOptions<OptionsType extends Options = Options> = {466 /**467 The Node.js executable to use.19 unmodified lines487 - timing out488 - being canceled489 - there's not enough memory or there are already too many child processes490 */485-export type ExecaReturnValue<IsSync extends boolean = boolean, OptionsType extends Options = Options> = {491+type ExecaCommonReturnValue<IsSync extends boolean = boolean, OptionsType extends CommonOptions = CommonOptions> = {492 /**493 The file and arguments that were run, for logging purposes.494 495 This is not escaped and should not be executed directly as a process, including using `execa()` or `execaCommand()`.90 unmodified lines586 */587 all?: AllOutput<OptionsType>;588 });589 584-export type ExecaSyncReturnValue<OptionsType extends Options = Options> = ExecaReturnValue<true, OptionsType>;590+export type ExecaReturnValue<OptionsType extends Options = Options> = ExecaCommonReturnValue<false, OptionsType>;591+export type ExecaSyncReturnValue<OptionsType extends SyncOptions = SyncOptions> = ExecaCommonReturnValue<true, OptionsType>;592 586-export type ExecaError<IsSync extends boolean = boolean, OptionsType extends Options = Options> = {593+type ExecaCommonError = {594 /**595 Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.596 597 The child process `stderr`, `stdout` and other file descriptors' output are appended to the end, separated with newlines and not interleaved.10 unmodified lines608 609 This is `undefined` unless the child process exited due to an `error` event or a timeout.610 */611 originalMessage?: string;605-} & Error & ExecaReturnValue<IsSync, OptionsType>;612+} & Error;613 607-export type ExecaSyncError<OptionsType extends Options = Options> = ExecaError<true, OptionsType>;614+export type ExecaError<OptionsType extends Options = Options> = ExecaCommonError & ExecaReturnValue<OptionsType>;615+export type ExecaSyncError<OptionsType extends SyncOptions = SyncOptions> = ExecaCommonError & ExecaSyncReturnValue<OptionsType>;616 617 export type KillOptions = {618 /**619 Milliseconds to wait for the child process to terminate before sending `SIGKILL`.15 unmodified lines635 */636 all?: Readable;637 638 catch<ResultType = never>(631- onRejected?: (reason: ExecaError<false, OptionsType>) => ResultType | PromiseLike<ResultType>632- ): Promise<ExecaReturnValue<false, OptionsType> | ResultType>;639+ onRejected?: (reason: ExecaError<OptionsType>) => ResultType | PromiseLike<ResultType>640+ ): Promise<ExecaReturnValue<OptionsType> | ResultType>;641 642 /**643 Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`. Note that this graceful termination does not work on Windows, because Windows [doesn't support signals](https://nodejs.org/api/process.html#process_signal_events) (`SIGKILL` and `SIGTERM` has the same effect of force-killing the process immediately.) If you want to achieve graceful termination on Windows, you have to use other means, such as [`taskkill`](https://github.com/sindresorhus/taskkill).644 */35 unmodified lines680 };681 682 export type ExecaChildProcess<OptionsType extends Options = Options> = ChildProcess &683 ExecaChildPromise<OptionsType> &676-Promise<ExecaReturnValue<false, OptionsType>>;684+Promise<ExecaReturnValue<OptionsType>>;685 686 /**687 Executes a command using `file ...arguments`. `file` is a string or a file URL. `arguments` are an array of strings. Returns a `childProcess`.688 104 unmodified lines793 });794 }, 1000);795 ```796 */789-export function execa<OptionsType extends Options<false> = {}>(797+export function execa<OptionsType extends Options = {}>(798 file: string | URL,799 arguments?: readonly string[],800 options?: OptionsType,801 ): ExecaChildProcess<OptionsType>;794-export function execa<OptionsType extends Options<false> = {}>(802+export function execa<OptionsType extends Options = {}>(803 file: string | URL,804 options?: OptionsType,805 ): ExecaChildProcess<OptionsType>;806 58 unmodified lines865 \*\/866 }867 ```868 */861-export function execaSync<OptionsType extends Options<true> = {}>(869+export function execaSync<OptionsType extends SyncOptions = {}>(870 file: string | URL,871 arguments?: readonly string[],872 options?: OptionsType,865-): ExecaReturnValue<true, OptionsType>;866-export function execaSync<OptionsType extends Options<true> = {}>(873+): ExecaSyncReturnValue<OptionsType>;874+export function execaSync<OptionsType extends SyncOptions = {}>(875 file: string | URL,876 options?: OptionsType,869-): ExecaReturnValue<true, OptionsType>;877+): ExecaSyncReturnValue<OptionsType>;878 879 /**880 Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a `childProcess`.881 15 unmodified lines897 console.log(stdout);898 //=> 'unicorns'899 ```900 */893-export function execaCommand<OptionsType extends Options<false> = {}>(901+export function execaCommand<OptionsType extends Options = {}>(902 command: string,903 options?: OptionsType904 ): ExecaChildProcess<OptionsType>;905 14 unmodified lines920 console.log(stdout);921 //=> 'unicorns'922 ```923 */916-export function execaCommandSync<OptionsType extends Options<true> = {}>(924+export function execaCommandSync<OptionsType extends SyncOptions = {}>(925 command: string,926 options?: OptionsType919-): ExecaReturnValue<true, OptionsType>;927+): ExecaSyncReturnValue<OptionsType>;928 921-type TemplateExpression = string | number | ExecaReturnValue922-| Array<string | number | ExecaReturnValue>;929+type TemplateExpression = string | number | ExecaCommonReturnValue930+| Array<string | number | ExecaCommonReturnValue>;931 924-type Execa$<OptionsType extends Options = {}> = {932+type Execa$<OptionsType extends CommonOptions = {}> = {933 /**934 Returns a new instance of `$` but with different default `options`. Consecutive calls are merged to previous ones.935 936 This can be used to either:15 unmodified lines952 await $$`echo rainbows`;953 //=> 'rainbows'954 ```955 */948- <NewOptionsType extends Options = {}>956+ <NewOptionsType extends CommonOptions = {}>957 (options: NewOptionsType):958 Execa$<OptionsType & NewOptionsType>;959 952- <NewOptionsType extends Options = {}>960 (templates: TemplateStringsArray, ...expressions: TemplateExpression[]):954- ExecaChildProcess<OptionsType & NewOptionsType>;961+ ExecaChildProcess<StricterOptions<OptionsType, Options>>;962 963 /**964 Same as $\`command\` but synchronous.965 43 unmodified lines1009 */1010 sync(1011 templates: TemplateStringsArray,1012 ...expressions: TemplateExpression[]1006- ): ExecaReturnValue<true, OptionsType>;1013+ ): ExecaSyncReturnValue<StricterOptions<OptionsType, SyncOptions>>;1014 1015 /**1016 Same as $\`command\` but synchronous.1017 43 unmodified lines1061 */1062 s(1063 templates: TemplateStringsArray,1064 ...expressions: TemplateExpression[]1058- ): ExecaReturnValue<true, OptionsType>;1065+ ): ExecaSyncReturnValue<StricterOptions<OptionsType, SyncOptions>>;1066 };1067 1068 /**1069 Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a `childProcess`.75 unmodified lines1145 1146 await execaNode('scriptPath', ['argument']);1147 ```1148 */1142-export function execaNode<OptionsType extends NodeOptions<Options<false>> = {}>(1149+export function execaNode<OptionsType extends NodeOptions = {}>(1150 scriptPath: string | URL,1151 arguments?: readonly string[],1152 options?: OptionsType1153 ): ExecaChildProcess<OptionsType>;1147-export function execaNode<OptionsType extends NodeOptions<Options<false>> = {}>(1154+export function execaNode<OptionsType extends NodeOptions = {}>(1155 scriptPath: string | URL,1156 options?: OptionsType1157 ): ExecaChildProcess<OptionsType>;modified:index.test-d.ts+54 added-54 removed
238 unmodified lines239 240 const ignoreFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});241 expectType<undefined>(ignoreFd3Result.stdio[3]);242 } catch (error: unknown) {243- const execaError = error as ExecaError<false>;243+ const execaError = error as ExecaError;244 245 expectType<string>(execaError.message);246 expectType<number | undefined>(execaError.exitCode);247 expectType<boolean>(execaError.failed);7 unmodified lines255 expectType<string | undefined>(execaError.originalMessage);256 257 expectType<undefined>(execaError.stdio[0]);258 259- const execaStringError = error as ExecaError<false, {}>;259+ const execaStringError = error as ExecaError<{}>;260 expectType<string>(execaStringError.stdout);261 expectType<string>(execaStringError.stdio[1]);262 expectType<string>(execaStringError.stderr);263 expectType<string>(execaStringError.stdio[2]);264 expectType<string | undefined>(execaStringError.all);265 266- const execaBufferError = error as ExecaError<false, {encoding: 'buffer'}>;266+ const execaBufferError = error as ExecaError<{encoding: 'buffer'}>;267 expectType<Uint8Array>(execaBufferError.stdout);268 expectType<Uint8Array>(execaBufferError.stdio[1]);269 expectType<Uint8Array>(execaBufferError.stderr);270 expectType<Uint8Array>(execaBufferError.stdio[2]);271 expectType<Uint8Array | undefined>(execaBufferError.all);272 273- const noBufferError = error as ExecaError<false, {buffer: false}>;273+ const noBufferError = error as ExecaError<{buffer: false}>;274 expectType<undefined>(noBufferError.stdout);275 expectType<undefined>(noBufferError.stdio[1]);276 expectType<undefined>(noBufferError.stderr);277 expectType<undefined>(noBufferError.stdio[2]);278 expectType<undefined>(noBufferError.all);279 280- const ignoreStdoutError = error as ExecaError<false, {stdout: 'ignore'}>;280+ const ignoreStdoutError = error as ExecaError<{stdout: 'ignore'}>;281 expectType<undefined>(ignoreStdoutError.stdout);282 expectType<undefined>(ignoreStdoutError.stdio[1]);283 expectType<string>(ignoreStdoutError.stderr);284 expectType<string>(ignoreStdoutError.stdio[2]);285 expectType<string | undefined>(ignoreStdoutError.all);286 287- const ignoreStderrError = error as ExecaError<false, {stderr: 'ignore'}>;287+ const ignoreStderrError = error as ExecaError<{stderr: 'ignore'}>;288 expectType<string>(ignoreStderrError.stdout);289 expectType<undefined>(ignoreStderrError.stderr);290 expectType<string | undefined>(ignoreStderrError.all);291 292- const inheritStdoutError = error as ExecaError<false, {stdout: 'inherit'}>;292+ const inheritStdoutError = error as ExecaError<{stdout: 'inherit'}>;293 expectType<undefined>(inheritStdoutError.stdout);294 expectType<string>(inheritStdoutError.stderr);295 expectType<string | undefined>(inheritStdoutError.all);296 297- const inheritStderrError = error as ExecaError<false, {stderr: 'inherit'}>;297+ const inheritStderrError = error as ExecaError<{stderr: 'inherit'}>;298 expectType<string>(inheritStderrError.stdout);299 expectType<undefined>(inheritStderrError.stderr);300 expectType<string | undefined>(inheritStderrError.all);301 302- const ipcStdoutError = error as ExecaError<false, {stdout: 'ipc'}>;302+ const ipcStdoutError = error as ExecaError<{stdout: 'ipc'}>;303 expectType<undefined>(ipcStdoutError.stdout);304 expectType<string>(ipcStdoutError.stderr);305 expectType<string | undefined>(ipcStdoutError.all);306 307- const ipcStderrError = error as ExecaError<false, {stderr: 'ipc'}>;307+ const ipcStderrError = error as ExecaError<{stderr: 'ipc'}>;308 expectType<string>(ipcStderrError.stdout);309 expectType<undefined>(ipcStderrError.stderr);310 expectType<string | undefined>(ipcStderrError.all);311 312- const numberStdoutError = error as ExecaError<false, {stdout: 1}>;312+ const numberStdoutError = error as ExecaError<{stdout: 1}>;313 expectType<undefined>(numberStdoutError.stdout);314 expectType<string>(numberStdoutError.stderr);315 expectType<string | undefined>(numberStdoutError.all);316 317- const numberStderrError = error as ExecaError<false, {stderr: 1}>;317+ const numberStderrError = error as ExecaError<{stderr: 1}>;318 expectType<string>(numberStderrError.stdout);319 expectType<undefined>(numberStderrError.stderr);320 expectType<string | undefined>(numberStderrError.all);321 322- const streamStdoutError = error as ExecaError<false, {stdout: typeof process.stdout}>;322+ const streamStdoutError = error as ExecaError<{stdout: typeof process.stdout}>;323 expectType<undefined>(streamStdoutError.stdout);324 expectType<string>(streamStdoutError.stderr);325 expectType<string | undefined>(streamStdoutError.all);326 327- const streamStderrError = error as ExecaError<false, {stderr: typeof process.stdout}>;327+ const streamStderrError = error as ExecaError<{stderr: typeof process.stdout}>;328 expectType<string>(streamStderrError.stdout);329 expectType<undefined>(streamStderrError.stderr);330 expectType<string | undefined>(streamStderrError.all);331 }71 unmodified lines403 expectType<string>(numberStderrResult.stdout);404 expectType<undefined>(numberStderrResult.stderr);405 expectError(numberStderrResult.all);406 } catch (error: unknown) {407- const execaError = error as ExecaError<true>;407+ const execaError = error as ExecaSyncError;408 409 expectType<ExecaSyncError>(execaError);410 expectType<string>(execaError.message);411 expectType<number | undefined>(execaError.exitCode);8 unmodified lines420 expectType<string | undefined>(execaError.originalMessage);421 422 expectType<undefined>(execaError.stdio[0]);423 424- const execaStringError = error as ExecaError<true, {}>;424+ const execaStringError = error as ExecaSyncError<{}>;425 expectType<string>(execaStringError.stdout);426 expectType<string>(execaStringError.stdio[1]);427 expectType<string>(execaStringError.stderr);428 expectType<string>(execaStringError.stdio[2]);429 expectError(execaStringError.all);430 431- const execaBufferError = error as ExecaError<true, {encoding: 'buffer'}>;431+ const execaBufferError = error as ExecaSyncError<{encoding: 'buffer'}>;432 expectType<Uint8Array>(execaBufferError.stdout);433 expectType<Uint8Array>(execaBufferError.stdio[1]);434 expectType<Uint8Array>(execaBufferError.stderr);435 expectType<Uint8Array>(execaBufferError.stdio[2]);436 expectError(execaBufferError.all);437 438- const ignoreStdoutError = error as ExecaError<true, {stdout: 'ignore'}>;438+ const ignoreStdoutError = error as ExecaSyncError<{stdout: 'ignore'}>;439 expectType<undefined>(ignoreStdoutError.stdout);440 expectType<undefined>(ignoreStdoutError.stdio[1]);441 expectType<string>(ignoreStdoutError.stderr);442 expectType<string>(ignoreStdoutError.stdio[2]);443 expectError(ignoreStdoutError.all);444 445- const ignoreStderrError = error as ExecaError<true, {stderr: 'ignore'}>;445+ const ignoreStderrError = error as ExecaSyncError<{stderr: 'ignore'}>;446 expectType<string>(ignoreStderrError.stdout);447 expectType<undefined>(ignoreStderrError.stderr);448 expectError(ignoreStderrError.all);449 450- const inheritStdoutError = error as ExecaError<true, {stdout: 'inherit'}>;450+ const inheritStdoutError = error as ExecaSyncError<{stdout: 'inherit'}>;451 expectType<undefined>(inheritStdoutError.stdout);452 expectType<string>(inheritStdoutError.stderr);453 expectError(inheritStdoutError.all);454 455- const inheritStderrError = error as ExecaError<true, {stderr: 'inherit'}>;455+ const inheritStderrError = error as ExecaSyncError<{stderr: 'inherit'}>;456 expectType<string>(inheritStderrError.stdout);457 expectType<undefined>(inheritStderrError.stderr);458 expectError(inheritStderrError.all);459 460- const ipcStdoutError = error as ExecaError<true, {stdout: 'ipc'}>;460+ const ipcStdoutError = error as ExecaSyncError<{stdout: 'ipc'}>;461 expectType<undefined>(ipcStdoutError.stdout);462 expectType<string>(ipcStdoutError.stderr);463 expectError(ipcStdoutError.all);464 465- const ipcStderrError = error as ExecaError<true, {stderr: 'ipc'}>;465+ const ipcStderrError = error as ExecaSyncError<{stderr: 'ipc'}>;466 expectType<string>(ipcStderrError.stdout);467 expectType<undefined>(ipcStderrError.stderr);468 expectError(ipcStderrError.all);469 470- const numberStdoutError = error as ExecaError<true, {stdout: 1}>;470+ const numberStdoutError = error as ExecaSyncError<{stdout: 1}>;471 expectType<undefined>(numberStdoutError.stdout);472 expectType<string>(numberStdoutError.stderr);473 expectError(numberStdoutError.all);474 475- const numberStderrError = error as ExecaError<true, {stderr: 1}>;475+ const numberStderrError = error as ExecaSyncError<{stderr: 1}>;476 expectType<string>(numberStderrError.stdout);477 expectType<undefined>(numberStderrError.stderr);478 expectError(numberStderrError.all);479 }438 unmodified lines918 919 expectError(execa(['unicorns', 'arg']));920 expectType<ExecaChildProcess>(execa('unicorns'));921 expectType<ExecaChildProcess>(execa(fileUrl));922-expectType<ExecaReturnValue<false>>(await execa('unicorns'));922+expectType<ExecaReturnValue>(await execa('unicorns'));923 expectAssignable<{stdout: string}>(await execa('unicorns'));924 expectAssignable<{stdout: Uint8Array}>(await execa('unicorns', {encoding: 'buffer'}));925 expectAssignable<{stdout: string}>(await execa('unicorns', ['foo']));926 expectAssignable<{stdout: Uint8Array}>(await execa('unicorns', ['foo'], {encoding: 'buffer'}));927 928 expectError(execaSync(['unicorns', 'arg']));929-expectAssignable<ExecaReturnValue<true>>(execaSync('unicorns'));930-expectAssignable<ExecaReturnValue<true>>(execaSync(fileUrl));929+expectAssignable<ExecaSyncReturnValue>(execaSync('unicorns'));930+expectAssignable<ExecaSyncReturnValue>(execaSync(fileUrl));931 expectAssignable<{stdout: string}>(execaSync('unicorns'));932 expectAssignable<{stdout: Uint8Array}>(execaSync('unicorns', {encoding: 'buffer'}));933 expectAssignable<{stdout: string}>(execaSync('unicorns', ['foo']));934 expectAssignable<{stdout: Uint8Array}>(execaSync('unicorns', ['foo'], {encoding: 'buffer'}));935 936 expectType<ExecaChildProcess>(execaCommand('unicorns'));937-expectType<ExecaReturnValue<false>>(await execaCommand('unicorns'));937+expectType<ExecaReturnValue>(await execaCommand('unicorns'));938 expectAssignable<{stdout: string}>(await execaCommand('unicorns'));939 expectAssignable<{stdout: Uint8Array}>(await execaCommand('unicorns', {encoding: 'buffer'}));940 expectAssignable<{stdout: string}>(await execaCommand('unicorns foo'));941 expectAssignable<{stdout: Uint8Array}>(await execaCommand('unicorns foo', {encoding: 'buffer'}));942 943-expectAssignable<ExecaReturnValue<true>>(execaCommandSync('unicorns'));943+expectAssignable<ExecaSyncReturnValue>(execaCommandSync('unicorns'));944 expectAssignable<{stdout: string}>(execaCommandSync('unicorns'));945 expectAssignable<{stdout: Uint8Array}>(execaCommandSync('unicorns', {encoding: 'buffer'}));946 expectAssignable<{stdout: string}>(execaCommandSync('unicorns foo'));947 expectAssignable<{stdout: Uint8Array}>(execaCommandSync('unicorns foo', {encoding: 'buffer'}));948 949 expectError(execaNode(['unicorns', 'arg']));950 expectType<ExecaChildProcess>(execaNode('unicorns'));951-expectType<ExecaReturnValue<false>>(await execaNode('unicorns'));952-expectType<ExecaReturnValue<false>>(await execaNode(fileUrl));951+expectType<ExecaReturnValue>(await execaNode('unicorns'));952+expectType<ExecaReturnValue>(await execaNode(fileUrl));953 expectAssignable<{stdout: string}>(await execaNode('unicorns'));954 expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {encoding: 'buffer'}));955 expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo']));956 expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', ['foo'], {encoding: 'buffer'}));5 unmodified lines962 expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));963 expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces']}));964 expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));965 966-expectType<ExecaChildProcess>($`unicorns`);967-expectType<ExecaReturnValue<false>>(await $`unicorns`);968-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns`);969-expectAssignable<ExecaReturnValue<true>>($.s`unicorns`);966+expectAssignable<ExecaChildProcess>($`unicorns`);967+expectAssignable<ExecaReturnValue>(await $`unicorns`);968+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns`);969+expectAssignable<ExecaSyncReturnValue>($.s`unicorns`);970 971 expectAssignable<ExecaChildProcess>($({})`unicorns`);972 expectAssignable<{stdout: string}>(await $({})`unicorns`);973 expectAssignable<{stdout: string}>($({}).sync`unicorns`);25 unmodified lines999 expectAssignable<ExecaChildProcess>($({})({encoding: 'buffer'})`unicorns foo`);1000 expectAssignable<{stdout: Uint8Array}>(await $({})({encoding: 'buffer'})`unicorns foo`);1001 expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).sync`unicorns foo`);1002 1003-expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${'foo'}`);1004-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${'foo'}`);1005-expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${1}`);1006-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${1}`);1007-expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${['foo', 'bar']}`);1008-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${['foo', 'bar']}`);1009-expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${[1, 2]}`);1010-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${[1, 2]}`);1011-expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${await $`echo foo`}`);1012-expectError<ExecaReturnValue<false>>(await $`unicorns ${$`echo foo`}`);1013-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${$.sync`echo foo`}`);1014-expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${[await $`echo foo`, 'bar']}`);1015-expectError<ExecaReturnValue<false>>(await $`unicorns ${[$`echo foo`, 'bar']}`);1016-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);1017-expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${true.toString()}`);1018-expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${false.toString()}`);1019-expectError<ExecaReturnValue<false>>(await $`unicorns ${true}`);1020-expectError<ExecaReturnValue<true>>($.sync`unicorns ${false}`);1003+expectAssignable<ExecaReturnValue>(await $`unicorns ${'foo'}`);1004+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${'foo'}`);1005+expectAssignable<ExecaReturnValue>(await $`unicorns ${1}`);1006+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${1}`);1007+expectAssignable<ExecaReturnValue>(await $`unicorns ${['foo', 'bar']}`);1008+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${['foo', 'bar']}`);1009+expectAssignable<ExecaReturnValue>(await $`unicorns ${[1, 2]}`);1010+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${[1, 2]}`);1011+expectAssignable<ExecaReturnValue>(await $`unicorns ${await $`echo foo`}`);1012+expectError<ExecaReturnValue>(await $`unicorns ${$`echo foo`}`);1013+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${$.sync`echo foo`}`);1014+expectAssignable<ExecaReturnValue>(await $`unicorns ${[await $`echo foo`, 'bar']}`);1015+expectError<ExecaReturnValue>(await $`unicorns ${[$`echo foo`, 'bar']}`);1016+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);1017+expectAssignable<ExecaReturnValue>(await $`unicorns ${true.toString()}`);1018+expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${false.toString()}`);1019+expectError<ExecaReturnValue>(await $`unicorns ${true}`);1020+expectError<ExecaSyncReturnValue>($.sync`unicorns ${false}`);