turbodombuilder - v0.9.22
    Preparing search index...

    Type Alias AutoOptions<Type>

    Options for configuring the @auto decorator.

    type AutoOptions<Type = any> = {
        override?: boolean;
        cancelIfUnchanged?: boolean;
        setIfUndefined?: boolean;
        returnDefinedGetterValue?: boolean;
        executeSetterBeforeStoring?: boolean;
        defaultValue?: Type;
        defaultValueCallback?: () => Type;
        initialValue?: Type;
        initialValueCallback?: () => Type;
        preprocessValue?: (value: Type) => Type;
        callBefore?: (value: Type) => void;
        callAfter?: (value: Type) => void;
    }

    Type Parameters

    • Type = any
    Index

    Properties

    override?: boolean

    If true, will try to override the defined property in super.

    cancelIfUnchanged?: boolean

    If true, cancels the setter if the new value is the same as the current value. Defaults to true.

    setIfUndefined?: boolean

    If true, will fire the setter when the underlying value is undefined and the program is trying to access it (maybe through its getter).

    returnDefinedGetterValue?: boolean

    If true and a custom getter is defined, the return value of this getter will be returned when accessing the property. Otherwise, the underlying saved value will always be returned. Defaults to false.

    executeSetterBeforeStoring?: boolean

    If true, when setting the value, the setter will execute first, and then the value will be stored. In this case, accessing the value in the setter will return the previous value. Defaults to false.

    defaultValue?: Type

    If defined, whenever the underlying value is undefined and trying to be accessed, it will be set to defaultValue through the setter before getting accessed.

    defaultValueCallback?: () => Type

    If defined, whenever the underlying value is undefined and trying to be accessed, it will be set to the return value of defaultValueCallback through the setter before getting accessed.

    initialValue?: Type

    If defined, on initialization, the property will be set to initialValue.

    initialValueCallback?: () => Type

    If defined, on initialization, the property will be set to the return value of initialValueCallback.

    preprocessValue?: (value: Type) => Type

    Optional callback to execute on the value and preprocess it just before it is set. The returned value will be stored.

    callBefore?: (value: Type) => void

    Optional function to call before preprocessing and setting the value.

    callAfter?: (value: Type) => void

    Optional function to call after setting the value.