import { StateMachine } from './stateMachine'; /** * Base for user-defined States. */ export interface MachineState { } /** * Base for user-defined States. */ export interface MachineInputSource { } /** * Set this to `once` to update the input only once at startup. Set to `always` to update it with every tick, or * supply your own callback to implement a custom condition. */ export declare type InputPolicy> = InputPolicyCallback | 'once' | 'always'; /** * A user-defined policy for an input polling. Must return true for the input to be polled on that specific `tick`. */ export declare type InputPolicyCallback> = { (state: Readonly, m: M): boolean; }; /** * An activation condition, takes two arguments and must return true for the associated action to fire. */ export declare type ActivationCond = (state: Readonly, machine: StateMachine) => boolean; /** * An activation action, takes two arguments and will only be executed during a tick * when the associated condition returns true. */ export declare type ActivationAction = (state: Readonly, machine: StateMachine) => Pick | void; /** * An activation condition, takes two arguments and must return true for the associated action to fire. */ export declare type PriorityExpression = (state: Readonly, machine: StateMachine) => number; /** * The HistoryManager interface allows for state manipulation and the rewinding of a program. */ export interface IHistory { readonly tick: number; readonly records: ReadonlyArray>; readonly currentState: Readonly; readonly initialState: Readonly; readonly nextState: Readonly & I>; /** * Limit the maximum number of past history states kept on record. */ limit: number; /** * Rewind time to `t`, the rest of the currently executing tick will be ignored. * A partial state can be passed as the second argument to mutate the rewound state and take back information to * the past state. * @param {number} t The discrete tick in time to rewind to. * @param {Partial} mutate Any mutations to apply to the state after rewinding. */ rewind(t: number, mutate?: Partial): void; /** * Clears the state history. Rewinds to the beginning, and the rest of the current tick will be aborted. */ clear(): void; }