MAIDR JavaScript API
    Preparing search index...

    ViewModel for managing application settings and configuration.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    store: EnhancedStore
    disposables: Disposable[]

    Accessors

    • get initialSection(): | "audio"
      | "braille"
      | "general"
      | "visual"
      | "ai"
      | "about"
      | null

      The page the dialog should open on, when its opener asked for one.

      Read once by the dialog as it mounts. It is not in Redux because the dialog reads this view model directly rather than subscribing to the store, so a dispatch would not reach it — the same reason the tactile connection state is held outside the store.

      Returns "audio" | "braille" | "general" | "visual" | "ai" | "about" | null

      The requested section, or null when the opener had no preference

    Methods

    • Toggles the visibility of the settings modal.

      Parameters

      • Optionalsection: "audio" | "braille" | "general" | "visual" | "ai" | "about"

      Returns void

    • Subscribes to changes in the tactile display connection.

      Settings reads this view model directly rather than through a Redux selector, so connection progress reaches the dialog through this subscription instead of a store update the dialog would not re-render for.

      Parameters

      • listener: (state: DotPadState) => void

        Called with each new connection state

      Returns Disposable

      A disposable that ends the subscription

    • Fetches the tactile display SDK ahead of any connect attempt, so the connect click is not spent waiting for it.

      Returns void

    • Opens the browser's device picker and connects to a tactile display.

      Must be reached synchronously from the user's click: the browser only shows the picker while a gesture is still in progress, and anything awaited first spends that activation.

      Parameters

      • transport: DotPadTransport

        Whether to look for the device over Bluetooth or USB

      Returns Promise<DotPadState>

      The connection state once the attempt settles