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->Print(vars,
 | 
			
		||||
                         "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->Indent();
 | 
			
		||||
          printer->Print(vars,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,9 +70,9 @@ declare module "grpc-web" {
 | 
			
		|||
 | 
			
		||||
  export class MethodDescriptor<REQ, RESP> {
 | 
			
		||||
    constructor(name: string,
 | 
			
		||||
                methodType: any,
 | 
			
		||||
                requestType: any,
 | 
			
		||||
                responseType: any,
 | 
			
		||||
                methodType: string,
 | 
			
		||||
                requestType: new (...args: unknown[]) => REQ,
 | 
			
		||||
                responseType: new (...args: unknown[]) => RESP,
 | 
			
		||||
                requestSerializeFn: any,
 | 
			
		||||
                responseDeserializeFn: any);
 | 
			
		||||
    createRequest(requestMessage: REQ,
 | 
			
		||||
| 
						 | 
				
			
			@ -83,10 +83,10 @@ declare module "grpc-web" {
 | 
			
		|||
                        status?: Status): UnaryResponse<REQ, RESP>;
 | 
			
		||||
    getName(): string;
 | 
			
		||||
    getMethodType(): string;
 | 
			
		||||
    getResponseMessageCtor(): any;
 | 
			
		||||
    getRequestMessageCtor(): any;
 | 
			
		||||
    getResponseDeserializeFn(): any;
 | 
			
		||||
    getRequestMessageCtor(): new (...args: unknown[]) => REQ;
 | 
			
		||||
    getResponseMessageCtor(): new (...args: unknown[]) => RESP;
 | 
			
		||||
    getRequestSerializeFn(): any;
 | 
			
		||||
    getResponseDeserializeFn(): any;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  export class Request<REQ, RESP> {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue