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

View File

@ -32,3 +32,11 @@ module.UnaryResponse.prototype.getResponseMessage = function() {};
module.UnaryResponse.prototype.getMetadata = function() {}; module.UnaryResponse.prototype.getMetadata = function() {};
module.UnaryResponse.prototype.getMethodDescriptor = function() {}; module.UnaryResponse.prototype.getMethodDescriptor = function() {};
module.UnaryResponse.prototype.getStatus = 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() {};