jssm 5.65.10 → 5.65.11

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/jssm.d.ts CHANGED
@@ -313,6 +313,35 @@ declare class Machine<mDT> {
313
313
  *
314
314
  */
315
315
  has_state(whichState: StateType): boolean;
316
+ /*********
317
+ *
318
+ * Lists all edges of a machine.
319
+ *
320
+ * ```typescript
321
+ * const lswitch = sm`on 'toggle' <=> 'toggle' off;`;
322
+ *
323
+ * lswitch.list_edges();
324
+ * [
325
+ * {
326
+ * from: 'on',
327
+ * to: 'off',
328
+ * kind: 'main',
329
+ * forced_only: false,
330
+ * main_path: true,
331
+ * action: 'toggle'
332
+ * },
333
+ * {
334
+ * from: 'off',
335
+ * to: 'on',
336
+ * kind: 'main',
337
+ * forced_only: false,
338
+ * main_path: true,
339
+ * action: 'toggle'
340
+ * }
341
+ * ]
342
+ * ```
343
+ *
344
+ */
316
345
  list_edges(): Array<JssmTransition<mDT>>;
317
346
  list_named_transitions(): Map<StateType, number>;
318
347
  list_actions(): Array<StateType>;
@@ -320,8 +349,45 @@ declare class Machine<mDT> {
320
349
  flow(): FslDirection;
321
350
  get_transition_by_state_names(from: StateType, to: StateType): number;
322
351
  lookup_transition_for(from: StateType, to: StateType): JssmTransition<mDT>;
352
+ /********
353
+ *
354
+ * List all transitions attached to the current state, sorted by entrance and
355
+ * exit. The order of each sublist is not defined. A node could appear in
356
+ * both lists.
357
+ *
358
+ * const lswitch = sm`on 'toggle' <=> 'toggle' off;`;
359
+ * const light = sm`red 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;
360
+ *
361
+ * light.state(); // 'red'
362
+ * light.list_transitions(); // { entrances: [ 'yellow', 'off' ], exits: [ 'green', 'off' ] }
363
+ *
364
+ */
323
365
  list_transitions(whichState?: StateType): JssmTransitionList;
366
+ /********
367
+ *
368
+ * List all entrances attached to the current state. Please note that the
369
+ * order of the list is not defined.
370
+ *
371
+ * const lswitch = sm`on 'toggle' <=> 'toggle' off;`;
372
+ * const light = sm`red 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;
373
+ *
374
+ * light.state(); // 'red'
375
+ * light.list_entrances(); // [ 'yellow', 'off' ]
376
+ *
377
+ */
324
378
  list_entrances(whichState?: StateType): Array<StateType>;
379
+ /********
380
+ *
381
+ * List all exits attached to the current state. Please note that the order
382
+ * of the list is not defined.
383
+ *
384
+ * const lswitch = sm`on 'toggle' <=> 'toggle' off;`;
385
+ * const light = sm`red 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`;
386
+ *
387
+ * light.state(); // 'red'
388
+ * light.list_exits(); // [ 'green', 'off' ]
389
+ *
390
+ */
325
391
  list_exits(whichState?: StateType): Array<StateType>;
326
392
  probable_exits_for(whichState: StateType): Array<JssmTransition<mDT>>;
327
393
  probabilistic_transition(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jssm",
3
- "version": "5.65.10",
3
+ "version": "5.65.11",
4
4
  "engines": {
5
5
  "node": ">=10.0.0"
6
6
  },