export type AsyncIntermediateReturn<T, Y = void> = {
    /**
     * Generator which yields values sent into it as a queue.
     */
    gen: AsyncGenerator<T, Y, void>;
    /**
     * Sends a value into the generator, returning a {@link Promise} that resolves when the generator
     * resumes after the corresponding yield.
     *
     * Users of the generator must be careful to always ask for a further value, e.g., via a
     * `for await` loop.
     */
    send: (update: T | PromiseLike<T>) => Promise<void>;
    /**
     * Stops the generator, causing the user of it to recieve the passed return value. All previous
     * sends are allowed to complete first. Unlike {@link AsyncIntermediateReturn#send}, this
     * resolves before the generator "yields" the return value.
     */
    stop: (final: Y | PromiseLike<Y>) => Promise<void>;
};
/**
 * Builds a {@link AsyncGenerator} which only allows one value to be queued at a time.
 */
export declare function buildAsyncIntermediate<T, Y = void>(): AsyncIntermediateReturn<T, Y>;
