From f2cb86ff79657e5493f52f4a4b460d20a57fe1c5 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 21 Mar 2019 22:24:43 +0700 Subject: [PATCH] Tweak the TS definition --- index.d.ts | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/index.d.ts b/index.d.ts index 6f2a7b6f3..afb0175a2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -234,20 +234,20 @@ export interface ExecaReturnBase { killed: boolean; } -export interface ExecaSyncReturnValue - extends ExecaReturnBase { +export interface ExecaSyncReturnValue + extends ExecaReturnBase { /** The exit code of the process that was run. */ code: number; } -export interface ExecaReturnValue - extends ExecaSyncReturnValue { +export interface ExecaReturnValue + extends ExecaSyncReturnValue { /** The output of the process with `stdout` and `stderr` interleaved. */ - all: StdOutErrType; + all: StdoutErrorType; /** Whether the process was canceled. @@ -255,9 +255,9 @@ export interface ExecaReturnValue isCanceled: boolean; } -export interface ExecaSyncError +export interface ExecaSyncError extends Error, - ExecaReturnBase { + ExecaReturnBase { /** The error message. */ @@ -269,12 +269,12 @@ export interface ExecaSyncError code: number | string; } -export interface ExecaError - extends ExecaSyncError { +export interface ExecaError + extends ExecaSyncError { /** The output of the process with `stdout` and `stderr` interleaved. */ - all: StdOutErrType; + all: StdoutErrorType; /** Whether the process was canceled. @@ -282,14 +282,12 @@ export interface ExecaError isCanceled: boolean; } -export interface ExecaChildPromise { +export interface ExecaChildPromise { catch( onRejected?: - | (( - reason: ExecaError - ) => ResultType | PromiseLike) + | ((reason: ExecaError) => ResultType | PromiseLike) | null - ): Promise | ResultType>; + ): Promise | ResultType>; /** Cancel the subprocess. @@ -299,9 +297,9 @@ export interface ExecaChildPromise { cancel(): void; } -export type ExecaChildProcess = ChildProcess & - ExecaChildPromise & - Promise>; +export type ExecaChildProcess = ChildProcess & + ExecaChildPromise & + Promise>; declare const execa: { /**