diff --git a/through/through-tests.ts b/through/through-tests.ts new file mode 100644 index 000000000..93fc6d2fa --- /dev/null +++ b/through/through-tests.ts @@ -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); \ No newline at end of file diff --git a/through/through.d.ts b/through/through.d.ts new file mode 100644 index 000000000..969d003d9 --- /dev/null +++ b/through/through.d.ts @@ -0,0 +1,21 @@ +/// + + + +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; +} \ No newline at end of file