UNPKG

886 BTypeScriptView Raw
1// Type definitions for concat-stream 2.0
2// Project: https://github.com/maxogden/concat-stream
3// Definitions by: Joey Marianer <https://github.com/jmarianer>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node" />
7
8import { Writable } from "stream";
9
10declare function concat(cb: (buf: Buffer) => void): Writable;
11declare function concat(opts: { encoding: "buffer" | undefined } | {}, cb: (buf: Buffer) => void): Writable;
12declare function concat(opts: { encoding: "string" }, cb: (buf: string) => void): Writable;
13declare function concat(opts: { encoding: "array" }, cb: (buf: Array<bigint>) => void): Writable;
14declare function concat(opts: { encoding: "uint8array" | "u8" | "uint8" }, cb: (buf: Uint8Array) => void): Writable;
15declare function concat(opts: { encoding: "object" }, cb: (buf: object[]) => void): Writable;
16
17export = concat;