import { ReadableStream } from './ReadableStream'; import { ReadRequest } from './ReadRequest'; export interface ReadableStreamControllerOptions { stream: ReadableStream; highWaterMark: number; startAlgorithm(controller: ReadableStreamController): Promise; pullAlgorithm: any; cancelAlgorithm: any; sizeAlgorithm: any; } export interface ReadableStreamControllerState { started: boolean; pulling: boolean; pullAgain: boolean; closeRequested: boolean; } export interface ReadableStreamControllerQueuedChunk { value: Data; size: number; } export declare class ReadableStreamController { private state; private stream; private startAlgorithm?; private pullAlgorithm?; private cancelAlgorithm?; private sizeAlgorithm; private queue; private queueTotalSize; private pendingPullIntos; constructor(options: ReadableStreamControllerOptions); /** * @see https://github.com/nodejs/node/blob/561f7fe941929d6c10b82b8250c04afb0693e4f3/lib/internal/webstreams/readablestream.js#L1924 */ pull(readRequest: ReadRequest): void; private getReadRequestCount; private dequeueChunk; /** @see https://github.com/nodejs/node/blob/561f7fe941929d6c10b82b8250c04afb0693e4f3/lib/internal/webstreams/readablestream.js#L1804 */ enqueue(chunk: Data): void; /** @see https://github.com/nodejs/node/blob/561f7fe941929d6c10b82b8250c04afb0693e4f3/lib/internal/webstreams/util.js#L156 */ private enqueueValueWithSize; /** * @see https://github.com/nodejs/node/blob/561f7fe941929d6c10b82b8250c04afb0693e4f3/lib/internal/webstreams/readablestream.js#L1794 */ close(): void; cancel(reason?: string): Promise; private canCloseOrEnqueue; /** * @see https://github.com/nodejs/node/blob/561f7fe941929d6c10b82b8250c04afb0693e4f3/lib/internal/webstreams/readablestream.js#L1876 */ private pullIfNeeded; private shouldCallPull; private triggerError; private clearQueue; private clearAlgorithms; }