mirror of https://github.com/grpc/grpc-web.git
Fix missing TypeScript return type for `serverStreaming` calls. (#1167)
* Add strongly types to MethodDescriptor constructor * Adds return type declaration to server streaming call Co-authored-by: Eryu Xia <eryu@google.com>
This commit is contained in:
parent
97baed4dbe
commit
6b1d1e97a9
|
|
@ -619,7 +619,8 @@ void PrintTypescriptFile(Printer* printer, const FileDescriptor* file,
|
||||||
printer->Indent();
|
printer->Indent();
|
||||||
printer->Print(vars,
|
printer->Print(vars,
|
||||||
"request: $input_type$,\n"
|
"request: $input_type$,\n"
|
||||||
"metadata?: grpcWeb.Metadata) {\n");
|
"metadata?: grpcWeb.Metadata): "
|
||||||
|
"grpcWeb.ClientReadableStream<$output_type$> {\n");
|
||||||
printer->Print(vars, "return this.client_.serverStreaming(\n");
|
printer->Print(vars, "return this.client_.serverStreaming(\n");
|
||||||
printer->Indent();
|
printer->Indent();
|
||||||
printer->Print(vars,
|
printer->Print(vars,
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,9 @@ declare module "grpc-web" {
|
||||||
|
|
||||||
export class MethodDescriptor<REQ, RESP> {
|
export class MethodDescriptor<REQ, RESP> {
|
||||||
constructor(name: string,
|
constructor(name: string,
|
||||||
methodType: any,
|
methodType: string,
|
||||||
requestType: any,
|
requestType: new (...args: unknown[]) => REQ,
|
||||||
responseType: any,
|
responseType: new (...args: unknown[]) => RESP,
|
||||||
requestSerializeFn: any,
|
requestSerializeFn: any,
|
||||||
responseDeserializeFn: any);
|
responseDeserializeFn: any);
|
||||||
createRequest(requestMessage: REQ,
|
createRequest(requestMessage: REQ,
|
||||||
|
|
@ -83,10 +83,10 @@ declare module "grpc-web" {
|
||||||
status?: Status): UnaryResponse<REQ, RESP>;
|
status?: Status): UnaryResponse<REQ, RESP>;
|
||||||
getName(): string;
|
getName(): string;
|
||||||
getMethodType(): string;
|
getMethodType(): string;
|
||||||
getResponseMessageCtor(): any;
|
getRequestMessageCtor(): new (...args: unknown[]) => REQ;
|
||||||
getRequestMessageCtor(): any;
|
getResponseMessageCtor(): new (...args: unknown[]) => RESP;
|
||||||
getResponseDeserializeFn(): any;
|
|
||||||
getRequestSerializeFn(): any;
|
getRequestSerializeFn(): any;
|
||||||
|
getResponseDeserializeFn(): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Request<REQ, RESP> {
|
export class Request<REQ, RESP> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue