added defs for some (stream) utils

This commit is contained in:
Bart van der Schoor
2014-05-26 14:31:30 +02:00
parent 568cb00761
commit cc82b36997
10 changed files with 163 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
/// <reference path="./from.d.ts" />
/// <reference path="../node/node.d.ts" />
import from = require('from');
var rs: NodeJS.ReadableStream;
rs = from([]);
rs = from(function (count: number, next: () => any) {
this.emit('end');
});
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for from v0.1.3
// Project: https://github.com/dominictarr/from
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'from' {
var mod: mod.From;
module mod {
interface From {
(getChunk: (count: number, next: () => any) => any): NodeJS.ReadableStream;
(chunks: any[]): NodeJS.ReadableStream;
emit(type: string, data: any): void;
}
}
export = mod;
}