import { expectType } from "tsd"; import streamToString = require(".."); declare const stream: NodeJS.ReadableStream; // test type exports type CB = streamToString.Callback; expectType>(streamToString(stream)); expectType>(streamToString(stream, "hex")); expectType>( streamToString(stream, (err, msg) => { expectType(err); expectType(msg); }) ); expectType>( streamToString(stream, "hex", (err, msg) => { expectType(err); expectType(msg); }) );