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

    A setting taking one of its options: another value throws a RangeError.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    defaultValue: T

    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).

    isSelectController: true

    Tells a setting of options, without instanceof (e.g. for an interface's list).

    isValueController: true

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

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

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

    options: readonly T[]

    The values it takes.

    skipSave: boolean

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

    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

    • The name of an option for the user: its label, else the option written as text.

      Parameters

      • option: T

      Returns string

    • 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: T

      Returns T