PowerKeys Scripting API
    Preparing search index...

    Interface ValueWrapper<T>

    A UI element that holds a runtime-validated typed value and notifies listeners on change. Returned by AddSlider, AddTextInput, AddToggle, AddDropdown, AddTextArea, AddColorPicker, AddFilePicker, AddDirectoryPicker, and AddListBox. Values are automatically persisted on every valid change and restored on next run. A saved value with the wrong type falls back to that control's documented default instead of leaking stale cross-type state.

    interface ValueWrapper<T> {
        Hide: () => void;
        Show: () => void;
        Destroy: () => void;
        SetText: (text: string) => void;
        SetStyle: (style: UIStyle) => void;
        GetValue: () => T;
        SetValue: (val: T) => void;
        OnChange: (callback: EventCallback<[newValue: T]>) => void;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index
    Hide: () => void

    Hides the element without destroying it. Call Show() to make it visible again.

    Show: () => void

    Makes a previously hidden element visible again.

    Destroy: () => void

    Permanently removes the element from the UI panel.

    SetText: (text: string) => void

    Updates the element's display text when the element has a label.

    SetStyle: (style: UIStyle) => void

    Merges supported renderer style properties into the element; unsupported keys are ignored.

    GetValue: () => T

    Returns the current value of the element.

    SetValue: (val: T) => void

    Validates and normalizes the value for this control, persists it, and triggers OnChange with the normalized value. A wrong type or invalid constrained value throws without changing storage.

    OnChange: (callback: EventCallback<[newValue: T]>) => void

    Registers a callback that fires whenever the user changes the value.