UNPKG

885 BTypeScriptView Raw
1// Type definitions for flush-write-stream 1.0
2// Project: https://github.com/mafintosh/flush-write-stream
3// Definitions by: Daniel Cassidy <https://github.com/djcsdy>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node"/>
7
8import { Writable, WritableOptions } from "stream";
9
10type Callback = (error?: Error) => void;
11type Write = (chunk: any, encoding: string, callback: Callback) => void;
12type Flush = (callback: Callback) => void;
13
14declare const WriteStream: {
15 (opts: WritableOptions, write: Write, flush?: Flush): Writable;
16 (write: Write, flush?: Flush): Writable;
17 new(opts: WritableOptions, write: Write, flush?: Flush): Writable;
18 new(write: Write, flush?: Flush): Writable;
19 obj(opts: WritableOptions, write: Write, flush?: Flush): Writable;
20 obj(write: Write, flush?: Flush): Writable;
21};
22
23export = WriteStream;