Module interactions/declarativeExperimental

@honua/sdk-js/interactions/declarative — compiles a standard interactions[] block (geospatial-mcp ADR-0030) onto this SDK's existing imperative binding primitives.

The standard constrains the document, not the dispatcher: "client runtimes implement dispatch by compiling bindings onto whatever imperative primitives they already have". That is exactly what this module does — it owns no event plumbing of its own, only a compile table from the closed (on.event, do.verb) vocabulary onto createSelectionHandler, createHoverHandler, bindTableSelectionToExploration, bindFilterControlsToExploration, and subscribeExplorationSelector.

Three properties are load-bearing and asserted by the suite:

  1. Validate before binding. compileHonuaInteractions runs the whole block through validateHonuaInteractions plus reference resolution against the components it was handed. A block with issues binds nothing — the standard rejects over-cap and malformed documents rather than truncating them.
  2. Actions never emit events. A verb-driven state change must not re-enter the dispatcher. Two mechanisms enforce it: every compiled handler is skipped while an action is in flight (#dispatching), and exploration-backed subscriptions run with the view controller's default includeSelf: false, so a change this compiler originated is never delivered back to this compiler. There is no cycle detection because there can be no cycle.
  3. Unsupported pairs are named, never dropped. When a binding's (on.event, do.verb) pair — or the component behind a ref — has no primitive to compile onto, it lands in HonuaCompiledInteractions.unsupported with the pair spelled out, so a host can surface a real "this runtime cannot honor that binding" message instead of silently rendering an inert app.

The compiler surface tracks geospatial-mcp ADR-0030 while that ADR is Proposed; the component-adapter shapes may gain fields.

Index

Interfaces

Type Aliases

Variables

Functions