Expose MethodDescriptor's public methods (#1160)

Co-authored-by: Eryu Xia <eryu@google.com>
This commit is contained in:
Cirillo Ferreira 2021-11-19 06:44:39 -03:00 committed by GitHub
parent cc1a135855
commit 97baed4dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -74,6 +74,7 @@ const MethodDescriptor = class {
/**
* @override
* @export
*/
getName() {
return this.name;
@ -81,6 +82,7 @@ const MethodDescriptor = class {
/**
* @override
* @export
*/
getMethodType() {
return this.methodType;
@ -88,6 +90,7 @@ const MethodDescriptor = class {
/**
* @override
* @export
* @return {function(new: RESPONSE, ...)}
*/
getResponseMessageCtor() {
@ -96,18 +99,25 @@ const MethodDescriptor = class {
/**
* @override
* @export
* @return {function(new: REQUEST, ...)}
*/
getRequestMessageCtor() {
return this.requestType;
}
/** @override */
/**
* @override
* @export
*/
getResponseDeserializeFn() {
return this.responseDeserializeFn;
}
/** @override */
/**
* @override
* @export
*/
getRequestSerializeFn() {
return this.requestSerializeFn;
}

View File

@ -32,3 +32,11 @@ 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() {};
module.MethodDescriptor.getMethodType = function() {};
module.MethodDescriptor.getResponseMessageCtor = function() {};
module.MethodDescriptor.getRequestMessageCtor = function() {};
module.MethodDescriptor.getResponseDeserializeFn = function() {};
module.MethodDescriptor.getRequestSerializeFn = function() {};