jssm 5.65.5 → 5.65.9
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/dist/es6/jssm.d.ts +78 -0
- package/dist/es6/jssm.js +78 -0
- package/dist/es6/version.js +1 -1
- package/dist/jssm.es5.cjs.js +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/jssm.d.ts +78 -0
- package/package.json +2 -2
package/jssm.d.ts
CHANGED
|
@@ -213,9 +213,60 @@ declare class Machine<mDT> {
|
|
|
213
213
|
_forced_transition_hook: HookHandler | undefined;
|
|
214
214
|
_any_transition_hook: HookHandler | undefined;
|
|
215
215
|
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name }: JssmGenericConfig<mDT>);
|
|
216
|
+
/********
|
|
217
|
+
*
|
|
218
|
+
* Internal method for fabricating states. Not meant for external use.
|
|
219
|
+
*
|
|
220
|
+
*/
|
|
216
221
|
_new_state(state_config: JssmGenericState): StateType;
|
|
222
|
+
/*********
|
|
223
|
+
*
|
|
224
|
+
* Get the current state of a machine.
|
|
225
|
+
*
|
|
226
|
+
* ```typescript
|
|
227
|
+
* import * as jssm from './jssm';
|
|
228
|
+
*
|
|
229
|
+
* const switch = jssm.from('on <=> off;');
|
|
230
|
+
* console.log( switch.state() ); // 'on'
|
|
231
|
+
*
|
|
232
|
+
* switch.transition('off');
|
|
233
|
+
* console.log( switch.state() ); // 'off'
|
|
234
|
+
* ```
|
|
235
|
+
*
|
|
236
|
+
*/
|
|
217
237
|
state(): StateType;
|
|
238
|
+
/********
|
|
239
|
+
*
|
|
240
|
+
* Check whether a given state is final (either has no exits or is marked
|
|
241
|
+
* `complete`.)
|
|
242
|
+
*
|
|
243
|
+
* ```typescript
|
|
244
|
+
* import { sm, state_is_final } from './jssm';
|
|
245
|
+
*
|
|
246
|
+
* const final_test = sm`first -> second;`;
|
|
247
|
+
*
|
|
248
|
+
* console.log( final_test.state_is_final('first') ); // false
|
|
249
|
+
* console.log( final_test.state_is_final('second') ); // true
|
|
250
|
+
* ```
|
|
251
|
+
*
|
|
252
|
+
*/
|
|
218
253
|
state_is_final(whichState: StateType): boolean;
|
|
254
|
+
/********
|
|
255
|
+
*
|
|
256
|
+
* Check whether the current state is final (either has no exits or is marked
|
|
257
|
+
* `complete`.)
|
|
258
|
+
*
|
|
259
|
+
* ```typescript
|
|
260
|
+
* import { sm, state_is_final } from './jssm';
|
|
261
|
+
*
|
|
262
|
+
* const final_test = sm`first -> second;`;
|
|
263
|
+
*
|
|
264
|
+
* console.log( final_test.is_final() ); // false
|
|
265
|
+
* state.transition('second');
|
|
266
|
+
* console.log( final_test.is_final() ); // true
|
|
267
|
+
* ```
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
219
270
|
is_final(): boolean;
|
|
220
271
|
graph_layout(): string;
|
|
221
272
|
dot_preamble(): string;
|
|
@@ -232,8 +283,35 @@ declare class Machine<mDT> {
|
|
|
232
283
|
state_declarations(): Map<StateType, JssmStateDeclaration>;
|
|
233
284
|
fsl_version(): string;
|
|
234
285
|
machine_state(): JssmMachineInternalState<mDT>;
|
|
286
|
+
/*********
|
|
287
|
+
*
|
|
288
|
+
* List all the states known by the machine. Please note that the order of
|
|
289
|
+
* these states is not guaranteed.
|
|
290
|
+
*
|
|
291
|
+
* ```typescript
|
|
292
|
+
* import * as jssm from './jssm';
|
|
293
|
+
*
|
|
294
|
+
* const switch = jssm.from('on <=> off;');
|
|
295
|
+
* console.log( switch.states() ); // ['on', 'off']
|
|
296
|
+
* ```
|
|
297
|
+
*
|
|
298
|
+
*/
|
|
235
299
|
states(): Array<StateType>;
|
|
236
300
|
state_for(whichState: StateType): JssmGenericState;
|
|
301
|
+
/*********
|
|
302
|
+
*
|
|
303
|
+
* Check whether the machine knows a given state.
|
|
304
|
+
*
|
|
305
|
+
* ```typescript
|
|
306
|
+
* import * as jssm from './jssm';
|
|
307
|
+
*
|
|
308
|
+
* const switch = jssm.from('on <=> off;');
|
|
309
|
+
|
|
310
|
+
* console.log( switch.has_state('off') ); // true
|
|
311
|
+
* console.log( switch.has_state('dance') ); // false
|
|
312
|
+
* ```
|
|
313
|
+
*
|
|
314
|
+
*/
|
|
237
315
|
has_state(whichState: StateType): boolean;
|
|
238
316
|
list_edges(): Array<JssmTransition<mDT>>;
|
|
239
317
|
list_named_transitions(): Map<StateType, number>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jssm",
|
|
3
|
-
"version": "5.65.
|
|
3
|
+
"version": "5.65.9",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.0.0"
|
|
6
6
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"min_iife": "mv dist/jssm.es5.iife.js dist/jssm.es5.iife.nonmin.js && terser dist/jssm.es5.iife.nonmin.js > dist/jssm.es5.iife.js",
|
|
53
53
|
"min_cjs": "mv dist/jssm.es5.cjs.js dist/jssm.es5.cjs.nonmin.js && terser dist/jssm.es5.cjs.nonmin.js > dist/jssm.es5.cjs.js",
|
|
54
54
|
"site": "cp src/site/* docs/",
|
|
55
|
-
"docs": "typedoc src/ts/jssm.ts --out docs/docs",
|
|
55
|
+
"docs": "typedoc src/ts/jssm.ts --out docs/docs --customCss ./src/site/typedoc-addon.css",
|
|
56
56
|
"changelog": "rm -f CHANGELOG.md && changelog-maker -a > CHANGELOG.md"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|