// Type definitions for execa 0.6 // Project: https://github.com/sindresorhus/execa#readme // Definitions by: Douglas Duteil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// import { ExecOptions, SpawnOptions, SpawnSyncOptions, SpawnSyncReturns, ChildProcess } from "child_process"; import { Stream } from 'stream'; interface ExecaOptions { input: string | Buffer | Stream; preferLocal: boolean; stripEof: boolean; } type Options = SpawnOptions & 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?: SpawnOptions): ExecaChildProcess; function sync(file: string, options?: SpawnSyncOptions): ExecaReturns; function sync(file: string, args?: string[], options?: SpawnSyncOptions): ExecaReturns; function shellSync(command: string, options?: SpawnOptions): ExecaReturns; } export = execa;