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/CHANGELOG.md +51 -59
- package/README.md +2 -2
- package/dist/es6/jssm.d.ts +20 -0
- package/dist/es6/jssm.js +35 -0
- package/dist/es6/jssm_types.d.ts +2 -0
- package/dist/es6/version.js +1 -1
- package/dist/jssm.es5.cjs.js +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/jssm.d.ts +20 -0
- package/jssm_types.d.ts +2 -0
- package/package.json +1 -1
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;
|