Skip to content

Commit 89fe60a

Browse files
committed
chore(@nestjs/microservices) improve ClientGrpcProxy.getService typing
1 parent 3ebec41 commit 89fe60a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/microservices/client/client-grpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
2525
this.grpcClient = this.createClient();
2626
}
2727

28-
public getService<T = any>(name: string): T {
28+
public getService<T extends {}>(name: keyof T): T {
2929
const { options } = this.options as GrpcOptions;
3030
if (!this.grpcClient[name]) {
3131
throw new InvalidGrpcServiceException();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export interface ClientGrpc {
2-
getService<T = any>(name: string): T;
2+
getService<T extends {}>(name: keyof T): T;
33
}

0 commit comments

Comments
 (0)