// IStateMonitor.swift // Protocol for monitoring state changes in a StateMachine // Ported from Android implementation import Foundation /// Protocol for monitoring state changes in a StateMachine public protocol IStateMonitor { /// Called when a state transition occurs /// - Parameters: /// - stateMachine: The state machine that changed state /// - state: The new state /// - lastState: The previous state /// - params: Optional parameters associated with the transition func onStateChanged(stateMachine: StateMachine, state: IState, lastState: IState?, params: Any?) }