Skip to content

InteractionRegistry

Defined in: packages/core/src/interactions/registry.ts:61

A registry of the named interactions core ships.

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.

new InteractionRegistry(click?, hover?): InteractionRegistry

Defined in: packages/core/src/interactions/registry.ts:81

Seed the registry from the click and hover interaction sets.

ParameterTypeDefault valueDescription
clickreadonly Interaction<unknown>[]CLICK_INTERACTIONSClick interactions in dispatch order (default: the built-in CLICK_INTERACTIONS — popup before flyTo).
hoverreadonly Interaction<unknown>[]HOVER_INTERACTIONSHover interactions in dispatch order (default: the built-in HOVER_INTERACTIONS).

InteractionRegistry

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.

clickInteractions(): readonly Interaction<unknown>[]

Defined in: packages/core/src/interactions/registry.ts:150

The click interactions in dispatch order.

readonly Interaction<unknown>[]

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.

ParameterType
namestring

boolean


hoverInteractions(): readonly Interaction<unknown>[]

Defined in: packages/core/src/interactions/registry.ts:155

The hover interactions in dispatch order.

readonly Interaction<unknown>[]


resolve(name): Interaction<unknown> | InteractionDenial

Defined in: packages/core/src/interactions/registry.ts:124

Resolve an interaction name to its handler, or deny it.

ParameterType
namestring

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.