createBehavioralFsm
createBehavioralFsm<
TClient,TStates>(config):BehavioralFsm<TClient,StateNamesOf<TStates>,InputNamesOf<TStates>>
Defined in: behavioral-fsm.ts:724
Create a behavioral FSM (one definition, many clients) from a config object.
Generic parameters are inferred automatically:
TClientmust be provided explicitly as a type parameter (it can’t be inferred from the config since nocontextproperty exists at the FSM level).TStatesis captured withconstinference to preserve string literal types, enabling compile-time validation of transition targets andhandle()input names.
State names, input names, and all handler signatures derive from TStates.
Type Parameters
Section titled “Type Parameters”TClient
Section titled “TClient”TClient extends object
TStates
Section titled “TStates”TStates extends Record<string, Record<string, unknown>>
Parameters
Section titled “Parameters”config
Section titled “config”FsmConfig<TClient, TStates>
Returns
Section titled “Returns”BehavioralFsm<TClient, StateNamesOf<TStates>, InputNamesOf<TStates>>