Protobufjs creating Types using reflection but missing type information

49 views Asked by At

Not using TS only JSDoc. I am trying to use Protobufjs with the Reflection only mode.

When using new protobuf.Type:

const VectorData = new Type("VectorData")
    .add(new Field("x", 1, "float"))
    .add(new Field("y", 2, "float"))
    .add(new Field("z", 3, "float"));

the only type information I get is protobuf.Type which doesnt really help since my Fields are missing? Is there any way I need to write my own type def, because in TS I could just use decorators.

export class VectorData extends Message<VectorData> {
    @Field.d(1, "float")
    public x: number;

    @Field.d(2, "float")
    public y: number;

    @Field.d(3, "float")
    public z: number;
}

Is there any better way to do this in JSDoc?

0

There are 0 answers