smartstream/dist/index.d.ts

39 lines
968 B
TypeScript
Raw Normal View History

/// <reference types="q" />
import * as plugins from './smartstream.plugins';
2016-09-25 12:00:16 +00:00
export interface IErrorFunction {
(err: any): any;
2016-09-25 12:00:16 +00:00
}
export interface IStreamStartFunction {
(stream: any): any;
}
export interface ICustomEventFunction {
(): any;
}
export interface ICustomEventObject {
eventName: string;
eventFunction: ICustomEventFunction;
}
/**
* class Smartstream handles
*/
2016-09-25 12:00:16 +00:00
export declare class Smartstream {
streamArray: any[];
errorFunction: IErrorFunction;
streamStartFunction: IStreamStartFunction;
customEventObjectArray: ICustomEventObject[];
2016-09-25 12:00:16 +00:00
constructor(streamArrayArg: any[]);
/**
* attach an error handler to the stream to prevent throwing
*/
2016-09-25 12:00:16 +00:00
onError(errorFunctionArg: IErrorFunction): void;
/**
* make something with the stream itself
*/
onStreamStart(): plugins.q.Promise<any>;
/**
* run the stream
* @returns Promise
*/
run(): plugins.q.Promise<void>;
2016-09-25 12:00:16 +00:00
}