media-stream-library
Version:
Media stream library for Node & the Web.
20 lines (19 loc) • 753 B
TypeScript
import { Tube } from '../component';
/**
* Component that writes passing incoming/outgoing streams
* interleaved to a filestream. The resulting stream (file) stores
* messages as a JSON array, where each element has a type, timestamp,
* and the original message (that went through the stream).
*/
export declare class Recorder extends Tube {
/**
* Create a new recorder component that will record to a writable stream.
* @param fileStream - The stream to save the messages to.
*/
constructor(fileStream: NodeJS.WritableStream);
/**
* Create a new recorder component that will record to a file.
* @param filename - The name of the file (relative to cwd)
*/
static toFile(filename?: string): Recorder;
}