Documentation - v20.0.0-dev
    Preparing search index...

    A number setting, kept between its min and max: a value outside is clamped, a value that is not a number (e.g. read from a storage) throws a TypeError, NaN a RangeError. Whole with a whole step.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    defaultValue: number

    The value at first and after reset.

    description: string

    What it changes, for the user (see ValueControllerOptions.description).

    hidden: boolean

    Whether an interface leaves it out (see ValueControllerOptions.hidden).

    isNumberController: true

    Tells a number setting, without instanceof (e.g. for an interface's slider).

    isValueController: true

    Tells a setting from the other fields of a Settings, without instanceof.

    max: number

    Largest value.

    min: number

    Smallest value.

    onChange: Signal<(value: number) => void> = ...

    Emitted with the new value when it changes; not when the value set is the current one.

    skipSave: boolean

    Whether the saved settings leave it out (see ValueControllerOptions.skipSave).

    step: number

    Step of a control editing it.

    Accessors

    • get value(): T

      The current value.

      Returns T

    • set value(value: T): void

      Sets the value, validated first (see validate).

      Parameters

      • value: T

      Returns void

    Methods

    • Sets the value back to defaultValue.

      Returns void

    • The value kept for value: value itself by default; a subclass corrects it or throws a RangeError.

      Parameters

      • value: number

      Returns number