import type { TransformCallback, TransformOptions as NodeTransformOptions, Transform as NodeTransform } from 'node:stream'; import type { WriteCallback } from './writable.js'; import { Duplex, type DuplexOptions } from './duplex.js'; /** `node:stream`'s options, plus the flags {@link DuplexOptions} adds. */ export interface TransformOptions extends NodeTransformOptions, Pick { } declare const kCallback: unique symbol; /** * As with `Writable._final`, `_flush` has no default implementation but `node:stream` types it * as always present; `final()` checks for it at runtime before calling it. */ export interface Transform { _flush(callback: TransformCallback): void; } /** * A Duplex where the output is derived from the input. * * Back-pressure is driven by the reading side: `_transform()` is only called again once the * previous output has been consumed, so an inflating transform cannot run away with memory. */ export declare class Transform extends Duplex implements NodeTransform { private [kCallback]; constructor(options?: TransformOptions); _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; _final(callback?: WriteCallback): void; _write(chunk: any, encoding: BufferEncoding, callback: WriteCallback): void; _read(): void; } export {};