Skip to content

Commit

Permalink
Expose getName() in MethodDescriptor and fix TS definitions. (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampajano authored Sep 30, 2022
1 parent ac17547 commit 4974a7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions javascript/net/grpc/web/methoddescriptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const MethodDescriptor = class {

/**
* @override
* @export
*/
getName() {
return this.name;
Expand Down
3 changes: 3 additions & 0 deletions packages/grpc-web/externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {};
11 changes: 0 additions & 11 deletions packages/grpc-web/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 4974a7b

Please sign in to comment.