Skip to content

Commit

Permalink
Add strongly types to MethodDescriptor constructor
Browse files Browse the repository at this point in the history
In the generated typescript code this will ensure that the generic
parameters will be infered from the values passed to the constructor
  • Loading branch information
lukasmoellerch committed Nov 11, 2021
1 parent 53964f3 commit 7ec3b9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/grpc-web/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ declare module "grpc-web" {

export class MethodDescriptor<REQ, RESP> {
constructor(name: string,
methodType: any,
requestType: any,
responseType: any,
requestSerializeFn: any,
responseDeserializeFn: any);
methodType: string,
requestType: new (...args: unknown[]) => REQ,
responseType: new (...args: unknown[]) => RESP,
requestSerializeFn: (request: REQ) => Uint8Array,
responseDeserializeFn: (bytes: Uint8Array) => RESP);
createRequest(requestMessage: REQ,
metadata?: Metadata,
callOptions?: CallOptions): Request<REQ, RESP>;
Expand Down

0 comments on commit 7ec3b9f

Please sign in to comment.