Skip to content

Commit 311d22e

Browse files
committed
grpc-js: Fix compatibility with @types/node 17.0.6
1 parent 5548679 commit 311d22e

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

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

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +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(): void;
40-
end(chunk: any & T, cb?: Function): void;
41-
end(chunk: any & T, encoding?: any, cb?: Function): void;
39+
end(): this;
40+
end(chunk: any & T, cb?: Function): this;
41+
end(chunk: any & T, encoding?: any, cb?: Function): this;
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(): void;
50-
end(chunk: T, cb?: Function): void;
51-
end(chunk: T, encoding?: any, cb?: Function): void;
49+
end(): this;
50+
end(chunk: T, cb?: Function): this;
51+
end(chunk: T, encoding?: any, cb?: Function): this;
5252
}
53-
54-
export type ObjectDuplex<T, U> = {
55-
read(size?: number): U;
56-
57-
_write(chunk: T, encoding: string, callback: Function): void;
58-
write(chunk: T, cb?: Function): boolean;
59-
write(chunk: T, encoding?: any, cb?: Function): boolean;
60-
end(): void;
61-
end(chunk: T, cb?: Function): void;
62-
end(chunk: T, encoding?: any, cb?: Function): void;
63-
} & Duplex &
64-
ObjectWritable<T> &
65-
ObjectReadable<U>;

packages/grpc-js/src/server-call.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export class ServerWritableStreamImpl<RequestType, ResponseType>
236236
this.trailingMetadata = metadata;
237237
}
238238

239-
super.end();
239+
return super.end();
240240
}
241241
}
242242

@@ -282,7 +282,7 @@ export class ServerDuplexStreamImpl<RequestType, ResponseType>
282282
this.trailingMetadata = metadata;
283283
}
284284

285-
super.end();
285+
return super.end();
286286
}
287287
}
288288

@@ -292,7 +292,6 @@ ServerDuplexStreamImpl.prototype._write =
292292
ServerWritableStreamImpl.prototype._write;
293293
ServerDuplexStreamImpl.prototype._final =
294294
ServerWritableStreamImpl.prototype._final;
295-
ServerDuplexStreamImpl.prototype.end = ServerWritableStreamImpl.prototype.end;
296295

297296
// Unary response callback signature.
298297
export type sendUnaryData<ResponseType> = (

0 commit comments

Comments
 (0)