jssm 5.104.2 → 5.112.4

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 (84) hide show
  1. package/MIGRATING-jssm-viz.md +67 -0
  2. package/README.md +179 -882
  3. package/dist/deno/README.md +347 -0
  4. package/dist/{es6 → deno}/jssm.d.ts +773 -39
  5. package/dist/deno/jssm.js +1 -0
  6. package/{jssm_compiler.d.ts → dist/deno/jssm_compiler.d.ts} +17 -2
  7. package/dist/deno/jssm_constants.d.ts +37 -0
  8. package/dist/deno/jssm_error.d.ts +27 -0
  9. package/dist/deno/jssm_theme.d.ts +15 -0
  10. package/dist/{es6 → deno}/jssm_types.d.ts +327 -8
  11. package/dist/deno/jssm_util.d.ts +258 -0
  12. package/dist/deno/jssm_viz.d.ts +175 -0
  13. package/dist/deno/jssm_viz_colors.d.ts +63 -0
  14. package/dist/jssm.es5.cjs +1 -1
  15. package/dist/jssm.es5.iife.js +1 -0
  16. package/dist/jssm.es6.mjs +1 -1
  17. package/dist/jssm_viz.cjs +1 -0
  18. package/dist/jssm_viz.iife.cjs +1 -0
  19. package/dist/jssm_viz.mjs +1 -0
  20. package/jssm.es5.d.cts +1191 -43
  21. package/jssm.es6.d.ts +1191 -43
  22. package/jssm_viz.es5.d.cts +2341 -0
  23. package/jssm_viz.es6.d.ts +2341 -0
  24. package/package.json +73 -24
  25. package/.clocignore +0 -1
  26. package/.codeclimate.yml +0 -22
  27. package/.editorconfig +0 -12
  28. package/.eslintrc +0 -20
  29. package/.gitattributes +0 -6
  30. package/.nycrc +0 -6
  31. package/.travis.yml +0 -9
  32. package/CHANGELOG.md +0 -178
  33. package/dist/es6/fsl_parser.js +0 -1
  34. package/dist/es6/jssm.js +0 -2488
  35. package/dist/es6/jssm_arrow.js +0 -187
  36. package/dist/es6/jssm_compiler.d.ts +0 -135
  37. package/dist/es6/jssm_compiler.js +0 -366
  38. package/dist/es6/jssm_constants.d.ts +0 -5
  39. package/dist/es6/jssm_constants.js +0 -94
  40. package/dist/es6/jssm_error.d.ts +0 -8
  41. package/dist/es6/jssm_error.js +0 -28
  42. package/dist/es6/jssm_theme.d.ts +0 -4
  43. package/dist/es6/jssm_theme.js +0 -13
  44. package/dist/es6/jssm_types.js +0 -3
  45. package/dist/es6/jssm_util.d.ts +0 -106
  46. package/dist/es6/jssm_util.js +0 -180
  47. package/dist/es6/themes/jssm_base_stylesheet.d.ts +0 -11
  48. package/dist/es6/themes/jssm_base_stylesheet.js +0 -58
  49. package/dist/es6/themes/jssm_theme_bold.d.ts +0 -11
  50. package/dist/es6/themes/jssm_theme_bold.js +0 -58
  51. package/dist/es6/themes/jssm_theme_default.d.ts +0 -11
  52. package/dist/es6/themes/jssm_theme_default.js +0 -58
  53. package/dist/es6/themes/jssm_theme_modern.d.ts +0 -11
  54. package/dist/es6/themes/jssm_theme_modern.js +0 -58
  55. package/dist/es6/themes/jssm_theme_ocean.d.ts +0 -11
  56. package/dist/es6/themes/jssm_theme_ocean.js +0 -56
  57. package/dist/es6/themes/jssm_theme_plain.d.ts +0 -11
  58. package/dist/es6/themes/jssm_theme_plain.js +0 -70
  59. package/dist/es6/version.js +0 -2
  60. package/dist/jssm.es5.iife.cjs +0 -1
  61. package/dist/jssm.es5.iife.nonmin.cjs +0 -23180
  62. package/dist/jssm.es5.nonmin.cjs +0 -23175
  63. package/dist/jssm.es6.nonmin.cjs +0 -23144
  64. package/fsl_parser.d.ts +0 -6
  65. package/jest-dragon.config.cjs +0 -33
  66. package/jest-spec.config.cjs +0 -33
  67. package/jest-stoch.config.cjs +0 -33
  68. package/jest-unicode.config.cjs +0 -33
  69. package/jssm.d.ts +0 -1141
  70. package/jssm_arrow.d.ts +0 -53
  71. package/jssm_constants.d.ts +0 -5
  72. package/jssm_error.d.ts +0 -8
  73. package/jssm_theme.d.ts +0 -4
  74. package/jssm_types.d.ts +0 -378
  75. package/jssm_util.d.ts +0 -106
  76. package/rollup.config.deno.js +0 -44
  77. package/rollup.config.es5.js +0 -52
  78. package/rollup.config.es6.js +0 -55
  79. package/tutorial_learn_testing.md +0 -168
  80. package/typedoc-options.cjs +0 -68
  81. package/version.d.ts +0 -2
  82. /package/dist/{es6 → deno}/fsl_parser.d.ts +0 -0
  83. /package/dist/{es6 → deno}/jssm_arrow.d.ts +0 -0
  84. /package/dist/{es6 → deno}/version.d.ts +0 -0
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,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 };
package/jssm_util.d.ts DELETED
@@ -1,106 +0,0 @@
1
- /*******
2
- *
3
- * Predicate for validating an array for uniqueness. Not generally meant for
4
- * external use.
5
- *
6
- */
7
- declare function arr_uniq_p<T>(el: T, i: number, source: T[]): boolean;
8
- declare const array_box_if_string: (n: any) => any;
9
- declare const weighted_rand_select: Function;
10
- /*******
11
- *
12
- * Returns, for a non-negative integer argument `n`, the series `[0 .. n]`.
13
- *
14
- * ```typescript
15
- * import { seq } from './jssm';
16
- *
17
- * seq(5); // [0, 1, 2, 3, 4]
18
- * seq(0); // []
19
- * ```
20
- *
21
- */
22
- declare function seq(n: number): number[];
23
- /*******
24
- *
25
- * Returns the histograph of an array as a `Map`. Makes no attempt to cope
26
- * with deep equality; will fail for complex contents, as such.
27
- *
28
- * ```typescript
29
- * import { histograph } from './jssm';
30
- *
31
- * histograph( [0, 0, 1, 1, 2, 2, 1] ); // Map()
32
- * ```
33
- *
34
- */
35
- declare const histograph: Function;
36
- declare const weighted_sample_select: Function;
37
- declare const weighted_histo_key: Function;
38
- /*******
39
- *
40
- * Internal method generating names for edges for the hook lookup map. Not
41
- * meant for external use.
42
- *
43
- */
44
- declare function name_bind_prop_and_state(prop: string, state: string): string;
45
- /*******
46
- *
47
- * Internal method generating names for edges for the hook lookup map. Not
48
- * meant for external use.
49
- *
50
- */
51
- declare const hook_name: (from: string, to: string) => string;
52
- /*******
53
- *
54
- * Internal method generating names for actions for the hook lookup map. Not
55
- * meant for external use.
56
- *
57
- */
58
- declare const named_hook_name: (from: string, to: string, action: string) => string;
59
- /*******
60
- *
61
- * Creates a SplitMix32 random generator. Used by the randomness test suite.
62
- *
63
- * Sourced from `bryc`: https://github.com/bryc/code/blob/master/jshash/PRNGs.md#splitmix32
64
- *
65
- * Replaces the Mulberry generator, which was found to have problems
66
- *
67
- */
68
- declare function gen_splitmix32(a?: number | undefined): () => number;
69
- /*******
70
- *
71
- * Reduces an array to its unique contents. Compares with `===` and makes no
72
- * effort to deep-compare contents; two matching arrays or objects contained
73
- * will be treated as distinct, according to javascript rules. This also means
74
- * that `NaNs` will be ***dropped***, because they do not self-compare.
75
- *
76
- * ```typescript
77
- * unique( [] ); // []
78
- * unique( [0,0] ); // [0]
79
- * unique( [0,1,2, 0,1,2, 0,1,2] ); // [0,1,2]
80
- * unique( [ [1], [1] ] ); // [ [1], [1] ] because arrays don't match
81
- * unique( [0,NaN,2] ); // [0,2]
82
- * ```
83
- *
84
- */
85
- declare const unique: <T>(arr?: T[]) => T[];
86
- /*******
87
- *
88
- * Lists all repeated items in an array along with their counts. Subject to
89
- * matching rules of Map. `NaN` is manually removed because of conflict rules
90
- * around {@link unique}. Because these are compared with `===` and because
91
- * arrays and objects never match that way unless they're the same object,
92
- * arrays and objects are never considered repeats.
93
- *
94
- * ```typescript
95
- * find_repeated<string>([ ]); // []
96
- * find_repeated<string>([ "one" ]); // []
97
- * find_repeated<string>([ "one", "two" ]); // []
98
- * find_repeated<string>([ "one", "one" ]); // [ ["one", 2] ]
99
- * find_repeated<string>([ "one", "two", "one" ]); // [ ["one", 2] ]
100
- * find_repeated<number>([ 0, NaN, 0, NaN ]); // [ [0, 2] ]
101
- * ```
102
- *
103
- */
104
- declare function find_repeated<T>(arr: T[]): [T, number][];
105
- declare function sleep(ms: number): Promise<unknown>;
106
- export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, gen_splitmix32, sleep };
@@ -1,44 +0,0 @@
1
-
2
- import nodeResolve from '@rollup/plugin-node-resolve';
3
- import commonjs from '@rollup/plugin-commonjs';
4
- import replace from '@rollup/plugin-replace';
5
-
6
-
7
-
8
-
9
-
10
- const config = {
11
-
12
- input: 'dist/es6/jssm.js',
13
-
14
- output: {
15
- file : 'dist/deno/jssm.deno-esm.nonmin.js',
16
- format : 'esm',
17
- name : 'jssm'
18
- },
19
-
20
- plugins : [
21
-
22
- nodeResolve({
23
- mainFields : ['module', 'main'],
24
- browser : true,
25
- extensions : [ '.js', '.json', '.ts', '.tsx' ],
26
- preferBuiltins : false
27
- }),
28
-
29
- commonjs(),
30
-
31
- replace({
32
- preventAssignment : true,
33
- 'process.env.NODE_ENV' : JSON.stringify( 'production' )
34
- })
35
-
36
- ]
37
-
38
- };
39
-
40
-
41
-
42
-
43
-
44
- export default config;
@@ -1,52 +0,0 @@
1
-
2
- import nodeResolve from '@rollup/plugin-node-resolve';
3
- import commonjs from '@rollup/plugin-commonjs';
4
- import replace from '@rollup/plugin-replace';
5
- import dts from "rollup-plugin-dts";
6
-
7
-
8
-
9
-
10
-
11
- const config = [{
12
-
13
- input: 'dist/es6/jssm.js',
14
-
15
- output: {
16
- file : 'dist/jssm.es5.cjs.js',
17
- format : 'cjs',
18
- name : 'jssm'
19
- },
20
-
21
- plugins : [
22
-
23
- nodeResolve({
24
- mainFields : ['module', 'main'],
25
- browser : true,
26
- extensions : [ '.js', '.json', '.ts', '.tsx' ],
27
- preferBuiltins : false
28
- }),
29
-
30
- commonjs(),
31
-
32
- replace({
33
- preventAssignment : true,
34
- 'process.env.NODE_ENV' : JSON.stringify( 'production' )
35
- }),
36
-
37
- ]}, {
38
-
39
- input: 'dist/es6/jssm.d.ts',
40
-
41
- output: {
42
- file : './jssm.es5.d.cts',
43
- format : 'cjs'
44
- },
45
-
46
- plugins : [
47
-
48
- dts()
49
- ]}
50
- ];
51
-
52
- export default config;