/** * An async queue. You shouldn't construct this directly and should instead use `asyncQueue`. * * You can push values onto the queue and pull them out later. If you pull before a value is pushed, the pull will wait until a value is pushed. * * @example * ```typescript * // Pushing, then pulling * queue.push(1); * queue.push(2); * await queue.next(); * // => { done: false, value: 1 } * await queue.next(); * // => { done: false, value: 2 } * * // Pulling, then pushing * const pullA = queue.next(); * const pullB = queue.next(); * queue.push(3); * queue.push(4); * await pullA; * // => { done: false, value: 3 } * await pullB; * // => { done: false, value: 4 } * ``` */ export declare class AsyncQueue implements AsyncIterableIterator { #private; /** * Push a value onto the queue. */ push(value: T): void; /** * Pull a value off of the queue in the iterator style. */ next(): Promise>; /** * This queue instance. */ [Symbol.asyncIterator](): this; } /** * Create an async queue. * * You can push values onto the queue and pull them out later. If you pull before a value is pushed, the pull will wait until a value is pushed. * * @example * ```typescript * const queue = asyncQueue(); * * // Pushing, then pulling * queue.push(1); * queue.push(2); * await queue.next(); * // => { done: false, value: 1 } * await queue.next(); * // => { done: false, value: 2 } * * // Pulling, then pushing * const pullA = queue.next(); * const pullB = queue.next(); * queue.push(3); * queue.push(4); * await pullA; * // => { done: false, value: 3 } * await pullB; * // => { done: false, value: 4 } * ``` */ export default function asyncQueue(): AsyncQueue;