import { AsyncIterableLike } from "../async-like"; import { Cancellable } from "./cancellable"; export type TransientAsyncIteratorSourceOnThrowFn = (error: unknown) => void | Promise | IteratorResult | Promise>; export type TransientAsyncIteratorSourceFn = (() => Promise) | (() => T); export declare function source(source?: AsyncIterableLike | TransientAsyncIteratorSourceFn, cancellable?: Cancellable): TransientAsyncIteratorSource; export declare class TransientAsyncIteratorSource implements AsyncIterable { private source?; private sourceCancellable?; private onThrow?; private sourceIterator?; private deferred; private isDone; private errorValue; private pullPromise; private values; private nextPointer; private pointer; constructor(source?: AsyncIterableLike, sourceCancellable?: Cancellable, onThrow?: TransientAsyncIteratorSourceOnThrowFn); static from(source?: AsyncIterableLike | TransientAsyncIteratorSourceFn, cancellable?: Cancellable): TransientAsyncIteratorSource; get error(): unknown; get open(): boolean; get hasSource(): boolean; /** * @param value * @returns {boolean} false if the value won't be processed */ push(value: T): boolean; /** * @returns {boolean} false if the pushable is not open */ close(): boolean; /** * @param error * @returns {boolean} false if the pushable is not open */ throw(error?: unknown): boolean; setSource(source?: AsyncIterableLike, sourceCancellable?: Cancellable): Promise; private pull; private waitForNext; private invokeDeferred; [Symbol.asyncIterator](): { next: () => Promise | IteratorYieldResult>; return: () => Promise>; throw: (error?: unknown) => Promise>; }; } export declare function isTransientAsyncIteratorSource(value: unknown): value is TransientAsyncIteratorSource;