///
import { EventEmitter } from 'events';
import type TweetStream from './TweetStream';
/** Why an iteration ends: the stream was closed, or `error` has to be thrown */
declare type TweetStreamCombinerEnding = {
error?: any;
};
export declare class TweetStreamEventCombiner extends EventEmitter {
private stream;
private stack;
private ending?;
private onceNewEvent;
constructor(stream: TweetStream);
/** Returns a new `Promise` that will `resolve` on next event (data, error or end of the stream). */
nextEvent(): Promise;
/** Returns `true` if there's something in the stack. */
hasStack(): boolean;
/** Returns stacked data events, and clean the stack. */
popStack(): T[];
/** Returns why the iteration ends, once it has to. */
getEnding(): TweetStreamCombinerEnding | undefined;
/** Ends the iteration once the stack is empty. The first ending wins. */
end(ending?: TweetStreamCombinerEnding): void;
/** Cleanup all the listeners attached on stream. */
destroy(): void;
private onStreamData;
private onStreamError;
private onConnectionLost;
private onReconnectLimitExceeded;
private onStreamClosed;
}
export default TweetStreamEventCombiner;