/// import { PassThrough } from 'stream'; export declare class MessageStreamError extends Error { } /** A class that extends PassThrough stream, supports async message fetching */ export declare class MessageStream extends PassThrough { /** Deleter is a function that'll called by free() */ private readonly deleter; constructor(deleter: () => void); /** * get an object asynchronously. * if there is an object in the stream, it'll be directly resolved; * else it'll be resolved when a new object is pushed into the stream. */ get(condition?: (ctx: T) => Promise | boolean): Promise; /** Alias of this.resume() */ waste(): void; /** Alias of this.pause() */ keep(): void; /** End the stream and free related resources */ free(): void; }