If you register an event handler on a specific event (i.e. Engine.on("my-event", ...)), the first argument of the method will be the params of the Event definition (type: Record<string, any>), not the Event object itself.
I'm not sure if this only the case for specific events or more generally the EventHandler:
|
export type EventHandler = ( |
|
event: Event, |
|
almanac: Almanac, |
|
ruleResult: RuleResult |
|
) => void; |
If you register an event handler on a specific event (i.e.
Engine.on("my-event", ...)), the first argument of the method will be theparamsof theEventdefinition (type:Record<string, any>), not theEventobject itself.I'm not sure if this only the case for specific events or more generally the
EventHandler:json-rules-engine/types/index.d.ts
Lines 106 to 110 in 90272d6