jssm 5.86.2 → 5.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/jssm.d.ts CHANGED
@@ -669,6 +669,26 @@ declare class Machine<mDT> {
669
669
  post_hook_entry(to: string, handler: HookHandler<mDT>): Machine<mDT>;
670
670
  post_hook_exit(from: string, handler: HookHandler<mDT>): Machine<mDT>;
671
671
  edges_between(from: string, to: string): JssmTransition<StateType, mDT>[];
672
+ /*********
673
+ *
674
+ * Replace the current state and data with no regard to the graph.
675
+ *
676
+ * ```typescript
677
+ * import { sm } from 'jssm';
678
+ *
679
+ * const machine = sm`a -> b -> c;`;
680
+ * console.log( machine.state() ); // 'a'
681
+ *
682
+ * machine.go('b');
683
+ * machine.go('c');
684
+ * console.log( machine.state() ); // 'c'
685
+ *
686
+ * machine.override('a');
687
+ * console.log( machine.state() ); // 'a'
688
+ * ```
689
+ *
690
+ */
691
+ override(newState: StateType, newData?: mDT | undefined): void;
672
692
  transition_impl(newStateOrAction: StateType, newData: mDT | undefined, wasForced: boolean, wasAction: boolean): boolean;
673
693
  /*********
674
694
  *
package/jssm_types.d.ts CHANGED
@@ -346,10 +346,12 @@ declare type HookComplexResult<mDT> = {
346
346
  pass: boolean;
347
347
  state?: StateType;
348
348
  data?: mDT;
349
+ next_data?: mDT;
349
350
  };
350
351
  declare type HookResult<mDT> = true | false | undefined | void | HookComplexResult<mDT>; /** Documents whether a hook succeeded, either with a primitive or a reference to the hook complex object */
351
352
  declare type HookContext<mDT> = {
352
353
  data: mDT;
354
+ next_data: mDT;
353
355
  };
354
356
  declare type HookHandler<mDT> = (hook_context: HookContext<mDT>) => HookResult<mDT>;
355
357
  declare type PostHookHandler<mDT> = (hook_context: HookContext<mDT>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jssm",
3
- "version": "5.86.2",
3
+ "version": "5.87.0",
4
4
  "engines": {
5
5
  "node": ">=10.0.0"
6
6
  },