type _PageLister = (t: { nextToken?: string; }) => Promise<{ items: R[]; meta: { nextToken?: string; }; }>; declare class AsyncCollection implements AsyncIterableIterator { private _list; private _nextToken?; private _elementsBuffer; private _isExhausted; constructor(_list: _PageLister); [Symbol.asyncIterator](): AsyncIterableIterator; /** * Get the next element from the collection and advance the iterator. */ next(): Promise>; /** * Take the next n elements from the collection, advancing the iterator, and * return them as an array. */ take(amount: number): Promise; /** * Take the next n pages of elements from the collection, advancing the * iterator, and return the elements as an array. */ takePage(amount: number): Promise; /** * Take all remaining elements from in collection, moving the iterator to the * end, and return them as an array. */ takeAll(): Promise; /** * Returns true if there are no more elements to fetch in the collection. */ get isExhausted(): boolean; private _fetchNextPageIntoBuffer; private get _bufferIsEmpty(); } export type { AsyncCollection }; export declare const createAsyncCollection: (listFn: _PageLister) => AsyncCollection;