Comparing version 5.78.0 to 5.79.0
@@ -5,3 +5,3 @@ # Changelog | ||
967 merges; 131 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md) | ||
979 merges; 132 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md) | ||
@@ -16,3 +16,3 @@ | ||
<a href="#5__77__1">5.77.1</a>, <a href="#5__77__0">5.77.0</a>, <a href="#5__76__2">5.76.2</a>, <a href="#5__76__0">5.76.0</a>, <a href="#5__75__1">5.75.1</a>, <a href="#5__75__0">5.75.0</a>, <a href="#5__74__0">5.74.0</a>, <a href="#5__73__1">5.73.1</a>, <a href="#5__73__0">5.73.0</a>, <a href="#5__72__5">5.72.5</a>, <a href="#5__72__4">5.72.4</a>, <a href="#5__72__3">5.72.3</a>, <a href="#5__72__2">5.72.2</a>, <a href="#5__72__1">5.72.1</a>, <a href="#5__72__0">5.72.0</a>, <a href="#5__71__1">5.71.1</a>, <a href="#5__71__0">5.71.0</a>, <a href="#5__70__36">5.70.36</a>, <a href="#5__70__35">5.70.35</a>, <a href="#5__70__34">5.70.34</a>, <a href="#5__70__33">5.70.33</a>, <a href="#5__70__32">5.70.32</a>, <a href="#5__70__31">5.70.31</a>, <a href="#5__70__30">5.70.30</a>, <a href="#5__70__29">5.70.29</a>, <a href="#5__70__28">5.70.28</a>, <a href="#5__70__27">5.70.27</a>, <a href="#5__70__26">5.70.26</a>, <a href="#5__70__25">5.70.25</a>, <a href="#5__70__24">5.70.24</a>, <a href="#5__70__23">5.70.23</a>, <a href="#5__70__22">5.70.22</a>, <a href="#5__70__21">5.70.21</a>, <a href="#5__70__20">5.70.20</a>, <a href="#5__70__19">5.70.19</a>, <a href="#5__70__18">5.70.18</a>, <a href="#5__70__16">5.70.16</a>, <a href="#5__70__15">5.70.15</a>, <a href="#5__70__14">5.70.14</a>, <a href="#5__70__13">5.70.13</a>, <a href="#5__70__12">5.70.12</a>, <a href="#5__70__11">5.70.11</a>, <a href="#5__70__10">5.70.10</a>, <a href="#5__70__9">5.70.9</a>, <a href="#5__70__8">5.70.8</a>, <a href="#5__70__7">5.70.7</a>, <a href="#5__70__6">5.70.6</a>, <a href="#5__70__5">5.70.5</a>, <a href="#5__70__4">5.70.4</a>, <a href="#5__70__3">5.70.3</a>, <a href="#5__70__2">5.70.2</a>, <a href="#5__70__1">5.70.1</a>, <a href="#5__70__0">5.70.0</a>, <a href="#5__69__4">5.69.4</a>, <a href="#5__69__3">5.69.3</a>, <a href="#5__69__2">5.69.2</a>, <a href="#5__69__0">5.69.0</a>, <a href="#5__68__0">5.68.0</a>, <a href="#5__67__2">5.67.2</a>, <a href="#5__67__0">5.67.0</a>, <a href="#5__66__0">5.66.0</a>, <a href="#5__65__14">5.65.14</a>, <a href="#5__65__12">5.65.12</a>, <a href="#5__65__11">5.65.11</a>, <a href="#5__65__10">5.65.10</a>, <a href="#5__65__9">5.65.9</a>, <a href="#5__65__8">5.65.8</a>, <a href="#5__65__7">5.65.7</a>, <a href="#5__65__5">5.65.5</a>, <a href="#5__65__4">5.65.4</a>, <a href="#5__65__3">5.65.3</a>, <a href="#5__65__2">5.65.2</a>, <a href="#5__65__1">5.65.1</a>, <a href="#5__65__0">5.65.0</a>, <a href="#5__64__2">5.64.2</a>, <a href="#5__64__1">5.64.1</a>, <a href="#5__64__0">5.64.0</a>, <a href="#5__63__0">5.63.0</a>, <a href="#5__62__0">5.62.0</a>, <a href="#5__61__4">5.61.4</a>, <a href="#5__61__3">5.61.3</a>, <a href="#5__61__2">5.61.2</a>, <a href="#5__61__1">5.61.1</a>, <a href="#5__60__4">5.60.4</a>, <a href="#5__60__3">5.60.3</a>, <a href="#5__60__0">5.60.0</a>, <a href="#5__59__1">5.59.1</a>, <a href="#5__59__0">5.59.0</a>, <a href="#5__58__1">5.58.1</a>, <a href="#5__58__0">5.58.0</a>, <a href="#5__57__1">5.57.1</a>, <a href="#5__57__0">5.57.0</a>, <a href="#5__56__2">5.56.2</a>, <a href="#5__56__1">5.56.1</a>, <a href="#5__55__0">5.55.0</a>, <a href="#5__54__0">5.54.0</a>, <a href="#5__53__0">5.53.0</a>, <a href="#5__52__0">5.52.0</a>, <a href="#5__51__0">5.51.0</a>, <a href="#5__50__0">5.50.0</a>, <a href="#5__49__0">5.49.0</a>, <a href="#5__48__0">5.48.0</a>, <a href="#5__47__0">5.47.0</a>, <a href="#5__46__0">5.46.0</a>, <a href="#5__45__2">5.45.2</a>, <a href="#5__45__0">5.45.0</a>, <a href="#5__44__0">5.44.0</a>, <a href="#5__43__2">5.43.2</a>, <a href="#v5__42__0">v5.42.0</a>, <a href="#5__42__0">5.42.0</a>, <a href="#v5__41__15">v5.41.15</a>, <a href="#5__41__15">5.41.15</a>, <a href="#v5__41__14">v5.41.14</a>, <a href="#5__41__14">5.41.14</a>, <a href="#v5__41__12">v5.41.12</a>, <a href="#5__41__12">5.41.12</a>, <a href="#v5__41__10">v5.41.10</a>, <a href="#5__41__10">5.41.10</a>, <a href="#v5__41__9">v5.41.9</a>, <a href="#5__41__9">5.41.9</a>, <a href="#v5__41__8">v5.41.8</a>, <a href="#5__41__8">5.41.8</a>, <a href="#v5__41__7">v5.41.7</a>, <a href="#v5__41__2">v5.41.2</a>, <a href="#v5__41__1">v5.41.1</a>, <a href="#v5__32__14">v5.32.14</a>, <a href="#5__14__0">5.14.0</a>, <a href="#5__12__0">5.12.0</a>, <a href="#5__11__12">5.11.12</a>, <a href="#5__11__1">5.11.1</a>, <a href="#5__11__0">5.11.0</a> | ||
<a href="#5__78__0">5.78.0</a>, <a href="#5__77__1">5.77.1</a>, <a href="#5__77__0">5.77.0</a>, <a href="#5__76__2">5.76.2</a>, <a href="#5__76__0">5.76.0</a>, <a href="#5__75__1">5.75.1</a>, <a href="#5__75__0">5.75.0</a>, <a href="#5__74__0">5.74.0</a>, <a href="#5__73__1">5.73.1</a>, <a href="#5__73__0">5.73.0</a>, <a href="#5__72__5">5.72.5</a>, <a href="#5__72__4">5.72.4</a>, <a href="#5__72__3">5.72.3</a>, <a href="#5__72__2">5.72.2</a>, <a href="#5__72__1">5.72.1</a>, <a href="#5__72__0">5.72.0</a>, <a href="#5__71__1">5.71.1</a>, <a href="#5__71__0">5.71.0</a>, <a href="#5__70__36">5.70.36</a>, <a href="#5__70__35">5.70.35</a>, <a href="#5__70__34">5.70.34</a>, <a href="#5__70__33">5.70.33</a>, <a href="#5__70__32">5.70.32</a>, <a href="#5__70__31">5.70.31</a>, <a href="#5__70__30">5.70.30</a>, <a href="#5__70__29">5.70.29</a>, <a href="#5__70__28">5.70.28</a>, <a href="#5__70__27">5.70.27</a>, <a href="#5__70__26">5.70.26</a>, <a href="#5__70__25">5.70.25</a>, <a href="#5__70__24">5.70.24</a>, <a href="#5__70__23">5.70.23</a>, <a href="#5__70__22">5.70.22</a>, <a href="#5__70__21">5.70.21</a>, <a href="#5__70__20">5.70.20</a>, <a href="#5__70__19">5.70.19</a>, <a href="#5__70__18">5.70.18</a>, <a href="#5__70__16">5.70.16</a>, <a href="#5__70__15">5.70.15</a>, <a href="#5__70__14">5.70.14</a>, <a href="#5__70__13">5.70.13</a>, <a href="#5__70__12">5.70.12</a>, <a href="#5__70__11">5.70.11</a>, <a href="#5__70__10">5.70.10</a>, <a href="#5__70__9">5.70.9</a>, <a href="#5__70__8">5.70.8</a>, <a href="#5__70__7">5.70.7</a>, <a href="#5__70__6">5.70.6</a>, <a href="#5__70__5">5.70.5</a>, <a href="#5__70__4">5.70.4</a>, <a href="#5__70__3">5.70.3</a>, <a href="#5__70__2">5.70.2</a>, <a href="#5__70__1">5.70.1</a>, <a href="#5__70__0">5.70.0</a>, <a href="#5__69__4">5.69.4</a>, <a href="#5__69__3">5.69.3</a>, <a href="#5__69__2">5.69.2</a>, <a href="#5__69__0">5.69.0</a>, <a href="#5__68__0">5.68.0</a>, <a href="#5__67__2">5.67.2</a>, <a href="#5__67__0">5.67.0</a>, <a href="#5__66__0">5.66.0</a>, <a href="#5__65__14">5.65.14</a>, <a href="#5__65__12">5.65.12</a>, <a href="#5__65__11">5.65.11</a>, <a href="#5__65__10">5.65.10</a>, <a href="#5__65__9">5.65.9</a>, <a href="#5__65__8">5.65.8</a>, <a href="#5__65__7">5.65.7</a>, <a href="#5__65__5">5.65.5</a>, <a href="#5__65__4">5.65.4</a>, <a href="#5__65__3">5.65.3</a>, <a href="#5__65__2">5.65.2</a>, <a href="#5__65__1">5.65.1</a>, <a href="#5__65__0">5.65.0</a>, <a href="#5__64__2">5.64.2</a>, <a href="#5__64__1">5.64.1</a>, <a href="#5__64__0">5.64.0</a>, <a href="#5__63__0">5.63.0</a>, <a href="#5__62__0">5.62.0</a>, <a href="#5__61__4">5.61.4</a>, <a href="#5__61__3">5.61.3</a>, <a href="#5__61__2">5.61.2</a>, <a href="#5__61__1">5.61.1</a>, <a href="#5__60__4">5.60.4</a>, <a href="#5__60__3">5.60.3</a>, <a href="#5__60__0">5.60.0</a>, <a href="#5__59__1">5.59.1</a>, <a href="#5__59__0">5.59.0</a>, <a href="#5__58__1">5.58.1</a>, <a href="#5__58__0">5.58.0</a>, <a href="#5__57__1">5.57.1</a>, <a href="#5__57__0">5.57.0</a>, <a href="#5__56__2">5.56.2</a>, <a href="#5__56__1">5.56.1</a>, <a href="#5__55__0">5.55.0</a>, <a href="#5__54__0">5.54.0</a>, <a href="#5__53__0">5.53.0</a>, <a href="#5__52__0">5.52.0</a>, <a href="#5__51__0">5.51.0</a>, <a href="#5__50__0">5.50.0</a>, <a href="#5__49__0">5.49.0</a>, <a href="#5__48__0">5.48.0</a>, <a href="#5__47__0">5.47.0</a>, <a href="#5__46__0">5.46.0</a>, <a href="#5__45__2">5.45.2</a>, <a href="#5__45__0">5.45.0</a>, <a href="#5__44__0">5.44.0</a>, <a href="#5__43__2">5.43.2</a>, <a href="#v5__42__0">v5.42.0</a>, <a href="#5__42__0">5.42.0</a>, <a href="#v5__41__15">v5.41.15</a>, <a href="#5__41__15">5.41.15</a>, <a href="#v5__41__14">v5.41.14</a>, <a href="#5__41__14">5.41.14</a>, <a href="#v5__41__12">v5.41.12</a>, <a href="#5__41__12">5.41.12</a>, <a href="#v5__41__10">v5.41.10</a>, <a href="#5__41__10">5.41.10</a>, <a href="#v5__41__9">v5.41.9</a>, <a href="#5__41__9">5.41.9</a>, <a href="#v5__41__8">v5.41.8</a>, <a href="#5__41__8">5.41.8</a>, <a href="#v5__41__7">v5.41.7</a>, <a href="#v5__41__2">v5.41.2</a>, <a href="#v5__41__1">v5.41.1</a>, <a href="#v5__32__14">v5.32.14</a>, <a href="#5__14__0">5.14.0</a>, <a href="#5__12__0">5.12.0</a>, <a href="#5__11__12">5.11.12</a>, <a href="#5__11__1">5.11.1</a>, <a href="#5__11__0">5.11.0</a> | ||
@@ -27,9 +27,9 @@ | ||
## [Untagged] - 7/9/2022 1:00:20 PM | ||
## [Untagged] - 7/13/2022 2:23:16 PM | ||
Commit [05c1f81f02406cb3211e3d2bd84eefb2da201b3e](https://github.com/StoneCypher/jssm/commit/05c1f81f02406cb3211e3d2bd84eefb2da201b3e) | ||
Commit [ef4f483808e5aff64c4dee0ffac1472ac9202c4b](https://github.com/StoneCypher/jssm/commit/ef4f483808e5aff64c4dee0ffac1472ac9202c4b) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* Spec underway | ||
* `.props`, fixes StoneCypher/fsl#1019; state props make it through compiler, fixes StoneCypher/fsl#1029; lots of doc improvements, numeric constants | ||
@@ -43,18 +43,13 @@ | ||
<a name="5__77__1" /> | ||
## [Untagged] - 7/13/2022 2:23:16 PM | ||
## [5.77.1] - 7/7/2022 10:36:21 PM | ||
Commit [090bc2640fdabe89196ac62aa3b83aa968f5ff8c](https://github.com/StoneCypher/jssm/commit/090bc2640fdabe89196ac62aa3b83aa968f5ff8c) | ||
Commit [6497ed49a6a7dbe55509ac552cc30adb9ee19c9c](https://github.com/StoneCypher/jssm/commit/6497ed49a6a7dbe55509ac552cc30adb9ee19c9c) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
Merges [e9400bd, 4623580] | ||
* `.props`, fixes StoneCypher/fsl#1019, lots of doc improvements, numeric constants | ||
* Merge pull request #512 from StoneCypher/SynonymDoForAction | ||
* Define do/1 to be a synonym for action/1, fixes StoneCypher/fsl#809 | ||
| ||
@@ -64,9 +59,9 @@ | ||
## [Untagged] - 7/7/2022 10:18:20 PM | ||
## [Untagged] - 7/13/2022 2:23:16 PM | ||
Commit [462358017970f5d968d8309ba8ee96d74648ec03](https://github.com/StoneCypher/jssm/commit/462358017970f5d968d8309ba8ee96d74648ec03) | ||
Commit [0f3870d1ca40c7b3fc849f62484afe94629da009](https://github.com/StoneCypher/jssm/commit/0f3870d1ca40c7b3fc849f62484afe94629da009) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* Define do/1 to be a synonym for action/1, fixes StoneCypher/fsl#809 | ||
* , fixes StoneCypher/fsl#1019, lots of doc improvements, numeric constants | ||
@@ -80,18 +75,13 @@ | ||
<a name="5__77__0" /> | ||
## [Untagged] - 7/13/2022 2:20:10 PM | ||
## [5.77.0] - 7/7/2022 10:18:06 PM | ||
Commit [7814c864c7bffeeb755bc0f3d7ec1faf8e4a965d](https://github.com/StoneCypher/jssm/commit/7814c864c7bffeeb755bc0f3d7ec1faf8e4a965d) | ||
Commit [e9400bd62c93201bcc34a002469e21910979cb2e](https://github.com/StoneCypher/jssm/commit/e9400bd62c93201bcc34a002469e21910979cb2e) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
Merges [d1b55ae, 2c633a6] | ||
* State properties in grammar, fixes StoneCypher/fsl#1030, fixes StoneCypher/fsl#1031, fixes StoneCypher/fsl#1032, fixes StoneCypher/fsl#1033, fixes StoneCypher/fsl#1034 | ||
* Merge pull request #511 from StoneCypher/SynonymGoForTransition | ||
* Define go/1 to be a synonym for transition/1, fixes StoneCypher/fsl#810 | ||
| ||
@@ -101,9 +91,9 @@ | ||
## [Untagged] - 7/7/2022 10:11:44 PM | ||
## [Untagged] - 7/13/2022 9:06:10 AM | ||
Commit [2c633a61b2ee0f13583ddc85923596f6b473abe6](https://github.com/StoneCypher/jssm/commit/2c633a61b2ee0f13583ddc85923596f6b473abe6) | ||
Commit [1349b752fd40db754dfa760bfb60b16646ef5108](https://github.com/StoneCypher/jssm/commit/1349b752fd40db754dfa760bfb60b16646ef5108) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* Define go/1 to be a synonym for transition/1, fixes StoneCypher/fsl#810 | ||
* known_prop, fixes StoneCypher/fsl#1021 | ||
@@ -117,9 +107,9 @@ | ||
## [Untagged] - 7/7/2022 12:29:56 PM | ||
## [Untagged] - 7/13/2022 8:14:19 AM | ||
Commit [d29b22488e10f3ee798b7ecb23598654fe987fb8](https://github.com/StoneCypher/jssm/commit/d29b22488e10f3ee798b7ecb23598654fe987fb8) | ||
Commit [c7191c8ba796bd21cb2ba123038b9c6b5b274057](https://github.com/StoneCypher/jssm/commit/c7191c8ba796bd21cb2ba123038b9c6b5b274057) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* it seems the bundling error I was facing when Discord insisted I just didn't get it might be a bug in deno | ||
* Default props now making it into machine, fixes StoneCypher/fsl#1039; datastructures, fixes StoneCypher/fsl#1022 | ||
@@ -133,18 +123,13 @@ | ||
<a name="5__76__2" /> | ||
## [Untagged] - 7/12/2022 10:05:06 AM | ||
## [5.76.2] - 7/6/2022 8:27:33 AM | ||
Commit [1629741f34d564706e6c91f8cfc60edcfdd379bb](https://github.com/StoneCypher/jssm/commit/1629741f34d564706e6c91f8cfc60edcfdd379bb) | ||
Commit [d1b55ae8944031677c228f06eec6a5a28eb695ac](https://github.com/StoneCypher/jssm/commit/d1b55ae8944031677c228f06eec6a5a28eb695ac) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
Merges [813d866, 40677c7] | ||
* Default properties now make it through compiler, fixes StoneCypher/fsl#1028; blocks repetition, fixes StoneCypher/fsl#1038 | ||
* Merge pull request #510 from StoneCypher/BumpCloc | ||
* Bump CLOC, fixes StoneCypher/fsl#995 | ||
| ||
@@ -154,9 +139,9 @@ | ||
## [Untagged] - 7/5/2022 1:24:10 PM | ||
## [Untagged] - 7/11/2022 10:38:54 PM | ||
Commit [40677c744241e590d901c317cdcc0046833a5257](https://github.com/StoneCypher/jssm/commit/40677c744241e590d901c317cdcc0046833a5257) | ||
Commit [fd306ed88144815a2d2fb26250709d4fba8f99fe](https://github.com/StoneCypher/jssm/commit/fd306ed88144815a2d2fb26250709d4fba8f99fe) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* Uh, you have to git add to git commit, dummy | ||
* Basic machine properties now making it through aggregation | ||
@@ -170,15 +155,13 @@ | ||
## [Untagged] - 7/5/2022 1:04:10 PM | ||
## [Untagged] - 7/11/2022 10:10:29 PM | ||
Commit [58e88fec3f6412cadfc762f646ed50f6bc10eac6](https://github.com/StoneCypher/jssm/commit/58e88fec3f6412cadfc762f646ed50f6bc10eac6) | ||
Commit [400cbe62582aa2261b694f01e0d04704a76a12ef](https://github.com/StoneCypher/jssm/commit/400cbe62582aa2261b694f01e0d04704a76a12ef) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
Merges [1cc0629, 0cc8f7b] | ||
* Basic tests for property defaults | ||
* WIP on IntroducingTheKitchenSinkDragon: 1cc0629 Sequester the stoch tests until they're more complete | ||
| ||
@@ -188,8 +171,8 @@ | ||
## [Untagged] - 7/5/2022 1:04:10 PM | ||
## [Untagged] - 7/11/2022 9:55:08 PM | ||
Commit [0cc8f7bad92e4327128237bc9600cedd2e7cbb94](https://github.com/StoneCypher/jssm/commit/0cc8f7bad92e4327128237bc9600cedd2e7cbb94) | ||
Commit [31425dd227fa0811e387d96f89e40e2c0e148df3](https://github.com/StoneCypher/jssm/commit/31425dd227fa0811e387d96f89e40e2c0e148df3) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* index on IntroducingTheKitchenSinkDragon: 1cc0629 Sequester the stoch tests until they're more complete | ||
* Internal property datastructures, fixes StoneCypher/fsl#1022, getting started with StoneCypher/fsl#1018 |
@@ -38,2 +38,6 @@ import { circular_buffer } from 'circular_buffer_js'; | ||
}; | ||
declare type JssmPropertyDefinition = { | ||
name: string; | ||
default_value?: any; | ||
}; | ||
declare type JssmTransitionPermitter<DataType> = (OldState: StateType, NewState: StateType, OldData: DataType, NewData: DataType) => boolean; | ||
@@ -52,3 +56,3 @@ declare type JssmTransitionPermitterMaybeArray<DataType> = JssmTransitionPermitter<DataType> | Array<JssmTransitionPermitter<DataType>>; | ||
}; | ||
declare type JssmTransitions<DataType> = Array<JssmTransition<DataType>>; | ||
declare type JssmTransitions<DataType> = JssmTransition<DataType>[]; | ||
declare type JssmTransitionList = { | ||
@@ -98,2 +102,3 @@ entrances: Array<StateType>; | ||
value: any; | ||
name?: string; | ||
}; | ||
@@ -110,2 +115,6 @@ declare type JssmStateDeclaration = { | ||
state: StateType; | ||
property?: { | ||
name: string; | ||
value: unknown; | ||
}; | ||
}; | ||
@@ -132,3 +141,5 @@ declare type JssmGenericConfig<DataType> = { | ||
end_states?: Array<StateType>; | ||
state_declaration?: Array<Object>; | ||
state_declaration?: Object[]; | ||
property_definition?: JssmPropertyDefinition[]; | ||
state_property?: JssmPropertyDefinition[]; | ||
arrange_declaration?: Array<Array<StateType>>; | ||
@@ -168,2 +179,4 @@ arrange_start_declaration?: Array<Array<StateType>>; | ||
name?: string; | ||
state?: string; | ||
default_value?: any; | ||
}; | ||
@@ -284,2 +297,2 @@ declare type JssmParseTree = Array<JssmCompileSeStart<StateType>>; | ||
declare type JssmHistory<mDT> = circular_buffer<[StateType, mDT]>; | ||
export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmHistory, JssmSerialization, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult }; | ||
export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmHistory, JssmSerialization, JssmPropertyDefinition, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult }; |
@@ -44,2 +44,9 @@ /******* | ||
*/ | ||
declare function name_bind_prop_and_state(prop: string, state: string): string; | ||
/******* | ||
* | ||
* Internal method generating names for edges for the hook lookup map. Not | ||
* meant for external use. | ||
* | ||
*/ | ||
declare const hook_name: (from: string, to: string) => string; | ||
@@ -61,2 +68,38 @@ /******* | ||
declare const make_mulberry_rand: (a?: number | undefined) => () => number; | ||
export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name, make_mulberry_rand }; | ||
/******* | ||
* | ||
* Reduces an array to its unique contents. Compares with `===` and makes no | ||
* effort to deep-compare contents; two matching arrays or objects contained | ||
* will be treated as distinct, according to javascript rules. This also means | ||
* that `NaNs` will be ***dropped***, because they do not self-compare. | ||
* | ||
* ```typescript | ||
* unique( [] ); // [] | ||
* unique( [0,0] ); // [0] | ||
* unique( [0,1,2, 0,1,2, 0,1,2] ); // [0,1,2] | ||
* unique( [ [1], [1] ] ); // [ [1], [1] ] because arrays don't match | ||
* unique( [0,NaN,2] ); // [0,2] | ||
* ``` | ||
* | ||
*/ | ||
declare const unique: <T>(arr?: T[]) => T[]; | ||
/******* | ||
* | ||
* Lists all repeated items in an array along with their counts. Subject to | ||
* matching rules of Map. `NaN` is manually removed because of conflict rules | ||
* around {@link unique}. Because these are compared with `===` and because | ||
* arrays and objects never match that way unless they're the same object, | ||
* arrays and objects are never considered repeats. | ||
* | ||
* ```typescript | ||
* find_repeated<string>([ ]); // [] | ||
* find_repeated<string>([ "one" ]); // [] | ||
* find_repeated<string>([ "one", "two" ]); // [] | ||
* find_repeated<string>([ "one", "one" ]); // [ ["one", 2] ] | ||
* find_repeated<string>([ "one", "two", "one" ]); // [ ["one", 2] ] | ||
* find_repeated<number>([ 0, NaN, 0, NaN ]); // [ [0, 2] ] | ||
* ``` | ||
* | ||
*/ | ||
declare function find_repeated<T>(arr: T[]): [T, number][]; | ||
export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, make_mulberry_rand }; |
@@ -0,1 +1,2 @@ | ||
import { JssmError } from './jssm_error'; | ||
/******* | ||
@@ -79,2 +80,17 @@ * | ||
*/ | ||
function name_bind_prop_and_state(prop, state) { | ||
if (typeof prop !== 'string') { | ||
throw new JssmError(undefined, `Name of property must be a string; got ${prop}`); | ||
} | ||
if (typeof state !== 'string') { | ||
throw new JssmError(undefined, `Name of state must be a string; got ${prop}`); | ||
} | ||
return JSON.stringify([prop, state]); | ||
} | ||
/******* | ||
* | ||
* Internal method generating names for edges for the hook lookup map. Not | ||
* meant for external use. | ||
* | ||
*/ | ||
const hook_name = (from, to) => JSON.stringify([from, to]); | ||
@@ -104,2 +120,53 @@ /******* | ||
}; | ||
export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name, make_mulberry_rand }; | ||
/******* | ||
* | ||
* Reduces an array to its unique contents. Compares with `===` and makes no | ||
* effort to deep-compare contents; two matching arrays or objects contained | ||
* will be treated as distinct, according to javascript rules. This also means | ||
* that `NaNs` will be ***dropped***, because they do not self-compare. | ||
* | ||
* ```typescript | ||
* unique( [] ); // [] | ||
* unique( [0,0] ); // [0] | ||
* unique( [0,1,2, 0,1,2, 0,1,2] ); // [0,1,2] | ||
* unique( [ [1], [1] ] ); // [ [1], [1] ] because arrays don't match | ||
* unique( [0,NaN,2] ); // [0,2] | ||
* ``` | ||
* | ||
*/ | ||
const unique = (arr) => arr.filter((v, i, a) => a.indexOf(v) === i); | ||
/******* | ||
* | ||
* Lists all repeated items in an array along with their counts. Subject to | ||
* matching rules of Map. `NaN` is manually removed because of conflict rules | ||
* around {@link unique}. Because these are compared with `===` and because | ||
* arrays and objects never match that way unless they're the same object, | ||
* arrays and objects are never considered repeats. | ||
* | ||
* ```typescript | ||
* find_repeated<string>([ ]); // [] | ||
* find_repeated<string>([ "one" ]); // [] | ||
* find_repeated<string>([ "one", "two" ]); // [] | ||
* find_repeated<string>([ "one", "one" ]); // [ ["one", 2] ] | ||
* find_repeated<string>([ "one", "two", "one" ]); // [ ["one", 2] ] | ||
* find_repeated<number>([ 0, NaN, 0, NaN ]); // [ [0, 2] ] | ||
* ``` | ||
* | ||
*/ | ||
function find_repeated(arr) { | ||
const uniqued = unique(arr); | ||
if (uniqued.length !== arr.length) { | ||
const residue_keys = new Map(); | ||
arr.forEach(k => residue_keys.set(k, residue_keys.has(k) | ||
? (residue_keys.get(k) + 1) | ||
: 1)); | ||
uniqued.forEach(k => residue_keys.set(k, residue_keys.get(k) - 1)); | ||
return [...residue_keys.entries()] | ||
.filter((e) => ((e[1] > 0) && (!(Number.isNaN(e[0]))))) | ||
.map((e) => [e[0], e[1] + 1]); | ||
} | ||
else { | ||
return []; | ||
} | ||
} | ||
export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, make_mulberry_rand }; |
declare type StateType = string; | ||
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule, | ||
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types'; | ||
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util'; | ||
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util'; | ||
import { shapes, gviz_shapes, named_colors } from './jssm_constants'; | ||
@@ -253,5 +253,8 @@ import { version } from './version'; | ||
_post_any_transition_hook: HookHandler<mDT> | undefined; | ||
_property_keys: Set<string>; | ||
_default_properties: Map<string, any>; | ||
_state_properties: Map<string, any>; | ||
_history: JssmHistory<mDT>; | ||
_history_length: number; | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data }: JssmGenericConfig<mDT>); | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, property_definition, state_property, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data }: JssmGenericConfig<mDT>); | ||
/******** | ||
@@ -298,2 +301,101 @@ * | ||
data(): mDT; | ||
/********* | ||
* | ||
* Get the current value of a given property name. | ||
* | ||
* ```typescript | ||
* | ||
* ``` | ||
* | ||
* @param name The relevant property name to look up | ||
* | ||
* @returns The value behind the prop name. Because functional props are | ||
* evaluated as getters, this can be anything. | ||
* | ||
*/ | ||
prop(name: string): any; | ||
/********* | ||
* | ||
* Get the current value of every prop, as an object. If no current definition | ||
* exists for a prop - that is, if the prop was defined without a default and | ||
* the current state also doesn't define the prop - then that prop will be listed | ||
* in the returned object with a value of `undefined`. | ||
* | ||
* ```typescript | ||
* const traffic_light = sm` | ||
* | ||
* property can_go default true; | ||
* property hesitate default true; | ||
* property stop_first default false; | ||
* | ||
* Off -> Red => Green => Yellow => Red; | ||
* [Red Yellow Green] ~> [Off FlashingRed]; | ||
* FlashingRed -> Red; | ||
* | ||
* state Red: { property stop_first true; property can_go false; }; | ||
* state Off: { property stop_first true; }; | ||
* state FlashingRed: { property stop_first true; }; | ||
* state Green: { property hesitate false; }; | ||
* | ||
* `; | ||
* | ||
* traffic_light.state(); // Off | ||
* traffic_light.props(); // { can_go: true, hesitate: true, stop_first: true; } | ||
* | ||
* traffic_light.go('Red'); | ||
* traffic_light.props(); // { can_go: false, hesitate: true, stop_first: true; } | ||
* | ||
* traffic_light.go('Green'); | ||
* traffic_light.props(); // { can_go: true, hesitate: false, stop_first: false; } | ||
* ``` | ||
* | ||
*/ | ||
props(): object; | ||
/********* | ||
* | ||
* Get the current value of every prop, as an object. Compare | ||
* {@link prop_map}, which returns a `Map`. | ||
* | ||
* ```typescript | ||
* | ||
* ``` | ||
* | ||
*/ | ||
/********* | ||
* | ||
* Get the current value of every prop, as an object. Compare | ||
* {@link prop_map}, which returns a `Map`. Akin to {@link strict_prop}, | ||
* this throws if a required prop is missing. | ||
* | ||
* ```typescript | ||
* | ||
* ``` | ||
* | ||
*/ | ||
/********* | ||
* | ||
* Check whether a given string is a known property's name. | ||
* | ||
* ```typescript | ||
* const example = sm`property foo default 1; a->b;`; | ||
* | ||
* example.known_prop('foo'); // true | ||
* example.known_prop('bar'); // false | ||
* ``` | ||
* | ||
* @param prop_name The relevant property name to look up | ||
* | ||
*/ | ||
known_prop(prop_name: string): boolean; | ||
/********* | ||
* | ||
* List all known property names. If you'd also like values, use | ||
* {@link props} instead. The order of the properties is not defined, and | ||
* the properties generally will not be sorted. | ||
* | ||
* ```typescript | ||
* ``` | ||
* | ||
*/ | ||
known_props(): string[]; | ||
/******** | ||
@@ -701,11 +803,23 @@ * | ||
* ```typescript | ||
* const light = sm`red 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`; | ||
* const light = sm` | ||
* off 'start' -> red; | ||
* red 'next' -> green 'next' -> yellow 'next' -> red; | ||
* [red yellow green] 'shutdown' ~> off; | ||
* `; | ||
* | ||
* light.state(); // 'red' | ||
* light.do('next'); // true | ||
* light.state(); // 'green' | ||
* light.state(); // 'off' | ||
* light.do('start'); // true | ||
* light.state(); // 'red' | ||
* light.do('next'); // true | ||
* light.state(); // 'green' | ||
* light.do('next'); // true | ||
* light.state(); // 'yellow' | ||
* light.do('dance'); // !! false - no such action | ||
* light.state(); // 'yellow' | ||
* light.do('start'); // !! false - yellow does not have the action start | ||
* light.state(); // 'yellow' | ||
* ``` | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
b * | ||
* @param actionName The action to engage | ||
@@ -722,7 +836,17 @@ * | ||
* ```typescript | ||
* const light = sm`red -> green -> yellow -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`; | ||
* const light = sm` | ||
* off 'start' -> red; | ||
* red 'next' -> green 'next' -> yellow 'next' -> red; | ||
* [red yellow green] 'shutdown' ~> off; | ||
* `; | ||
* | ||
* light.state(); // 'red' | ||
* light.transition('green'); // true | ||
* light.state(); // 'green' | ||
* light.state(); // 'off' | ||
* light.go('red'); // true | ||
* light.state(); // 'red' | ||
* light.go('green'); // true | ||
* light.state(); // 'green' | ||
* light.go('blue'); // !! false - no such state | ||
* light.state(); // 'green' | ||
* light.go('red'); // !! false - green may not go directly to red, only to yellow | ||
* light.state(); // 'green' | ||
* ``` | ||
@@ -840,2 +964,2 @@ * | ||
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>; | ||
export { version, transfer_state_properties, Machine, deserialize, 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, is_hook_rejection, is_hook_complex_result, abstract_hook_step }; | ||
export { version, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step }; |
@@ -1,2 +0,2 @@ | ||
const version = "5.78.0"; | ||
const version = "5.79.0"; | ||
export { version }; |
@@ -38,2 +38,6 @@ import { circular_buffer } from 'circular_buffer_js'; | ||
}; | ||
declare type JssmPropertyDefinition = { | ||
name: string; | ||
default_value?: any; | ||
}; | ||
declare type JssmTransitionPermitter<DataType> = (OldState: StateType, NewState: StateType, OldData: DataType, NewData: DataType) => boolean; | ||
@@ -52,3 +56,3 @@ declare type JssmTransitionPermitterMaybeArray<DataType> = JssmTransitionPermitter<DataType> | Array<JssmTransitionPermitter<DataType>>; | ||
}; | ||
declare type JssmTransitions<DataType> = Array<JssmTransition<DataType>>; | ||
declare type JssmTransitions<DataType> = JssmTransition<DataType>[]; | ||
declare type JssmTransitionList = { | ||
@@ -98,2 +102,3 @@ entrances: Array<StateType>; | ||
value: any; | ||
name?: string; | ||
}; | ||
@@ -110,2 +115,6 @@ declare type JssmStateDeclaration = { | ||
state: StateType; | ||
property?: { | ||
name: string; | ||
value: unknown; | ||
}; | ||
}; | ||
@@ -132,3 +141,5 @@ declare type JssmGenericConfig<DataType> = { | ||
end_states?: Array<StateType>; | ||
state_declaration?: Array<Object>; | ||
state_declaration?: Object[]; | ||
property_definition?: JssmPropertyDefinition[]; | ||
state_property?: JssmPropertyDefinition[]; | ||
arrange_declaration?: Array<Array<StateType>>; | ||
@@ -168,2 +179,4 @@ arrange_start_declaration?: Array<Array<StateType>>; | ||
name?: string; | ||
state?: string; | ||
default_value?: any; | ||
}; | ||
@@ -284,2 +297,2 @@ declare type JssmParseTree = Array<JssmCompileSeStart<StateType>>; | ||
declare type JssmHistory<mDT> = circular_buffer<[StateType, mDT]>; | ||
export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmHistory, JssmSerialization, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult }; | ||
export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmHistory, JssmSerialization, JssmPropertyDefinition, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult }; |
@@ -44,2 +44,9 @@ /******* | ||
*/ | ||
declare function name_bind_prop_and_state(prop: string, state: string): string; | ||
/******* | ||
* | ||
* Internal method generating names for edges for the hook lookup map. Not | ||
* meant for external use. | ||
* | ||
*/ | ||
declare const hook_name: (from: string, to: string) => string; | ||
@@ -61,2 +68,38 @@ /******* | ||
declare const make_mulberry_rand: (a?: number | undefined) => () => number; | ||
export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name, make_mulberry_rand }; | ||
/******* | ||
* | ||
* Reduces an array to its unique contents. Compares with `===` and makes no | ||
* effort to deep-compare contents; two matching arrays or objects contained | ||
* will be treated as distinct, according to javascript rules. This also means | ||
* that `NaNs` will be ***dropped***, because they do not self-compare. | ||
* | ||
* ```typescript | ||
* unique( [] ); // [] | ||
* unique( [0,0] ); // [0] | ||
* unique( [0,1,2, 0,1,2, 0,1,2] ); // [0,1,2] | ||
* unique( [ [1], [1] ] ); // [ [1], [1] ] because arrays don't match | ||
* unique( [0,NaN,2] ); // [0,2] | ||
* ``` | ||
* | ||
*/ | ||
declare const unique: <T>(arr?: T[]) => T[]; | ||
/******* | ||
* | ||
* Lists all repeated items in an array along with their counts. Subject to | ||
* matching rules of Map. `NaN` is manually removed because of conflict rules | ||
* around {@link unique}. Because these are compared with `===` and because | ||
* arrays and objects never match that way unless they're the same object, | ||
* arrays and objects are never considered repeats. | ||
* | ||
* ```typescript | ||
* find_repeated<string>([ ]); // [] | ||
* find_repeated<string>([ "one" ]); // [] | ||
* find_repeated<string>([ "one", "two" ]); // [] | ||
* find_repeated<string>([ "one", "one" ]); // [ ["one", 2] ] | ||
* find_repeated<string>([ "one", "two", "one" ]); // [ ["one", 2] ] | ||
* find_repeated<number>([ 0, NaN, 0, NaN ]); // [ [0, 2] ] | ||
* ``` | ||
* | ||
*/ | ||
declare function find_repeated<T>(arr: T[]): [T, number][]; | ||
export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, make_mulberry_rand }; |
148
jssm.d.ts
declare type StateType = string; | ||
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule, | ||
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types'; | ||
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util'; | ||
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util'; | ||
import { shapes, gviz_shapes, named_colors } from './jssm_constants'; | ||
@@ -253,5 +253,8 @@ import { version } from './version'; | ||
_post_any_transition_hook: HookHandler<mDT> | undefined; | ||
_property_keys: Set<string>; | ||
_default_properties: Map<string, any>; | ||
_state_properties: Map<string, any>; | ||
_history: JssmHistory<mDT>; | ||
_history_length: number; | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data }: JssmGenericConfig<mDT>); | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, property_definition, state_property, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data }: JssmGenericConfig<mDT>); | ||
/******** | ||
@@ -298,2 +301,101 @@ * | ||
data(): mDT; | ||
/********* | ||
* | ||
* Get the current value of a given property name. | ||
* | ||
* ```typescript | ||
* | ||
* ``` | ||
* | ||
* @param name The relevant property name to look up | ||
* | ||
* @returns The value behind the prop name. Because functional props are | ||
* evaluated as getters, this can be anything. | ||
* | ||
*/ | ||
prop(name: string): any; | ||
/********* | ||
* | ||
* Get the current value of every prop, as an object. If no current definition | ||
* exists for a prop - that is, if the prop was defined without a default and | ||
* the current state also doesn't define the prop - then that prop will be listed | ||
* in the returned object with a value of `undefined`. | ||
* | ||
* ```typescript | ||
* const traffic_light = sm` | ||
* | ||
* property can_go default true; | ||
* property hesitate default true; | ||
* property stop_first default false; | ||
* | ||
* Off -> Red => Green => Yellow => Red; | ||
* [Red Yellow Green] ~> [Off FlashingRed]; | ||
* FlashingRed -> Red; | ||
* | ||
* state Red: { property stop_first true; property can_go false; }; | ||
* state Off: { property stop_first true; }; | ||
* state FlashingRed: { property stop_first true; }; | ||
* state Green: { property hesitate false; }; | ||
* | ||
* `; | ||
* | ||
* traffic_light.state(); // Off | ||
* traffic_light.props(); // { can_go: true, hesitate: true, stop_first: true; } | ||
* | ||
* traffic_light.go('Red'); | ||
* traffic_light.props(); // { can_go: false, hesitate: true, stop_first: true; } | ||
* | ||
* traffic_light.go('Green'); | ||
* traffic_light.props(); // { can_go: true, hesitate: false, stop_first: false; } | ||
* ``` | ||
* | ||
*/ | ||
props(): object; | ||
/********* | ||
* | ||
* Get the current value of every prop, as an object. Compare | ||
* {@link prop_map}, which returns a `Map`. | ||
* | ||
* ```typescript | ||
* | ||
* ``` | ||
* | ||
*/ | ||
/********* | ||
* | ||
* Get the current value of every prop, as an object. Compare | ||
* {@link prop_map}, which returns a `Map`. Akin to {@link strict_prop}, | ||
* this throws if a required prop is missing. | ||
* | ||
* ```typescript | ||
* | ||
* ``` | ||
* | ||
*/ | ||
/********* | ||
* | ||
* Check whether a given string is a known property's name. | ||
* | ||
* ```typescript | ||
* const example = sm`property foo default 1; a->b;`; | ||
* | ||
* example.known_prop('foo'); // true | ||
* example.known_prop('bar'); // false | ||
* ``` | ||
* | ||
* @param prop_name The relevant property name to look up | ||
* | ||
*/ | ||
known_prop(prop_name: string): boolean; | ||
/********* | ||
* | ||
* List all known property names. If you'd also like values, use | ||
* {@link props} instead. The order of the properties is not defined, and | ||
* the properties generally will not be sorted. | ||
* | ||
* ```typescript | ||
* ``` | ||
* | ||
*/ | ||
known_props(): string[]; | ||
/******** | ||
@@ -701,11 +803,23 @@ * | ||
* ```typescript | ||
* const light = sm`red 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`; | ||
* const light = sm` | ||
* off 'start' -> red; | ||
* red 'next' -> green 'next' -> yellow 'next' -> red; | ||
* [red yellow green] 'shutdown' ~> off; | ||
* `; | ||
* | ||
* light.state(); // 'red' | ||
* light.do('next'); // true | ||
* light.state(); // 'green' | ||
* light.state(); // 'off' | ||
* light.do('start'); // true | ||
* light.state(); // 'red' | ||
* light.do('next'); // true | ||
* light.state(); // 'green' | ||
* light.do('next'); // true | ||
* light.state(); // 'yellow' | ||
* light.do('dance'); // !! false - no such action | ||
* light.state(); // 'yellow' | ||
* light.do('start'); // !! false - yellow does not have the action start | ||
* light.state(); // 'yellow' | ||
* ``` | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
b * | ||
* @param actionName The action to engage | ||
@@ -722,7 +836,17 @@ * | ||
* ```typescript | ||
* const light = sm`red -> green -> yellow -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;`; | ||
* const light = sm` | ||
* off 'start' -> red; | ||
* red 'next' -> green 'next' -> yellow 'next' -> red; | ||
* [red yellow green] 'shutdown' ~> off; | ||
* `; | ||
* | ||
* light.state(); // 'red' | ||
* light.transition('green'); // true | ||
* light.state(); // 'green' | ||
* light.state(); // 'off' | ||
* light.go('red'); // true | ||
* light.state(); // 'red' | ||
* light.go('green'); // true | ||
* light.state(); // 'green' | ||
* light.go('blue'); // !! false - no such state | ||
* light.state(); // 'green' | ||
* light.go('red'); // !! false - green may not go directly to red, only to yellow | ||
* light.state(); // 'green' | ||
* ``` | ||
@@ -840,2 +964,2 @@ * | ||
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>; | ||
export { version, transfer_state_properties, Machine, deserialize, 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, is_hook_rejection, is_hook_complex_result, abstract_hook_step }; | ||
export { version, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step }; |
{ | ||
"name": "jssm", | ||
"version": "5.78.0", | ||
"version": "5.79.0", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=10.0.0" |
@@ -21,3 +21,3 @@ <!-- | ||
* Generated for version 5.78.0 at 7/9/2022, 3:41:50 PM | ||
* Generated for version 5.79.0 at 7/13/2022, 6:40:45 PM | ||
@@ -33,3 +33,3 @@ --> | ||
***4,670 tests*** run 5,561 times. 4,661 specs with 100.0% coverage, 9 fuzz tests with 5.4% coverage. With 1,762 lines, that's about 2.7 tests per line, or 3.2 generated tests per line. | ||
***4,745 tests*** run 5,636 times. 4,736 specs with 100.0% coverage, 9 fuzz tests with 5.4% coverage. With 1,894 lines, that's about 2.5 tests per line, or 3.0 generated tests per line. | ||
@@ -36,0 +36,0 @@ ***Meet your new state machine library.*** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1141950
8913