pipe.d.ts
This file
Path
types/pipe.d.ts
58 lines · 2.4 KiB · TypeScript
Last changed by
Add `.js` to imports in types (#1033)ehmickybefore adoption3bdab60
History of this fileTake it
Add `.js` to imports in types (#1033)ehmickybefore adoption3bdab60
lines 1–5why, one step back1import type {Options} from './arguments/options.js';2import type {Result} from './return/result.js';3import type {FromOption, ToOption} from './arguments/fd-options.js';4import type {ResultPromise} from './subprocess/subprocess.js';5import type {TemplateExpression} from './methods/template.js';Split type files (#978)ehmickybefore adoption0bd0f0d
lines 6–9why, one step back67// `subprocess.pipe()` options8type PipeOptions = {9 /**Add user guides (#989)ehmickybefore adoptionbe91ecf
line 10why, one step back10 Which stream to pipe from the source subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.Split type files (#978)ehmickybefore adoption0bd0f0d
lines 11–16why, one step back1112 `"all"` pipes both `stdout` and `stderr`. This requires the `all` option to be `true`.13 */14 readonly from?: FromOption;1516 /**Add user guides (#989)ehmickybefore adoptionbe91ecf
line 17why, one step back17 Which stream to pipe to the destination subprocess. A [file descriptor](https://en.wikipedia.org/wiki/File_descriptor) like `"fd3"` can also be passed.Split type files (#978)ehmickybefore adoption0bd0f0d
lines 18–27why, one step back18 */19 readonly to?: ToOption;2021 /**22 Unpipe the subprocess when the signal aborts.23 */24 readonly unpipeSignal?: AbortSignal;25};2627// `subprocess.pipe()`Upgrade `tsd` and `c8` (#982)ehmickybefore adoption08eb743
line 28why, one step back28export type PipableSubprocess = {Split type files (#978)ehmickybefore adoption0bd0f0d
lines 29–37why, one step back29 /**30 [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.3132 This follows the same syntax as `execa(file, arguments?, options?)` except both regular options and pipe-specific options can be specified.33 */34 pipe<OptionsType extends Options & PipeOptions = {}>(35 file: string | URL,36 arguments?: readonly string[],37 options?: OptionsType,Rename some types (#1009)ehmickybefore adoption2ef9186
line 38why, one step back38 ): Promise<Result<OptionsType>> & PipableSubprocess;Split type files (#978)ehmickybefore adoption0bd0f0d
lines 39–41why, one step back39 pipe<OptionsType extends Options & PipeOptions = {}>(40 file: string | URL,41 options?: OptionsType,Rename some types (#1009)ehmickybefore adoption2ef9186
line 42why, one step back42 ): Promise<Result<OptionsType>> & PipableSubprocess;Split type files (#978)ehmickybefore adoption0bd0f0d
lines 43–47why, one step back4344 /**45 Like `subprocess.pipe(file, arguments?, options?)` but using a `command` template string instead. This follows the same syntax as `$`.46 */47 pipe(templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[]):Rename some types (#1009)ehmickybefore adoption2ef9186
line 48why, one step back48 Promise<Result<{}>> & PipableSubprocess;Split type files (#978)ehmickybefore adoption0bd0f0d
lines 49–50why, one step back49 pipe<OptionsType extends Options & PipeOptions = {}>(options: OptionsType):50 (templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[])Rename some types (#1009)ehmickybefore adoption2ef9186
line 51why, one step back51 => Promise<Result<OptionsType>> & PipableSubprocess;Split type files (#978)ehmickybefore adoption0bd0f0d
lines 52–55why, one step back5253 /**54 Like `subprocess.pipe(file, arguments?, options?)` but using the return value of another `execa()` call instead.55 */Rename some types (#1009)ehmickybefore adoption2ef9186
line 56why, one step back56 pipe<Destination extends ResultPromise>(destination: Destination, options?: PipeOptions):Split type files (#978)ehmickybefore adoption0bd0f0d
lines 57–58why, one step back57 Promise<Awaited<Destination>> & PipableSubprocess;58};