update smartstream

This commit is contained in:
2017-06-30 18:32:32 +02:00
parent f8b79710be
commit 93bcc03e72
11 changed files with 250 additions and 160 deletions

View File

@ -1,9 +1,8 @@
import * as plugins from './smartstream.plugins'
// interfaces
// interfaces
import { Transform } from 'stream'
export interface IErrorFunction {
(err): any
}
@ -35,14 +34,14 @@ export class Smartstream {
/**
* make something with the stream itself
*/
streamStarted(): plugins.q.Promise<any> {
streamStarted (): Promise<any> {
return this.streamStartedDeferred.promise
}
/**
* attach listener to custom event
*/
onCustomEvent(eventNameArg: string, eventFunctionArg: ICustomEventFunction) {
onCustomEvent (eventNameArg: string, eventFunctionArg: ICustomEventFunction) {
this.customEventObjectArray.push({
eventName: eventNameArg,
eventFunction: eventFunctionArg
@ -53,7 +52,7 @@ export class Smartstream {
* run the stream
* @returns Promise
*/
run(): plugins.q.Promise<void> {
run (): Promise<void> {
let done = plugins.q.defer<void>()
// clone Array

View File

@ -1,3 +1,3 @@
import 'typings-global'
export import q = require('q')
export import q = require('smartq')
export import through2 = require('through2')