FsmState
Defined in: src/modules/fsm/fsm.ts:20
One state’s behaviour. update returns the next state key to
transition, or null to stay. onEnter / onExit fire on transition
boundaries — use them to reset timers or set a target. self gives the
handler the machine’s elapsedMs (time-in-state) and current.
Type Parameters
Section titled “Type Parameters”TCtx
TKey extends string
Properties
Section titled “Properties”onEnter?
Section titled “onEnter?”
optionalonEnter?: (ctx,self) =>void
Defined in: src/modules/fsm/fsm.ts:21
Parameters
Section titled “Parameters”TCtx
Fsm<TKey>
Returns
Section titled “Returns”void
onExit?
Section titled “onExit?”
optionalonExit?: (ctx,self) =>void
Defined in: src/modules/fsm/fsm.ts:22
Parameters
Section titled “Parameters”TCtx
Fsm<TKey>
Returns
Section titled “Returns”void
update
Section titled “update”update: (
ctx,self) =>TKey|null
Defined in: src/modules/fsm/fsm.ts:23
Parameters
Section titled “Parameters”TCtx
Fsm<TKey>
Returns
Section titled “Returns”TKey | null