Merge pull request #871 from AndrewGaspar/through

I added definitions for through
This commit is contained in:
Diullei Gomes
2013-08-16 05:55:45 -07:00
2 changed files with 33 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import through = require('through');
var i = 0;
through(
function () {
this.queue((i++).toString());
}, function () {
this.queue(null);
}, { autoDestroy: true }).pipe(process.stdout);
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for through
// Project: https://github.com/dominictarr/through
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "through" {
import Stream = require("stream");
function through(write?: (data) => void,
end?: () => void,
opts?: {
autoDestroy: boolean;
}): through.ThroughStream;
module through {
export interface ThroughStream extends Stream.ReadWriteStream {
autoDestroy: boolean;
}
}
export = through;
}