diff --git a/types/node/stream.d.ts b/types/node/stream.d.ts index 3b38302b9adfa0..1ff32e040ec63f 100644 --- a/types/node/stream.d.ts +++ b/types/node/stream.d.ts @@ -897,9 +897,9 @@ declare module "stream" { * @param encoding The encoding if `chunk` is a string * @param callback Callback for when the stream is finished. */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + end(cb?: (error: Error | null | undefined) => void): this; + end(chunk: any, cb?: (error: Error | null | undefined) => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): this; /** * The `writable.cork()` method forces all written data to be buffered in memory. * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. diff --git a/types/node/v20/stream.d.ts b/types/node/v20/stream.d.ts index 9d13d1bb629948..f4e876061c99a9 100644 --- a/types/node/v20/stream.d.ts +++ b/types/node/v20/stream.d.ts @@ -899,9 +899,9 @@ declare module "stream" { * @param encoding The encoding if `chunk` is a string * @param callback Callback for when the stream is finished. */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + end(cb?: (error: Error | null | undefined) => void): this; + end(chunk: any, cb?: (error: Error | null | undefined) => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): this; /** * The `writable.cork()` method forces all written data to be buffered in memory. * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. diff --git a/types/node/v22/stream.d.ts b/types/node/v22/stream.d.ts index 5799cc0305f675..58246ff9fcab45 100644 --- a/types/node/v22/stream.d.ts +++ b/types/node/v22/stream.d.ts @@ -892,9 +892,9 @@ declare module "stream" { * @param encoding The encoding if `chunk` is a string * @param callback Callback for when the stream is finished. */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + end(cb?: (error: Error | null | undefined) => void): this; + end(chunk: any, cb?: (error: Error | null | undefined) => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): this; /** * The `writable.cork()` method forces all written data to be buffered in memory. * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called.