Expose getName() in MethodDescriptor and fix TS definitions. (#1289)

This commit is contained in:
Eryu Xia 2022-09-30 16:28:51 -07:00 committed by GitHub
parent ac17547d78
commit 4974a7b5a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 11 deletions

View File

@ -74,6 +74,7 @@ const MethodDescriptor = class {
/**
* @override
* @export
*/
getName() {
return this.name;

View File

@ -32,3 +32,6 @@ module.UnaryResponse.prototype.getResponseMessage = function() {};
module.UnaryResponse.prototype.getMetadata = function() {};
module.UnaryResponse.prototype.getMethodDescriptor = function() {};
module.UnaryResponse.prototype.getStatus = function() {};
module.MethodDescriptor = function() {};
module.MethodDescriptor.getName = function() {};

View File

@ -75,18 +75,7 @@ declare module "grpc-web" {
responseType: new (...args: unknown[]) => RESP,
requestSerializeFn: any,
responseDeserializeFn: any);
createRequest(requestMessage: REQ,
metadata?: Metadata,
callOptions?: CallOptions): Request<REQ, RESP>;
createUnaryResponse(responseMessage: RESP,
metadata?: Metadata,
status?: Status): UnaryResponse<REQ, RESP>;
getName(): string;
getMethodType(): string;
getRequestMessageCtor(): new (...args: unknown[]) => REQ;
getResponseMessageCtor(): new (...args: unknown[]) => RESP;
getRequestSerializeFn(): any;
getResponseDeserializeFn(): any;
}
export class Request<REQ, RESP> {