jssm 5.104.2 → 5.112.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.
Files changed (62) hide show
  1. package/.gitattributes +17 -6
  2. package/.log-progress.json +9 -0
  3. package/CHANGELOG.md +130 -45
  4. package/CLAUDE.md +11 -0
  5. package/MIGRATING-jssm-viz.md +67 -0
  6. package/README.md +179 -882
  7. package/dist/es6/fsl_parser.js +1 -1
  8. package/dist/es6/jssm.d.ts +773 -39
  9. package/dist/es6/jssm.js +921 -89
  10. package/dist/es6/jssm_arrow.js +24 -0
  11. package/dist/es6/jssm_compiler.d.ts +17 -2
  12. package/dist/es6/jssm_compiler.js +17 -3
  13. package/dist/es6/jssm_constants.d.ts +27 -0
  14. package/dist/es6/jssm_constants.js +27 -0
  15. package/dist/es6/jssm_error.d.ts +19 -0
  16. package/dist/es6/jssm_error.js +19 -0
  17. package/dist/es6/jssm_theme.d.ts +11 -0
  18. package/dist/es6/jssm_theme.js +11 -0
  19. package/dist/es6/jssm_types.d.ts +29 -3
  20. package/dist/es6/jssm_util.d.ts +161 -9
  21. package/dist/es6/jssm_util.js +174 -17
  22. package/dist/es6/jssm_viz.d.ts +175 -0
  23. package/dist/es6/jssm_viz.js +560 -0
  24. package/dist/es6/jssm_viz_colors.d.ts +63 -0
  25. package/dist/es6/jssm_viz_colors.js +63 -0
  26. package/dist/es6/version.js +1 -1
  27. package/dist/jssm.es5.cjs +1 -1
  28. package/dist/jssm.es5.iife.js +1 -0
  29. package/dist/jssm.es5.nonmin.cjs +2201 -870
  30. package/dist/jssm.es6.mjs +1 -1
  31. package/dist/jssm.es6.nonmin.cjs +2200 -871
  32. package/dist/jssm_viz.cjs +1 -0
  33. package/dist/{jssm.es5.iife.nonmin.cjs → jssm_viz.es5.iife.nonmin.cjs} +2589 -1090
  34. package/dist/jssm_viz.es5.nonmin.cjs +24674 -0
  35. package/dist/jssm_viz.es6.nonmin.cjs +24661 -0
  36. package/dist/jssm_viz.iife.cjs +1 -0
  37. package/dist/jssm_viz.mjs +1 -0
  38. package/jest-dragon.config.cjs +4 -1
  39. package/jest-spec.config.cjs +9 -6
  40. package/jest-stoch.config.cjs +4 -1
  41. package/jest-unicode.config.cjs +4 -1
  42. package/jssm.es5.d.cts +950 -41
  43. package/jssm.es6.d.ts +950 -41
  44. package/jssm_viz.es5.d.cts +2127 -0
  45. package/jssm_viz.es6.d.ts +2127 -0
  46. package/log-progress.data.json +28 -0
  47. package/package.json +56 -23
  48. package/rollup.config.viz.es5.js +46 -0
  49. package/rollup.config.viz.es6.js +46 -0
  50. package/rollup.config.viz.iife.js +36 -0
  51. package/typedoc-options.cjs +4 -3
  52. package/dist/jssm.es5.iife.cjs +0 -1
  53. package/fsl_parser.d.ts +0 -6
  54. package/jssm.d.ts +0 -1141
  55. package/jssm_arrow.d.ts +0 -53
  56. package/jssm_compiler.d.ts +0 -135
  57. package/jssm_constants.d.ts +0 -5
  58. package/jssm_error.d.ts +0 -8
  59. package/jssm_theme.d.ts +0 -4
  60. package/jssm_types.d.ts +0 -378
  61. package/jssm_util.d.ts +0 -106
  62. package/version.d.ts +0 -2
package/jssm_arrow.d.ts DELETED
@@ -1,53 +0,0 @@
1
- import { JssmArrow, JssmArrowDirection, JssmArrowKind } from './jssm_types';
2
- /*********
3
- *
4
- * Return the direction of an arrow - `right`, `left`, or `both`.
5
- *
6
- * ```typescript
7
- * import { arrow_direction } from 'jssm';
8
- *
9
- * arrow_direction('->'); // 'right'
10
- * arrow_direction('<~=>'); // 'both'
11
- * ```
12
- *
13
- * @param arrow The arrow to be evaluated
14
- *
15
- */
16
- declare function arrow_direction(arrow: JssmArrow): JssmArrowDirection;
17
- /*********
18
- *
19
- * Return the direction of an arrow - `right`, `left`, or `both`.
20
- *
21
- * ```typescript
22
- * import { arrow_left_kind } from 'jssm';
23
- *
24
- * arrow_left_kind('<-'); // 'legal'
25
- * arrow_left_kind('<='); // 'main'
26
- * arrow_left_kind('<~'); // 'forced'
27
- * arrow_left_kind('<->'); // 'legal'
28
- * arrow_left_kind('->'); // 'none'
29
- * ```
30
- *
31
- * @param arrow The arrow to be evaluated
32
- *
33
- */
34
- declare function arrow_left_kind(arrow: JssmArrow): JssmArrowKind;
35
- /*********
36
- *
37
- * Return the direction of an arrow - `right`, `left`, or `both`.
38
- *
39
- * ```typescript
40
- * import { arrow_left_kind } from 'jssm';
41
- *
42
- * arrow_left_kind('->'); // 'legal'
43
- * arrow_left_kind('=>'); // 'main'
44
- * arrow_left_kind('~>'); // 'forced'
45
- * arrow_left_kind('<->'); // 'legal'
46
- * arrow_left_kind('<-'); // 'none'
47
- * ```
48
- *
49
- * @param arrow The arrow to be evaluated
50
- *
51
- */
52
- declare function arrow_right_kind(arrow: JssmArrow): JssmArrowKind;
53
- export { arrow_direction, arrow_left_kind, arrow_right_kind };
@@ -1,135 +0,0 @@
1
- import { JssmTransition, JssmCompileSe, JssmParseTree, JssmGenericConfig } from './jssm_types';
2
- /*********
3
- *
4
- * Internal method meant to perform factory assembly of an edge. Not meant for
5
- * external use.
6
- *
7
- * @internal
8
- *
9
- * @typeparam mDT The type of the machine data member; usually omitted
10
- *
11
- */
12
- declare function makeTransition<StateType, mDT>(this_se: JssmCompileSe<StateType, mDT>, from: StateType, to: StateType, isRight: boolean, _wasList?: Array<StateType>, _wasIndex?: number): JssmTransition<StateType, mDT>;
13
- /*********
14
- *
15
- * This method wraps the parser call that comes from the peg grammar,
16
- * {@link parse}. Generally neither this nor that should be used directly
17
- * unless you mean to develop plugins or extensions for the machine.
18
- *
19
- * Parses the intermediate representation of a compiled string down to a
20
- * machine configuration object. If you're using this (probably don't,) you're
21
- * probably also using {@link compile} and {@link Machine.constructor}.
22
- *
23
- * ```typescript
24
- * import { parse, compile, Machine } from 'jssm';
25
- *
26
- * const intermediate = wrap_parse('a -> b;', {});
27
- * // [ {key:'transition', from:'a', se:{kind:'->',to:'b'}} ]
28
- *
29
- * const cfg = compile(intermediate);
30
- * // { start_states:['a'], transitions: [{ from:'a', to:'b', kind:'legal', forced_only:false, main_path:false }] }
31
- *
32
- * const machine = new Machine(cfg);
33
- * // Machine { _instance_name: undefined, _state: 'a', ...
34
- * ```
35
- *
36
- * This method is mostly for plugin and intermediate tool authors, or people
37
- * who need to work with the machine's intermediate representation.
38
- *
39
- * # Hey!
40
- *
41
- * Most people looking at this want either the `sm` operator or method `from`,
42
- * which perform all the steps in the chain. The library's author mostly uses
43
- * operator `sm`, and mostly falls back to `.from` when needing to parse
44
- * strings dynamically instead of from template literals.
45
- *
46
- * Operator {@link sm}:
47
- *
48
- * ```typescript
49
- * import { sm } from 'jssm';
50
- *
51
- * const lswitch = sm`on <=> off;`;
52
- * ```
53
- *
54
- * Method {@link from}:
55
- *
56
- * ```typescript
57
- * import * as jssm from 'jssm';
58
- *
59
- * const toggle = jssm.from('up <=> down;');
60
- * ```
61
- *
62
- * `wrap_parse` itself is an internal convenience method for alting out an
63
- * object as the options call. Not generally meant for external use.
64
- *
65
- * @param input The FSL code to be evaluated
66
- *
67
- * @param options Things to control about the instance
68
- *
69
- */
70
- declare function wrap_parse(input: string, options?: Object): any;
71
- /*********
72
- *
73
- * Compile a machine's JSON intermediate representation to a config object. If
74
- * you're using this (probably don't,) you're probably also using
75
- * {@link parse} to get the IR, and the object constructor
76
- * {@link Machine.construct} to turn the config object into a workable machine.
77
- *
78
- * ```typescript
79
- * import { parse, compile, Machine } from 'jssm';
80
- *
81
- * const intermediate = parse('a -> b;');
82
- * // [ {key:'transition', from:'a', se:{kind:'->',to:'b'}} ]
83
- *
84
- * const cfg = compile(intermediate);
85
- * // { start_states:['a'], transitions: [{ from:'a', to:'b', kind:'legal', forced_only:false, main_path:false }] }
86
- *
87
- * const machine = new Machine(cfg);
88
- * // Machine { _instance_name: undefined, _state: 'a', ...
89
- * ```
90
- *
91
- * This method is mostly for plugin and intermediate tool authors, or people
92
- * who need to work with the machine's intermediate representation.
93
- *
94
- * # Hey!
95
- *
96
- * Most people looking at this want either the `sm` operator or method `from`,
97
- * which perform all the steps in the chain. The library's author mostly uses
98
- * operator `sm`, and mostly falls back to `.from` when needing to parse
99
- * strings dynamically instead of from template literals.
100
- *
101
- * Operator {@link sm}:
102
- *
103
- * ```typescript
104
- * import { sm } from 'jssm';
105
- *
106
- * const lswitch = sm`on <=> off;`;
107
- * ```
108
- *
109
- * Method {@link from}:
110
- *
111
- * ```typescript
112
- * import * as jssm from 'jssm';
113
- *
114
- * const toggle = jssm.from('up <=> down;');
115
- * ```
116
- *
117
- * @typeparam mDT The type of the machine data member; usually omitted
118
- *
119
- * @param tree The parse tree to be boiled down into a machine config
120
- *
121
- */
122
- declare function compile<StateType, mDT>(tree: JssmParseTree<StateType, mDT>): JssmGenericConfig<StateType, mDT>;
123
- /*********
124
- *
125
- * An internal convenience wrapper for parsing then compiling a machine string.
126
- * Not generally meant for external use. Please see {@link compile} or
127
- * {@link sm}.
128
- *
129
- * @typeparam mDT The type of the machine data member; usually omitted
130
- *
131
- * @param plan The FSL code to be evaluated and built into a machine config
132
- *
133
- */
134
- declare function make<StateType, mDT>(plan: string): JssmGenericConfig<StateType, mDT>;
135
- export { compile, make, makeTransition, wrap_parse };
@@ -1,5 +0,0 @@
1
- export declare const NegInfinity: number, PosInfinity: number, Epsilon: number, Pi: number, E: number, Root2: number, RootHalf: number, Ln2: number, Ln10: number, Log2E: number, Log10E: number, MaxSafeInt: number, MinSafeInt: number, MaxPosNum: number, MinPosNum: number, Phi = 1.618033988749895, EulerC = 0.5772156649015329;
2
- declare const gviz_shapes: string[];
3
- declare const shapes: string[];
4
- declare const named_colors: string[];
5
- export { gviz_shapes, shapes, named_colors, };
package/jssm_error.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { JssmErrorExtendedInfo } from './jssm_types';
2
- declare class JssmError extends Error {
3
- message: string;
4
- base_message: string;
5
- requested_state: string | undefined;
6
- constructor(machine: any, message: string, JEEI?: JssmErrorExtendedInfo);
7
- }
8
- export { JssmError };
package/jssm_theme.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { FslTheme, JssmBaseTheme } from './jssm_types';
2
- import { base_theme } from './themes/jssm_base_stylesheet';
3
- declare const theme_mapping: Map<FslTheme, JssmBaseTheme>;
4
- export { theme_mapping, base_theme };
package/jssm_types.d.ts DELETED
@@ -1,378 +0,0 @@
1
- import { circular_buffer } from 'circular_buffer_js';
2
- declare type StateType = string;
3
- declare type JssmSuccess = {
4
- success: true;
5
- }; /** Composite type indicating success as part of a result */
6
- declare type JssmFailure = {
7
- success: false;
8
- error: any;
9
- }; /** Composite type indicating an error, and why, as part of a result */
10
- declare type JssmIncomplete = {
11
- success: 'incomplete';
12
- }; /** Composite type indicating that a result isn't finished */
13
- declare type JssmResult = JssmSuccess | JssmFailure | JssmIncomplete; /** Composite type composing whether or not a result was successful */
14
- declare type JssmColor = string;
15
- declare type JssmPermitted = 'required' | 'disallowed';
16
- declare type JssmPermittedOpt = 'required' | 'disallowed' | 'optional';
17
- declare type JssmArrow = '->' | '<-' | '<->' | '<=->' | '<~->' | '=>' | '<=' | '<=>' | '<-=>' | '<~=>' | '~>' | '<~' | '<~>' | '<-~>' | '<=~>';
18
- /**
19
- * A type teaching Typescript the various supported shapes for nodes, mostly inherited from GraphViz
20
- */
21
- declare type JssmShape = "box" | "polygon" | "ellipse" | "oval" | "circle" | "point" | "egg" | "triangle" | "plaintext" | "plain" | "diamond" | "trapezium" | "parallelogram" | "house" | "pentagon" | "hexagon" | "septagon" | "octagon" | "doublecircle" | "doubleoctagon" | "tripleoctagon" | "invtriangle" | "invtrapezium" | "invhouse" | "Mdiamond" | "Msquare" | "Mcircle" | "rect" | "rectangle" | "square" | "star" | "none" | "underline" | "cylinder" | "note" | "tab" | "folder" | "box3d" | "component" | "promoter" | "cds" | "terminator" | "utr" | "primersite" | "restrictionsite" | "fivepoverhang" | "threepoverhang" | "noverhang" | "assembly" | "signature" | "insulator" | "ribosite" | "rnastab" | "proteasesite" | "proteinstab" | "rpromoter" | "rarrow" | "larrow" | "lpromoter" | "record";
22
- declare type JssmArrowDirection = 'left' | 'right' | 'both';
23
- declare type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
24
- declare type JssmLayout = 'dot' | 'circo' | 'twopi' | 'fdp' | 'neato';
25
- declare type JssmCorner = 'regular' | 'rounded' | 'lined';
26
- declare type JssmLineStyle = 'solid' | 'dashed' | 'dotted';
27
- declare type JssmAllowsOverride = true | false | undefined;
28
- declare const FslDirections: readonly ["up", "right", "down", "left"];
29
- declare type FslDirection = typeof FslDirections[number];
30
- declare const FslThemes: readonly ["default", "ocean", "modern", "plain", "bold"];
31
- declare type FslTheme = typeof FslThemes[number];
32
- declare type JssmSerialization<DataType> = {
33
- jssm_version: string;
34
- timestamp: number;
35
- comment?: string | undefined;
36
- state: StateType;
37
- history: [string, DataType][];
38
- history_capacity: number;
39
- data: DataType;
40
- };
41
- declare type JssmPropertyDefinition = {
42
- name: string;
43
- default_value?: any;
44
- required?: boolean;
45
- };
46
- declare type JssmTransitionPermitter<DataType> = (OldState: StateType, NewState: StateType, OldData: DataType, NewData: DataType) => boolean;
47
- declare type JssmTransitionPermitterMaybeArray<DataType> = JssmTransitionPermitter<DataType> | Array<JssmTransitionPermitter<DataType>>;
48
- declare type JssmTransition<StateType, DataType> = {
49
- from: StateType;
50
- to: StateType;
51
- after_time?: number;
52
- se?: JssmCompileSe<StateType, DataType>;
53
- name?: StateType;
54
- action?: StateType;
55
- check?: JssmTransitionPermitterMaybeArray<DataType>;
56
- probability?: number;
57
- kind: JssmArrowKind;
58
- forced_only: boolean;
59
- main_path: boolean;
60
- };
61
- declare type JssmTransitions<StateType, DataType> = JssmTransition<StateType, DataType>[];
62
- declare type JssmTransitionList = {
63
- entrances: Array<StateType>;
64
- exits: Array<StateType>;
65
- };
66
- declare type JssmTransitionCycle = {
67
- key: 'cycle';
68
- value: StateType;
69
- };
70
- declare type JssmTransitionRule = StateType | JssmTransitionCycle;
71
- declare type JssmGenericState = {
72
- from: Array<StateType>;
73
- name: StateType;
74
- to: Array<StateType>;
75
- complete: boolean;
76
- };
77
- declare type JssmMachineInternalState<DataType> = {
78
- internal_state_impl_version: 1;
79
- state: StateType;
80
- states: Map<StateType, JssmGenericState>;
81
- named_transitions: Map<StateType, number>;
82
- edge_map: Map<StateType, Map<StateType, number>>;
83
- actions: Map<StateType, Map<StateType, number>>;
84
- reverse_actions: Map<StateType, Map<StateType, number>>;
85
- edges: Array<JssmTransition<StateType, DataType>>;
86
- };
87
- declare type JssmStatePermitter<DataType> = (OldState: StateType, NewState: StateType, OldData: DataType, NewData: DataType) => boolean;
88
- declare type JssmStatePermitterMaybeArray<DataType> = JssmStatePermitter<DataType> | Array<JssmStatePermitter<DataType>>;
89
- declare type JssmGenericMachine<DataType> = {
90
- name?: string;
91
- state: StateType;
92
- data?: DataType;
93
- nodes?: Array<StateType>;
94
- transitions: JssmTransitions<StateType, DataType>;
95
- check?: JssmStatePermitterMaybeArray<DataType>;
96
- min_transitions?: number;
97
- max_transitions?: number;
98
- allow_empty?: boolean;
99
- allow_islands?: boolean;
100
- allow_force?: boolean;
101
- keep_history?: boolean | number;
102
- };
103
- declare type JssmStateDeclarationRule = {
104
- key: string;
105
- value: any;
106
- name?: string;
107
- };
108
- declare type JssmStateDeclaration = {
109
- declarations: Array<JssmStateDeclarationRule>;
110
- shape?: JssmShape;
111
- color?: JssmColor;
112
- corners?: JssmCorner;
113
- lineStyle?: JssmLineStyle;
114
- stateLabel?: string;
115
- textColor?: JssmColor;
116
- backgroundColor?: JssmColor;
117
- borderColor?: JssmColor;
118
- state: StateType;
119
- property?: {
120
- name: string;
121
- value: unknown;
122
- };
123
- };
124
- declare type JssmStateConfig = Partial<JssmStateDeclaration>;
125
- declare type JssmStateStyleShape = {
126
- key: 'shape';
127
- value: JssmShape;
128
- };
129
- declare type JssmStateStyleColor = {
130
- key: 'color';
131
- value: JssmColor;
132
- };
133
- declare type JssmStateStyleTextColor = {
134
- key: 'text-color';
135
- value: JssmColor;
136
- };
137
- declare type JssmStateStyleCorners = {
138
- key: 'corners';
139
- value: JssmCorner;
140
- };
141
- declare type JssmStateStyleLineStyle = {
142
- key: 'line-style';
143
- value: JssmLineStyle;
144
- };
145
- declare type JssmStateStyleStateLabel = {
146
- key: 'state-label';
147
- value: string;
148
- };
149
- declare type JssmStateStyleBackgroundColor = {
150
- key: 'background-color';
151
- value: JssmColor;
152
- };
153
- declare type JssmStateStyleBorderColor = {
154
- key: 'border-color';
155
- value: JssmColor;
156
- };
157
- declare type JssmStateStyleKey = JssmStateStyleShape | JssmStateStyleColor | JssmStateStyleTextColor | JssmStateStyleCorners | JssmStateStyleLineStyle | JssmStateStyleBackgroundColor | JssmStateStyleStateLabel | JssmStateStyleBorderColor;
158
- declare type JssmStateStyleKeyList = JssmStateStyleKey[];
159
- declare type JssmBaseTheme = {
160
- name: string;
161
- state: JssmStateConfig;
162
- hooked: JssmStateConfig;
163
- start: JssmStateConfig;
164
- end: JssmStateConfig;
165
- terminal: JssmStateConfig;
166
- active: JssmStateConfig;
167
- active_hooked: JssmStateConfig;
168
- active_start: JssmStateConfig;
169
- active_end: JssmStateConfig;
170
- active_terminal: JssmStateConfig;
171
- graph: undefined;
172
- legal: undefined;
173
- main: undefined;
174
- forced: undefined;
175
- action: undefined;
176
- title: undefined;
177
- };
178
- declare type JssmTheme = Partial<JssmBaseTheme>;
179
- declare type JssmGenericConfig<StateType, DataType> = {
180
- graph_layout?: JssmLayout;
181
- complete?: Array<StateType>;
182
- transitions: JssmTransitions<StateType, DataType>;
183
- theme?: FslTheme[];
184
- flow?: FslDirection;
185
- name?: string;
186
- data?: DataType;
187
- nodes?: Array<StateType>;
188
- check?: JssmStatePermitterMaybeArray<DataType>;
189
- history?: number;
190
- min_exits?: number;
191
- max_exits?: number;
192
- allow_islands?: false;
193
- allow_force?: false;
194
- actions?: JssmPermittedOpt;
195
- simplify_bidi?: boolean;
196
- allows_override?: JssmAllowsOverride;
197
- config_allows_override?: JssmAllowsOverride;
198
- dot_preamble?: string;
199
- start_states: Array<StateType>;
200
- end_states?: Array<StateType>;
201
- initial_state?: StateType;
202
- start_states_no_enforce?: boolean;
203
- state_declaration?: Object[];
204
- property_definition?: JssmPropertyDefinition[];
205
- state_property?: JssmPropertyDefinition[];
206
- arrange_declaration?: Array<Array<StateType>>;
207
- arrange_start_declaration?: Array<Array<StateType>>;
208
- arrange_end_declaration?: Array<Array<StateType>>;
209
- machine_author?: string | Array<string>;
210
- machine_comment?: string;
211
- machine_contributor?: string | Array<string>;
212
- machine_definition?: string;
213
- machine_language?: string;
214
- machine_license?: string;
215
- machine_name?: string;
216
- machine_version?: string;
217
- fsl_version?: string;
218
- auto_api?: boolean | string;
219
- instance_name?: string | undefined;
220
- default_state_config?: JssmStateStyleKeyList;
221
- default_start_state_config?: JssmStateStyleKeyList;
222
- default_end_state_config?: JssmStateStyleKeyList;
223
- default_hooked_state_config?: JssmStateStyleKeyList;
224
- default_terminal_state_config?: JssmStateStyleKeyList;
225
- default_active_state_config?: JssmStateStyleKeyList;
226
- rng_seed?: number | undefined;
227
- time_source?: () => number;
228
- timeout_source?: (Function: any, number: any) => number;
229
- clear_timeout_source?: (number: any) => void;
230
- };
231
- declare type JssmCompileRule<StateType> = {
232
- agg_as: string;
233
- val: any;
234
- };
235
- declare type JssmCompileSe<StateType, mDT> = {
236
- to: StateType;
237
- se?: JssmCompileSe<StateType, mDT>;
238
- kind: JssmArrow;
239
- l_action?: StateType;
240
- r_action?: StateType;
241
- l_probability: number;
242
- r_probability: number;
243
- l_after?: number;
244
- r_after?: number;
245
- };
246
- declare type JssmCompileSeStart<StateType, DataType> = {
247
- from: StateType;
248
- se: JssmCompileSe<StateType, DataType>;
249
- key: string;
250
- value?: string | number;
251
- name?: string;
252
- state?: string;
253
- default_value?: any;
254
- required?: boolean;
255
- };
256
- declare type JssmParseTree<StateType, mDT> = Array<JssmCompileSeStart<StateType, mDT>>;
257
- declare type JssmParseFunctionType<StateType, mDT> = (string: any) => JssmParseTree<StateType, mDT>;
258
- declare type BasicHookDescription<mDT> = {
259
- kind: 'hook';
260
- from: string;
261
- to: string;
262
- handler: HookHandler<mDT>;
263
- };
264
- declare type HookDescriptionWithAction<mDT> = {
265
- kind: 'named';
266
- from: string;
267
- to: string;
268
- action: string;
269
- handler: HookHandler<mDT>;
270
- };
271
- declare type StandardTransitionHook<mDT> = {
272
- kind: 'standard transition';
273
- handler: HookHandler<mDT>;
274
- };
275
- declare type MainTransitionHook<mDT> = {
276
- kind: 'main transition';
277
- handler: HookHandler<mDT>;
278
- };
279
- declare type ForcedTransitionHook<mDT> = {
280
- kind: 'forced transition';
281
- handler: HookHandler<mDT>;
282
- };
283
- declare type AnyTransitionHook<mDT> = {
284
- kind: 'any transition';
285
- handler: HookHandler<mDT>;
286
- };
287
- declare type GlobalActionHook<mDT> = {
288
- kind: 'global action';
289
- action: string;
290
- handler: HookHandler<mDT>;
291
- };
292
- declare type AnyActionHook<mDT> = {
293
- kind: 'any action';
294
- handler: HookHandler<mDT>;
295
- };
296
- declare type EntryHook<mDT> = {
297
- kind: 'entry';
298
- to: string;
299
- handler: HookHandler<mDT>;
300
- };
301
- declare type ExitHook<mDT> = {
302
- kind: 'exit';
303
- from: string;
304
- handler: HookHandler<mDT>;
305
- };
306
- declare type AfterHook<mDT> = {
307
- kind: 'after';
308
- from: string;
309
- handler: HookHandler<mDT>;
310
- };
311
- declare type PostBasicHookDescription<mDT> = {
312
- kind: 'post hook';
313
- from: string;
314
- to: string;
315
- handler: PostHookHandler<mDT>;
316
- };
317
- declare type PostHookDescriptionWithAction<mDT> = {
318
- kind: 'post named';
319
- from: string;
320
- to: string;
321
- action: string;
322
- handler: PostHookHandler<mDT>;
323
- };
324
- declare type PostStandardTransitionHook<mDT> = {
325
- kind: 'post standard transition';
326
- handler: PostHookHandler<mDT>;
327
- };
328
- declare type PostMainTransitionHook<mDT> = {
329
- kind: 'post main transition';
330
- handler: PostHookHandler<mDT>;
331
- };
332
- declare type PostForcedTransitionHook<mDT> = {
333
- kind: 'post forced transition';
334
- handler: PostHookHandler<mDT>;
335
- };
336
- declare type PostAnyTransitionHook<mDT> = {
337
- kind: 'post any transition';
338
- handler: PostHookHandler<mDT>;
339
- };
340
- declare type PostGlobalActionHook<mDT> = {
341
- kind: 'post global action';
342
- action: string;
343
- handler: PostHookHandler<mDT>;
344
- };
345
- declare type PostAnyActionHook<mDT> = {
346
- kind: 'post any action';
347
- handler: PostHookHandler<mDT>;
348
- };
349
- declare type PostEntryHook<mDT> = {
350
- kind: 'post entry';
351
- to: string;
352
- handler: PostHookHandler<mDT>;
353
- };
354
- declare type PostExitHook<mDT> = {
355
- kind: 'post exit';
356
- from: string;
357
- handler: PostHookHandler<mDT>;
358
- };
359
- declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT> | AfterHook<mDT> | PostBasicHookDescription<mDT> | PostHookDescriptionWithAction<mDT> | PostGlobalActionHook<mDT> | PostAnyActionHook<mDT> | PostStandardTransitionHook<mDT> | PostMainTransitionHook<mDT> | PostForcedTransitionHook<mDT> | PostAnyTransitionHook<mDT> | PostEntryHook<mDT> | PostExitHook<mDT>;
360
- declare type HookComplexResult<mDT> = {
361
- pass: boolean;
362
- state?: StateType;
363
- data?: mDT;
364
- next_data?: mDT;
365
- };
366
- 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 */
367
- declare type HookContext<mDT> = {
368
- data: mDT;
369
- next_data: mDT;
370
- };
371
- declare type HookHandler<mDT> = (hook_context: HookContext<mDT>) => HookResult<mDT>;
372
- declare type PostHookHandler<mDT> = (hook_context: HookContext<mDT>) => void;
373
- declare type JssmErrorExtendedInfo = {
374
- requested_state?: StateType | undefined;
375
- };
376
- declare type JssmHistory<mDT> = circular_buffer<[StateType, mDT]>;
377
- declare type JssmRng = () => number;
378
- export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmStateConfig, JssmStateStyleKey, JssmStateStyleKeyList, JssmBaseTheme, JssmTheme, JssmLayout, JssmHistory, JssmSerialization, JssmPropertyDefinition, JssmAllowsOverride, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirections, FslDirection, FslThemes, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult, JssmRng };