// Type definitions for execa 0.7 // Project: https://github.com/sindresorhus/execa#readme // Definitions by: Douglas Duteil // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// import { ChildProcess, ExecOptions, SpawnOptions, SpawnSyncOptions } from "child_process"; import { Stream } from 'stream'; type StdIOOption = 'pipe' | 'ipc' | 'ignore' | number | Stream | undefined | null; interface ExecaOptions { input: string | Buffer | Stream; preferLocal: boolean; stripEof: boolean; extendEnv: boolean; argv0: string; localDir: string; reject: boolean; cleanup: boolean; stdin: StdIOOption; stdout: StdIOOption; stderr: StdIOOption; } type Options = SpawnOptions & ExecaOptions & ExecOptions; type SyncOptions = SpawnSyncOptions & ExecaOptions & ExecOptions; interface ExecaReturns { cmd: string; code: number; failed: boolean; killed: boolean; signal: string | null; stderr: string; stdout: string; timedOut: boolean; } type ExecaError = Error & ExecaReturns; interface ExecaChildPromise { catch(onrejected?: ((reason: ExecaError) => TResult | PromiseLike) | undefined | null): Promise; } type ExecaChildProcess = ChildProcess & ExecaChildPromise & Promise; declare function execa(file: string, options?: Partial): ExecaChildProcess; declare function execa(file: string, args?: string[], options?: Partial): ExecaChildProcess; declare namespace execa { function stdout(file: string, options?: Partial): Promise; function stdout(file: string, args?: string[], options?: Partial): Promise; function stderr(file: string, options?: Partial): Promise; function stderr(file: string, args?: string[], options?: Partial): Promise; function shell(command: string, options?: Partial): ExecaChildProcess; function sync(file: string, options?: Partial): ExecaReturns; function sync(file: string, args?: string[], options?: Partial): ExecaReturns; function shellSync(command: string, options?: Partial): ExecaReturns; } export = execa;