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"
      | "shortcuts"
      | "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" | "shortcuts" | "ai" | "about" | null

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

    • get supportsAgentTools(): boolean

      Reports whether this browser offers WebMCP, so the dialog shows the agent-tools setting only where it can do something.

      Returns boolean

      True when the browser can take MAIDR's WebMCP tools

    Methods

    • Toggles the visibility of the settings modal.

      Parameters

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

      Returns void

    • The shortcuts the Keyboard Shortcuts tab lists, with the keys the dialog's unsaved edits give them.

      These return rather than dispatch, like the tactile state below: the dialog holds its edits in its own state until Save, and a changed shortcut is one of those edits.

      Parameters

      • overrides: Readonly<Record<string, string>>

        The shortcuts as the dialog's edits have them

      Returns HelpMenuItem[]

      Every shortcut the reader may change, grouped

    • Gives a command the shortcut the reader pressed.

      Parameters

      • commandKey: string

        The command to rebind

      • combo: string

        The new shortcut, as hotkeys-js would bind it

      • overrides: Readonly<Record<string, string>>

        The shortcuts as the dialog's edits have them

      Returns RebindResult

      What happened, what to announce, and the edits after it

    • Puts one command's default shortcut back.

      Parameters

      • commandKey: string

        The command to restore

      • overrides: Readonly<Record<string, string>>

        The shortcuts as the dialog's edits have them

      Returns RebindResult

      What happened, what to announce, and the edits after it

    • Puts every default shortcut back.

      Parameters

      • overrides: Readonly<Record<string, string>>

        The shortcuts as the dialog's edits have them

      Returns RebindResult

      What happened, what to announce, and the edits after it

    • 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 what connecting to a tactile display would otherwise wait on, so the connect click is not spent waiting for it: the DotPad SDK for a DotPad, nothing for a Monarch.

      Parameters

      • deviceId: string | null

        The device the reader picked, or null when none yet

      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 a DotPad over Bluetooth or USB, or for a Monarch over WebHID

      Returns Promise<DotPadState>

      The connection state once the attempt settles