@flighthq/statechart 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787

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/README.md CHANGED
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/statechart`. The `@f
13
13
  This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
14
14
 
15
15
  - [Flight project](https://github.com/flighthq/flight)
16
- - [Source for @flighthq/statechart@0.5.1-next.903.f434bc2](https://github.com/flighthq/flight/tree/f434bc233778d75aeea61995df3a8cfaec459a85/packages/statechart)
17
- - [License](https://github.com/flighthq/flight/blob/f434bc233778d75aeea61995df3a8cfaec459a85/LICENSE.md)
16
+ - [Source for @flighthq/statechart@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/statechart)
17
+ - [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/statechart",
3
- "version": "0.5.1-next.903.f434bc2",
3
+ "version": "0.5.1-next.905.5fbf787",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,10 +38,10 @@
38
38
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@flighthq/entity": "0.5.1-next.903.f434bc2",
42
- "@flighthq/log": "0.5.1-next.903.f434bc2",
43
- "@flighthq/signals": "0.5.1-next.903.f434bc2",
44
- "@flighthq/types": "0.5.1-next.903.f434bc2"
41
+ "@flighthq/entity": "0.5.1-next.905.5fbf787",
42
+ "@flighthq/log": "0.5.1-next.905.5fbf787",
43
+ "@flighthq/signals": "0.5.1-next.905.5fbf787",
44
+ "@flighthq/types": "0.5.1-next.905.5fbf787"
45
45
  },
46
46
  "devDependencies": {
47
47
  "typescript": "^5.3.0"
@@ -15,6 +15,7 @@ import {
15
15
  getStatechartInputIndex,
16
16
  getStatechartRegionBlend,
17
17
  getStatechartRegionState,
18
+ initializeStatechartInstance,
18
19
  setStatechartBooleanInput,
19
20
  setStatechartNumberInput,
20
21
  setStatechartRegionDuration,
@@ -314,6 +315,12 @@ describe('getStatechartRegionState', () => {
314
315
  });
315
316
  });
316
317
 
318
+ describe('initializeStatechartInstance', () => {
319
+ it('is the construction initializer of createStatechartInstance', () => {
320
+ expect(typeof initializeStatechartInstance).toBe('function');
321
+ });
322
+ });
323
+
317
324
  describe('setStatechartBooleanInput', () => {
318
325
  it('writes the Boolean input vocabulary as numeric 0/1', () => {
319
326
  const instance = createStatechartInstance(
@@ -352,27 +359,6 @@ describe('setStatechartNumberInput', () => {
352
359
  });
353
360
  });
354
361
 
355
- describe('setStatechartRegionDuration', () => {
356
- it('sets the plain per-region exit-time denominator', () => {
357
- const instance = createStatechartInstance(createEmptyChart());
358
- setStatechartRegionDuration(instance, 0, 250);
359
- expect(instance.regionDuration[0]).toBe(250);
360
- });
361
-
362
- it('accepts zero as an explicit unavailable duration', () => {
363
- const instance = createStatechartInstance(createEmptyChart());
364
- setStatechartRegionDuration(instance, 0, 0);
365
- expect(instance.regionDuration[0]).toBe(0);
366
- });
367
-
368
- it('throws for an invalid region or invalid duration', () => {
369
- const instance = createStatechartInstance(createEmptyChart());
370
- expect(() => setStatechartRegionDuration(instance, 1, 1)).toThrow(RangeError);
371
- expect(() => setStatechartRegionDuration(instance, 0, -1)).toThrow(RangeError);
372
- expect(() => setStatechartRegionDuration(instance, 0, Number.NaN)).toThrow(RangeError);
373
- });
374
- });
375
-
376
362
  function condition(inputIndex: number, comparison: StatechartComparison, value: number): StatechartCondition {
377
363
  return { comparison, inputIndex, value };
378
364
  }
@@ -433,3 +419,23 @@ function transition(
433
419
  targetStateIndex,
434
420
  };
435
421
  }
422
+ describe('setStatechartRegionDuration', () => {
423
+ it('sets the plain per-region exit-time denominator', () => {
424
+ const instance = createStatechartInstance(createEmptyChart());
425
+ setStatechartRegionDuration(instance, 0, 250);
426
+ expect(instance.regionDuration[0]).toBe(250);
427
+ });
428
+
429
+ it('accepts zero as an explicit unavailable duration', () => {
430
+ const instance = createStatechartInstance(createEmptyChart());
431
+ setStatechartRegionDuration(instance, 0, 0);
432
+ expect(instance.regionDuration[0]).toBe(0);
433
+ });
434
+
435
+ it('throws for an invalid region or invalid duration', () => {
436
+ const instance = createStatechartInstance(createEmptyChart());
437
+ expect(() => setStatechartRegionDuration(instance, 1, 1)).toThrow(RangeError);
438
+ expect(() => setStatechartRegionDuration(instance, 0, -1)).toThrow(RangeError);
439
+ expect(() => setStatechartRegionDuration(instance, 0, Number.NaN)).toThrow(RangeError);
440
+ });
441
+ });
@@ -8,7 +8,7 @@ import {
8
8
  fireStatechartTrigger,
9
9
  setStatechartRegionDuration,
10
10
  } from './statechart';
11
- import { enableStatechartSignals, getStatechartSignals } from './statechartSignals';
11
+ import { enableStatechartSignals, getStatechartSignals, initializeStatechartSignals } from './statechartSignals';
12
12
 
13
13
  describe('enableStatechartSignals', () => {
14
14
  it('lazily attaches one standard signal group to the mutable instance', () => {
@@ -94,3 +94,8 @@ function createImmediateChart(): Statechart {
94
94
  ],
95
95
  };
96
96
  }
97
+ describe('initializeStatechartSignals', () => {
98
+ it('is the construction initializer of createStatechartSignals', () => {
99
+ expect(typeof initializeStatechartSignals).toBe('function');
100
+ });
101
+ });