Skip to content

Commit fba2b94

Browse files
committed
Fix end type again for older @types/node versions
1 parent e2dfb8f commit fba2b94

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/grpc-js/src/object-stream.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ export interface IntermediateObjectWritable<T> extends Writable {
3636
write(chunk: any & T, cb?: WriteCallback): boolean;
3737
write(chunk: any & T, encoding?: any, cb?: WriteCallback): boolean;
3838
setDefaultEncoding(encoding: string): this;
39-
end(): this;
40-
end(chunk: any & T, cb?: Function): this;
41-
end(chunk: any & T, encoding?: any, cb?: Function): this;
39+
end(): ReturnType<Writable['end']> extends Writable ? this : void;
40+
end(chunk: any & T, cb?: Function): ReturnType<Writable['end']> extends Writable ? this : void;
41+
end(chunk: any & T, encoding?: any, cb?: Function): ReturnType<Writable['end']> extends Writable ? this : void;
4242
}
4343

4444
export interface ObjectWritable<T> extends IntermediateObjectWritable<T> {
4545
_write(chunk: T, encoding: string, callback: Function): void;
4646
write(chunk: T, cb?: Function): boolean;
4747
write(chunk: T, encoding?: any, cb?: Function): boolean;
4848
setDefaultEncoding(encoding: string): this;
49-
end(): this;
50-
end(chunk: T, cb?: Function): this;
51-
end(chunk: T, encoding?: any, cb?: Function): this;
49+
end(): ReturnType<Writable['end']> extends Writable ? this : void;
50+
end(chunk: T, cb?: Function): ReturnType<Writable['end']> extends Writable ? this : void;
51+
end(chunk: T, encoding?: any, cb?: Function): ReturnType<Writable['end']> extends Writable ? this : void;
5252
}

0 commit comments

Comments
 (0)