Function TransformOffset

  • @TransformOffset decorator applies an offset transformation to the decorated property value during the binary reading or writing phase. The decorator adds the specified offset to the value when reading and subtracts it during writing, ensuring symmetry.

    Type Parameters

    • This

      The type of the class the decorator is applied to.

    • Value

      The type of the decorated property.

    Parameters

    • off: number

      The offset number to apply.

    • Optionalopt: Partial<TransformerOptions>

      Optional configuration.

    Returns DecoratorType<This, Value>

    The property decorator function.