/// /// import { Readable, Writable } from 'stream'; export interface DataSource { /** * @returns a readable stream from the data source. */ asReadStream(): Promise; /** * @returns a writable stream to the data source. */ asWriteStream(obj?: any): Writable; /** * @returns an array like buffer from the data source. */ asArrayBuffer(): Promise; /** * @returns a buffer from the data source. */ asBuffer(): Promise; /** * @returns a promise resolved when the content of * the data source has been written to the specified * file. The promise resolves the path of the * output file. * @param filePath the path of the file to write to. * @note the file path must be absolute. */ asFile(filePath?: string): Promise; }