jssm 5.84.1 → 5.85.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/CHANGELOG.md +49 -42
- package/README.md +2 -2
- package/dist/es6/jssm.d.ts +26 -0
- package/dist/es6/jssm.js +29 -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 +26 -0
- package/package.json +1 -1
package/jssm.d.ts
CHANGED
|
@@ -303,12 +303,38 @@ declare class Machine<mDT> {
|
|
|
303
303
|
*
|
|
304
304
|
* const lswitch = jssm.from('a -> b; state a: { label: "Foo!"; };');
|
|
305
305
|
* console.log( lswitch.label_for('a') ); // 'Foo!'
|
|
306
|
+
* console.log( lswitch.label_for('b') ); // undefined
|
|
306
307
|
* ```
|
|
307
308
|
*
|
|
309
|
+
* See also {@link display_text}.
|
|
310
|
+
*
|
|
308
311
|
* @typeparam mDT The type of the machine data member; usually omitted
|
|
309
312
|
*
|
|
310
313
|
*/
|
|
311
314
|
label_for(state: StateType): string;
|
|
315
|
+
/*********
|
|
316
|
+
*
|
|
317
|
+
* Get whatever the node should show as text.
|
|
318
|
+
*
|
|
319
|
+
* Currently, this means to get the label for a given state, if any;
|
|
320
|
+
* otherwise to return the node's name. However, this definition is expected
|
|
321
|
+
* to grow with time, and it is currently considered ill-advised to manually
|
|
322
|
+
* parse this text.
|
|
323
|
+
*
|
|
324
|
+
* See also {@link label_for}.
|
|
325
|
+
*
|
|
326
|
+
* ```typescript
|
|
327
|
+
* import * as jssm from 'jssm';
|
|
328
|
+
*
|
|
329
|
+
* const lswitch = jssm.from('a -> b; state a: { label: "Foo!"; };');
|
|
330
|
+
* console.log( lswitch.display_text('a') ); // 'Foo!'
|
|
331
|
+
* console.log( lswitch.display_text('b') ); // 'b'
|
|
332
|
+
* ```
|
|
333
|
+
*
|
|
334
|
+
* @typeparam mDT The type of the machine data member; usually omitted
|
|
335
|
+
*
|
|
336
|
+
*/
|
|
337
|
+
display_text(state: StateType): string;
|
|
312
338
|
/*********
|
|
313
339
|
*
|
|
314
340
|
* Get the current data of a machine.
|