smartstream/dist/index.d.ts

43 lines
1.0 KiB
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 ICustomEventFunction {
(): any;
}
export interface ICustomEventObject {
eventName: string;
eventFunction: ICustomEventFunction;
}
/**
* class Smartstream handles
*/
2016-09-25 12:00:16 +00:00
export declare class Smartstream {
2016-09-25 14:28:42 +00:00
private streamArray;
private errorFunction;
private customEventObjectArray;
private streamStartedDeferred;
/**
* constructor
*/
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
*/
2016-09-25 14:28:42 +00:00
streamStarted(): plugins.q.Promise<any>;
/**
* attach listener to custom event
*/
onCustomEvent(eventNameArg: string, eventFunctionArg: ICustomEventFunction): void;
/**
* run the stream
* @returns Promise
*/
run(): plugins.q.Promise<void>;
2016-09-25 12:00:16 +00:00
}