• @Count decorator define a variable length array based on the primitive.

    Type Parameters

    • This
    • Value

    Parameters

    • arg: string | number

      The number of time to read the target property or a string refering to a field present on the target instance.

    • Optionalopt: Partial<ControllerOptions>

    Returns DecoratorType<This, Value>

    The property decorator function ran at runtime

    The decorator also allows to refer to another field already present in the binary definition target instance.

    class BinProtocol {
    @Relation(PrimitiveSymbol.u8)
    len: Number

    @Count('len')
    @Relation(PrimitiveSymbol.u8)
    vec: Number
    }