/// import { Readable, Stream } from 'stream'; /** * Returns a boolean indicating whether a value is a Stream * * @param val - Value to test * @returns Boolean indicating whether `val` is a Stream */ export declare function IsStream(val: any): boolean; /** * Returns a boolean indicating whether a value is a Readable Stream * * @param val - Value to test * @returns Boolean indicating whether `val` is a Readable Stream */ export declare function IsReadableStream(val: any): boolean; /** * Returns a Buffer with data read from the stream. * * @param stream - Stream to read data from * @returns Promise that resolves to a Buffer containing the data from the stream * @async */ export declare function StreamToBuffer(stream: Stream): Promise; /** * Returns a string with data read from the stream. * * @param stream - Stream to read data from * @param encoding - String encoding to use; defaults to utf8 * @returns Promise that resolves to a string containing the data from the stream * @async */ export declare function StreamToString(stream: Stream, encoding?: string): Promise; /** * Reads a certain amount of bytes from the beginning of a Stream, returning a Buffer. * The amount of data read might be smaller if the stream ends before it could return the amount of data requested. * * If the `peek` argument is true, the data is put back into the beginning of the stream, so it can be consumed by another function * * Note that this function will pause the stream, so you might need to call the `resume` method on it to make it flow again. * * If passing a stream that has already ended, the function could enter into an infinite loop and return a Promise that never resolves. It's your responsibility to ensure that streams passed to this function still have data to return. * * @param stream - Readable Stream to read data from * @param size - Amount of data to read * @param peek - If true, after reading the data it is added back to the beginning of the stream * @returns Promise that resolves to a Buffer with a length of at most `size` * @async */ export declare function ReadChunkFromStream(stream: Readable, size: number, peek?: boolean): Promise;