jssm 5.65.3 → 5.65.4
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 +39 -2
- package/dist/es6/jssm.js +39 -2
- 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 +39 -2
- package/package.json +1 -1
package/dist/es6/jssm.d.ts
CHANGED
|
@@ -82,13 +82,15 @@ declare function arrow_right_kind(arrow: JssmArrow): JssmArrowKind;
|
|
|
82
82
|
* operator `sm`, and mostly falls back to `.from` when needing to parse
|
|
83
83
|
* strings dynamically instead of from template literals.
|
|
84
84
|
*
|
|
85
|
+
* Operator {@link sm}:
|
|
86
|
+
*
|
|
85
87
|
* ```typescript
|
|
86
88
|
* import { sm } from './jssm';
|
|
87
89
|
*
|
|
88
90
|
* const switch = sm`on <=> off;`;
|
|
89
91
|
* ```
|
|
90
92
|
*
|
|
91
|
-
*
|
|
93
|
+
* Method {@link from}:
|
|
92
94
|
*
|
|
93
95
|
* ```typescript
|
|
94
96
|
* import * as jssm from './jssm';
|
|
@@ -131,13 +133,15 @@ declare function wrap_parse(input: string, options?: Object): any;
|
|
|
131
133
|
* operator `sm`, and mostly falls back to `.from` when needing to parse
|
|
132
134
|
* strings dynamically instead of from template literals.
|
|
133
135
|
*
|
|
136
|
+
* Operator {@link sm}:
|
|
137
|
+
*
|
|
134
138
|
* ```typescript
|
|
135
139
|
* import { sm } from './jssm';
|
|
136
140
|
*
|
|
137
141
|
* const switch = sm`on <=> off;`;
|
|
138
142
|
* ```
|
|
139
143
|
*
|
|
140
|
-
*
|
|
144
|
+
* Method {@link from}:
|
|
141
145
|
*
|
|
142
146
|
* ```typescript
|
|
143
147
|
* import * as jssm from './jssm';
|
|
@@ -281,6 +285,39 @@ declare class Machine<mDT> {
|
|
|
281
285
|
instance_name(): string | undefined;
|
|
282
286
|
sm(template_strings: TemplateStringsArray, ...remainder: any[]): Machine<mDT>;
|
|
283
287
|
}
|
|
288
|
+
/*********
|
|
289
|
+
*
|
|
290
|
+
* Create a state machine from a template string. This is one of the two main
|
|
291
|
+
* paths for working with JSSM, alongside {@link from}.
|
|
292
|
+
*
|
|
293
|
+
* Use this method when you want to work directly and conveniently with a
|
|
294
|
+
* constant template expression. Use `.from` when you want to pull from
|
|
295
|
+
* dynamic strings.
|
|
296
|
+
*
|
|
297
|
+
*
|
|
298
|
+
* ```typescript
|
|
299
|
+
* import * as jssm from './jssm';
|
|
300
|
+
*
|
|
301
|
+
* const switch = jssm.from('on <=> off;');
|
|
302
|
+
* ```
|
|
303
|
+
*
|
|
304
|
+
*/
|
|
284
305
|
declare function sm<mDT>(template_strings: TemplateStringsArray, ...remainder: any[]): Machine<mDT>;
|
|
306
|
+
/*********
|
|
307
|
+
*
|
|
308
|
+
* Create a state machine from an implementation string. This is one of the
|
|
309
|
+
* two main paths for working with JSSM, alongside {@link sm}.
|
|
310
|
+
*
|
|
311
|
+
* Use this method when you want to conveniently pull a state machine from a
|
|
312
|
+
* string dynamically. Use operator `sm` when you just want to work with a
|
|
313
|
+
* template expression.
|
|
314
|
+
*
|
|
315
|
+
* ```typescript
|
|
316
|
+
* import * as jssm from './jssm';
|
|
317
|
+
*
|
|
318
|
+
* const switch = jssm.from('on <=> off;');
|
|
319
|
+
* ```
|
|
320
|
+
*
|
|
321
|
+
*/
|
|
285
322
|
declare function from<mDT>(MachineAsString: string, ExtraConstructorFields?: Partial<JssmGenericConfig<mDT>> | undefined): Machine<mDT>;
|
|
286
323
|
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
|
package/dist/es6/jssm.js
CHANGED
|
@@ -253,13 +253,15 @@ function makeTransition(this_se, from, to, isRight, _wasList, _wasIndex) {
|
|
|
253
253
|
* operator `sm`, and mostly falls back to `.from` when needing to parse
|
|
254
254
|
* strings dynamically instead of from template literals.
|
|
255
255
|
*
|
|
256
|
+
* Operator {@link sm}:
|
|
257
|
+
*
|
|
256
258
|
* ```typescript
|
|
257
259
|
* import { sm } from './jssm';
|
|
258
260
|
*
|
|
259
261
|
* const switch = sm`on <=> off;`;
|
|
260
262
|
* ```
|
|
261
263
|
*
|
|
262
|
-
*
|
|
264
|
+
* Method {@link from}:
|
|
263
265
|
*
|
|
264
266
|
* ```typescript
|
|
265
267
|
* import * as jssm from './jssm';
|
|
@@ -376,13 +378,15 @@ function compile_rule_handler(rule) {
|
|
|
376
378
|
* operator `sm`, and mostly falls back to `.from` when needing to parse
|
|
377
379
|
* strings dynamically instead of from template literals.
|
|
378
380
|
*
|
|
381
|
+
* Operator {@link sm}:
|
|
382
|
+
*
|
|
379
383
|
* ```typescript
|
|
380
384
|
* import { sm } from './jssm';
|
|
381
385
|
*
|
|
382
386
|
* const switch = sm`on <=> off;`;
|
|
383
387
|
* ```
|
|
384
388
|
*
|
|
385
|
-
*
|
|
389
|
+
* Method {@link from}:
|
|
386
390
|
*
|
|
387
391
|
* ```typescript
|
|
388
392
|
* import * as jssm from './jssm';
|
|
@@ -1195,6 +1199,23 @@ class Machine {
|
|
|
1195
1199
|
return sm(template_strings, ...remainder);
|
|
1196
1200
|
}
|
|
1197
1201
|
}
|
|
1202
|
+
/*********
|
|
1203
|
+
*
|
|
1204
|
+
* Create a state machine from a template string. This is one of the two main
|
|
1205
|
+
* paths for working with JSSM, alongside {@link from}.
|
|
1206
|
+
*
|
|
1207
|
+
* Use this method when you want to work directly and conveniently with a
|
|
1208
|
+
* constant template expression. Use `.from` when you want to pull from
|
|
1209
|
+
* dynamic strings.
|
|
1210
|
+
*
|
|
1211
|
+
*
|
|
1212
|
+
* ```typescript
|
|
1213
|
+
* import * as jssm from './jssm';
|
|
1214
|
+
*
|
|
1215
|
+
* const switch = jssm.from('on <=> off;');
|
|
1216
|
+
* ```
|
|
1217
|
+
*
|
|
1218
|
+
*/
|
|
1198
1219
|
function sm(template_strings, ...remainder /* , arguments */) {
|
|
1199
1220
|
// foo`a${1}b${2}c` will come in as (['a','b','c'],1,2)
|
|
1200
1221
|
// this includes when a and c are empty strings
|
|
@@ -1208,6 +1229,22 @@ function sm(template_strings, ...remainder /* , arguments */) {
|
|
|
1208
1229
|
/* eslint-enable prefer-rest-params */
|
|
1209
1230
|
)));
|
|
1210
1231
|
}
|
|
1232
|
+
/*********
|
|
1233
|
+
*
|
|
1234
|
+
* Create a state machine from an implementation string. This is one of the
|
|
1235
|
+
* two main paths for working with JSSM, alongside {@link sm}.
|
|
1236
|
+
*
|
|
1237
|
+
* Use this method when you want to conveniently pull a state machine from a
|
|
1238
|
+
* string dynamically. Use operator `sm` when you just want to work with a
|
|
1239
|
+
* template expression.
|
|
1240
|
+
*
|
|
1241
|
+
* ```typescript
|
|
1242
|
+
* import * as jssm from './jssm';
|
|
1243
|
+
*
|
|
1244
|
+
* const switch = jssm.from('on <=> off;');
|
|
1245
|
+
* ```
|
|
1246
|
+
*
|
|
1247
|
+
*/
|
|
1211
1248
|
function from(MachineAsString, ExtraConstructorFields) {
|
|
1212
1249
|
const to_decorate = make(MachineAsString);
|
|
1213
1250
|
if (ExtraConstructorFields !== undefined) {
|
package/dist/es6/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const version = "5.65.
|
|
1
|
+
const version = "5.65.4";
|
|
2
2
|
export { version };
|