declare type StateTransitions = WeakMap, WeakSet>>; export declare const _states: unique symbol; export declare const _stateTransitions: unique symbol; export declare const _prevState: unique symbol; export declare const _currState: unique symbol; export declare class StateMachineBuilder { [_states]: Map>; [_stateTransitions]: Array<[string, Array]> | undefined; constructor(); withTransitions(transitions: Array<[string, Array]>): this; withStates(names: string[], actions?: Actions): this; withState(name: string, actions?: Actions): this; private addStateUnchecked; build(currentStateName: string): StateMachine; private buildStates; private buildTransitions; } export declare class StateMachine { [_states]: State[]; [_stateTransitions]: StateTransitions; [_prevState]: State | undefined; [_currState]: State; constructor(states: State[], transitions: StateTransitions, currentState: State); changeState(sourceState: string | State, context?: Context): Promise; hasTransition(to: string | State): boolean; allowedTransitionStates(): State[]; } declare const _stateName: unique symbol; declare const _stateActions: unique symbol; interface Actions { beforeExit?(fromState: State, toState: State, context: Context): boolean; onEntry?(fromState: State, toState: State, context: Context): Promise | void; } export declare class State { [_stateActions]: Actions; [_stateName]: string; get name(): string; constructor(name: string, actions?: Actions); entry(fromState: State, toState: State, context: Context): Promise; exit(fromState: State, toState: State, context: Context): boolean; toString(): string; toJSON(): string; } export declare class FsmError extends Error { } export {};