You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using proto-loader-gen-types for ts-types generating, the root ProtoGrpcType type is not declared to extends grpc.GrpcObject.
Because of that, when I grpc.loadPackageDefinition(...), I cannot cast it directly to as MyProtoGrpcType and I have to cast it to as unknown first.
Though root ProtoGrpcType is in fact the extension of grpc.GrpcObject -- the only problem is the absence of declaration.
@murgatroid99 , I strongly appreciate your creature: the proto-loader-gen-types!
It is a very helpful thing! And I even can go on with as unknown cast.
But this duct-tape of as unknown can be removed -- and please let's do it.
I created a PR addressing this problem, it's very simple. Please take a look.
The text was updated successfully, but these errors were encountered:
I should add: the same thing happens with ServiceClient we're building from ServiceClientConstructor in that very GrpcObject. The generated client always de facto implements grpc.ServiceClient -- though it's not declared. So for now user has to cast as unknown first and only then cast as {MyServiceClient}.
Problem description
When using proto-loader-gen-types for ts-types generating, the root
ProtoGrpcType
type is not declared toextends grpc.GrpcObject
.Because of that, when I
grpc.loadPackageDefinition(...)
, I cannot cast it directly toas MyProtoGrpcType
and I have to cast it toas unknown
first.Though root
ProtoGrpcType
is in fact the extension ofgrpc.GrpcObject
-- the only problem is the absence of declaration.Reproduction steps
Environment
Additional context
@murgatroid99 , I strongly appreciate your creature: the proto-loader-gen-types!
It is a very helpful thing! And I even can go on with
as unknown
cast.But this duct-tape of
as unknown
can be removed -- and please let's do it.I created a PR addressing this problem, it's very simple. Please take a look.
The text was updated successfully, but these errors were encountered: