diff --git a/types/busboy/busboy-tests.ts b/types/busboy/busboy-tests.ts index 751aaa2ebc6d9e..c4f834a56e8c6a 100644 --- a/types/busboy/busboy-tests.ts +++ b/types/busboy/busboy-tests.ts @@ -21,7 +21,7 @@ const bb = busboy({ bb.addListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.addListener("field", (name, value, info) => { @@ -54,7 +54,7 @@ bb.on(Symbol("foo"), foo => { bb.on("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.on("field", (name, value, info) => { @@ -87,7 +87,7 @@ bb.on(Symbol("foo"), foo => { bb.once("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.once("field", (name, value, info) => { @@ -120,7 +120,7 @@ bb.once(Symbol("foo"), foo => { bb.removeListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.removeListener("field", (name, value, info) => { @@ -153,7 +153,7 @@ bb.removeListener(Symbol("foo"), foo => { bb.off("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.off("field", (name, value, info) => { @@ -186,7 +186,7 @@ bb.off(Symbol("foo"), foo => { bb.prependListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.prependListener("field", (name, value, info) => { @@ -219,7 +219,7 @@ bb.prependListener(Symbol("foo"), foo => { bb.prependOnceListener("file", (name, stream, info) => { name; // $ExpectType string - stream; // $ExpectType Readable + stream; // $ExpectType Readable & { truncated?: boolean | undefined; } info; // $ExpectType FileInfo }); bb.prependOnceListener("field", (name, value, info) => { diff --git a/types/busboy/index.d.ts b/types/busboy/index.d.ts index ee3bffdf7f7fb0..6873698001be1d 100644 --- a/types/busboy/index.d.ts +++ b/types/busboy/index.d.ts @@ -155,7 +155,7 @@ declare namespace busboy { * @param listener.transferEncoding Contains the 'Content-Transfer-Encoding' value for the file stream. * @param listener.mimeType Contains the 'Content-Type' value for the file stream. */ - file: (name: string, stream: Readable, info: FileInfo) => void; + file: (name: string, stream: Readable & { truncated?: boolean }, info: FileInfo) => void; /** * Emitted for each new non-file field found.