libpetri 1.5.0 → 1.7.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/dist/index.js CHANGED
@@ -282,16 +282,38 @@ var TransitionContext = class {
282
282
  }
283
283
  }
284
284
  // ==================== Output Access ====================
285
- /** Add output value. Throws if place not declared as output. */
286
- output(place2, value) {
285
+ /**
286
+ * Add one or more output values to the same place in a single call.
287
+ *
288
+ * Validates the place once, then appends each value to the output
289
+ * collector. Calling with zero values is a no-op.
290
+ *
291
+ * @example
292
+ * ctx.output(outPlace, 'a', 'b', 'c');
293
+ * ctx.output(outPlace, ...someArray);
294
+ *
295
+ * @throws if place not declared as output.
296
+ */
297
+ output(place2, ...values) {
287
298
  this.requireOutput(place2);
288
- this._rawOutput.add(place2, value);
299
+ for (const value of values) {
300
+ this._rawOutput.add(place2, value);
301
+ }
289
302
  return this;
290
303
  }
291
- /** Add output token with metadata. */
292
- outputToken(place2, token) {
304
+ /**
305
+ * Add one or more pre-built output tokens to the same place in a single call.
306
+ *
307
+ * Validates the place once, then appends each token. Calling with zero
308
+ * tokens is a no-op.
309
+ *
310
+ * @throws if place not declared as output.
311
+ */
312
+ outputToken(place2, ...tokens) {
293
313
  this.requireOutput(place2);
294
- this._rawOutput.addToken(place2, token);
314
+ for (const token of tokens) {
315
+ this._rawOutput.addToken(place2, token);
316
+ }
295
317
  return this;
296
318
  }
297
319
  /** Returns declared output places. */