From 122d52957e92d0be2c1c1db9bb30c815dcaa77bd Mon Sep 17 00:00:00 2001 From: Jed Mao Date: Wed, 15 Oct 2014 17:09:03 -0500 Subject: [PATCH] Fix through2 --- CONTRIBUTORS.md | 1 + through2/through2.d.ts | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 58718a0765..b35cb0ee4c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -384,6 +384,7 @@ All definitions files include a header with the author and editors, so at some p * [text-buffer](https://github.com/atom/text-buffer) (by [vvakame](https://github.com/vvakame)) * [text-encoding](https://github.com/inexorabletash/text-encoding) (by [MIZUNE Pine](https://github.com/pine613)) * [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/)) +* [through2](https://github.com/rvagg/through2) (by [Bart van der Schoor](https://github.com/Bartvds) and [jedmao](https://github.com/jedmao)) * [TimelineJS](https://github.com/NUKnightLab/TimelineJS) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) (by [Rogier Schouten](https://github.com/rogierschouten)) * [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov)) diff --git a/through2/through2.d.ts b/through2/through2.d.ts index 3eb16f2e6d..95cedf7520 100644 --- a/through2/through2.d.ts +++ b/through2/through2.d.ts @@ -1,23 +1,26 @@ // Type definitions for through2 v 0.4.2 // Project: https://github.com/rvagg/through2 -// Definitions by: Bart van der Schoor +// Definitions by: Bart van der Schoor , jedmao // Definitions: https://github.com/borisyankov/DefinitelyTyped /// declare module 'through2' { + import stream = require('stream'); - var mod: mod.Through2; + function through2(transform?: (chunk: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; + + function through2(opts: stream.DuplexOptions, transform?: (chunk: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; + + module through2 { + + export function obj(transform: (chunk: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; + + export function push(data: any): void; - module mod { - interface Through2 { - (transform?: (entry: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; - (opts: stream.DuplexOptions, transform?: (entry: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; - obj(transform: (entry: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; - push(data: any): void; - } } - export = mod; -} + export = through2; + +}