@modoki/engine / index / UIActionContext
Interface: UIActionContext
Context passed to every action handler.
Actions
emit
emit: (
type,payload?) =>void
Record a semantic event to the journal (Percept), pre-bound to this action's world — so a handler never has to pass world (and can't target the wrong one in an async callback). Any koota Entity in the payload is auto-converted to its stable GUID. Prefer this over the free emit(type, payload, world).
Parameters
type
string
payload?
unknown
Returns
void
params?
optionalparams?:Record<string,unknown>
Typed arguments the binding authored, keyed by the action's params schema (with the $value token already resolved to the event value).
payload?
optionalpayload?:UIActionPayload
The triggering event's value (input/slider value, or a binding's authored single payload). Use for the $value token and schema-less actions.
target?
optionaltarget?:Entity
Entity the binding targets (resolved from the binding's target GUID), if any.
world
world:
World
The current ECS world.