InteractionRegistry
Defined in: packages/core/src/interactions/registry.ts:61
A registry of the named interactions core ships.
Remarks
Section titled “Remarks”Deliberately an instance rather than a module singleton, mirroring
ExtensionRegistry: two documents from different trust domains, or two
tests, each get their own registry with no shared state. The allowlist is
seeded once at construction — the built-in click and hover sets by default —
and never mutated after: there is no register/add method, so the
vocabulary a given registry resolves is fixed for its lifetime.
The closed-world guarantee is about the document trust boundary: an untrusted document can never introduce a handler, because a document only names interactions and an unknown name is denied — it cannot pass a function in. Host JS can, of course, construct a registry seeded with its own interaction sets; that is host code writing host code, outside the document trust boundary, and is not a path a document can reach.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InteractionRegistry(
click?,hover?):InteractionRegistry
Defined in: packages/core/src/interactions/registry.ts:81
Seed the registry from the click and hover interaction sets.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
click | readonly Interaction<unknown>[] | CLICK_INTERACTIONS | Click interactions in dispatch order (default: the built-in CLICK_INTERACTIONS — popup before flyTo). |
hover | readonly Interaction<unknown>[] | HOVER_INTERACTIONS | Hover interactions in dispatch order (default: the built-in HOVER_INTERACTIONS). |
Returns
Section titled “Returns”InteractionRegistry
Throws
Section titled “Throws”if two interactions share a name within one trigger list — a
name must resolve to exactly one handler per trigger, and a silent
last-wins would let one shadow another. A name that appears once in the
click list AND once in the hover list is not a duplicate: it is one
logical interaction key (e.g. emit) valid on both triggers, each with
its own runtime. Such a name is deduped into byName — the
trigger-agnostic allowlist — as a single membership.
Methods
Section titled “Methods”clickInteractions()
Section titled “clickInteractions()”clickInteractions(): readonly
Interaction<unknown>[]
Defined in: packages/core/src/interactions/registry.ts:150
The click interactions in dispatch order.
Returns
Section titled “Returns”readonly Interaction<unknown>[]
Remarks
Section titled “Remarks”The ordered set EventHandler/attachInteractions iterate for a click
trigger. Order is behavior — popup dispatches before flyTo so the popup
opens at the clicked point and then travels with the camera.
has(
name):boolean
Defined in: packages/core/src/interactions/registry.ts:138
Whether a name is on the allowlist.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name | string |
Returns
Section titled “Returns”boolean
hoverInteractions()
Section titled “hoverInteractions()”hoverInteractions(): readonly
Interaction<unknown>[]
Defined in: packages/core/src/interactions/registry.ts:155
The hover interactions in dispatch order.
Returns
Section titled “Returns”readonly Interaction<unknown>[]
resolve()
Section titled “resolve()”resolve(
name):Interaction<unknown> |InteractionDenial
Defined in: packages/core/src/interactions/registry.ts:124
Resolve an interaction name to its handler, or deny it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name | string |
Returns
Section titled “Returns”Interaction<unknown> | InteractionDenial
the Interaction when name is on the allowlist, otherwise
an InteractionDenial carrying a warning. Default-deny: an unknown
name is never a handler, so a by-name caller drops it with a diagnostic
rather than throwing or running something unintended.