jssm 5.159.2 → 5.160.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/README.md +3 -3
- package/dist/cdn/instance.js +2 -2
- package/dist/cdn/viz.js +2 -2
- package/dist/cli/fsl-export-system-prompt.cjs +1 -1
- package/dist/cli/fsl-render.cjs +1 -1
- package/dist/cli/fsl.cjs +1 -1
- package/dist/cli/lib.cjs +1 -1
- package/dist/cli/lib.mjs +1 -1
- package/dist/deno/README.md +3 -3
- package/dist/deno/fsl_fence_render.d.ts +0 -10
- package/dist/deno/fsl_markdown_fence.d.ts +3 -3
- package/dist/deno/jssm.d.ts +2 -2
- package/dist/deno/jssm.js +1 -1
- package/dist/deno/jssm_types.d.ts +138 -138
- package/dist/deno/jssm_viz.d.ts +3 -3
- package/dist/fence/fence.js +31906 -31893
- package/dist/jssm.es5.cjs +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/dist/jssm.es6.mjs +1 -1
- package/dist/jssm_viz.cjs +1 -1
- package/dist/jssm_viz.iife.cjs +1 -1
- package/dist/jssm_viz.mjs +1 -1
- package/dist/wc/instance.js +5 -0
- package/dist/wc/widgets.js +3 -0
- package/jssm.cli.d.cts +4 -4
- package/jssm.cli.d.ts +4 -4
- package/jssm.es5.d.cts +131 -131
- package/jssm.es6.d.ts +131 -131
- package/jssm.fence.d.ts +122 -132
- package/jssm_viz.es5.d.cts +125 -125
- package/jssm_viz.es6.d.ts +125 -125
- package/package.json +5 -5
package/jssm_viz.es6.d.ts
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
import { circular_buffer } from 'circular_buffer_js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type StateType$1 = string;
|
|
4
4
|
/**
|
|
5
5
|
* A color value accepted by jssm-viz for state and arrow styling. Currently
|
|
6
6
|
* any string, validated downstream by Graphviz / the named-colors list.
|
|
7
7
|
* Intended to be narrowed to `#RRGGBB` / `#RRGGBBAA` and CSS named colors
|
|
8
8
|
* in a future release.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
type JssmColor = string;
|
|
11
11
|
/**
|
|
12
12
|
* Three-state policy flag: `'required'`, `'disallowed'`, or `'optional'`.
|
|
13
13
|
* Used by machine configuration where a default-permissive middle ground
|
|
14
14
|
* is meaningful (for example, the `actions` config key).
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
type JssmPermittedOpt = 'required' | 'disallowed' | 'optional';
|
|
17
17
|
/**
|
|
18
18
|
* The set of ASCII arrow tokens recognized by the FSL grammar. Each arrow
|
|
19
19
|
* encodes a direction (one-way left/right, or two-way) and a "kind" for
|
|
20
20
|
* each direction (`-` legal, `=` main path, `~` forced-only). See the
|
|
21
21
|
* Language Reference docs for the full semantic table.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
type JssmArrow = '->' | '<-' | '<->' | '<=->' | '<~->' | '=>' | '<=' | '<=>' | '<-=>' | '<~=>' | '~>' | '<~' | '<~>' | '<-~>' | '<=~>';
|
|
24
24
|
/**
|
|
25
25
|
* A type teaching Typescript the various supported shapes for nodes, mostly inherited from GraphViz
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
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";
|
|
28
28
|
/**
|
|
29
29
|
* Semantic category of an arrow's transition. `'legal'` is a normal
|
|
30
30
|
* transition, `'main'` is part of the machine's primary path, `'forced'`
|
|
31
31
|
* may only be taken via {@link Machine.force_transition}, and `'none'`
|
|
32
32
|
* means no transition exists in that direction.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
|
|
35
35
|
/**
|
|
36
36
|
* Graphviz layout engine selector. Controls how jssm-viz lays out the
|
|
37
37
|
* rendered diagram; `'dot'` is the default and most useful for state
|
|
38
38
|
* machines. See the Graphviz documentation for the differences.
|
|
39
39
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
type JssmLayout = 'dot' | 'circo' | 'twopi' | 'fdp' | 'neato';
|
|
41
|
+
type JssmCorner = 'regular' | 'rounded' | 'lined';
|
|
42
|
+
type JssmLineStyle = 'solid' | 'dashed' | 'dotted';
|
|
43
43
|
/**
|
|
44
44
|
* Tristate flag for whether a property may be overridden at runtime.
|
|
45
45
|
* `true` permits overrides, `false` forbids them, and `undefined` defers
|
|
46
46
|
* the decision to the surrounding configuration's default.
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
type JssmAllowsOverride = true | false | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* Controls whether the state graph may contain disconnected components
|
|
51
51
|
* (islands). `true` permits islands (default), `false` requires a single
|
|
52
52
|
* connected component, and `'with_start'` permits islands only when every
|
|
53
53
|
* component contains at least one start state.
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
type JssmAllowIslands = true | false | 'with_start';
|
|
56
56
|
/**
|
|
57
57
|
* Structured render-size hint for a machine visualization, set by the FSL
|
|
58
58
|
* `default_size` directive. All three forms are optional in the sense that
|
|
@@ -66,7 +66,7 @@ declare type JssmAllowIslands = true | false | 'with_start';
|
|
|
66
66
|
*
|
|
67
67
|
* @see Machine.default_size
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
type JssmDefaultSize = {
|
|
70
70
|
width?: number;
|
|
71
71
|
height?: number;
|
|
72
72
|
};
|
|
@@ -80,7 +80,7 @@ declare const FslDirections: readonly ["up", "right", "down", "left"];
|
|
|
80
80
|
* String literal type of the four supported FSL flow directions. This is
|
|
81
81
|
* the type of the `flow` config key on a machine.
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
type FslDirection = typeof FslDirections[number];
|
|
84
84
|
/**
|
|
85
85
|
* Runtime-iterable list of the built-in theme names that ship with jssm-viz.
|
|
86
86
|
* Use this when you need to enumerate themes; for the type itself see
|
|
@@ -92,7 +92,7 @@ declare const FslThemes: readonly ["default", "ocean", "modern", "plain", "bold"
|
|
|
92
92
|
* type of the `theme` config key (which accepts an array so that themes
|
|
93
93
|
* can be layered).
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
type FslTheme = typeof FslThemes[number];
|
|
96
96
|
/**
|
|
97
97
|
* Persistable snapshot of a Machine produced by {@link Machine.serialize}
|
|
98
98
|
* and consumed by {@link deserialize}. Carries the current state, the
|
|
@@ -101,7 +101,7 @@ declare type FslTheme = typeof FslThemes[number];
|
|
|
101
101
|
*
|
|
102
102
|
* @typeParam DataType - The type of the user-supplied data payload (`mDT`).
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
type JssmSerialization<DataType> = {
|
|
105
105
|
jssm_version: string;
|
|
106
106
|
timestamp: number;
|
|
107
107
|
comment?: string | undefined;
|
|
@@ -129,7 +129,7 @@ declare type JssmSerialization<DataType> = {
|
|
|
129
129
|
* @see JssmGroupRef
|
|
130
130
|
* @see JssmGroupRegistry
|
|
131
131
|
*/
|
|
132
|
-
|
|
132
|
+
type JssmGroupMemberRef = {
|
|
133
133
|
kind: 'state';
|
|
134
134
|
name: string;
|
|
135
135
|
} | {
|
|
@@ -155,7 +155,7 @@ declare type JssmGroupMemberRef = {
|
|
|
155
155
|
*
|
|
156
156
|
* @see JssmGroupMemberRef
|
|
157
157
|
*/
|
|
158
|
-
|
|
158
|
+
type JssmGroupRegistry = Map<string, JssmGroupMemberRef[]>;
|
|
159
159
|
/**
|
|
160
160
|
* The compiled boundary-hook surface for a single subject (a group or a
|
|
161
161
|
* state): the action to run on entry (`onEnter`) and/or on exit (`onExit`).
|
|
@@ -165,7 +165,7 @@ declare type JssmGroupRegistry = Map<string, JssmGroupMemberRef[]>;
|
|
|
165
165
|
*
|
|
166
166
|
* @see JssmHookDeclaration
|
|
167
167
|
*/
|
|
168
|
-
|
|
168
|
+
type JssmBoundaryHooks = {
|
|
169
169
|
onEnter?: string;
|
|
170
170
|
onExit?: string;
|
|
171
171
|
};
|
|
@@ -176,7 +176,7 @@ declare type JssmBoundaryHooks = {
|
|
|
176
176
|
*
|
|
177
177
|
* @see JssmHookDeclaration
|
|
178
178
|
*/
|
|
179
|
-
|
|
179
|
+
type JssmGroupHooks = Map<string, JssmBoundaryHooks>;
|
|
180
180
|
/**
|
|
181
181
|
* Maps each plain state name that has at least one boundary hook to its
|
|
182
182
|
* merged {@link JssmBoundaryHooks}. The state-subject analogue of
|
|
@@ -184,7 +184,7 @@ declare type JssmGroupHooks = Map<string, JssmBoundaryHooks>;
|
|
|
184
184
|
*
|
|
185
185
|
* @see JssmHookDeclaration
|
|
186
186
|
*/
|
|
187
|
-
|
|
187
|
+
type JssmStateHooks = Map<string, JssmBoundaryHooks>;
|
|
188
188
|
/**
|
|
189
189
|
* Declaration of a named property that a machine's states may carry.
|
|
190
190
|
* Set `required: true` to force every state to define the property, or
|
|
@@ -197,15 +197,15 @@ declare type JssmStateHooks = Map<string, JssmBoundaryHooks>;
|
|
|
197
197
|
* may carry only the serialized `name`, and global property definitions
|
|
198
198
|
* never set them.
|
|
199
199
|
*/
|
|
200
|
-
|
|
200
|
+
type JssmPropertyDefinition = {
|
|
201
201
|
name: string;
|
|
202
202
|
default_value?: any;
|
|
203
203
|
required?: boolean;
|
|
204
204
|
property?: string;
|
|
205
205
|
state?: string;
|
|
206
206
|
};
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
type JssmTransitionPermitter<DataType> = (OldState: StateType$1, NewState: StateType$1, OldData: DataType, NewData: DataType) => boolean;
|
|
208
|
+
type JssmTransitionPermitterMaybeArray<DataType> = JssmTransitionPermitter<DataType> | Array<JssmTransitionPermitter<DataType>>;
|
|
209
209
|
/**
|
|
210
210
|
* A single directed transition (edge) within a state machine. Captures
|
|
211
211
|
* both the topology (`from` / `to`), the FSL semantics (`kind`,
|
|
@@ -217,7 +217,7 @@ declare type JssmTransitionPermitterMaybeArray<DataType> = JssmTransitionPermitt
|
|
|
217
217
|
* @typeParam StateType - The state-name type (usually `string`).
|
|
218
218
|
* @typeParam DataType - The machine's data payload type (`mDT`).
|
|
219
219
|
*/
|
|
220
|
-
|
|
220
|
+
type JssmTransition<StateType, DataType> = {
|
|
221
221
|
from: StateType;
|
|
222
222
|
to: StateType;
|
|
223
223
|
after_time?: number;
|
|
@@ -231,12 +231,12 @@ declare type JssmTransition<StateType, DataType> = {
|
|
|
231
231
|
main_path: boolean;
|
|
232
232
|
};
|
|
233
233
|
/** A list of {@link JssmTransition}s — the edge set of a machine. */
|
|
234
|
-
|
|
234
|
+
type JssmTransitions<StateType, DataType> = JssmTransition<StateType, DataType>[];
|
|
235
235
|
/**
|
|
236
236
|
* The set of states that can immediately precede or follow a given state.
|
|
237
237
|
* Returned by jssm helpers that report a state's connectivity in the graph.
|
|
238
238
|
*/
|
|
239
|
-
|
|
239
|
+
type JssmTransitionList = {
|
|
240
240
|
entrances: Array<StateType$1>;
|
|
241
241
|
exits: Array<StateType$1>;
|
|
242
242
|
};
|
|
@@ -245,7 +245,7 @@ declare type JssmTransitionList = {
|
|
|
245
245
|
* states it can be reached from, the set of states it can transition to,
|
|
246
246
|
* and whether reaching it constitutes "completing" the machine.
|
|
247
247
|
*/
|
|
248
|
-
|
|
248
|
+
type JssmGenericState = {
|
|
249
249
|
from: Array<StateType$1>;
|
|
250
250
|
name: StateType$1;
|
|
251
251
|
to: Array<StateType$1>;
|
|
@@ -258,7 +258,7 @@ declare type JssmGenericState = {
|
|
|
258
258
|
* `internal_state_impl_version` field exists so that consumers can detect
|
|
259
259
|
* shape changes if this representation evolves.
|
|
260
260
|
*/
|
|
261
|
-
|
|
261
|
+
type JssmMachineInternalState<DataType> = {
|
|
262
262
|
internal_state_impl_version: 1;
|
|
263
263
|
state: StateType$1;
|
|
264
264
|
states: Map<StateType$1, JssmGenericState>;
|
|
@@ -268,8 +268,8 @@ declare type JssmMachineInternalState<DataType> = {
|
|
|
268
268
|
reverse_actions: Map<StateType$1, Map<StateType$1, number>>;
|
|
269
269
|
edges: Array<JssmTransition<StateType$1, DataType>>;
|
|
270
270
|
};
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
type JssmStatePermitter<DataType> = (OldState: StateType$1, NewState: StateType$1, OldData: DataType, NewData: DataType) => boolean;
|
|
272
|
+
type JssmStatePermitterMaybeArray<DataType> = JssmStatePermitter<DataType> | Array<JssmStatePermitter<DataType>>;
|
|
273
273
|
/**
|
|
274
274
|
* A source span produced by the FSL parser when `parse(input, { locations:
|
|
275
275
|
* true })` is used. Mirrors PEG.js's native `location()` shape: byte
|
|
@@ -281,12 +281,12 @@ declare type JssmStatePermitterMaybeArray<DataType> = JssmStatePermitter<DataTyp
|
|
|
281
281
|
* // end: { offset: 7, line: 1, column: 8 } }
|
|
282
282
|
* ```
|
|
283
283
|
*/
|
|
284
|
-
|
|
284
|
+
type FslSourcePoint = {
|
|
285
285
|
offset: number;
|
|
286
286
|
line: number;
|
|
287
287
|
column: number;
|
|
288
288
|
};
|
|
289
|
-
|
|
289
|
+
type FslSourceLocation = {
|
|
290
290
|
start: FslSourcePoint;
|
|
291
291
|
end: FslSourcePoint;
|
|
292
292
|
};
|
|
@@ -295,7 +295,7 @@ declare type FslSourceLocation = {
|
|
|
295
295
|
* raw form produced by the parser before being condensed into a
|
|
296
296
|
* {@link JssmStateDeclaration}.
|
|
297
297
|
*/
|
|
298
|
-
|
|
298
|
+
type JssmStateDeclarationRule = {
|
|
299
299
|
key: string;
|
|
300
300
|
value: any;
|
|
301
301
|
name?: string;
|
|
@@ -307,7 +307,7 @@ declare type JssmStateDeclarationRule = {
|
|
|
307
307
|
* rule list (`declarations`) and the well-known styling fields jssm-viz
|
|
308
308
|
* understands. Returned by {@link Machine.state_declaration}.
|
|
309
309
|
*/
|
|
310
|
-
|
|
310
|
+
type JssmStateDeclaration = {
|
|
311
311
|
declarations: Array<JssmStateDeclarationRule>;
|
|
312
312
|
shape?: JssmShape;
|
|
313
313
|
color?: JssmColor;
|
|
@@ -330,44 +330,44 @@ declare type JssmStateDeclaration = {
|
|
|
330
330
|
* optional. Used as the value type for theme entries and for default
|
|
331
331
|
* state configuration where most fields will be inherited or merged.
|
|
332
332
|
*/
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
type JssmStateConfig = Partial<JssmStateDeclaration>;
|
|
334
|
+
type JssmStateStyleShape = {
|
|
335
335
|
key: 'shape';
|
|
336
336
|
value: JssmShape;
|
|
337
337
|
};
|
|
338
|
-
|
|
338
|
+
type JssmStateStyleColor = {
|
|
339
339
|
key: 'color';
|
|
340
340
|
value: JssmColor;
|
|
341
341
|
};
|
|
342
|
-
|
|
342
|
+
type JssmStateStyleTextColor = {
|
|
343
343
|
key: 'text-color';
|
|
344
344
|
value: JssmColor;
|
|
345
345
|
};
|
|
346
|
-
|
|
346
|
+
type JssmStateStyleCorners = {
|
|
347
347
|
key: 'corners';
|
|
348
348
|
value: JssmCorner;
|
|
349
349
|
};
|
|
350
|
-
|
|
350
|
+
type JssmStateStyleLineStyle = {
|
|
351
351
|
key: 'line-style';
|
|
352
352
|
value: JssmLineStyle;
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
type JssmStateStyleStateLabel = {
|
|
355
355
|
key: 'state-label';
|
|
356
356
|
value: string;
|
|
357
357
|
};
|
|
358
|
-
|
|
358
|
+
type JssmStateStyleBackgroundColor = {
|
|
359
359
|
key: 'background-color';
|
|
360
360
|
value: JssmColor;
|
|
361
361
|
};
|
|
362
|
-
|
|
362
|
+
type JssmStateStyleBorderColor = {
|
|
363
363
|
key: 'border-color';
|
|
364
364
|
value: JssmColor;
|
|
365
365
|
};
|
|
366
|
-
|
|
366
|
+
type JssmStateStyleImage = {
|
|
367
367
|
key: 'image';
|
|
368
368
|
value: string;
|
|
369
369
|
};
|
|
370
|
-
|
|
370
|
+
type JssmStateStyleUrl = {
|
|
371
371
|
key: 'url';
|
|
372
372
|
value: string;
|
|
373
373
|
};
|
|
@@ -376,13 +376,13 @@ declare type JssmStateStyleUrl = {
|
|
|
376
376
|
* a state's style configuration. The `key` discriminator selects which
|
|
377
377
|
* member, and the `value` is typed accordingly.
|
|
378
378
|
*/
|
|
379
|
-
|
|
379
|
+
type JssmStateStyleKey = JssmStateStyleShape | JssmStateStyleColor | JssmStateStyleTextColor | JssmStateStyleCorners | JssmStateStyleLineStyle | JssmStateStyleBackgroundColor | JssmStateStyleStateLabel | JssmStateStyleBorderColor | JssmStateStyleImage | JssmStateStyleUrl;
|
|
380
380
|
/**
|
|
381
381
|
* An ordered list of {@link JssmStateStyleKey} entries. Used by the
|
|
382
382
|
* `default_*_state_config` machine config options to provide a fallback
|
|
383
383
|
* style stack.
|
|
384
384
|
*/
|
|
385
|
-
|
|
385
|
+
type JssmStateStyleKeyList = JssmStateStyleKey[];
|
|
386
386
|
/**
|
|
387
387
|
* The graph-wide default edge colour style item, produced by the
|
|
388
388
|
* `edge-color`/`edge_color` line inside a `transition: {}` (or `graph: {}`)
|
|
@@ -390,7 +390,7 @@ declare type JssmStateStyleKeyList = JssmStateStyleKey[];
|
|
|
390
390
|
* applies to edges rather than nodes, and because it carries the legacy
|
|
391
391
|
* `graph_default_edge_color` key the grammar emits.
|
|
392
392
|
*/
|
|
393
|
-
|
|
393
|
+
type JssmGraphDefaultEdgeColor = {
|
|
394
394
|
key: 'graph_default_edge_color';
|
|
395
395
|
value: JssmColor;
|
|
396
396
|
};
|
|
@@ -402,7 +402,7 @@ declare type JssmGraphDefaultEdgeColor = {
|
|
|
402
402
|
*
|
|
403
403
|
* @see JssmTransitionConfig
|
|
404
404
|
*/
|
|
405
|
-
|
|
405
|
+
type JssmTransitionStyleKey = JssmStateStyleKey | JssmGraphDefaultEdgeColor;
|
|
406
406
|
/**
|
|
407
407
|
* The compiled value of a `transition: {}` config block: an ordered list of
|
|
408
408
|
* edge-default style items. V1 mirrors the state-style shape used by
|
|
@@ -417,7 +417,7 @@ declare type JssmTransitionStyleKey = JssmStateStyleKey | JssmGraphDefaultEdgeCo
|
|
|
417
417
|
*
|
|
418
418
|
* @see JssmGraphConfig
|
|
419
419
|
*/
|
|
420
|
-
|
|
420
|
+
type JssmTransitionConfig = JssmTransitionStyleKey[];
|
|
421
421
|
/**
|
|
422
422
|
* Graph-scope default-config style items folded from the deprecated
|
|
423
423
|
* top-level graph keywords (`graph_layout`, `graph_bg_color`,
|
|
@@ -425,7 +425,7 @@ declare type JssmTransitionConfig = JssmTransitionStyleKey[];
|
|
|
425
425
|
* default) into the consolidated `graph: {}` config. Each carries the
|
|
426
426
|
* legacy parse key so downstream consumers can disambiguate.
|
|
427
427
|
*/
|
|
428
|
-
|
|
428
|
+
type JssmGraphAliasKey = {
|
|
429
429
|
key: 'graph_layout';
|
|
430
430
|
value: JssmLayout;
|
|
431
431
|
} | {
|
|
@@ -449,7 +449,7 @@ declare type JssmGraphAliasKey = {
|
|
|
449
449
|
*
|
|
450
450
|
* @see JssmGraphConfig
|
|
451
451
|
*/
|
|
452
|
-
|
|
452
|
+
type JssmGraphStyleKey = JssmStateStyleKey | JssmGraphAliasKey;
|
|
453
453
|
/**
|
|
454
454
|
* The compiled value of a `graph: {}` config block: an ordered list of
|
|
455
455
|
* graph-default style items. The compiler folds the deprecated top-level
|
|
@@ -466,7 +466,7 @@ declare type JssmGraphStyleKey = JssmStateStyleKey | JssmGraphAliasKey;
|
|
|
466
466
|
*
|
|
467
467
|
* @see JssmTransitionConfig
|
|
468
468
|
*/
|
|
469
|
-
|
|
469
|
+
type JssmGraphConfig = JssmGraphStyleKey[];
|
|
470
470
|
/**
|
|
471
471
|
* Complete shape of a jssm-viz theme. A theme provides a style block for
|
|
472
472
|
* each kind of state (`state`, `hooked`, `start`, `end`, `terminal`) as
|
|
@@ -478,7 +478,7 @@ declare type JssmGraphConfig = JssmGraphStyleKey[];
|
|
|
478
478
|
* Most user-defined themes should be typed as {@link JssmTheme} (the
|
|
479
479
|
* `Partial` of this) so that omitted fields fall back to the base theme.
|
|
480
480
|
*/
|
|
481
|
-
|
|
481
|
+
type JssmBaseTheme = {
|
|
482
482
|
name: string;
|
|
483
483
|
state: JssmStateConfig;
|
|
484
484
|
hooked: JssmStateConfig;
|
|
@@ -515,28 +515,28 @@ declare type JssmBaseTheme = {
|
|
|
515
515
|
* (fsl#1334), read by the all-widgets web control: a stochastic run-count
|
|
516
516
|
* and the panels the machine requests under `request` panel mode.
|
|
517
517
|
*/
|
|
518
|
-
|
|
518
|
+
type JssmEditorConfig = {
|
|
519
519
|
stochastic_run_count?: number;
|
|
520
520
|
panels?: Array<string>;
|
|
521
521
|
};
|
|
522
522
|
/** Which stochastic view a run batch produces. */
|
|
523
|
-
|
|
523
|
+
type JssmStochasticMode = 'montecarlo' | 'steady_state';
|
|
524
524
|
/** Options for {@link Machine.stochastic_summary} / {@link Machine.stochastic_runs}. */
|
|
525
|
-
|
|
525
|
+
type JssmStochasticOptions = {
|
|
526
526
|
mode?: JssmStochasticMode;
|
|
527
527
|
runs?: number;
|
|
528
528
|
max_steps?: number;
|
|
529
529
|
seed?: number;
|
|
530
530
|
};
|
|
531
531
|
/** One walk's result, yielded by {@link Machine.stochastic_runs}. */
|
|
532
|
-
|
|
532
|
+
type JssmStochasticRun = {
|
|
533
533
|
states: Array<string>;
|
|
534
534
|
edges: Array<string>;
|
|
535
535
|
length: number;
|
|
536
536
|
terminated: boolean;
|
|
537
537
|
};
|
|
538
538
|
/** Aggregate statistics over a stochastic run batch. */
|
|
539
|
-
|
|
539
|
+
type JssmStochasticSummary = {
|
|
540
540
|
mode: JssmStochasticMode;
|
|
541
541
|
runs: number;
|
|
542
542
|
seed: number;
|
|
@@ -547,7 +547,7 @@ declare type JssmStochasticSummary = {
|
|
|
547
547
|
terminal_reached?: number;
|
|
548
548
|
capped?: number;
|
|
549
549
|
};
|
|
550
|
-
|
|
550
|
+
type JssmGenericConfig<StateType, DataType> = {
|
|
551
551
|
graph_layout?: JssmLayout;
|
|
552
552
|
complete?: Array<StateType>;
|
|
553
553
|
transitions: JssmTransitions<StateType, DataType>;
|
|
@@ -655,7 +655,7 @@ declare type JssmGenericConfig<StateType, DataType> = {
|
|
|
655
655
|
*
|
|
656
656
|
* @internal
|
|
657
657
|
*/
|
|
658
|
-
|
|
658
|
+
type JssmCompileSe<StateType, mDT> = {
|
|
659
659
|
to: StateType;
|
|
660
660
|
se?: JssmCompileSe<StateType, mDT>;
|
|
661
661
|
kind: JssmArrow;
|
|
@@ -670,120 +670,120 @@ declare type JssmCompileSe<StateType, mDT> = {
|
|
|
670
670
|
l_action_loc?: FslSourceLocation;
|
|
671
671
|
r_action_loc?: FslSourceLocation;
|
|
672
672
|
};
|
|
673
|
-
|
|
673
|
+
type BasicHookDescription<mDT> = {
|
|
674
674
|
kind: 'hook';
|
|
675
675
|
from: string;
|
|
676
676
|
to: string;
|
|
677
677
|
handler: HookHandler<mDT>;
|
|
678
678
|
};
|
|
679
|
-
|
|
679
|
+
type HookDescriptionWithAction<mDT> = {
|
|
680
680
|
kind: 'named';
|
|
681
681
|
from: string;
|
|
682
682
|
to: string;
|
|
683
683
|
action: string;
|
|
684
684
|
handler: HookHandler<mDT>;
|
|
685
685
|
};
|
|
686
|
-
|
|
686
|
+
type StandardTransitionHook<mDT> = {
|
|
687
687
|
kind: 'standard transition';
|
|
688
688
|
handler: HookHandler<mDT>;
|
|
689
689
|
};
|
|
690
|
-
|
|
690
|
+
type MainTransitionHook<mDT> = {
|
|
691
691
|
kind: 'main transition';
|
|
692
692
|
handler: HookHandler<mDT>;
|
|
693
693
|
};
|
|
694
|
-
|
|
694
|
+
type ForcedTransitionHook<mDT> = {
|
|
695
695
|
kind: 'forced transition';
|
|
696
696
|
handler: HookHandler<mDT>;
|
|
697
697
|
};
|
|
698
|
-
|
|
698
|
+
type AnyTransitionHook<mDT> = {
|
|
699
699
|
kind: 'any transition';
|
|
700
700
|
handler: HookHandler<mDT>;
|
|
701
701
|
};
|
|
702
|
-
|
|
702
|
+
type GlobalActionHook<mDT> = {
|
|
703
703
|
kind: 'global action';
|
|
704
704
|
action: string;
|
|
705
705
|
handler: HookHandler<mDT>;
|
|
706
706
|
};
|
|
707
|
-
|
|
707
|
+
type AnyActionHook<mDT> = {
|
|
708
708
|
kind: 'any action';
|
|
709
709
|
handler: HookHandler<mDT>;
|
|
710
710
|
};
|
|
711
|
-
|
|
711
|
+
type EntryHook<mDT> = {
|
|
712
712
|
kind: 'entry';
|
|
713
713
|
to: string;
|
|
714
714
|
handler: HookHandler<mDT>;
|
|
715
715
|
};
|
|
716
|
-
|
|
716
|
+
type ExitHook<mDT> = {
|
|
717
717
|
kind: 'exit';
|
|
718
718
|
from: string;
|
|
719
719
|
handler: HookHandler<mDT>;
|
|
720
720
|
};
|
|
721
|
-
|
|
721
|
+
type AfterHook<mDT> = {
|
|
722
722
|
kind: 'after';
|
|
723
723
|
from: string;
|
|
724
724
|
handler: HookHandler<mDT>;
|
|
725
725
|
};
|
|
726
|
-
|
|
726
|
+
type PostBasicHookDescription<mDT> = {
|
|
727
727
|
kind: 'post hook';
|
|
728
728
|
from: string;
|
|
729
729
|
to: string;
|
|
730
730
|
handler: PostHookHandler<mDT>;
|
|
731
731
|
};
|
|
732
|
-
|
|
732
|
+
type PostHookDescriptionWithAction<mDT> = {
|
|
733
733
|
kind: 'post named';
|
|
734
734
|
from: string;
|
|
735
735
|
to: string;
|
|
736
736
|
action: string;
|
|
737
737
|
handler: PostHookHandler<mDT>;
|
|
738
738
|
};
|
|
739
|
-
|
|
739
|
+
type PostStandardTransitionHook<mDT> = {
|
|
740
740
|
kind: 'post standard transition';
|
|
741
741
|
handler: PostHookHandler<mDT>;
|
|
742
742
|
};
|
|
743
|
-
|
|
743
|
+
type PostMainTransitionHook<mDT> = {
|
|
744
744
|
kind: 'post main transition';
|
|
745
745
|
handler: PostHookHandler<mDT>;
|
|
746
746
|
};
|
|
747
|
-
|
|
747
|
+
type PostForcedTransitionHook<mDT> = {
|
|
748
748
|
kind: 'post forced transition';
|
|
749
749
|
handler: PostHookHandler<mDT>;
|
|
750
750
|
};
|
|
751
|
-
|
|
751
|
+
type PostAnyTransitionHook<mDT> = {
|
|
752
752
|
kind: 'post any transition';
|
|
753
753
|
handler: PostHookHandler<mDT>;
|
|
754
754
|
};
|
|
755
|
-
|
|
755
|
+
type PostGlobalActionHook<mDT> = {
|
|
756
756
|
kind: 'post global action';
|
|
757
757
|
action: string;
|
|
758
758
|
handler: PostHookHandler<mDT>;
|
|
759
759
|
};
|
|
760
|
-
|
|
760
|
+
type PostAnyActionHook<mDT> = {
|
|
761
761
|
kind: 'post any action';
|
|
762
762
|
handler: PostHookHandler<mDT>;
|
|
763
763
|
};
|
|
764
|
-
|
|
764
|
+
type PostEntryHook<mDT> = {
|
|
765
765
|
kind: 'post entry';
|
|
766
766
|
to: string;
|
|
767
767
|
handler: PostHookHandler<mDT>;
|
|
768
768
|
};
|
|
769
|
-
|
|
769
|
+
type PostExitHook<mDT> = {
|
|
770
770
|
kind: 'post exit';
|
|
771
771
|
from: string;
|
|
772
772
|
handler: PostHookHandler<mDT>;
|
|
773
773
|
};
|
|
774
|
-
|
|
774
|
+
type PreEverythingHook<mDT> = {
|
|
775
775
|
kind: 'pre everything';
|
|
776
776
|
handler: EverythingHookHandler<mDT>;
|
|
777
777
|
};
|
|
778
|
-
|
|
778
|
+
type EverythingHook<mDT> = {
|
|
779
779
|
kind: 'everything';
|
|
780
780
|
handler: EverythingHookHandler<mDT>;
|
|
781
781
|
};
|
|
782
|
-
|
|
782
|
+
type PrePostEverythingHook<mDT> = {
|
|
783
783
|
kind: 'pre post everything';
|
|
784
784
|
handler: PostEverythingHookHandler<mDT>;
|
|
785
785
|
};
|
|
786
|
-
|
|
786
|
+
type PostEverythingHook<mDT> = {
|
|
787
787
|
kind: 'post everything';
|
|
788
788
|
handler: PostEverythingHookHandler<mDT>;
|
|
789
789
|
};
|
|
@@ -801,13 +801,13 @@ declare type PostEverythingHook<mDT> = {
|
|
|
801
801
|
* variants (`'post *'`) cannot veto and are invoked only after a
|
|
802
802
|
* successful transition.
|
|
803
803
|
*/
|
|
804
|
-
|
|
804
|
+
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> | PreEverythingHook<mDT> | EverythingHook<mDT> | PrePostEverythingHook<mDT> | PostEverythingHook<mDT>;
|
|
805
805
|
/**
|
|
806
806
|
* Whether an observational hook runs in the pre-transition phase (where it
|
|
807
807
|
* may veto/mutate the transition) or the post-transition phase (a pure
|
|
808
808
|
* observer that runs only after a successful transition commits).
|
|
809
809
|
*/
|
|
810
|
-
|
|
810
|
+
type HookPhase = 'pre' | 'post';
|
|
811
811
|
/**
|
|
812
812
|
* Normalized description of the target a registry entry is bound to. Exactly
|
|
813
813
|
* one scope variant applies; the present fields depend on the scope:
|
|
@@ -818,7 +818,7 @@ declare type HookPhase = 'pre' | 'post';
|
|
|
818
818
|
* - `'global'` carries no further keys (it matches everything),
|
|
819
819
|
* - `'group'` carries `group` (a named state group with a boundary hook).
|
|
820
820
|
*/
|
|
821
|
-
|
|
821
|
+
type HookTarget = {
|
|
822
822
|
scope: 'edge';
|
|
823
823
|
from: StateType$1;
|
|
824
824
|
to: StateType$1;
|
|
@@ -842,7 +842,7 @@ declare type HookTarget = {
|
|
|
842
842
|
* covers only the programmatically-registered observational hooks), so the
|
|
843
843
|
* registry widens its `kind` field with them.
|
|
844
844
|
*/
|
|
845
|
-
|
|
845
|
+
type HookBoundaryKind = 'group enter' | 'group exit' | 'state enter' | 'state exit';
|
|
846
846
|
/**
|
|
847
847
|
* One row of the generated uniform observational-hook registry. `kind` is
|
|
848
848
|
* either an original {@link HookDescription} discriminator (e.g. `'entry'`,
|
|
@@ -851,7 +851,7 @@ declare type HookBoundaryKind = 'group enter' | 'group exit' | 'state enter' | '
|
|
|
851
851
|
* normalized {@link HookTarget} it is bound to. The triple
|
|
852
852
|
* `(kind, target, phase)` is the registry key the spec calls for.
|
|
853
853
|
*/
|
|
854
|
-
|
|
854
|
+
type HookRegistryEntry = {
|
|
855
855
|
kind: HookDescription<unknown>['kind'] | HookBoundaryKind;
|
|
856
856
|
phase: HookPhase;
|
|
857
857
|
target: HookTarget;
|
|
@@ -864,7 +864,7 @@ declare type HookRegistryEntry = {
|
|
|
864
864
|
* mirrors the spec's `hooks_on(state)` / `hooks_on(from→to)` /
|
|
865
865
|
* `hooks_on(action)` / `hooks_on(&group)` set with one parameter shape.
|
|
866
866
|
*/
|
|
867
|
-
|
|
867
|
+
type HookQuery = StateType$1 | {
|
|
868
868
|
from: StateType$1;
|
|
869
869
|
to: StateType$1;
|
|
870
870
|
action?: string;
|
|
@@ -881,7 +881,7 @@ declare type HookQuery = StateType$1 | {
|
|
|
881
881
|
* `data` overrides the data observed by other hooks in the same chain,
|
|
882
882
|
* and `next_data` overrides the data committed after the transition.
|
|
883
883
|
*/
|
|
884
|
-
|
|
884
|
+
type HookComplexResult<mDT> = {
|
|
885
885
|
pass: boolean;
|
|
886
886
|
state?: StateType$1;
|
|
887
887
|
data?: mDT;
|
|
@@ -893,7 +893,7 @@ declare type HookComplexResult<mDT> = {
|
|
|
893
893
|
* a {@link HookComplexResult} that additionally rewrites the next state
|
|
894
894
|
* and/or the next data payload.
|
|
895
895
|
*/
|
|
896
|
-
|
|
896
|
+
type HookResult<mDT> = true | false | undefined | void | HookComplexResult<mDT>;
|
|
897
897
|
/**
|
|
898
898
|
* Context object passed to every {@link HookHandler}. `data` is the
|
|
899
899
|
* data payload as it stands before the transition, and `next_data` is
|
|
@@ -901,7 +901,7 @@ declare type HookResult<mDT> = true | false | undefined | void | HookComplexResu
|
|
|
901
901
|
* handlers may inspect or mutate the latter via a
|
|
902
902
|
* {@link HookComplexResult} return value.
|
|
903
903
|
*/
|
|
904
|
-
|
|
904
|
+
type HookContext<mDT> = {
|
|
905
905
|
data: mDT;
|
|
906
906
|
next_data: mDT;
|
|
907
907
|
};
|
|
@@ -911,7 +911,7 @@ declare type HookContext<mDT> = {
|
|
|
911
911
|
* {@link HookContext} with `hook_name`, which identifies which specific
|
|
912
912
|
* hook fired so a single handler can route on it.
|
|
913
913
|
*/
|
|
914
|
-
|
|
914
|
+
type EverythingHookContext<mDT> = HookContext<mDT> & {
|
|
915
915
|
hook_name: string;
|
|
916
916
|
};
|
|
917
917
|
/**
|
|
@@ -921,38 +921,38 @@ declare type EverythingHookContext<mDT> = HookContext<mDT> & {
|
|
|
921
921
|
* result allows it, and a {@link HookComplexResult} can additionally
|
|
922
922
|
* rewrite the next state or next data.
|
|
923
923
|
*/
|
|
924
|
-
|
|
924
|
+
type HookHandler<mDT> = (hook_context: HookContext<mDT>) => HookResult<mDT>;
|
|
925
925
|
/**
|
|
926
926
|
* Signature of a post-transition hook handler. Invoked after a successful
|
|
927
927
|
* transition has been committed; the return value is ignored (the
|
|
928
928
|
* transition cannot be undone).
|
|
929
929
|
*/
|
|
930
|
-
|
|
930
|
+
type PostHookHandler<mDT> = (hook_context: HookContext<mDT>) => void;
|
|
931
931
|
/**
|
|
932
932
|
* Signature of an "everything" pre-transition hook handler. Like
|
|
933
933
|
* {@link HookHandler} but receives an {@link EverythingHookContext} so the
|
|
934
934
|
* handler can dispatch on `hook_name`.
|
|
935
935
|
*/
|
|
936
|
-
|
|
936
|
+
type EverythingHookHandler<mDT> = (hook_context: EverythingHookContext<mDT>) => HookResult<mDT>;
|
|
937
937
|
/**
|
|
938
938
|
* Signature of an "everything" post-transition hook handler. Like
|
|
939
939
|
* {@link PostHookHandler} but receives an {@link EverythingHookContext}.
|
|
940
940
|
* The return value is ignored.
|
|
941
941
|
*/
|
|
942
|
-
|
|
942
|
+
type PostEverythingHookHandler<mDT> = (hook_context: EverythingHookContext<mDT>) => void;
|
|
943
943
|
/**
|
|
944
944
|
* Bounded history of recently-visited states paired with the data payload
|
|
945
945
|
* observed in each. Backed by `circular_buffer_js`, so the oldest entry
|
|
946
946
|
* is dropped silently once the configured capacity is exceeded.
|
|
947
947
|
*/
|
|
948
|
-
|
|
948
|
+
type JssmHistory<mDT> = circular_buffer<[StateType$1, mDT]>;
|
|
949
949
|
/**
|
|
950
950
|
* Pluggable random-number-generator function shape. Must return a value
|
|
951
951
|
* in `[0, 1)` exactly as `Math.random` does. Supplied via the
|
|
952
952
|
* `rng_seed`-aware machine configuration so that stochastic models can be
|
|
953
953
|
* made reproducible.
|
|
954
954
|
*/
|
|
955
|
-
|
|
955
|
+
type JssmRng = () => number;
|
|
956
956
|
/**
|
|
957
957
|
* All event names that {@link Machine.on} accepts. These are observation
|
|
958
958
|
* events fired by the machine in addition to (not in place of) the hook
|
|
@@ -960,14 +960,14 @@ declare type JssmRng = () => number;
|
|
|
960
960
|
*
|
|
961
961
|
* @see Machine.on
|
|
962
962
|
*/
|
|
963
|
-
|
|
963
|
+
type JssmEventName = 'transition' | 'rejection' | 'action' | 'entry' | 'exit' | 'terminal' | 'complete' | 'error' | 'data-change' | 'override' | 'timeout' | 'hook-registration' | 'hook-removal';
|
|
964
964
|
/**
|
|
965
965
|
* Detail payload fired with a `transition` event. Carries the resolved
|
|
966
966
|
* source and target, the action name (if the transition was driven by an
|
|
967
967
|
* action), the data observed before and after the change, the edge kind,
|
|
968
968
|
* and whether the call was a forced transition.
|
|
969
969
|
*/
|
|
970
|
-
|
|
970
|
+
type JssmTransitionEventDetail<mDT> = {
|
|
971
971
|
from: StateType$1;
|
|
972
972
|
to: StateType$1;
|
|
973
973
|
action?: StateType$1;
|
|
@@ -982,7 +982,7 @@ declare type JssmTransitionEventDetail<mDT> = {
|
|
|
982
982
|
* and why. `reason` is `'invalid'` when no edge existed, `'hook'` when
|
|
983
983
|
* a hook handler vetoed; `hook_name` is set when `reason` is `'hook'`.
|
|
984
984
|
*/
|
|
985
|
-
|
|
985
|
+
type JssmRejectionEventDetail<mDT> = {
|
|
986
986
|
from: StateType$1;
|
|
987
987
|
to: StateType$1;
|
|
988
988
|
action?: StateType$1;
|
|
@@ -996,7 +996,7 @@ declare type JssmRejectionEventDetail<mDT> = {
|
|
|
996
996
|
* Detail payload fired with an `action` event. Fires when an action is
|
|
997
997
|
* attempted, before transition validation runs.
|
|
998
998
|
*/
|
|
999
|
-
|
|
999
|
+
type JssmActionEventDetail<mDT> = {
|
|
1000
1000
|
action: StateType$1;
|
|
1001
1001
|
from: StateType$1;
|
|
1002
1002
|
to?: StateType$1;
|
|
@@ -1008,7 +1008,7 @@ declare type JssmActionEventDetail<mDT> = {
|
|
|
1008
1008
|
* state. `from` is the predecessor state, if any. `action` is the
|
|
1009
1009
|
* action that drove the entry, if any.
|
|
1010
1010
|
*/
|
|
1011
|
-
|
|
1011
|
+
type JssmEntryEventDetail<mDT> = {
|
|
1012
1012
|
state: StateType$1;
|
|
1013
1013
|
from?: StateType$1;
|
|
1014
1014
|
action?: StateType$1;
|
|
@@ -1019,7 +1019,7 @@ declare type JssmEntryEventDetail<mDT> = {
|
|
|
1019
1019
|
* state. `to` is the next state, if any. `action` is the action that
|
|
1020
1020
|
* drove the exit, if any.
|
|
1021
1021
|
*/
|
|
1022
|
-
|
|
1022
|
+
type JssmExitEventDetail<mDT> = {
|
|
1023
1023
|
state: StateType$1;
|
|
1024
1024
|
to?: StateType$1;
|
|
1025
1025
|
action?: StateType$1;
|
|
@@ -1029,7 +1029,7 @@ declare type JssmExitEventDetail<mDT> = {
|
|
|
1029
1029
|
* Detail payload fired with a `terminal` event. Indicates that the
|
|
1030
1030
|
* machine has reached a state with no outgoing edges.
|
|
1031
1031
|
*/
|
|
1032
|
-
|
|
1032
|
+
type JssmTerminalEventDetail<mDT> = {
|
|
1033
1033
|
state: StateType$1;
|
|
1034
1034
|
data: mDT;
|
|
1035
1035
|
};
|
|
@@ -1037,7 +1037,7 @@ declare type JssmTerminalEventDetail<mDT> = {
|
|
|
1037
1037
|
* Detail payload fired with a `complete` event. Indicates that the
|
|
1038
1038
|
* machine has reached a FSL `complete` state.
|
|
1039
1039
|
*/
|
|
1040
|
-
|
|
1040
|
+
type JssmCompleteEventDetail<mDT> = {
|
|
1041
1041
|
state: StateType$1;
|
|
1042
1042
|
data: mDT;
|
|
1043
1043
|
};
|
|
@@ -1047,7 +1047,7 @@ declare type JssmCompleteEventDetail<mDT> = {
|
|
|
1047
1047
|
* identify the event whose handler threw, and `handler` is the offending
|
|
1048
1048
|
* function so consumers can correlate / blame.
|
|
1049
1049
|
*/
|
|
1050
|
-
|
|
1050
|
+
type JssmErrorEventDetail = {
|
|
1051
1051
|
error: unknown;
|
|
1052
1052
|
source_event: JssmEventName;
|
|
1053
1053
|
source_detail: unknown;
|
|
@@ -1058,7 +1058,7 @@ declare type JssmErrorEventDetail = {
|
|
|
1058
1058
|
* machine's data payload is replaced. `old_data` is the value before the
|
|
1059
1059
|
* change; `new_data` is the value after.
|
|
1060
1060
|
*/
|
|
1061
|
-
|
|
1061
|
+
type JssmDataChangeEventDetail<mDT> = {
|
|
1062
1062
|
from?: StateType$1;
|
|
1063
1063
|
to?: StateType$1;
|
|
1064
1064
|
action?: StateType$1;
|
|
@@ -1070,7 +1070,7 @@ declare type JssmDataChangeEventDetail<mDT> = {
|
|
|
1070
1070
|
* Detail payload fired with an `override` event. Distinguishes a forced
|
|
1071
1071
|
* state replacement from a normal transition.
|
|
1072
1072
|
*/
|
|
1073
|
-
|
|
1073
|
+
type JssmOverrideEventDetail<mDT> = {
|
|
1074
1074
|
from: StateType$1;
|
|
1075
1075
|
to: StateType$1;
|
|
1076
1076
|
old_data: mDT;
|
|
@@ -1080,7 +1080,7 @@ declare type JssmOverrideEventDetail<mDT> = {
|
|
|
1080
1080
|
* Detail payload fired with a `timeout` event. Fires when a configured
|
|
1081
1081
|
* `after` clause causes an automatic transition.
|
|
1082
1082
|
*/
|
|
1083
|
-
|
|
1083
|
+
type JssmTimeoutEventDetail = {
|
|
1084
1084
|
from: StateType$1;
|
|
1085
1085
|
to: StateType$1;
|
|
1086
1086
|
after_time: number;
|
|
@@ -1090,7 +1090,7 @@ declare type JssmTimeoutEventDetail = {
|
|
|
1090
1090
|
* Mirrors the {@link HookDescription} so inspector tools can mirror the
|
|
1091
1091
|
* current hook set.
|
|
1092
1092
|
*/
|
|
1093
|
-
|
|
1093
|
+
type JssmHookLifecycleEventDetail<mDT> = {
|
|
1094
1094
|
description: HookDescription<mDT>;
|
|
1095
1095
|
};
|
|
1096
1096
|
/**
|
|
@@ -1098,7 +1098,7 @@ declare type JssmHookLifecycleEventDetail<mDT> = {
|
|
|
1098
1098
|
* payload. Drives the discriminated-union typing of {@link Machine.on},
|
|
1099
1099
|
* so `e.action` and friends only exist where they're meaningful.
|
|
1100
1100
|
*/
|
|
1101
|
-
|
|
1101
|
+
type JssmEventDetailMap<mDT> = {
|
|
1102
1102
|
'transition': JssmTransitionEventDetail<mDT>;
|
|
1103
1103
|
'rejection': JssmRejectionEventDetail<mDT>;
|
|
1104
1104
|
'action': JssmActionEventDetail<mDT>;
|
|
@@ -1119,7 +1119,7 @@ declare type JssmEventDetailMap<mDT> = {
|
|
|
1119
1119
|
* filter entry fire the handler. Events that don't list a filter key in
|
|
1120
1120
|
* v1 take no filter properties.
|
|
1121
1121
|
*/
|
|
1122
|
-
|
|
1122
|
+
type JssmEventFilterMap<mDT> = {
|
|
1123
1123
|
'transition': {
|
|
1124
1124
|
from?: StateType$1;
|
|
1125
1125
|
to?: StateType$1;
|
|
@@ -1147,19 +1147,19 @@ declare type JssmEventFilterMap<mDT> = {
|
|
|
1147
1147
|
* @typeparam mDT The type of the machine data member.
|
|
1148
1148
|
* @typeparam Ev The event name.
|
|
1149
1149
|
*/
|
|
1150
|
-
|
|
1150
|
+
type JssmEventFilter<mDT, Ev extends JssmEventName> = JssmEventFilterMap<mDT>[Ev];
|
|
1151
1151
|
/**
|
|
1152
1152
|
* Per-event handler signature. Receives a detail object typed by event
|
|
1153
1153
|
* name, so `e.action` (etc.) only exist where they're meaningful.
|
|
1154
1154
|
* @typeparam mDT The type of the machine data member.
|
|
1155
1155
|
* @typeparam Ev The event name.
|
|
1156
1156
|
*/
|
|
1157
|
-
|
|
1157
|
+
type JssmEventHandler<mDT, Ev extends JssmEventName> = (detail: JssmEventDetailMap<mDT>[Ev]) => void;
|
|
1158
1158
|
/**
|
|
1159
1159
|
* Function returned by {@link Machine.on} and {@link Machine.once} that
|
|
1160
1160
|
* removes the subscription. Calling it more than once is a no-op.
|
|
1161
1161
|
*/
|
|
1162
|
-
|
|
1162
|
+
type JssmUnsubscribe = () => void;
|
|
1163
1163
|
|
|
1164
1164
|
/**
|
|
1165
1165
|
* String interning support for the jssm machine internals.
|
|
@@ -1242,7 +1242,7 @@ declare const version: string;
|
|
|
1242
1242
|
*/
|
|
1243
1243
|
declare const build_time: number;
|
|
1244
1244
|
|
|
1245
|
-
|
|
1245
|
+
type StateType = string;
|
|
1246
1246
|
|
|
1247
1247
|
/**
|
|
1248
1248
|
* Internal record holding a single registered event subscription: the
|
|
@@ -1251,7 +1251,7 @@ declare type StateType = string;
|
|
|
1251
1251
|
*
|
|
1252
1252
|
* @internal
|
|
1253
1253
|
*/
|
|
1254
|
-
|
|
1254
|
+
type JssmEventEntry<mDT, Ev extends JssmEventName> = {
|
|
1255
1255
|
handler: JssmEventHandler<mDT, Ev>;
|
|
1256
1256
|
filter?: JssmEventFilter<mDT, Ev>;
|
|
1257
1257
|
once: boolean;
|
|
@@ -3838,7 +3838,7 @@ declare class Machine<mDT> {
|
|
|
3838
3838
|
* diagram or when overlap is pervasive.
|
|
3839
3839
|
* - `'off'` — ignore groups entirely; byte-for-byte the historical output.
|
|
3840
3840
|
*/
|
|
3841
|
-
|
|
3841
|
+
type RenderGroups = 'cluster' | 'chips' | 'off';
|
|
3842
3842
|
/**
|
|
3843
3843
|
* Inject runtime configuration for jssm/viz. Currently only accepts a
|
|
3844
3844
|
* custom `DOMParser` constructor for use by `*_svg_element` functions in
|
|
@@ -4127,7 +4127,7 @@ declare function graph_attrs_body(config: JssmGraphConfig | undefined): string;
|
|
|
4127
4127
|
*
|
|
4128
4128
|
* @internal
|
|
4129
4129
|
*/
|
|
4130
|
-
|
|
4130
|
+
type StateKind = 'final' | 'complete' | 'terminal' | 'base';
|
|
4131
4131
|
/**
|
|
4132
4132
|
* Slugify a group name into the body of a Graphviz `cluster_…` subgraph
|
|
4133
4133
|
* identifier. Graphviz treats any `subgraph` whose name begins with the
|
|
@@ -4276,7 +4276,7 @@ declare function chips_for_all_groups<T>(u_jssm: Machine<T>, l_states: string[])
|
|
|
4276
4276
|
* see {@link RenderGroups}. `'off'` reproduces the historical, group-blind
|
|
4277
4277
|
* output byte-for-byte.
|
|
4278
4278
|
*/
|
|
4279
|
-
|
|
4279
|
+
type VizRenderOpts = {
|
|
4280
4280
|
hide_state_labels?: boolean;
|
|
4281
4281
|
footer?: string;
|
|
4282
4282
|
engine?: string;
|