import {SimpleStateMachineDescription} from "./SimpleStateMachineDescription";

export class SimpleStateMachine {
    get description(): SimpleStateMachineDescription

    constructor(d: SimpleStateMachineDescription)

    addEventHandlerStateEntry(state: number, handler: (old_state: number, current_state: number) => any, thisArg?: any): void

    removeEventHandlerStateEntry(state: number, handler: (old_state: number, current_state: number) => any, thisArg?: any): void

    addEventHandlerStateExit(state: number, handler: (old_state: number, current_state: number) => any, thisArg?: any): void

    removeEventHandlerStateExit(state: number, handler: (old_state: number, current_state: number) => any, thisArg?: any): void


    setState(s: number): void

    getState(): number

    /**
     * @throws if no path could be found to target state
     */
    navigateTo(target: number): void

    advance<T>(input: T, preStateChangeHook?: (target: number, input: T) => any): boolean
}
