import { IOResult, type ByteSource } from '../../../io/types.ts'; import type { PathSpec } from '../../../types.ts'; import type { CommandFnResult, CommandOpts } from '../../config.ts'; import { type FlagValue } from '../../spec/types.ts'; export interface TeeFlags { append: boolean; stopOnError: boolean; } export declare function parseFlags(flags: Record): TeeFlags; export declare function teeGeneric(paths: PathSpec[], texts: string[], opts: CommandOpts, stream: (p: PathSpec) => AsyncIterable, write: (p: PathSpec, data: Uint8Array) => Promise, append?: (p: PathSpec, data: Uint8Array) => Promise): Promise; /** * Copy `raw` to every operand, GNU-style. * * An operand that cannot be written is diagnosed and skipped rather than ending * the run: GNU keeps going and still writes the rest, and only * `--output-error=exit` stops at the first failure. stdin always reaches stdout * either way. The operand is named as typed and the strerror comes from the * shared table, so an unwritable destination reads like GNU rather than * exposing the backend's own exception text. * * Deliberate divergence: GNU opens every operand up front, so under `exit` an * *open* failure aborts before any data is written. A mount has no open/write * split — `write` is one call — so the operands before the failure are already * written. The two agree whenever the failure is at write time, which is what a * remote backend reports. */ export declare function writeOutput(paths: PathSpec[], raw: Uint8Array, parsed: TeeFlags, stream: (p: PathSpec) => AsyncIterable, write: (p: PathSpec, data: Uint8Array) => Promise, append?: (p: PathSpec, data: Uint8Array) => Promise): Promise<[ByteSource | null, IOResult]>; //# sourceMappingURL=tee.d.ts.map