UNPKG

688 BTypeScriptView Raw
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
7interface Options {
8 readable?: boolean;
9 writable?: boolean;
10 error?: boolean;
11}
12type Stream = NodeJS.ReadableStream | NodeJS.WritableStream;
13type Callback = (error?: Error | null) => void;
14declare function eos(
15 stream: Stream,
16 callback?: Callback
17): () => void;
18declare function eos(
19 stream: Stream,
20 options: Options,
21 callback?: Callback
22): () => void;
23declare namespace eos {
24}
25export = eos;