jssm 5.72.2 → 5.72.3

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
@@ -1,6 +1,6 @@
1
1
  declare type StateType = string;
2
2
  import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
3
- JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler } from './jssm_types';
3
+ JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler, HookResult } from './jssm_types';
4
4
  import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
5
5
  import { shapes, gviz_shapes, named_colors } from './jssm_constants';
6
6
  import { version } from './version';
@@ -223,11 +223,11 @@ declare class Machine<mDT> {
223
223
  _has_exit_hooks: boolean;
224
224
  _has_global_action_hooks: boolean;
225
225
  _has_transition_hooks: boolean;
226
- _hooks: Map<string, Function>;
227
- _named_hooks: Map<string, Function>;
228
- _entry_hooks: Map<string, Function>;
229
- _exit_hooks: Map<string, Function>;
230
- _global_action_hooks: Map<string, Function>;
226
+ _hooks: Map<string, HookHandler<mDT>>;
227
+ _named_hooks: Map<string, HookHandler<mDT>>;
228
+ _entry_hooks: Map<string, HookHandler<mDT>>;
229
+ _exit_hooks: Map<string, HookHandler<mDT>>;
230
+ _global_action_hooks: Map<string, HookHandler<mDT>>;
231
231
  _any_action_hook: HookHandler<mDT> | undefined;
232
232
  _standard_transition_hook: HookHandler<mDT> | undefined;
233
233
  _main_transition_hook: HookHandler<mDT> | undefined;
@@ -669,4 +669,5 @@ declare function sm<mDT>(template_strings: TemplateStringsArray, ...remainder: a
669
669
  *
670
670
  */
671
671
  declare function from<mDT>(MachineAsString: string, ExtraConstructorFields?: Partial<JssmGenericConfig<mDT>> | undefined): Machine<mDT>;
672
- export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
672
+ declare function is_hook_rejection(hr: HookResult): boolean;
673
+ export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors, is_hook_rejection };
package/jssm_types.d.ts CHANGED
@@ -198,6 +198,11 @@ declare type ExitHook<mDT> = {
198
198
  handler: HookHandler<mDT>;
199
199
  };
200
200
  declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT>;
201
+ declare type HookComplexResult<mDT> = {
202
+ pass: boolean;
203
+ state?: StateType;
204
+ data?: mDT;
205
+ };
201
206
  declare type HookResult = true | false | undefined | void;
202
207
  declare type HookContext<mDT> = {
203
208
  data: mDT;
@@ -206,4 +211,4 @@ declare type HookHandler<mDT> = (hook_context: HookContext<mDT>) => HookResult;
206
211
  declare type JssmErrorExtendedInfo = {
207
212
  requested_state?: StateType | undefined;
208
213
  };
209
- export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookResult };
214
+ export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jssm",
3
- "version": "5.72.2",
3
+ "version": "5.72.3",
4
4
  "engines": {
5
5
  "node": ">=10.0.0"
6
6
  },