jssm 5.162.2 → 5.162.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cdn/instance.js +1 -1
- package/dist/cdn/viz.js +1 -1
- 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 +2 -2
- package/dist/deno/jssm.d.ts +14 -13
- package/dist/deno/jssm.js +1 -1
- package/dist/deno/jssm_compiler.d.ts +1 -1
- package/dist/deno/jssm_types.d.ts +17 -17
- package/dist/deno/jssm_viz.d.ts +1 -1
- package/dist/fence/fence.js +11 -11
- 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/jssm.es5.d.cts +30 -29
- package/jssm.es6.d.ts +30 -29
- package/jssm.fence.d.ts +29 -28
- package/jssm_viz.es5.d.cts +30 -29
- package/jssm_viz.es6.d.ts +30 -29
- package/package.json +1 -1
package/jssm_viz.es5.d.cts
CHANGED
|
@@ -28,7 +28,7 @@ type JssmShape = "box" | "polygon" | "ellipse" | "oval" | "circle" | "point" | "
|
|
|
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
|
-
* may only be taken via {@link Machine.force_transition}, and `'none'`
|
|
31
|
+
* may only be taken via {@link jssm!Machine.force_transition}, and `'none'`
|
|
32
32
|
* means no transition exists in that direction.
|
|
33
33
|
*/
|
|
34
34
|
type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
|
|
@@ -94,8 +94,8 @@ declare const FslThemes: readonly ["default", "ocean", "modern", "plain", "bold"
|
|
|
94
94
|
*/
|
|
95
95
|
type FslTheme = typeof FslThemes[number];
|
|
96
96
|
/**
|
|
97
|
-
* Persistable snapshot of a Machine produced by {@link Machine.serialize}
|
|
98
|
-
* and consumed by {@link deserialize}. Carries the current state, the
|
|
97
|
+
* Persistable snapshot of a Machine produced by {@link jssm!Machine.serialize}
|
|
98
|
+
* and consumed by {@link jssm!deserialize}. Carries the current state, the
|
|
99
99
|
* associated machine data, the recent history (subject to the configured
|
|
100
100
|
* capacity), and metadata to detect version-skew on rehydration.
|
|
101
101
|
*
|
|
@@ -252,7 +252,7 @@ type JssmGenericState = {
|
|
|
252
252
|
complete: boolean;
|
|
253
253
|
};
|
|
254
254
|
/**
|
|
255
|
-
* The full internal bookkeeping snapshot of a {@link Machine}, exposed for
|
|
255
|
+
* The full internal bookkeeping snapshot of a {@link jssm!Machine}, exposed for
|
|
256
256
|
* advanced introspection. Contains the current state, the state map, the
|
|
257
257
|
* edge map and reverse-action map, and the original edge list. The
|
|
258
258
|
* `internal_state_impl_version` field exists so that consumers can detect
|
|
@@ -305,7 +305,7 @@ type JssmStateDeclarationRule = {
|
|
|
305
305
|
/**
|
|
306
306
|
* The fully-condensed declaration for a single state, including its raw
|
|
307
307
|
* rule list (`declarations`) and the well-known styling fields jssm-viz
|
|
308
|
-
* understands. Returned by {@link Machine.state_declaration}.
|
|
308
|
+
* understands. Returned by {@link jssm!Machine.state_declaration}.
|
|
309
309
|
*/
|
|
310
310
|
type JssmStateDeclaration = {
|
|
311
311
|
declarations: Array<JssmStateDeclarationRule>;
|
|
@@ -498,7 +498,7 @@ type JssmBaseTheme = {
|
|
|
498
498
|
title: undefined;
|
|
499
499
|
};
|
|
500
500
|
/**
|
|
501
|
-
* Full configuration object accepted by the {@link Machine} constructor and
|
|
501
|
+
* Full configuration object accepted by the {@link jssm!Machine} constructor and
|
|
502
502
|
* by {@link from}. Carries the transition list and the optional knobs
|
|
503
503
|
* governing layout, theming, history, start/end states, property
|
|
504
504
|
* definitions, machine metadata (author, license, version, ...) and the
|
|
@@ -521,14 +521,14 @@ type JssmEditorConfig = {
|
|
|
521
521
|
};
|
|
522
522
|
/** Which stochastic view a run batch produces. */
|
|
523
523
|
type JssmStochasticMode = 'montecarlo' | 'steady_state';
|
|
524
|
-
/** Options for {@link Machine.stochastic_summary} / {@link Machine.stochastic_runs}. */
|
|
524
|
+
/** Options for {@link jssm!Machine.stochastic_summary} / {@link jssm!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
|
-
/** One walk's result, yielded by {@link Machine.stochastic_runs}. */
|
|
531
|
+
/** One walk's result, yielded by {@link jssm!Machine.stochastic_runs}. */
|
|
532
532
|
type JssmStochasticRun = {
|
|
533
533
|
states: Array<string>;
|
|
534
534
|
edges: Array<string>;
|
|
@@ -560,7 +560,7 @@ type JssmGenericConfig<StateType, DataType> = {
|
|
|
560
560
|
history?: number;
|
|
561
561
|
/**
|
|
562
562
|
* Maximum depth of the boundary-hook action cascade before the machine
|
|
563
|
-
* throws a {@link JssmError} rather than risking a stack overflow or hang.
|
|
563
|
+
* throws a {@link jssm_error!JssmError} rather than risking a stack overflow or hang.
|
|
564
564
|
*
|
|
565
565
|
* Each time a boundary action fires a transition that itself crosses a
|
|
566
566
|
* boundary, the depth counter increments. A cascade exceeding this limit is
|
|
@@ -857,7 +857,7 @@ type HookRegistryEntry = {
|
|
|
857
857
|
target: HookTarget;
|
|
858
858
|
};
|
|
859
859
|
/**
|
|
860
|
-
* Query for {@link Machine.has_hook} / {@link Machine.hooks_on}. A bare
|
|
860
|
+
* Query for {@link jssm!Machine.has_hook} / {@link jssm!Machine.hooks_on}. A bare
|
|
861
861
|
* string is read as a state name; an `{ from, to, action? }` object is read
|
|
862
862
|
* as an edge (optionally a named edge); an `{ action }` object is read as a
|
|
863
863
|
* named action; a `{ group }` object is read as a named state group. This
|
|
@@ -954,7 +954,7 @@ type JssmHistory<mDT> = circular_buffer<[StateType$1, mDT]>;
|
|
|
954
954
|
*/
|
|
955
955
|
type JssmRng = () => number;
|
|
956
956
|
/**
|
|
957
|
-
* All event names that {@link Machine.on} accepts. These are observation
|
|
957
|
+
* All event names that {@link jssm!Machine.on} accepts. These are observation
|
|
958
958
|
* events fired by the machine in addition to (not in place of) the hook
|
|
959
959
|
* system. Hooks intercept; events observe.
|
|
960
960
|
*
|
|
@@ -1095,7 +1095,7 @@ type JssmHookLifecycleEventDetail<mDT> = {
|
|
|
1095
1095
|
};
|
|
1096
1096
|
/**
|
|
1097
1097
|
* Mapped type from {@link JssmEventName} to the corresponding detail
|
|
1098
|
-
* payload. Drives the discriminated-union typing of {@link Machine.on},
|
|
1098
|
+
* payload. Drives the discriminated-union typing of {@link jssm!Machine.on},
|
|
1099
1099
|
* so `e.action` and friends only exist where they're meaningful.
|
|
1100
1100
|
*/
|
|
1101
1101
|
type JssmEventDetailMap<mDT> = {
|
|
@@ -1114,7 +1114,7 @@ type JssmEventDetailMap<mDT> = {
|
|
|
1114
1114
|
'hook-removal': JssmHookLifecycleEventDetail<mDT>;
|
|
1115
1115
|
};
|
|
1116
1116
|
/**
|
|
1117
|
-
* Filter accepted by {@link Machine.on} / {@link Machine.once} for an
|
|
1117
|
+
* Filter accepted by {@link jssm!Machine.on} / {@link jssm!Machine.once} for an
|
|
1118
1118
|
* individual event name. Only events whose detail key matches every
|
|
1119
1119
|
* filter entry fire the handler. Events that don't list a filter key in
|
|
1120
1120
|
* v1 take no filter properties.
|
|
@@ -1142,7 +1142,7 @@ type JssmEventFilterMap<mDT> = {
|
|
|
1142
1142
|
'hook-removal': Record<string, never>;
|
|
1143
1143
|
};
|
|
1144
1144
|
/**
|
|
1145
|
-
* Per-event filter object (as passed to {@link Machine.on}). Use
|
|
1145
|
+
* Per-event filter object (as passed to {@link jssm!Machine.on}). Use
|
|
1146
1146
|
* `JssmEventDetailMap<mDT>[Ev]` to find the matching detail type.
|
|
1147
1147
|
* @typeParam mDT The type of the machine data member.
|
|
1148
1148
|
* @typeParam Ev The event name.
|
|
@@ -1156,7 +1156,7 @@ type JssmEventFilter<mDT, Ev extends JssmEventName> = JssmEventFilterMap<mDT>[Ev
|
|
|
1156
1156
|
*/
|
|
1157
1157
|
type JssmEventHandler<mDT, Ev extends JssmEventName> = (detail: JssmEventDetailMap<mDT>[Ev]) => void;
|
|
1158
1158
|
/**
|
|
1159
|
-
* Function returned by {@link Machine.on} and {@link Machine.once} that
|
|
1159
|
+
* Function returned by {@link jssm!Machine.on} and {@link jssm!Machine.once} that
|
|
1160
1160
|
* removes the subscription. Calling it more than once is a no-op.
|
|
1161
1161
|
*/
|
|
1162
1162
|
type JssmUnsubscribe = () => void;
|
|
@@ -1742,7 +1742,7 @@ declare class Machine<mDT> {
|
|
|
1742
1742
|
* Serialize the current machine, including all defining state but not the
|
|
1743
1743
|
* machine string, to a structure. This means you will need the machine
|
|
1744
1744
|
* string to recreate (to not waste repeated space;) if you want the machine
|
|
1745
|
-
* string embedded, call
|
|
1745
|
+
* string embedded, call `serialize_with_string` instead.
|
|
1746
1746
|
*
|
|
1747
1747
|
* @typeParam mDT The type of the machine data member; usually omitted
|
|
1748
1748
|
*
|
|
@@ -2129,7 +2129,7 @@ declare class Machine<mDT> {
|
|
|
2129
2129
|
* List all entrances attached to the current state. Please note that the
|
|
2130
2130
|
* order of the list is not defined. This list includes both unforced and
|
|
2131
2131
|
* forced entrances; if this isn't desired, consider
|
|
2132
|
-
*
|
|
2132
|
+
* `list_unforced_entrances` or `list_forced_entrances` as
|
|
2133
2133
|
* appropriate.
|
|
2134
2134
|
*
|
|
2135
2135
|
* ```typescript
|
|
@@ -2151,8 +2151,8 @@ declare class Machine<mDT> {
|
|
|
2151
2151
|
*
|
|
2152
2152
|
* List all exits attached to the current state. Please note that the order
|
|
2153
2153
|
* of the list is not defined. This list includes both unforced and forced
|
|
2154
|
-
* exits; if this isn't desired, consider
|
|
2155
|
-
*
|
|
2154
|
+
* exits; if this isn't desired, consider `list_unforced_exits` or
|
|
2155
|
+
* `list_forced_exits` as appropriate.
|
|
2156
2156
|
*
|
|
2157
2157
|
* ```typescript
|
|
2158
2158
|
* import { sm } from 'jssm';
|
|
@@ -2527,9 +2527,9 @@ declare class Machine<mDT> {
|
|
|
2527
2527
|
*
|
|
2528
2528
|
* @typeParam Ev The event name (drives the detail type).
|
|
2529
2529
|
* @param name The event name to subscribe to.
|
|
2530
|
-
* @param
|
|
2531
|
-
*
|
|
2532
|
-
*
|
|
2530
|
+
* @param handler The handler invoked on each matching delivery. The
|
|
2531
|
+
* three-argument `(name, filter, handler)` form inserts a
|
|
2532
|
+
* filter object before the handler (see the example above).
|
|
2533
2533
|
* @returns A function that unsubscribes when called.
|
|
2534
2534
|
*
|
|
2535
2535
|
* @see Machine.off
|
|
@@ -2548,8 +2548,9 @@ declare class Machine<mDT> {
|
|
|
2548
2548
|
*
|
|
2549
2549
|
* @typeParam Ev The event name.
|
|
2550
2550
|
* @param name The event name.
|
|
2551
|
-
* @param
|
|
2552
|
-
*
|
|
2551
|
+
* @param handler The handler invoked on the first matching delivery. The
|
|
2552
|
+
* three-argument `(name, filter, handler)` form inserts a
|
|
2553
|
+
* filter object before the handler (same shapes as `on`).
|
|
2553
2554
|
* @returns A function that unsubscribes early if called before the
|
|
2554
2555
|
* handler has fired.
|
|
2555
2556
|
*
|
|
@@ -3506,7 +3507,7 @@ declare class Machine<mDT> {
|
|
|
3506
3507
|
* state's declaration into a fresh {@link JssmStateConfig} — the tier-5
|
|
3507
3508
|
* "`state foo : { … }`" contribution of the config cascade. A state with no
|
|
3508
3509
|
* declaration yields an all-`undefined` config (which contributes nothing
|
|
3509
|
-
* once folded with
|
|
3510
|
+
* once folded with `merge_state_config`).
|
|
3510
3511
|
*
|
|
3511
3512
|
* @param state The state whose per-state declared style is wanted.
|
|
3512
3513
|
*
|
|
@@ -3546,7 +3547,7 @@ declare class Machine<mDT> {
|
|
|
3546
3547
|
* overlay (tier 6) is NOT applied here; it is layered on top by
|
|
3547
3548
|
* {@link resolve_state_config} so it wins over per-state config.
|
|
3548
3549
|
*
|
|
3549
|
-
* Tiers, folded least-specific → most-specific with
|
|
3550
|
+
* Tiers, folded least-specific → most-specific with `merge_state_config`
|
|
3550
3551
|
* (later wins, never throwing on a cross-tier key collision):
|
|
3551
3552
|
*
|
|
3552
3553
|
* 1. theme defaults — `base_theme.state`, then each selected theme's
|
|
@@ -3578,7 +3579,7 @@ declare class Machine<mDT> {
|
|
|
3578
3579
|
* successor to the ad-hoc layer merge {@link style_for} used to perform.
|
|
3579
3580
|
*
|
|
3580
3581
|
* For any state OTHER than the current one, this returns the memoized static
|
|
3581
|
-
* resolution (tiers 1–5; see
|
|
3582
|
+
* resolution (tiers 1–5; see `_compose_state_config`) — theme →
|
|
3582
3583
|
* `default_state_config` → per-kind defaults → depth-ordered group metadata →
|
|
3583
3584
|
* per-state config. The cache is keyed by state and never invalidated, since
|
|
3584
3585
|
* those tiers do not depend on which state is current.
|
|
@@ -3588,7 +3589,7 @@ declare class Machine<mDT> {
|
|
|
3588
3589
|
* layers: the active-state THEME layers fold in just below the per-state
|
|
3589
3590
|
* config (tier 3-active), and the user `active_state : { … }` overlay folds
|
|
3590
3591
|
* in LAST (tier 6), on top of everything, so it wins over per-state config.
|
|
3591
|
-
* Every fold uses
|
|
3592
|
+
* Every fold uses `merge_state_config`, so a key set at a lower tier is
|
|
3592
3593
|
* overridden — never rejected — by a higher one.
|
|
3593
3594
|
*
|
|
3594
3595
|
* ```typescript
|
|
@@ -4317,7 +4318,7 @@ declare function chips_for_render_mode<T>(u_jssm: Machine<T>, l_states: string[]
|
|
|
4317
4318
|
* the state's display text plus any group chips the node builder appends, with
|
|
4318
4319
|
* DOT's `\"` escaping undone (SVG carries the literal character). A label that
|
|
4319
4320
|
* wraps across lines becomes several `<text>` elements; this returns the lines
|
|
4320
|
-
* joined by `\n`, exactly how
|
|
4321
|
+
* joined by `\n`, exactly how `extract_state_fills` reads them back — so
|
|
4321
4322
|
* the derived key and the extracted key meet at the same string.
|
|
4322
4323
|
*
|
|
4323
4324
|
* This is the single source of truth the static fence renderer keys its
|
package/jssm_viz.es6.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ type JssmShape = "box" | "polygon" | "ellipse" | "oval" | "circle" | "point" | "
|
|
|
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
|
-
* may only be taken via {@link Machine.force_transition}, and `'none'`
|
|
31
|
+
* may only be taken via {@link jssm!Machine.force_transition}, and `'none'`
|
|
32
32
|
* means no transition exists in that direction.
|
|
33
33
|
*/
|
|
34
34
|
type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
|
|
@@ -94,8 +94,8 @@ declare const FslThemes: readonly ["default", "ocean", "modern", "plain", "bold"
|
|
|
94
94
|
*/
|
|
95
95
|
type FslTheme = typeof FslThemes[number];
|
|
96
96
|
/**
|
|
97
|
-
* Persistable snapshot of a Machine produced by {@link Machine.serialize}
|
|
98
|
-
* and consumed by {@link deserialize}. Carries the current state, the
|
|
97
|
+
* Persistable snapshot of a Machine produced by {@link jssm!Machine.serialize}
|
|
98
|
+
* and consumed by {@link jssm!deserialize}. Carries the current state, the
|
|
99
99
|
* associated machine data, the recent history (subject to the configured
|
|
100
100
|
* capacity), and metadata to detect version-skew on rehydration.
|
|
101
101
|
*
|
|
@@ -252,7 +252,7 @@ type JssmGenericState = {
|
|
|
252
252
|
complete: boolean;
|
|
253
253
|
};
|
|
254
254
|
/**
|
|
255
|
-
* The full internal bookkeeping snapshot of a {@link Machine}, exposed for
|
|
255
|
+
* The full internal bookkeeping snapshot of a {@link jssm!Machine}, exposed for
|
|
256
256
|
* advanced introspection. Contains the current state, the state map, the
|
|
257
257
|
* edge map and reverse-action map, and the original edge list. The
|
|
258
258
|
* `internal_state_impl_version` field exists so that consumers can detect
|
|
@@ -305,7 +305,7 @@ type JssmStateDeclarationRule = {
|
|
|
305
305
|
/**
|
|
306
306
|
* The fully-condensed declaration for a single state, including its raw
|
|
307
307
|
* rule list (`declarations`) and the well-known styling fields jssm-viz
|
|
308
|
-
* understands. Returned by {@link Machine.state_declaration}.
|
|
308
|
+
* understands. Returned by {@link jssm!Machine.state_declaration}.
|
|
309
309
|
*/
|
|
310
310
|
type JssmStateDeclaration = {
|
|
311
311
|
declarations: Array<JssmStateDeclarationRule>;
|
|
@@ -498,7 +498,7 @@ type JssmBaseTheme = {
|
|
|
498
498
|
title: undefined;
|
|
499
499
|
};
|
|
500
500
|
/**
|
|
501
|
-
* Full configuration object accepted by the {@link Machine} constructor and
|
|
501
|
+
* Full configuration object accepted by the {@link jssm!Machine} constructor and
|
|
502
502
|
* by {@link from}. Carries the transition list and the optional knobs
|
|
503
503
|
* governing layout, theming, history, start/end states, property
|
|
504
504
|
* definitions, machine metadata (author, license, version, ...) and the
|
|
@@ -521,14 +521,14 @@ type JssmEditorConfig = {
|
|
|
521
521
|
};
|
|
522
522
|
/** Which stochastic view a run batch produces. */
|
|
523
523
|
type JssmStochasticMode = 'montecarlo' | 'steady_state';
|
|
524
|
-
/** Options for {@link Machine.stochastic_summary} / {@link Machine.stochastic_runs}. */
|
|
524
|
+
/** Options for {@link jssm!Machine.stochastic_summary} / {@link jssm!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
|
-
/** One walk's result, yielded by {@link Machine.stochastic_runs}. */
|
|
531
|
+
/** One walk's result, yielded by {@link jssm!Machine.stochastic_runs}. */
|
|
532
532
|
type JssmStochasticRun = {
|
|
533
533
|
states: Array<string>;
|
|
534
534
|
edges: Array<string>;
|
|
@@ -560,7 +560,7 @@ type JssmGenericConfig<StateType, DataType> = {
|
|
|
560
560
|
history?: number;
|
|
561
561
|
/**
|
|
562
562
|
* Maximum depth of the boundary-hook action cascade before the machine
|
|
563
|
-
* throws a {@link JssmError} rather than risking a stack overflow or hang.
|
|
563
|
+
* throws a {@link jssm_error!JssmError} rather than risking a stack overflow or hang.
|
|
564
564
|
*
|
|
565
565
|
* Each time a boundary action fires a transition that itself crosses a
|
|
566
566
|
* boundary, the depth counter increments. A cascade exceeding this limit is
|
|
@@ -857,7 +857,7 @@ type HookRegistryEntry = {
|
|
|
857
857
|
target: HookTarget;
|
|
858
858
|
};
|
|
859
859
|
/**
|
|
860
|
-
* Query for {@link Machine.has_hook} / {@link Machine.hooks_on}. A bare
|
|
860
|
+
* Query for {@link jssm!Machine.has_hook} / {@link jssm!Machine.hooks_on}. A bare
|
|
861
861
|
* string is read as a state name; an `{ from, to, action? }` object is read
|
|
862
862
|
* as an edge (optionally a named edge); an `{ action }` object is read as a
|
|
863
863
|
* named action; a `{ group }` object is read as a named state group. This
|
|
@@ -954,7 +954,7 @@ type JssmHistory<mDT> = circular_buffer<[StateType$1, mDT]>;
|
|
|
954
954
|
*/
|
|
955
955
|
type JssmRng = () => number;
|
|
956
956
|
/**
|
|
957
|
-
* All event names that {@link Machine.on} accepts. These are observation
|
|
957
|
+
* All event names that {@link jssm!Machine.on} accepts. These are observation
|
|
958
958
|
* events fired by the machine in addition to (not in place of) the hook
|
|
959
959
|
* system. Hooks intercept; events observe.
|
|
960
960
|
*
|
|
@@ -1095,7 +1095,7 @@ type JssmHookLifecycleEventDetail<mDT> = {
|
|
|
1095
1095
|
};
|
|
1096
1096
|
/**
|
|
1097
1097
|
* Mapped type from {@link JssmEventName} to the corresponding detail
|
|
1098
|
-
* payload. Drives the discriminated-union typing of {@link Machine.on},
|
|
1098
|
+
* payload. Drives the discriminated-union typing of {@link jssm!Machine.on},
|
|
1099
1099
|
* so `e.action` and friends only exist where they're meaningful.
|
|
1100
1100
|
*/
|
|
1101
1101
|
type JssmEventDetailMap<mDT> = {
|
|
@@ -1114,7 +1114,7 @@ type JssmEventDetailMap<mDT> = {
|
|
|
1114
1114
|
'hook-removal': JssmHookLifecycleEventDetail<mDT>;
|
|
1115
1115
|
};
|
|
1116
1116
|
/**
|
|
1117
|
-
* Filter accepted by {@link Machine.on} / {@link Machine.once} for an
|
|
1117
|
+
* Filter accepted by {@link jssm!Machine.on} / {@link jssm!Machine.once} for an
|
|
1118
1118
|
* individual event name. Only events whose detail key matches every
|
|
1119
1119
|
* filter entry fire the handler. Events that don't list a filter key in
|
|
1120
1120
|
* v1 take no filter properties.
|
|
@@ -1142,7 +1142,7 @@ type JssmEventFilterMap<mDT> = {
|
|
|
1142
1142
|
'hook-removal': Record<string, never>;
|
|
1143
1143
|
};
|
|
1144
1144
|
/**
|
|
1145
|
-
* Per-event filter object (as passed to {@link Machine.on}). Use
|
|
1145
|
+
* Per-event filter object (as passed to {@link jssm!Machine.on}). Use
|
|
1146
1146
|
* `JssmEventDetailMap<mDT>[Ev]` to find the matching detail type.
|
|
1147
1147
|
* @typeParam mDT The type of the machine data member.
|
|
1148
1148
|
* @typeParam Ev The event name.
|
|
@@ -1156,7 +1156,7 @@ type JssmEventFilter<mDT, Ev extends JssmEventName> = JssmEventFilterMap<mDT>[Ev
|
|
|
1156
1156
|
*/
|
|
1157
1157
|
type JssmEventHandler<mDT, Ev extends JssmEventName> = (detail: JssmEventDetailMap<mDT>[Ev]) => void;
|
|
1158
1158
|
/**
|
|
1159
|
-
* Function returned by {@link Machine.on} and {@link Machine.once} that
|
|
1159
|
+
* Function returned by {@link jssm!Machine.on} and {@link jssm!Machine.once} that
|
|
1160
1160
|
* removes the subscription. Calling it more than once is a no-op.
|
|
1161
1161
|
*/
|
|
1162
1162
|
type JssmUnsubscribe = () => void;
|
|
@@ -1742,7 +1742,7 @@ declare class Machine<mDT> {
|
|
|
1742
1742
|
* Serialize the current machine, including all defining state but not the
|
|
1743
1743
|
* machine string, to a structure. This means you will need the machine
|
|
1744
1744
|
* string to recreate (to not waste repeated space;) if you want the machine
|
|
1745
|
-
* string embedded, call
|
|
1745
|
+
* string embedded, call `serialize_with_string` instead.
|
|
1746
1746
|
*
|
|
1747
1747
|
* @typeParam mDT The type of the machine data member; usually omitted
|
|
1748
1748
|
*
|
|
@@ -2129,7 +2129,7 @@ declare class Machine<mDT> {
|
|
|
2129
2129
|
* List all entrances attached to the current state. Please note that the
|
|
2130
2130
|
* order of the list is not defined. This list includes both unforced and
|
|
2131
2131
|
* forced entrances; if this isn't desired, consider
|
|
2132
|
-
*
|
|
2132
|
+
* `list_unforced_entrances` or `list_forced_entrances` as
|
|
2133
2133
|
* appropriate.
|
|
2134
2134
|
*
|
|
2135
2135
|
* ```typescript
|
|
@@ -2151,8 +2151,8 @@ declare class Machine<mDT> {
|
|
|
2151
2151
|
*
|
|
2152
2152
|
* List all exits attached to the current state. Please note that the order
|
|
2153
2153
|
* of the list is not defined. This list includes both unforced and forced
|
|
2154
|
-
* exits; if this isn't desired, consider
|
|
2155
|
-
*
|
|
2154
|
+
* exits; if this isn't desired, consider `list_unforced_exits` or
|
|
2155
|
+
* `list_forced_exits` as appropriate.
|
|
2156
2156
|
*
|
|
2157
2157
|
* ```typescript
|
|
2158
2158
|
* import { sm } from 'jssm';
|
|
@@ -2527,9 +2527,9 @@ declare class Machine<mDT> {
|
|
|
2527
2527
|
*
|
|
2528
2528
|
* @typeParam Ev The event name (drives the detail type).
|
|
2529
2529
|
* @param name The event name to subscribe to.
|
|
2530
|
-
* @param
|
|
2531
|
-
*
|
|
2532
|
-
*
|
|
2530
|
+
* @param handler The handler invoked on each matching delivery. The
|
|
2531
|
+
* three-argument `(name, filter, handler)` form inserts a
|
|
2532
|
+
* filter object before the handler (see the example above).
|
|
2533
2533
|
* @returns A function that unsubscribes when called.
|
|
2534
2534
|
*
|
|
2535
2535
|
* @see Machine.off
|
|
@@ -2548,8 +2548,9 @@ declare class Machine<mDT> {
|
|
|
2548
2548
|
*
|
|
2549
2549
|
* @typeParam Ev The event name.
|
|
2550
2550
|
* @param name The event name.
|
|
2551
|
-
* @param
|
|
2552
|
-
*
|
|
2551
|
+
* @param handler The handler invoked on the first matching delivery. The
|
|
2552
|
+
* three-argument `(name, filter, handler)` form inserts a
|
|
2553
|
+
* filter object before the handler (same shapes as `on`).
|
|
2553
2554
|
* @returns A function that unsubscribes early if called before the
|
|
2554
2555
|
* handler has fired.
|
|
2555
2556
|
*
|
|
@@ -3506,7 +3507,7 @@ declare class Machine<mDT> {
|
|
|
3506
3507
|
* state's declaration into a fresh {@link JssmStateConfig} — the tier-5
|
|
3507
3508
|
* "`state foo : { … }`" contribution of the config cascade. A state with no
|
|
3508
3509
|
* declaration yields an all-`undefined` config (which contributes nothing
|
|
3509
|
-
* once folded with
|
|
3510
|
+
* once folded with `merge_state_config`).
|
|
3510
3511
|
*
|
|
3511
3512
|
* @param state The state whose per-state declared style is wanted.
|
|
3512
3513
|
*
|
|
@@ -3546,7 +3547,7 @@ declare class Machine<mDT> {
|
|
|
3546
3547
|
* overlay (tier 6) is NOT applied here; it is layered on top by
|
|
3547
3548
|
* {@link resolve_state_config} so it wins over per-state config.
|
|
3548
3549
|
*
|
|
3549
|
-
* Tiers, folded least-specific → most-specific with
|
|
3550
|
+
* Tiers, folded least-specific → most-specific with `merge_state_config`
|
|
3550
3551
|
* (later wins, never throwing on a cross-tier key collision):
|
|
3551
3552
|
*
|
|
3552
3553
|
* 1. theme defaults — `base_theme.state`, then each selected theme's
|
|
@@ -3578,7 +3579,7 @@ declare class Machine<mDT> {
|
|
|
3578
3579
|
* successor to the ad-hoc layer merge {@link style_for} used to perform.
|
|
3579
3580
|
*
|
|
3580
3581
|
* For any state OTHER than the current one, this returns the memoized static
|
|
3581
|
-
* resolution (tiers 1–5; see
|
|
3582
|
+
* resolution (tiers 1–5; see `_compose_state_config`) — theme →
|
|
3582
3583
|
* `default_state_config` → per-kind defaults → depth-ordered group metadata →
|
|
3583
3584
|
* per-state config. The cache is keyed by state and never invalidated, since
|
|
3584
3585
|
* those tiers do not depend on which state is current.
|
|
@@ -3588,7 +3589,7 @@ declare class Machine<mDT> {
|
|
|
3588
3589
|
* layers: the active-state THEME layers fold in just below the per-state
|
|
3589
3590
|
* config (tier 3-active), and the user `active_state : { … }` overlay folds
|
|
3590
3591
|
* in LAST (tier 6), on top of everything, so it wins over per-state config.
|
|
3591
|
-
* Every fold uses
|
|
3592
|
+
* Every fold uses `merge_state_config`, so a key set at a lower tier is
|
|
3592
3593
|
* overridden — never rejected — by a higher one.
|
|
3593
3594
|
*
|
|
3594
3595
|
* ```typescript
|
|
@@ -4317,7 +4318,7 @@ declare function chips_for_render_mode<T>(u_jssm: Machine<T>, l_states: string[]
|
|
|
4317
4318
|
* the state's display text plus any group chips the node builder appends, with
|
|
4318
4319
|
* DOT's `\"` escaping undone (SVG carries the literal character). A label that
|
|
4319
4320
|
* wraps across lines becomes several `<text>` elements; this returns the lines
|
|
4320
|
-
* joined by `\n`, exactly how
|
|
4321
|
+
* joined by `\n`, exactly how `extract_state_fills` reads them back — so
|
|
4321
4322
|
* the derived key and the extracted key meet at the same string.
|
|
4322
4323
|
*
|
|
4323
4324
|
* This is the single source of truth the static fence renderer keys its
|