import 'reflect-metadata'; import { ActivationCond, InputPolicy, MachineInputSource, MachineState, PriorityExpression } from './interfaces'; import { StateMachine } from './stateMachine'; import { ConditionBuilder, WhenDecoratorWithChain } from './util'; export * from './stateMachine'; export * from './interfaces'; /** * Builds a condition for the final decorator. */ /** * A TypeScript decorator to declare a method as an action with one or more attached a conditions. * @param cond A condition to match against every tick or true. */ export declare function when(cond: ActivationCond | true, chainedHistory?: ConditionBuilder[]): WhenDecoratorWithChain; /** * A chainable TypeScript decorator to declare a method as an action with one or more inhibitor * conditions. * An inhibitor prevents the execution of the action for one tick if the others can activate. * @param {ActivationCond[]} inhibitor The inhibiting member action. * @return {WhenDecoratorWithChain} */ export declare function unless(inhibitor: ActivationCond, chainedHistory?: ConditionBuilder[]): WhenDecoratorWithChain; /** * A chainable TypeScript decorator to declare a method as an action with one or more inhibitor * actions. * An inhibitor prevents the execution of the action for one tick if the others can activate. * @param {string} inhibitorAction The name of the inhibiting member action. * @return {WhenDecoratorWithChain} */ export declare function inhibitedBy = any>(inhibitorAction: keyof M, chainedHistory?: ConditionBuilder[]): WhenDecoratorWithChain; /** * Mark a property as a state machine input. This will poll the target with every tick and * update the provided rename in the state. * @param policy {'once'|'always'|} * @param transform An optional transformation function to transform the value. * @param rename A new name for the variable in the state object. */ export declare function input = any, K extends keyof I = any, T extends I[K] = any>(policy?: InputPolicy, transform?: { (value: T): T; }, rename?: K): PropertyDecorator; export declare function priority = any>(priority: number | PriorityExpression, chainedHistory?: ConditionBuilder[]): WhenDecoratorWithChain; export declare type StateObject = S & Readonly;