/**
 * Form State Machine Logic
 * Lightweight engine for declarative form transitions and branching.
 */
export type StateIdentifier = string;
export interface StateMachineConfig<TContext = any> {
    /** The initial state name */
    initial: StateIdentifier;
    /** State definitions */
    states: Record<StateIdentifier, StateDefinition<TContext>>;
}
export interface StateDefinition<TContext = any> {
    /** Map of events to transitions */
    on?: Record<string, Transition<TContext>>;
    /** Actions executed when entering this state */
    entry?: Array<(context: TContext) => void>;
    /** Actions executed when exiting this state */
    exit?: Array<(context: TContext) => void>;
}
export type Transition<TContext = any> = StateIdentifier | TransitionConfig<TContext>;
export interface TransitionConfig<TContext = any> {
    /** Target state */
    target: StateIdentifier;
    /** Optional conditional guard */
    guard?: (context: TContext) => boolean;
    /** Actions to execute during transition */
    actions?: Array<(context: TContext) => void>;
}
/**
 * Result of a state transition
 */
export interface TransitionResult<TContext> {
    /** The new state name */
    value: StateIdentifier;
    /** Actions to be performed by the runner */
    actions: Array<(context: TContext) => void>;
    /** Whether the transition actually occurred */
    changed: boolean;
}
/**
 * Pure transition function for the state machine
 */
export declare function transition<TContext>(config: StateMachineConfig<TContext>, currentState: StateIdentifier, event: string, context: TContext): TransitionResult<TContext>;
