1 | // Type definitions for end-of-stream 1.4
|
2 | // Project: https://github.com/mafintosh/end-of-stream
|
3 | // Definitions by: Sami Kukkonen <https://github.com/strax>
|
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
5 | /// <reference types="node"/>
|
6 |
|
7 | interface Options {
|
8 | readable?: boolean | undefined;
|
9 | writable?: boolean | undefined;
|
10 | error?: boolean | undefined;
|
11 | }
|
12 | type Stream = NodeJS.ReadableStream | NodeJS.WritableStream;
|
13 | type Callback = (error?: Error | null) => void;
|
14 | declare function eos(
|
15 | stream: Stream,
|
16 | callback?: Callback
|
17 | ): () => void;
|
18 | declare function eos(
|
19 | stream: Stream,
|
20 | options: Options,
|
21 | callback?: Callback
|
22 | ): () => void;
|
23 | declare namespace eos {
|
24 | }
|
25 | export = eos;
|