UNPKG

@push.rocks/smartstream

Version:

A library to simplify the creation and manipulation of Node.js streams, providing utilities for handling transform, duplex, and readable/writable streams effectively in TypeScript.

36 lines (35 loc) 791 B
export interface IErrorFunction { (err: Error): any; } export interface ICustomEventFunction { (): any; } export interface ICustomEventObject { eventName: string; eventFunction: ICustomEventFunction; } /** * class Smartstream handles */ export declare class StreamWrapper { private streamArray; private customEventObjectArray; private streamStartedDeferred; /** * constructor */ constructor(streamArrayArg: any[]); /** * make something with the stream itself */ streamStarted(): Promise<any>; /** * attach listener to custom event */ onCustomEvent(eventNameArg: string, eventFunctionArg: ICustomEventFunction): void; /** * run the stream * @returns Promise */ run(): Promise<void>; }