jssm 5.112.4 → 5.118.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 +7 -7
- package/dist/deno/README.md +7 -7
- package/dist/deno/jssm.d.ts +70 -5
- package/dist/deno/jssm.js +1 -1
- package/dist/deno/jssm_constants.d.ts +58 -1
- package/dist/deno/jssm_viz.d.ts +41 -6
- package/dist/deno/version.d.ts +13 -1
- 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 +143 -4
- package/jssm.es6.d.ts +143 -4
- package/jssm_viz.es5.d.cts +111 -9
- package/jssm_viz.es6.d.ts +111 -9
- package/package.json +1 -1
|
@@ -34,4 +34,61 @@ declare const shapes: string[];
|
|
|
34
34
|
*
|
|
35
35
|
*/
|
|
36
36
|
declare const named_colors: string[];
|
|
37
|
-
|
|
37
|
+
/*******
|
|
38
|
+
*
|
|
39
|
+
* Character ranges accepted by the FSL grammar for identifier and label
|
|
40
|
+
* tokens. Each entry is an inclusive `{from, to}` range of single Unicode
|
|
41
|
+
* characters. Single-character entries (e.g. `.`) appear with `from === to`.
|
|
42
|
+
*
|
|
43
|
+
* These are intended for tooling, validators, and editors that need to know
|
|
44
|
+
* which characters are legal in a given FSL token position without re-parsing
|
|
45
|
+
* the PEG grammar.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* Inclusive character ranges accepted by `AtomLetter` — i.e., the characters
|
|
50
|
+
* legal in any but the first position of an FSL state name (atom).
|
|
51
|
+
*
|
|
52
|
+
* Includes ASCII digits/letters and the symbols
|
|
53
|
+
* `.`, `+`, `_`, `^`, `(`, `)`, `*`, `&`, `$`, `#`, `@`, `!`, `?`, `,`,
|
|
54
|
+
* plus the high-Unicode range `U+0080`–`U+FFFF`.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* state_name_chars.some(r => 'A' >= r.from && 'A' <= r.to); // true
|
|
58
|
+
*/
|
|
59
|
+
declare const state_name_chars: ReadonlyArray<{
|
|
60
|
+
from: string;
|
|
61
|
+
to: string;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Inclusive character ranges accepted by `AtomFirstLetter` — i.e., the
|
|
65
|
+
* characters legal in the first position of an FSL state name (atom).
|
|
66
|
+
*
|
|
67
|
+
* Notably narrower than {@link state_name_chars}: omits `+`, `(`, `)`, `&`,
|
|
68
|
+
* `#`, `@`. Includes ASCII digits/letters, `.`, `_`, `!`, `$`, `^`, `*`,
|
|
69
|
+
* `?`, `,`, and the high-Unicode range `U+0080`–`U+FFFF`.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* state_name_first_chars.some(r => '+' >= r.from && '+' <= r.to); // false
|
|
73
|
+
*/
|
|
74
|
+
declare const state_name_first_chars: ReadonlyArray<{
|
|
75
|
+
from: string;
|
|
76
|
+
to: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Inclusive character ranges accepted by `ActionLabelUnescaped` — i.e., the
|
|
80
|
+
* characters legal inside a single-quoted action label without escaping.
|
|
81
|
+
* Space (`U+0020`) is included; the apostrophe `'` (`U+0027`) is explicitly
|
|
82
|
+
* excluded since it terminates the label.
|
|
83
|
+
*
|
|
84
|
+
* Three ranges: `U+0020`–`U+0026`, `U+0028`–`U+005B`, `U+005D`–`U+FFFF`.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* action_label_chars.some(r => ' ' >= r.from && ' ' <= r.to); // true
|
|
88
|
+
* action_label_chars.some(r => "'" >= r.from && "'" <= r.to); // false
|
|
89
|
+
*/
|
|
90
|
+
declare const action_label_chars: ReadonlyArray<{
|
|
91
|
+
from: string;
|
|
92
|
+
to: string;
|
|
93
|
+
}>;
|
|
94
|
+
export { gviz_shapes, shapes, named_colors, state_name_chars, state_name_first_chars, action_label_chars, };
|
package/dist/deno/jssm_viz.d.ts
CHANGED
|
@@ -88,30 +88,49 @@ declare function style_for_state<T>(u_jssm: jssm.Machine<T>, state: string): str
|
|
|
88
88
|
/**
|
|
89
89
|
* Render a {@link jssm.Machine} as a graphviz dot string.
|
|
90
90
|
*
|
|
91
|
+
* An optional `footer` may be supplied via `opts.footer`; it is emitted
|
|
92
|
+
* verbatim just before the closing `}` of the dot source, after all
|
|
93
|
+
* arrange declarations. This is a function-argument-only feature for
|
|
94
|
+
* the moment — a machine-attribute equivalent is planned as a follow-up.
|
|
95
|
+
*
|
|
91
96
|
* ```typescript
|
|
92
97
|
* import { sm } from 'jssm';
|
|
93
98
|
* import { machine_to_dot } from 'jssm/viz';
|
|
94
99
|
*
|
|
95
100
|
* const dot = machine_to_dot(sm`a -> b;`);
|
|
96
101
|
* // 'digraph G { ... }'
|
|
102
|
+
*
|
|
103
|
+
* const dot_with_footer = machine_to_dot(sm`a -> b;`, { footer: 'labelloc="b"; label="caption";' });
|
|
104
|
+
* // 'digraph G { ... labelloc="b"; label="caption"; }'
|
|
97
105
|
* ```
|
|
98
106
|
*
|
|
99
107
|
* @param u_jssm The machine to render.
|
|
108
|
+
* @param opts Optional rendering options.
|
|
109
|
+
* @param opts.footer Optional verbatim dot source inserted just before the closing `}`.
|
|
100
110
|
* @returns A complete graphviz dot source string.
|
|
101
111
|
*/
|
|
102
|
-
declare function machine_to_dot<T>(u_jssm: jssm.Machine<T
|
|
112
|
+
declare function machine_to_dot<T>(u_jssm: jssm.Machine<T>, opts?: {
|
|
113
|
+
footer?: string;
|
|
114
|
+
}): string;
|
|
103
115
|
/**
|
|
104
116
|
* Render an FSL string directly to graphviz dot source.
|
|
105
117
|
*
|
|
106
118
|
* ```typescript
|
|
107
119
|
* import { fsl_to_dot } from 'jssm/viz';
|
|
108
120
|
* const dot = fsl_to_dot('a -> b;');
|
|
121
|
+
*
|
|
122
|
+
* const dot_with_footer = fsl_to_dot('a -> b;', { footer: 'label="caption";' });
|
|
123
|
+
* // 'digraph G { ... label="caption"; }'
|
|
109
124
|
* ```
|
|
110
125
|
*
|
|
111
126
|
* @param fsl The FSL source.
|
|
127
|
+
* @param opts Optional rendering options.
|
|
128
|
+
* @param opts.footer Optional verbatim dot source inserted just before the closing `}`.
|
|
112
129
|
* @returns A complete graphviz dot source string.
|
|
113
130
|
*/
|
|
114
|
-
declare function fsl_to_dot(fsl: string
|
|
131
|
+
declare function fsl_to_dot(fsl: string, opts?: {
|
|
132
|
+
footer?: string;
|
|
133
|
+
}): string;
|
|
115
134
|
/**
|
|
116
135
|
* Render a graphviz dot source string to SVG using `@viz-js/viz`. The
|
|
117
136
|
* underlying viz instance is lazy-initialized on first call and cached for
|
|
@@ -129,32 +148,48 @@ declare function dot_to_svg(dot: string): Promise<string>;
|
|
|
129
148
|
* Render an FSL string directly to SVG.
|
|
130
149
|
*
|
|
131
150
|
* @param fsl The FSL source.
|
|
151
|
+
* @param opts Optional rendering options.
|
|
152
|
+
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
132
153
|
* @returns A promise resolving to an SVG XML string.
|
|
133
154
|
*/
|
|
134
|
-
declare function fsl_to_svg_string(fsl: string
|
|
155
|
+
declare function fsl_to_svg_string(fsl: string, opts?: {
|
|
156
|
+
footer?: string;
|
|
157
|
+
}): Promise<string>;
|
|
135
158
|
/**
|
|
136
159
|
* Render a {@link jssm.Machine} to SVG.
|
|
137
160
|
*
|
|
138
161
|
* @param u_jssm The machine to render.
|
|
162
|
+
* @param opts Optional rendering options.
|
|
163
|
+
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
139
164
|
* @returns A promise resolving to an SVG XML string.
|
|
140
165
|
*/
|
|
141
|
-
declare function machine_to_svg_string<T>(u_jssm: jssm.Machine<T
|
|
166
|
+
declare function machine_to_svg_string<T>(u_jssm: jssm.Machine<T>, opts?: {
|
|
167
|
+
footer?: string;
|
|
168
|
+
}): Promise<string>;
|
|
142
169
|
/**
|
|
143
170
|
* Render an FSL string directly to a parsed `SVGSVGElement`.
|
|
144
171
|
*
|
|
145
172
|
* @param fsl The FSL source.
|
|
173
|
+
* @param opts Optional rendering options.
|
|
174
|
+
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
146
175
|
* @returns A promise resolving to a parsed `SVGSVGElement`.
|
|
147
176
|
* @throws {JssmError} if no `DOMParser` is available (Node without `configure`).
|
|
148
177
|
*/
|
|
149
|
-
declare function fsl_to_svg_element(fsl: string
|
|
178
|
+
declare function fsl_to_svg_element(fsl: string, opts?: {
|
|
179
|
+
footer?: string;
|
|
180
|
+
}): Promise<SVGSVGElement>;
|
|
150
181
|
/**
|
|
151
182
|
* Render a {@link jssm.Machine} to a parsed `SVGSVGElement`.
|
|
152
183
|
*
|
|
153
184
|
* @param u_jssm The machine to render.
|
|
185
|
+
* @param opts Optional rendering options.
|
|
186
|
+
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
154
187
|
* @returns A promise resolving to a parsed `SVGSVGElement`.
|
|
155
188
|
* @throws {JssmError} if no `DOMParser` is available (Node without `configure`).
|
|
156
189
|
*/
|
|
157
|
-
declare function machine_to_svg_element<T>(u_jssm: jssm.Machine<T
|
|
190
|
+
declare function machine_to_svg_element<T>(u_jssm: jssm.Machine<T>, opts?: {
|
|
191
|
+
footer?: string;
|
|
192
|
+
}): Promise<SVGSVGElement>;
|
|
158
193
|
/**
|
|
159
194
|
* Compatibility wrapper for {@link machine_to_dot}, retained from
|
|
160
195
|
* jssm-viz. Will be removed in the next major.
|
package/dist/deno/version.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The published semantic version of the jssm package this build was cut from.
|
|
3
|
+
* Mirrored from `package.json` by `src/buildjs/makever.cjs` at build time.
|
|
4
|
+
* Useful for runtime diagnostics and for embedding in serialized machine
|
|
5
|
+
* snapshots so that deserializers can detect version-skew.
|
|
6
|
+
*/
|
|
7
|
+
declare const version: string;
|
|
8
|
+
/**
|
|
9
|
+
* The Unix epoch timestamp (in milliseconds) at which this build was produced,
|
|
10
|
+
* written by `src/buildjs/makever.cjs`. Useful for distinguishing builds
|
|
11
|
+
* with the same `version` string during development, and for diagnostic logs.
|
|
12
|
+
*/
|
|
13
|
+
declare const build_time: number;
|
|
2
14
|
export { version, build_time };
|