agreatfool / grpc_tools_node_protoc_ts

Generate TypeScript d.ts definitions for generated js files from grpc_tools_node_protoc
MIT License
498 stars 56 forks source link

Adding keyword `list` on each repeated field in `asObject` #110

Open YounosAlshamy opened 3 years ago

YounosAlshamy commented 3 years ago

I am using nestjs framework and to send the result to grpc I must use asObject to convert the class to object but my problem that you added keyword list on each repeated field in asObject like this proto

syntax = "proto3";

package test;

message Users {
repeated uint32 ids = 1;
}

_pb.d.ts file will be like that

export namespace Users {
    export type AsObject = {
        idsList: Array<number>,
    }
}

I can't send this one to grpc because in my proto ids not idsList and I can't use _grpc_pb.d.ts because I don't want to overwrite grpc sever in nestjs

agreatfool commented 3 years ago

Please have a look at :

I think the grpc js source code append the List suffix, so ts need to follow it.