stateUtils.d.ts 1.9 KB

123456789101112131415161718
  1. import { EventObject, StateValue } from './types';
  2. import { StateNode } from './StateNode';
  3. declare type Configuration<TC, TE extends EventObject> = Iterable<StateNode<TC, any, TE>>;
  4. declare type AdjList<TC, TE extends EventObject> = Map<StateNode<TC, any, TE>, Array<StateNode<TC, any, TE>>>;
  5. export declare const isLeafNode: (stateNode: StateNode<any, any, any, any, any, any>) => boolean;
  6. export declare function getAllChildren<TC, TE extends EventObject>(stateNode: StateNode<TC, any, TE>): Array<StateNode<TC, any, TE>>;
  7. export declare function getChildren<TC, TE extends EventObject>(stateNode: StateNode<TC, any, TE>): Array<StateNode<TC, any, TE>>;
  8. export declare function getAllStateNodes<TC, TE extends EventObject>(stateNode: StateNode<TC, any, TE, any, any, any>): Array<StateNode<TC, any, TE, any, any, any>>;
  9. export declare function getConfiguration<TC, TE extends EventObject>(prevStateNodes: Iterable<StateNode<TC, any, TE, any, any, any>>, stateNodes: Iterable<StateNode<TC, any, TE, any, any, any>>): Set<StateNode<TC, any, TE, any, any, any>>;
  10. export declare function getAdjList<TC, TE extends EventObject>(configuration: Configuration<TC, TE>): AdjList<TC, TE>;
  11. export declare function getValue<TC, TE extends EventObject>(rootNode: StateNode<TC, any, TE, any>, configuration: Configuration<TC, TE>): StateValue;
  12. export declare function has<T>(iterable: Iterable<T>, item: T): boolean;
  13. export declare function nextEvents<TC, TE extends EventObject>(configuration: Array<StateNode<TC, any, TE>>): Array<TE['type']>;
  14. export declare function isInFinalState<TC, TE extends EventObject>(configuration: Array<StateNode<TC, any, TE, any, any, any>>, stateNode: StateNode<TC, any, TE, any, any, any>): boolean;
  15. export declare function getMeta(configuration?: StateNode[]): Record<string, any>;
  16. export declare function getTagsFromConfiguration(configuration: StateNode<any, any, any, any>[]): Set<string>;
  17. export {};
  18. //# sourceMappingURL=stateUtils.d.ts.map