API

Function addAccessorsForMaterialProperty

  • Adds accessors for a material property. Applied to an auto-accessor field. Reads/writes from a private backing field named by sourceKey (default: "_" + property name). The backing field is expected to have a .value property.

    Parameters

    • setCallback: string

      The name of the callback function to call when the property is set.

    • sourceKey: Nullable<string> = null

      The name of the private field that stores the value (defaults to "_" + accessor name).

    Returns <This, V>(
        _value: ClassAccessorDecoratorTarget<This, V>,
        context: ClassAccessorDecoratorContext<This, V>,
    ) => ClassAccessorDecoratorResult<This, V>

    An accessor decorator.