I cannot seem to find a way to dynamically get the string name (used in the any.pack function) of an object. The only way I know of is to explicitly pass in a string to the .pack function.
Here is how I currently get the "any" version of my Protobuf objects
const payload = new SysTypes.PbRepeatedUint32Struct();
payload.setValuesList(items);
const any_pb = new GoogleProtobuf.Any;
any_pb.pack(payload.serializeBinary(), 'MpaInterface.PbRepeatedUint32Struct');
Is there a different way to do this without having to know the string ahead of time?
It looks like the generated .js file actually contains a reference to the string I want to use:
I cannot seem to find a way to dynamically get the string name (used in the any.pack function) of an object. The only way I know of is to explicitly pass in a string to the .pack function.
Here is how I currently get the "any" version of my Protobuf objects
Is there a different way to do this without having to know the string ahead of time?
It looks like the generated .js file actually contains a reference to the string I want to use:
proto.MpaInterface.PbRepeatedUint32Struct.displayName = 'proto.MpaInterface.PbRepeatedUint32Struct';
but this property isn't accessible in the generated Typescript files.
Does anyone know how to access the "string name" of the Protobuf object?