import type { AbortSignal, QueuingStrategy } from "./stream.js"; import { ReadableStream } from "./stream.js"; export interface PushReadableStreamController { abortSignal: AbortSignal; enqueue(chunk: T): Promise; close(): void; error(e?: unknown): void; } export type PushReadableStreamSource = (controller: PushReadableStreamController) => void | Promise; export type PushReadableLogger = (event: { source: "producer"; operation: "enqueue"; value: T; phase: "start" | "waiting" | "ignored" | "complete"; } | { source: "producer"; operation: "close" | "error"; explicit: boolean; phase: "start" | "ignored" | "complete"; } | { source: "consumer"; operation: "pull" | "cancel"; phase: "start" | "complete"; }) => void; export declare class PushReadableStream extends ReadableStream { /** * Create a new `PushReadableStream` from a source. * * @param source If `source` returns a `Promise`, the stream will be closed * when the `Promise` is resolved, and be errored when the `Promise` is rejected. * @param strategy */ constructor(source: PushReadableStreamSource, strategy?: QueuingStrategy, logger?: PushReadableLogger); } //# sourceMappingURL=push-readable.d.ts.map