String literal type representing valid states
Context data type for the state machine
Add a single allowed transition
Check if transition to a specific state is allowed
Target state to check
Clear transition history
Enable or disable history tracking
Optional
enable: booleanWhether to enable history
Fire an event
Event name to fire
Optional
payload: unknownOptional data to pass to handlers
Get the transition history array
Get the internal Valtio store for use with useSnapshot
Transition to a new state
Target state
Optional
payload: unknownOptional data to pass to transition handlers
Remove event handler(s)
Event name
Optional
handler: EventHandler<TContext>Specific handler to remove (removes all if omitted)
Register event handler
Event name to listen for
Function to call when event fires
Register one-time event handler
Event name to listen for
Function to call when event fires (once)
Add a listener for context changes
Function to call when context changes
Function to remove the listener
Add a listener for state transitions
Function to call on transition
Remove an allowed transition
Reset context to initial values
Set maximum history size
Maximum number of history items
Set allowed transitions for a state
Register a callback for a specific state
State to watch
Function to call when in this state
Main interface for the state machine