mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added defs for some (stream) utils
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
Vendored
+21
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user