import { SimpleReadableStream } from "./types/simple-readable-stream"; /** * TextStreamSearch finds occurrences of a given text or regular expression in a given text stream. */ export declare class TextStreamSearch { /** the output captured so far */ private streamText; /** * Subscriptions contains all the requests from users of this library * to be notified when a particular text or regex shows up in the text stream. */ private searchList; constructor(stream: SimpleReadableStream); /** * Returns a promise that resolves with the matching text * when the given text shows up in the observed stream. * If a timeout is given, aborts after the given duration. */ waitForText(text: string, timeout?: number): Promise; /** * Returns a promise that resolves with the matching text * when the given RegExp shows up in observed stream. * If a timeout is given, aborts after the given duration. */ waitForRegex(regex: RegExp, timeout?: number): Promise; /** OnStreamData is called when new text arrives on the input stream. */ private onStreamData; }