UNPKG

1.02 kBTypeScriptView Raw
1// Type definitions for pumpify 1.4
2// Project: https://github.com/mafintosh/pumpify
3// Definitions by: Justin Beckwith <https://github.com/JustinBeckwith>
4// Ankur Oberoi <https://github.com/aoberoi>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
7/// <reference types="node" />
8
9import { Stream, Writable, Readable, Duplex } from 'stream';
10import * as duplexify from 'duplexify';
11
12declare class Pumpify extends Duplex implements duplexify.Duplexify {
13 constructor(...streams: Stream[]);
14 constructor(streams: Stream[]);
15 setPipeline(...streams: Stream[]): void;
16 setPipeline(streams: Stream[]): void;
17
18 // Duplexify members
19 setWritable(writable: Writable): void;
20 setReadable(readable: Readable): void;
21}
22
23interface PumpifyFactoryOptions {
24 autoDestroy: boolean;
25 destroy: boolean;
26 objectMode: boolean;
27 highWaterMark: number;
28}
29
30declare namespace Pumpify {
31 let obj: typeof Pumpify;
32 function ctor(opts: PumpifyFactoryOptions): typeof Pumpify;
33}
34
35export = Pumpify;