Skip to content

Commit

Permalink
Merge pull request #1590 from badsyntax/grpc-native-core-type-fix
Browse files Browse the repository at this point in the history
Add ResponseType to ServerWritableStream
  • Loading branch information
murgatroid99 committed Oct 5, 2020
2 parents ea36f75 + 58481c4 commit 96803d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/grpc-native-core/index.d.ts
Expand Up @@ -26,7 +26,7 @@ declare module "grpc" {

/* The Message interface is copied and slightly modified from @types/protobuf
* version 5.0.31, which was distributed under the following license:
*
*
* This project is licensed under the MIT license.
* Copyrights are respective of each contributor listed at the beginning of each definition file.
*
Expand Down Expand Up @@ -452,13 +452,13 @@ declare module "grpc" {
* User provided method to handle server streaming methods on the server.
*/
type handleServerStreamingCall<RequestType, ResponseType> =
(call: ServerWritableStream<RequestType>) => void;
(call: ServerWritableStream<RequestType, ResponseType>) => void;

/**
* A stream that the server can write to. Used for calls that are streaming
* from the server side.
*/
export class ServerWritableStream<RequestType> extends Writable {
export class ServerWritableStream<RequestType, ResponseType=unknown> extends Writable {
/**
* Indicates if the call has been cancelled
*/
Expand Down Expand Up @@ -491,7 +491,7 @@ declare module "grpc" {

/* This typo existed in previous versions of this file, so we provide this
* type alias for backwards compatibility. */
export type ServerWriteableStream<RequestType> = ServerWritableStream<RequestType>;
export type ServerWriteableStream<RequestType, ResponseType=unknown> = ServerWritableStream<RequestType, ResponseType>;

/**
* User provided method to handle bidirectional streaming calls on the server.
Expand Down

0 comments on commit 96803d4

Please sign in to comment.