/**
 * Makes sure that events are emitted within `ms`.
 * Otherwise emits an error.
 *
 * @group Transformers
 * @throws {@link TimeoutError}
 * @example
 * readableStream
 *   .pipeThrough(timeout(1_000))
 *   .pipeTo(write())
 *   .catch(error => {
 *     // error is TimeoutError if any event took too long
 *   })
 */
export declare function timeout<T>(ms: number): import("node:stream/web").TransformStream<T, T>;
/**
 * The error emitted from {@link timeout}.
 *
 * @group Transformers
 */
export declare class TimeoutError extends Error {
    readonly ms: number;
    constructor(ms: number);
}
//# sourceMappingURL=timeout.d.ts.map